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.
- 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)
- Add each snipsonian-package that you need by running
npm install --save @snipsonian/<packageName>
- e.g.
npm install --save @snipsonian/core
for thecore
package
- e.g.
- 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
- e.g.
- install nvm (https://github.com/nvm-sh/nvm) if not installed yet
- git clone
- switch to correct node version:
nvm install
(first time) ornvm use
(later) - Install top package dependencies:
npm install
- Link local packages together and install remaining package dependencies:
npx lerna bootstrap
Runs sequentially the linters and the unit tests.
nvm use
- 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) - manually briefly check the generated folders (snipsonian-analytics was previously generated somewhat wrong, but that issue is now fixed !)
- switch to the appropriate npm user
- execute one of: (see https://github.com/lerna/lerna/tree/master/commands/publish)
npx lerna publish
= publish packages that have changed since the last releasenpx lerna publish from-git
= explicitly publish packages tagged in the current commitnpx lerna publish from-package
= explicitly publish packages where the latest version is not present in the registry
The ISC License