Skip to content

Typescript Snippets powered by Kunstmaan Development. Besides typescript source code, also transpiled javascript files are published. We'll add some documentation on how to use the different snippets in the future.

License

Notifications You must be signed in to change notification settings

Kunstmaan/snipsonian

Repository files navigation

lerna

Snipsonian

Typescript Snippets powered by Kunstmaan Development. Besides typescript source code, also transpiled javascript files are published. We'll add some documentation on how to use the different snippets in the future.

Goal

  • Provide some small re-usable typescript/javascript code snippets that can be used in a variety of javascript projects.
  • Idea is that you just import (es6 syntax) the code snippet(s) you need and bundle it yourself with the rest of your project code (vs. having to include a 'large' concatenated/minified bundle of which you may only need a small part of)

Usage

  1. Add each snipsonian-package that you need by running npm install --save @snipsonian/<packageName>
    • e.g. npm install --save @snipsonian/core for the core package
  2. Import the snippet you need by importing it's /es/ version
    • e.g. import isSet from '@snipsonian/core/es/is/isSet';
    • each such .js snippet will have a related .d.ts file for the typescript types

Development

Installation

  1. install nvm (https://github.com/nvm-sh/nvm) if not installed yet
  2. git clone
  3. switch to correct node version: nvm install (first time) or nvm use (later)
  4. Install top package dependencies: npm install
  5. Link local packages together and install remaining package dependencies: npx lerna bootstrap

Dev commands

npm test

Runs sequentially the linters and the unit tests.

Publish new version

  1. nvm use
  2. execute npm run transpile to transpile the typescript code to .js and .d.ts files under the "/es" and "/cjs" (common js for node) folders (per package)
  3. manually briefly check the generated folders (snipsonian-analytics was previously generated somewhat wrong, but that issue is now fixed !)
  4. switch to the appropriate npm user
  5. execute one of: (see https://github.com/lerna/lerna/tree/master/commands/publish)
    • npx lerna publish = publish packages that have changed since the last release
    • npx lerna publish from-git = explicitly publish packages tagged in the current commit
    • npx lerna publish from-package = explicitly publish packages where the latest version is not present in the registry

License

The ISC License

About

Typescript Snippets powered by Kunstmaan Development. Besides typescript source code, also transpiled javascript files are published. We'll add some documentation on how to use the different snippets in the future.

Resources

License

Stars

Watchers

Forks

Packages

No packages published