npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dmitrymin/eventmapper-common

v2.6.102

Published

EventMapper common types and utilities

Downloads

114

Readme

EventMapper Common

Common types and utilities shared across EventMapper applications.

Publish

npm run relase # trigger automatic version change and push to github
npm publish

Installation

npm install eventmapper-common

Data schema, types, validation

GraphQL

  • https://khalilstemmler.com/articles/graphql/graphql-schemas-vs-restful-dtos/

GraphQL -> Resolvers -> |Domain Boundary| -> Services -> Loaders -> Data Sources (Postgres/Redis/Elasticsearch)

  • https://stackoverflow.com/questions/64178320/how-lazy-should-a-graphql-resolver-be

https://2ality.com/2020/06/validating-data-typescript.html#approaches-for-data-validation-in-typescript

OpenAPI - https://www.npmjs.com/package/@openapi-contrib/json-schema-to-openapi-schema

Schema

To provide a common entity interface shareable across applications, entities are defined using JSON Schema DSL. JSON schema is then used to define the validator.

  • https://githubmemory.com/repo/json-schema-org/json-schema-spec/issues/1087
  • https://github.com/ajv-validator/ajv-formats

Types / Interfaces

TypeScript types are derived from the JSON Schema DSL with the help of TypeBox

The typing can be augmented using the TypeBox modifiers. This produces:

  • types with optional & readonly property identifiers
  • types with all enumarated properties // Strict() https://github.com/sinclairzx81/typebox#Strict // const U = Type.Strict(T)

External vs. internal representation of data...

Validation

Validation is handled by AJV

https://www.npmjs.com/package/ajv/v/6.12.6 https://ajv.js.org/packages/ajv-formats.html https://github.com/ajv-validator/ajv-errors https://caoslab.psy.cmu.edu:32443/developers/jsexperimentslayout/-/tree/homepage_full/client/node_modules/babel-loader/node_modules/ajv https://opensourcelibs.com/lib/typebox

  • testing - https://moshfeu.medium.com/test-json-schema-with-ajv-and-jest-c1d2984234c9

Parsing / serialization -

https://ajv.js.org/guide/getting-started.html#parsing-and-serializing-json

  • author on reddit - https://www.reddit.com/r/typescript/comments/oetimi/json_schema_runtime_type_system_for_typescript/

https://levelup.gitconnected.com/typescript-validation-with-ajv-1b70a76dd678 https://code.tutsplus.com/tutorials/validating-data-with-json-schema-part-1--cms-25343 https://spin.atomicobject.com/2018/03/26/typescript-data-validation/

Resources

Project setup

  • https://blog.logrocket.com/publishing-node-modules-typescript-es-modules/
  • https://www.freecodecamp.org/news/how-to-make-a-beautiful-tiny-npm-package-and-publish-it-2881d4307f78/
  • https://www.intricatecloud.io/2020/02/creating-a-simple-npm-library-to-use-in-and-out-of-the-browser/

Versioning

  • https://itnext.io/how-to-automate-versioning-and-publication-of-an-npm-package-233e8757a526
  • https://unicorn-utterances.com/posts/setup-standard-version/

TSLint

  • https://khalilstemmler.com/blogs/typescript/eslint-for-typescript/

Alternatives

  • https://github.com/release-it/release-it