Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@skypilot/toolchain

skypilot-dev2.9kISC5.2.3TypeScript support: included

Toolchain for Node projects

eslint, eslintconfig, jest, typescript

readme

@skypilot/toolchain

npm stable stable build npm next next build Codacy grade downloads license: ISC

An opinionated toolchain for developing Node packages.

Toolchain comes configured with:

  • Babel
  • ESLint
  • Jest
  • TypeScript
  • Lint-Staged (using Husky)
  • GitHub Actions versioning & publication workflows

with a pre-commit hook to enforce linting on commit.

What does it do

Toolchain installs all dependencies & configurations needed to start creating Node projects using TypeScript. Compilation, typing, linting, release versioning, and publication are pre-configured.

How to install

$ yarn add --dev @skypilot/toolchain
$ yarn toolchain init

The toolchain init command creates a set of configuration files that include scripts & configs for distributing the project as a package. A planned change is to have toolchain init create only the core files & configs. A separate command would add the files & configs for creating a package.

If Husky's post-install script isn't run automatically, use the command yarn toolchain install-husky to run the script.

How to use

Once Toolchain is installed and initialized:

  • The linter will run automatically on each commit Note: Branches beginning with wip- or ending with -wip will not be linted

  • ESLint, Jest, and TypeScript will automatically use the configurations created by Toolchain

GitHub Actions workflows will

  • run code-quality checks on every push to GitHub (except wip/, wip- and -wip branches)
  • publish an NPM package on every push to GitHub on the stable or prerelease branches

How to publish releases

Toolchain creates GitHub Actions workflows that automate the process of creating and releasing NPM packages. Two different types of automated releases are supported:

  • Stable release: Has an ordinary semver version number, such as 1.1.2
  • Prerelease: Has a version number with a version-tag suffix and iteration number, such as 1.0.0-beta.0

The workflows are configured to automatically

  • publish a stable release on every push to main
  • publish a prerelease on every push to alpha, beta, or next branch

Toolchain performs the following steps when a release is created. If any step fails, the release is halted.

  • Run all automated checks (typechecking, linting, and testing)
  • Build the package and generate types
  • Determine the next version number (based on commit messages)
  • Create a version tag
  • Publish the package to NPM (if publication is enabled)
  • If the version stage is designated as the latest stage, tag the package as latest

For stable releases, the workflow will also:

  • Bump the version number in package.json
  • Generate an updated CHANGELOG.md
  • Commit these changes to the stable branch
  • Tag the package as latest

To designate a stage other than the stable-release branch as the latest stage, add the stage name to .skypilot/quick-release.yaml.

Example: This setting designates the beta stage as the latest stage.

prerelease:
  latestStage: 'beta'

Convenience scripts

These convenience scripts are added to package.json by yarn toolchain init:

  • all-ci-checks: Locally run the status checks that are run by the continuous-integration workflow
  • all-cq-checks: Run code-quality checks: linting, type-checking, and standalone tests
  • build: Build the project for distribution as an NPM package
  • ci: An alias for all-ci-checks
  • cq: An alias for all-cq-checks
  • generate-typings: Generate typings for the distribution
  • lint: Run the linter
  • prepublishOnly: Run all checks and build steps in preparation for publication to NPM
  • tc: An alias for typecheck
  • test: An alias for test:standalone
  • test:all: Run all tests using Jest
  • test:integration: Run all integration tests (tests that rely on external services) using Jest
  • test:standalone: Run all standalone tests (app, component, and unit tests, which do not rely
  • typecheck: Checks that all types in the project are valid

To run a script, use yarn run SCRIPT_NAME.

changelog

5.2.3 (2021-03-31)

5.2.2 (2021-03-20)

5.2.1 (2021-03-13)

5.2.0 (2021-03-13)

Bug Fixes

  • Husky post-install script fails (d7fba69)
  • Husky post-install script fails (e9cc1d0)
  • Husky pre-commit hook fails after upgrade from v4 to v5 (d386ff6)

Features

  • Add package-file scripts for subsets of test suites (15465a4)
  • Support NPM automation tokens (7fccbac)

5.1.4-alpha.0 (2021-01-28)

5.1.3 (2021-01-25)

5.1.2 (2020-12-07)

Bug Fixes

  • GitHub Actions workflows fail when set-env is used (2ad69d1)

5.1.1 (2020-10-26)

5.1.0 (2020-10-05)

Features

  • A prerelease branch can be designated as 'latest' (93fa1da)

5.0.3 (2020-10-03)

5.0.2 (2020-09-22)

5.0.2-next.2 (2020-09-22)

5.0.2-next.1 (2020-09-22)

5.0.2-next.0 (2020-09-22)

5.0.1 (2020-09-14)

5.0.1-next.0 (2020-09-14)

5.0.0 (2020-08-29)

  • MAJOR!: Upgrade all dependencies, including TypeScript to v4 (7e0f8b6)

BREAKING CHANGES

  • Upgrades Typescript to v4.0.2, which may introduce breaking changes into projects that use TypeScript

4.1.4 (2020-08-29)

4.1.4-next.0 (2020-08-28)

Bug Fixes

  • CI workflow-step order results in wrong version in build (d980f9e)

4.1.3 (2020-08-15)

4.1.3-next.0 (2020-08-15)

Bug Fixes

  • EditorConfig & linter config have differ max line length (4e35247)

4.1.2 (2020-08-15)

4.1.2-next.0 (2020-08-15)

4.1.1 (2020-07-31)

4.1.1-next.0 (2020-07-31)

4.1.0 (2020-07-31)

4.1.0-next.1 (2020-07-31)

4.1.0-next.0 (2020-07-30)

Features

  • Automatically update next to master after stable release (4e30745)

4.0.7-next.0 (2020-06-29)

4.0.6 (2020-06-25)

4.0.6-next.0 (2020-06-23)

4.0.5 (2020-06-16)

4.0.5-next.1 (2020-06-16)

4.0.5-alpha.0 (2020-06-08)

4.0.5-next.0 (2020-06-04)

4.0.4 (2020-05-29)

4.0.4-next.1 (2020-05-29)

4.0.4-next.0 (2020-05-18)

4.0.3 (2020-05-08)

4.0.3-next.0 (2020-05-08)

4.0.2 (2020-05-07)

4.0.2-next.0 (2020-05-07)

4.0.1 (2020-05-07)

4.0.1-next.0 (2020-05-07)

4.0.0 (2020-05-07)

4.0.0-next.0 (2020-05-07)

MAJOR

BREAKING CHANGES

  • Jest v26.0.1 includes breaking changes

3.6.4 (2020-05-07)

3.6.4-next.0 (2020-05-07)

3.6.3 (2020-05-01)

3.6.3-next.0 (2020-05-01)

3.6.2 (2020-04-30)

3.6.2-next.0 (2020-04-30)

3.6.1 (2020-04-19)

3.6.1-next.0 (2020-04-19)

3.6.0 (2020-04-19)

3.6.0-next.0 (2020-04-19)

Features

  • Support src & root path aliases (9e843f9)

3.5.14 (2020-04-08)

3.5.14-next.0 (2020-04-08)

3.5.13 (2020-04-05)

3.5.13-next.1 (2020-04-05)

3.5.12 (2020-03-31)

3.5.12-next.1 (2020-03-31)

3.5.12-next.0 (2020-03-31)

3.5.11 (2020-03-27)

3.5.11-next.0 (2020-03-27)

3.5.10 (2020-03-24)

3.5.10-next.0 (2020-03-24)

3.5.9 (2020-03-18)

3.5.9-next.2 (2020-03-18)

3.5.8-next.1 (2020-03-14)

3.5.7 (2020-03-14)

3.5.6-next.1 (2020-03-14)

3.5.5 (2020-03-14)

3.5.5-next.0 (2020-03-14)

3.5.4 (2020-03-14)

3.5.4-next.1 (2020-03-14)

Bug Fixes

  • Patch security vulnerabilities in acorn package (c3e1460)

3.5.3 (2020-03-12)

3.5.2 (2020-03-10)

3.5.2-next.0 (2020-03-10)

Bug Fixes

  • Test of file-copy function sometimes fails in CI workflow (0224873)

3.5.1 (2020-03-01)

3.5.1-next.0 (2020-03-01)

3.5.0 (2020-02-28)

3.5.0-next.0 (2020-02-28)

3.5.0-beta.0 (2020-02-26)

Features

  • Allow finer control over CI workflows (1fd8ad3)

3.4.1-next.0 (2020-02-18)

3.4.1-beta.0 (2020-02-16)

Bug Fixes

  • Path to package file can't be resolved under Yarn PnP (9a77451)

3.4.0 (2020-02-15)

3.4.0-next.1 (2020-02-15)

Features

  • Modify .gitignore to support Yarn 2 (d4a8249)
  • Support Yarn PnP by removing use of node_modules (c42ba2d)

3.3.9 (2020-02-15)

3.3.8 (2020-02-15)

3.3.4 (2020-02-14)

3.3.3 (2020-02-14)

3.3.2 (2020-02-14)

3.3.1 (2020-02-12)

3.3.0 (2020-02-11)

Features

  • Overrides the no-console lint rule in the scripts directory (60410ac)

3.2.1 (2020-02-10)

3.2.0 (2020-02-10)

Features

  • Avoid attempts to tag or publish a version multiple times (1d0cbdb)

3.1.0 (2020-02-10)

Bug Fixes

  • Workflow lacks enough history to determine change level (8d48bb0)

Features

  • Workflows support customizable behavior (f0d17d0)

3.0.1 (2020-02-09)

3.0.0 (2020-02-09)

Bug Fixes

  • Tests fail when branch references aren't fetched (a281bd6)
  • Version-bump skips merged branch when calculating change level (0aaf404)

Features

  • Enable custom identity & tag signing in CI prerelease workflow (8de76e4)
  • Separate NPM auth token into read & publish tokens (e744ce1)

2.1.8 (2020-02-08)

Bug Fixes

  • Version bump of stable release is always a patch (2815897)

2.1.7 (2020-02-07)

2.1.6 (2020-02-07)

Bug Fixes

  • Husky installation fails (e5ba935)

Features

  • Include .nvmrc in standard configs (3eb208f)

2.1.5 (2020-02-07)

Bug Fixes

  • Check for need to fetch Git history in CI workflow is faulty (d1d68ad)

2.1.4 (2020-02-07)

Features

  • Enable commit signing in CI workflow (1b67024)

2.1.3 (2020-02-06)

Bug Fixes

  • Globbing patterns don't cover both project root & subdirs (1a32a8b)

2.1.2 (2020-02-06)

Bug Fixes

  • Globbing pattern for .md files doesn't work (2eed195)

2.1.1 (2020-02-06)

Bug Fixes

  • Globbing pattern for .md files doesn't work (41ae07b)

2.0.4 (2020-02-06)

Bug Fixes

  • Packages used only in CI workflows are included in package file (d35d609)

2.0.3 (2020-02-06)

Features

  • Skip release when only docs are changed (453508b)

2.0.2 (2020-02-06)

2.0.1 (2020-02-06)

2.0.0 (2020-02-06)

Bug Fixes

  • Next release version is always a patch bump (c90e0ec)

1.14.8 (2020-02-06)

Bug Fixes

  • Publication should be skipped if repo has no NPM auth token (f55a8e6)

Features

  • Fall back to default token when personal access token isn't found (b3c5317)

1.14.7 (2020-02-05)

1.14.6 (2020-02-05)

Bug Fixes

  • CI workflow proceeds despite version-bump error (a4df46b)
  • Version bump error (a75ba47)

1.14.5 (2020-02-05)

Features

  • Enable push to master on version bump (3eb05b1)
  • Improve prerelease versioning by gathering NPM publication data (ee75051)
  • Improve release versioning by gathering NPM publication data (d423732)

1.14.0 (2020-02-04)

Bug Fixes

  • Release version must always be higher than previous release (a3d3073)

Features

  • Don't publish when only package file & changelog have changed (1cd9267)

1.12.0 (2020-02-04)

Bug Fixes

  • Prerelease must always be higher than release version (0011253)

Features

  • Don't publish when README is only changed file (5ddd7bd)

1.11.0 (2020-02-04)

Bug Fixes

  • CI ignores tags on other branches when computing next version (f46b91b)
  • Invalid line continuation in YAML script (1b88ed9)
  • master branch can't be fetched into master branch (3f7c9b4)

Features

  • Automatically bump version number (ae4db90)
  • Automatically lint config files (7b73329)
  • Automatically publish prereleases (07c844f)
  • Automatically publish stable releases (d1caf69)
  • Push tag to repo upon prerelease (1ac7616)

1.10.0 (2020-02-03)

Bug Fixes

  • Git history variable is undefined in CI workflow (4ce46f6)
  • Release workflow reports error when no upstream exists (114ab99)

Features

  • Allow JSON files to be read in tests (f14db15)
  • Enable automated releases (0f2ce55)
  • Optionally make full repo history available to CI workflow (057add1)
  • Revert change log & package file after publishing prerelease (5e7881e)
  • Support publication of prerelease branches (74cd8a5)

1.5.1 (2020-01-27)

1.5.0 (2020-01-27)

Features

  • Can retrieve values from the package file (5b8607d)

1.4.5 (2020-01-10)

1.4.4 (2020-01-10)

Bug Fixes

  • Typo in generated compile-ts script (2584923)

1.4.3 (2020-01-09)

1.4.1 (2020-01-09)

Bug Fixes

  • Trailing spaces are trimmed in Markdown files (f2f347e)

1.3.0 (2019-12-08)

1.2.0 (2019-12-07)

1.1.5 (2019-12-07)

Bug Fixes

  • Use new script names in CI workflow (1134b27)

1.1.4 (2019-12-07)

Bug Fixes

  • Use new names in package-file scripts (15003bc)

1.1.3 (2019-12-07)

1.1.2 (2019-12-07)

1.1.1 (2019-12-06)

1.1.0 (2019-12-03)

1.0.1 (2019-12-01)

1.0.0 (2019-11-23)

0.4.21 (2019-11-22)

Features

  • Package-file entries can be sorted numerically or alphabetically (a457dec)
  • Package-file scripts are sorted when updated (0ae86f3)

0.4.20 (2019-11-22)

Features

  • Entrypoints for pkg publication are are created during init (c1a2cec)
  • Package file can be updated using "replace" strategy (e23880c)

0.4.19 (2019-11-21)

Bug Fixes

  • Package-file entries made during init are created under "key" key (70e94e6)

Features

  • New 'all-cq-checks' convenience script runs code-quality checks (1a80aac)

0.4.18 (2019-11-21)

Features

  • Project init creates a default 'files' key in the package file (72a3404)
  • Project init won't overwrite existing 'files' key in package file (7413c5d)

0.3.7 (2019-09-11)

0.3.6 (2019-09-11)

0.3.5 (2019-09-11)

0.3.4 (2019-09-10)

0.3.3 (2019-09-10)

0.3.2 (2019-09-10)

0.3.1 (2019-09-10)

0.3.0 (2019-09-10)