Skip to content

Latest commit

 

History

History
93 lines (53 loc) · 2.58 KB

ADMIN.md

File metadata and controls

93 lines (53 loc) · 2.58 KB

Administration

Few useful bullet points to administrate ic-js.

Table of contents

Create a new library

  1. Init a new workspace
npm init -w ./packages/a
  1. 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.

  1. Configure did files (if needed)

Add did source files import-candid and compile-idl-js.

  1. Generate did and js files (if needed)

Run the scripts modified in last steps

  1. Implement the library

Implement one feature or provide a src/index.ts file in the new lib that contains at least an export {};.

  1. 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.

  1. Add new library to docs generator.

  2. Add the new library to the build-next script to tweak version and make dependencies less restrictive when the "next" version is published.

  3. Add to Size workflow

Add new entry in the field size-limit of the main package.json.

  1. Update CI

Add new library to "nightly" and "publish" CI workflows.

  1. Build, PR and merge

  2. Tag and release to npm

  3. Provide a new PR that bump version of all libs to start next version

  4. Merge and publish next to npm

Release

Steps to release new versions of the libraries.

  1. Create a PR bumping versions
  • Upgrade "version" in the various library packages.json. If package depends on another package of ic-js, update the reference as well.
  • Update "version" in the root packages.json of the project.
  • Run npm i from root directory.
  • Update Changelog.

Example PR: #475

  1. Create a new Github release.

This will start an action that build and publish the libraries.

  1. Create a new PR

To open next version afterward, bump the libraries' version and add a note in CHANGELOG.