Few useful bullet points to administrate ic-js.
- Init a new workspace
npm init -w ./packages/a
- Setup the new package
Copy package.json
, license.md
, esbuild.mjs
, jest.config.js
and tsconfig.json
files as in other libs.
For example, copy the ones from cmc library.
Adapt package.json
content.
- Configure did files (if needed)
Add did source files import-candid and compile-idl-js.
- Generate did and js files (if needed)
Run the scripts modified in last steps
- Implement the library
Implement one feature or provide a src/index.ts
file in the new lib that contains at least an export {};
.
- Add empty test
Add an empty test file index.spec.ts
to make sure the command will not fail because there are no tests.
import * as lib from "./index";
describe("my-lib", () => {
it("is implemented", () => {
expect(lib).toEqual({});
});
});
You need an import
to avoid considering it a global script file.
-
Add new library to docs generator.
-
Add the new library to the build-next script to tweak version and make dependencies less restrictive when the "next" version is published.
-
Add to Size workflow
Add new entry in the field size-limit
of the main package.json.
- Update CI
Add new library to "nightly" and "publish" CI workflows.
-
Build, PR and merge
-
Tag and release to npm
-
Provide a new PR that bump version of all libs to start
next
version -
Merge and publish
next
to npm
Steps to release new versions of the libraries.
- Create a PR bumping versions
- Upgrade
"version"
in the various librarypackages.json
. If package depends on another package of ic-js, update the reference as well. - Update
"version"
in the rootpackages.json
of the project. - Run
npm i
from root directory. - Update Changelog.
Example PR: #475
- Create a new Github release.
This will start an action that build and publish the libraries.
- Create a new PR
To open next version afterward, bump the libraries' version and add a note in CHANGELOG.