npm.io
1.1.0 • Published 3 weeks ago

@asl-19/js-utils

Licence
GPL-3.0-or-later
Version
1.1.0
Deps
1
Size
60 kB
Vulns
0
Weekly
0

@asl-19/js-utils

Shared JavaScript utility functions for ASL19 projects.

Install

npm install @asl-19/js-utils

Documentation

See docs/README.md for API documentation.

Development

This package uses mise to manage the Node.js and pinact versions (see mise.toml). With mise activated in your shell:

# Install Node.js and pinact
mise install

mise.toml only lists tools, so mise trusts it without mise trust. Keep it that way: adding [env], [hooks] or [tasks] would let it run code when you cd into the folder.

.npmrc and package.json (devEngines, allowScripts) configure npm supply-chain gates: a one-day release-age window, approved install scripts only, and registry-only dependencies. See AGENTS.md for details.

In this folder:

# Run tests in watch mode
npm test

# Build into dist
npm run build

# Install dependencies if needed, then type check, lint, check formatting,
# run tests, and lint package
npm run dev-lint-test

If you add a function or change the documentation comments or signature of an existing function, regenerate the API documentation (CI will fail if docs is out of date):

# Update docs/* (Markdown documentation generated by TypeDoc)
npm run docs

To check for updates to Node.js (in mise.toml), npm packages, and GitHub Actions (pinned to commit SHAs in .github/workflows):

npm run outdated

# Update GitHub Actions to the latest releases that are at least 7 days old
npm run pinact-update

To test changes in a project that uses js-utils, use yalc:

# In this folder: build, check, and publish to the local yalc store
npx yalc publish

# In the project: replace the project’s copy of js-utils with the local version
npx yalc add @asl-19/js-utils

After making further changes, run npx yalc push in this folder to update the projects using it.

Once you’re finished testing run npx yalc remove @asl-19/js-utils in the project, then run npm install to revert to the published copy of the package.