Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
55eb76a
chore: groundwork for the 2.0.1 fixes
claude Nov 16, 2026
d928227
refactor(internals): rebuild the runtime around a per-substitute state
claude Nov 16, 2026
2788049
test: cover the 2.0.1 runtime and argument findings
claude Nov 16, 2026
a01cf3b
fix(mimick): members the instance lacks read as undefined (D12)
claude Nov 16, 2026
fffad01
test: pin the D9 deferral boundaries
claude Nov 16, 2026
a55c82b
fix(packaging): ESM entry point, exports map, prepack build, separate…
claude Nov 16, 2026
feb0708
fix(compatibility-checks): run against the packed build, fix the node…
claude Nov 16, 2026
ccb01fa
ci: test every supported LTS line, the oldest Node and the test runne…
claude Nov 16, 2026
9d51d2c
test(packaging): packaging, release and CI checks; add CONTRIBUTING.md
claude Nov 16, 2026
2604a0a
docs(contributing): use a --match pattern that selects tests
claude Nov 16, 2026
3ec797b
fix(types): rework the public typings
claude Nov 16, 2026
8ec9c1a
test(types): add type-level tests and a minimum TypeScript check
claude Nov 16, 2026
13cd279
Merge engine rewrite (fix/engine-b)
claude Nov 16, 2026
0015c5c
Merge typings fixes (fix/types)
claude Nov 16, 2026
47ba7f9
Merge packaging and CI fixes (fix/packaging)
claude Nov 16, 2026
9e2e85a
test(compatibility-checks): keep covering the deferred assertion report
claude Nov 16, 2026
135bc61
build: keep JSDoc comments in the emitted typings
claude Nov 16, 2026
b8c7bf8
fix(engine): reject substitution symbols on a substitute itself (D22)
claude Nov 16, 2026
ea77525
fix(messages): list at most 50 received calls in a failure message (D23)
claude Nov 16, 2026
b0c38e4
fix(messages): no colours with NODE_DISABLE_COLORS or TERM=dumb (D24)
claude Nov 16, 2026
69486d7
feat(messages): explain reads that were not calls
claude Nov 16, 2026
31109df
fix(messages): the deferred D9 report says the member was called as a…
claude Nov 16, 2026
6fed868
perf(engine): index literal substitutions; keep auto-substitutes of m…
claude Nov 16, 2026
75e7a1e
docs(readme): rewrite the README for 2.0.1
claude Nov 16, 2026
4ce3511
docs: add a migration guide for 1.x and the 2.0.0 betas
claude Nov 16, 2026
8541485
docs: add a changelog
claude Nov 16, 2026
c6fd66d
test(docs): type-check and run the documentation examples
claude Nov 16, 2026
9ad5d7e
fix(engine): received(Arg...) followed by a member access is an asser…
claude Nov 16, 2026
0c983ec
fix(messages): name assignments in the listing of an assignment asser…
claude Nov 16, 2026
7d29478
docs(readme): note that setup method names on unconfigured values are…
claude Nov 16, 2026
94830e6
test: port engine A's behavioural tests that pass unchanged
claude Nov 16, 2026
8809478
test: port engine A's wording-dependent tests with this engine's wording
claude Nov 16, 2026
3364170
Merge branch 'fix/grafts': engine polish from the round-1 review
claude Nov 16, 2026
25fe90e
Merge branch 'docs/readme': README, migration guide, changelog and do…
claude Nov 16, 2026
aa65ad9
fix(assertions): D33 deferred report for property-style didNotReceive…
claude Nov 16, 2026
cf1c239
fix(engine): D28 unconfigured protocol keys read as undefined and are…
claude Nov 16, 2026
739be90
fix(engine): D32 methods of a property value run with the value as this
claude Nov 16, 2026
9042ed3
perf(engine): D35 structural hash for the auto-substitute cache and t…
claude Nov 16, 2026
65e999e
perf(engine): D30 smaller auto-substitutes
claude Nov 16, 2026
fb752db
feat(arguments): D27 Arg matchers nested in plain objects and arrays
claude Nov 16, 2026
3f0a214
fix(engine): D25 chains only span operations from the same function
claude Nov 16, 2026
cc41db2
types: keep the setup API and string assertions in generic code (TD-2…
claude Nov 16, 2026
78a5029
types: members typed only null/undefined keep their plain type (TD-1)
claude Nov 16, 2026
9623604
feat(engine): D26 call, apply and bind with a member and a direct-cal…
claude Nov 16, 2026
b83187c
types: no TS2590 for members with very large literal unions (TD-8)
claude Nov 16, 2026
ba03bdc
types: received().optionalProp = undefined compiles (TD-7)
claude Nov 16, 2026
a3a927a
types: Arg.all() type-checks after leading arguments (TD-3)
claude Nov 16, 2026
061e314
fix(configure): D31 nested setups through a configured or mimicked me…
claude Nov 16, 2026
a614036
types: Arg.any('function'/'object') fit typed parameters, standalone …
claude Nov 16, 2026
6fafdff
test(types): cover the round-3 typing fixes with the minimum TypeScri…
claude Nov 16, 2026
976b4cf
docs(types): documentation comments on the whole public API (TD-10)
claude Nov 16, 2026
13a257d
fix(arguments): the nested-matcher scan runs no getters and survives …
claude Nov 16, 2026
326a8de
feat(assertions): direct-call assertions through the string forms and…
claude Nov 16, 2026
99cc83f
fix(engine): call/apply/bind on a substitute mimicking an object with…
claude Nov 16, 2026
8dbec02
fix(packaging): make the ES module entry independent of CommonJS inte…
claude Nov 16, 2026
88bc60d
fix(packaging): give exports["."] a CommonJS fallback for Node.js 13.…
claude Nov 16, 2026
a227cbe
ci: check the oldest supported TypeScript in CI and document every ch…
claude Nov 16, 2026
160619b
test(compat): check substitutes inside jest matchers (P28, ENG2-7)
claude Nov 16, 2026
86c2254
Merge branch 'fix/r3-engine': round-3 engine fixes (D25-D36)
claude Nov 16, 2026
a52ccb4
Merge branch 'fix/r3-types': round-3 typing fixes (T25-T32)
claude Nov 16, 2026
2f08953
Merge branch 'fix/r3-packaging': round-3 packaging fixes (P25-P28)
claude Nov 16, 2026
190428c
docs(contributing): test:types:min-ts also checks the documentation c…
claude Nov 16, 2026
d588449
docs: document the round-3 behaviour and correct the migration notes
claude Nov 16, 2026
6cb1c22
test(hashing): do not pin Node.js's own isDeepStrictEqual rules; foll…
claude Nov 16, 2026
3fd35c2
fix(hashing): bound the cost of the structural hash per argument (E3)
claude Nov 16, 2026
1f6f040
fix(protocol keys): use the runtime's util.promisify.custom and util.…
claude Nov 16, 2026
7e81996
types: setups and checks through a type parameter's constraint (T33, …
claude Nov 16, 2026
d3525ff
types: substitutes of function types are configured and checked throu…
claude Nov 16, 2026
13418c1
types: unions whose variants declare null-only members no longer redu…
claude Nov 16, 2026
471c08f
test(types): pin the optional-callback limitation of the assertion vi…
claude Nov 16, 2026
289a39d
fix(call sites): format "called at" normally, read frames from a sepa…
claude Nov 16, 2026
3cc28fd
fix(assertions): throw deferred reports from a microtask (E6)
claude Nov 16, 2026
3ef3428
types: Arg.is.not / Arg.any.not document the inverse at the call site…
claude Nov 16, 2026
c8bf647
types: Arg.any('undefined') only fits parameters that accept undefine…
claude Nov 16, 2026
04f24b6
test(types): check the round-4 typing patterns with TypeScript 3.6 (T…
claude Nov 16, 2026
472b24b
test(compatibility): require jest's own report of the deferred failur…
claude Nov 16, 2026
88aa9fa
fix(hashing): load on Node.js 10, which has no globalThis
claude Nov 16, 2026
82f3236
perf(types): read member types with Extract instead of intersecting w…
claude Nov 16, 2026
e8bb73e
perf(hashing): sample long strings in three plain loops
claude Nov 16, 2026
c0ca6ca
test(types): pin two assertion-view limitations found while checking …
claude Nov 16, 2026
f9af6d1
perf(types): map generic code over the type parameter itself instead …
claude Nov 16, 2026
40bd3ce
test(compat): check the documented workarounds for bundled CommonJS r…
claude Nov 16, 2026
873d777
docs(contributing): state where deep imports work, and check it on ev…
claude Nov 16, 2026
82655ee
Merge branch 'fix/r4-engine': round-4 engine fixes (E1-E7)
claude Nov 16, 2026
4b4c75f
Merge branch 'fix/r4-types': round-4 typing fixes (T33-T38)
claude Nov 16, 2026
95230fc
Merge branch 'fix/r4-packaging': round-4 packaging fixes (P29, P30)
claude Nov 16, 2026
ec64181
docs: bring README, MIGRATION and CHANGELOG in line with the round-4 …
claude Nov 16, 2026
de0f7a6
fix(engine): decide conversions by frames and capture one call site p…
claude Nov 16, 2026
82347bf
fix(hash): hash error-like objects as Node.js compares them (E10)
claude Nov 16, 2026
75807be
types: unions of function types take any variant's value in their set…
claude Nov 16, 2026
a48b7d6
perf(arguments): bound the cost of wide and shared arguments per call…
claude Nov 16, 2026
ebf3c83
test(compat): pin what each runner does around a deferred report (E12)
claude Nov 16, 2026
2c95fa9
perf(arguments): let the per-argument item bound keep "each of 1,000 …
claude Nov 16, 2026
db6893a
docs(engine): keep the faceApply comment on faceApply
claude Nov 16, 2026
5a4138e
test(types): pin optional and nullable members in generic code per Ty…
claude Nov 16, 2026
c609ffc
types: keys of a constraint's index signature can be configured in ge…
claude Nov 16, 2026
37e2bac
fix(packaging): the ES module entry decides completeness by the named…
claude Nov 16, 2026
80c728a
types: state which TypeScript versions decide a tuple-wrapped check e…
claude Nov 16, 2026
d26dd88
test(packaging): pack a temporary copy, never the working tree's dist…
claude Nov 16, 2026
0d0c34a
test(compat): CommonJS output with the package external uses the name…
claude Nov 16, 2026
aa017b0
fix(types): identify an overload by its parameters when computing uni…
claude Nov 16, 2026
362d0b0
Merge branch 'fix/r5-engine': round-5 engine fixes (E8-E12)
claude Nov 16, 2026
244232e
Merge branch 'fix/r5-types': round-5 typing fixes (T39-T41)
claude Nov 16, 2026
f5cc1d0
Merge branch 'fix/r5-packaging': round-5 packaging fixes (P31-P33)
claude Nov 16, 2026
45facfb
docs: bring README, MIGRATION and CHANGELOG in line with the round-5 …
claude Nov 16, 2026
d6bab2b
test: remove the source-map check's temporary directory (PK5-1, E17)
claude Nov 16, 2026
8828db4
fix(call sites): tolerate a read-only, getter-only, frozen or missing…
claude Nov 16, 2026
ba73aea
fix(call sites): read a record's first frame without throwing when a …
claude Nov 16, 2026
ad811e7
fix(hash): tell distinct wide objects, Maps and Sets apart, and list …
claude Nov 16, 2026
16eb387
fix(hash): match a value that cannot be read by its identity (R5V-2, …
claude Nov 16, 2026
b630c7b
fix(hash): tell wide tables of records apart, and list a wide object'…
claude Nov 16, 2026
218a7d8
fix(call sites): keep the bare call site of a record, and lower a fix…
claude Nov 16, 2026
907fea6
fix(types): setup API for union variants whose method parameter lists…
claude Nov 16, 2026
681a3a5
test(types): pin T42 on old TypeScript and its documented limits
claude Nov 16, 2026
55a80f3
test: describe the limits of the wide-value generator as they are now…
claude Nov 16, 2026
c7b0c0f
fix(arguments): search a wide table for nested matchers once, not on …
claude Nov 17, 2026
0424c0e
fix(arguments): remember a shared table of records as searched, also …
claude Nov 17, 2026
ab15b75
test: take the best of three runs for the 200 setups with wide object…
claude Nov 17, 2026
18d350c
perf(types): one signature per parameter list for union members (T42)
claude Nov 17, 2026
8415327
Merge branch 'fix/r6-engine': round-6 engine fixes (E13-E17)
claude Nov 17, 2026
83e41e8
Merge branch 'fix/r6-types': round-6 typing fixes (T42)
claude Nov 17, 2026
74b8588
docs: bring README, MIGRATION and CHANGELOG in line with the round-6 …
claude Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ A clear and concise description of what you expected to happen.
- Typescript version: ` `
- substitute.js version: ` `
- Node version: ` `
- Module system (CommonJS, native ESM, bundler): ` `
- Test runner (ava, jest, mocha, node:test, vitest, ...): ` `

**Additional context**
Add any other context about the problem here.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ updates:
interval: daily
time: "04:00"
open-pull-requests-limit: 10

# The test runners used by compatibility-checks/ (dev tooling only).
- package-ecosystem: npm
directory: "/compatibility-checks"
schedule:
interval: weekly
open-pull-requests-limit: 5
26 changes: 13 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ on:
schedule:
- cron: '0 6 * * 1'

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
# https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
show-progress: false

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
182 changes: 163 additions & 19 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,171 @@
name: Node CI
on: [push]

on:
push:
pull_request:
workflow_dispatch:
# The publish workflow runs exactly these checks before it publishes.
workflow_call:

permissions:
contents: read

env:
# The oldest Node.js version the package supports. It must equal engines.node in package.json
# (packaging/package.test.js checks that), and the minimum-node job below smoke-tests the packed package on it.
MINIMUM_NODE_VERSION: '10.0.0'
# The oldest Node.js version with native ES module support, for the ESM entry point (dist/index.mjs).
MINIMUM_ESM_NODE_VERSION: '12.17.0'
# F2: Node.js 13.0 and 13.1 read "exports" but not its conditions. They load the package through the array fallback
# in exports["."] (the CommonJS entry); without it, require() fails there.
EXPORTS_FALLBACK_NODE_VERSION: '13.0.0'
# Node.js 13.2 to 13.6 have ES modules but not the "import" condition, so 13.7 is the oldest 13.x release on which
# the ES module entry works.
MINIMUM_ESM_NODE_13_VERSION: '13.7.0'

jobs:
build:
test:
name: Test on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18, 20, 21]
# Every Node.js LTS line that is still supported: https://nodejs.org/en/about/previous-releases
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@v5
with:
show-progress: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run the specs and the packaging checks
run: npm test
- name: Run the type tests
run: npm run test:types --if-present
# Type-checks and runs the code examples of README.md and MIGRATION.md against the built package, and checks links.
- name: Check the code examples in the documentation
run: npm run test:docs

# F4: README, MIGRATION and CHANGELOG promise TypeScript 3.6 or newer. Type-checks the built typings with exactly that
# version (spec-types/min-ts/check.js installs it on the fly with npx), so a .d.ts change that needs newer
# TypeScript fails CI and is never published.
types-min-ts:
name: Typings on the oldest supported TypeScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
show-progress: false
- name: Use the development Node.js version
uses: actions/setup-node@v5
with:
node-version-file: package.json
cache: npm
- name: Install dependencies
run: npm ci
- name: Build and type-check the typings with the oldest supported TypeScript
run: npm run test:types:min-ts

compatibility:
name: Test runner compatibility on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@v5
with:
show-progress: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: |
package-lock.json
compatibility-checks/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install the compatibility check dependencies
run: npm ci
working-directory: compatibility-checks
# The pretest script packs the repository like npm publish does and installs that tarball,
# so ava, jest, mocha, node:test and vitest run against the package as it would be published.
- name: Run the compatibility checks against the packed package
run: npm test
working-directory: compatibility-checks

minimum-node:
name: Packed package on the oldest supported Node versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Transpile typescript
run: npm run build --if-present
- name: Run tests
run: npm test
env:
CI: true
- uses: actions/checkout@v5
with:
show-progress: false
- name: Use the development Node.js version
uses: actions/setup-node@v5
with:
node-version-file: package.json
cache: npm
- name: Install dependencies
run: npm ci
- name: Pack the package like npm publish does
run: |
consumer="$RUNNER_TEMP/consumer"
mkdir -p "$consumer/node_modules/@fluffy-spoon/substitute"
npm pack --pack-destination "$RUNNER_TEMP"
tar -xzf "$RUNNER_TEMP"/fluffy-spoon-substitute-*.tgz -C "$consumer/node_modules/@fluffy-spoon/substitute" --strip-components=1
cp packaging/smoke/* "$consumer/"
- name: Use Node.js ${{ env.MINIMUM_NODE_VERSION }}
uses: actions/setup-node@v5
with:
node-version: ${{ env.MINIMUM_NODE_VERSION }}
# G:PK-2: engines.node must be a version the package really runs on.
# R3TD-5: deep-imports.js checks, on every version below, that the deep imports work or fail as
# packaging/smoke/deep-import-support.js (and CONTRIBUTING.md and MIGRATION.md) say.
- name: CommonJS smoke test on Node ${{ env.MINIMUM_NODE_VERSION }}
working-directory: ${{ runner.temp }}/consumer
run: |
node --version
node require.js
node deep-imports.js
- name: Use Node.js ${{ env.MINIMUM_ESM_NODE_VERSION }}
uses: actions/setup-node@v5
with:
node-version: ${{ env.MINIMUM_ESM_NODE_VERSION }}
- name: CommonJS and ES module smoke test on Node ${{ env.MINIMUM_ESM_NODE_VERSION }}
working-directory: ${{ runner.temp }}/consumer
run: |
node --version
node require.js
node import.mjs
node deep-imports.js
- name: Use Node.js ${{ env.EXPORTS_FALLBACK_NODE_VERSION }}
uses: actions/setup-node@v5
with:
node-version: ${{ env.EXPORTS_FALLBACK_NODE_VERSION }}
- name: CommonJS smoke test on Node ${{ env.EXPORTS_FALLBACK_NODE_VERSION }} (exports without conditions)
working-directory: ${{ runner.temp }}/consumer
run: |
node --version
node require.js
node deep-imports.js
- name: Use Node.js ${{ env.MINIMUM_ESM_NODE_13_VERSION }}
uses: actions/setup-node@v5
with:
node-version: ${{ env.MINIMUM_ESM_NODE_13_VERSION }}
- name: CommonJS and ES module smoke test on Node ${{ env.MINIMUM_ESM_NODE_13_VERSION }}
working-directory: ${{ runner.temp }}/consumer
run: |
node --version
node require.js
node import.mjs
node deep-imports.js
91 changes: 41 additions & 50 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,57 @@
name: Publish

# Publishing a GitHub release publishes the package to npm. See CONTRIBUTING.md ("Releasing").
# - The release tag must match the version in package.json (v2.0.1 or 2.0.1 for version 2.0.1).
# - A stable version is published with the npm dist-tag `latest`. A prerelease version (2.1.0-beta.1) or a release
# marked as a prerelease on GitHub is published with the dist-tag `beta`.
#
# There is no GitHub Packages job: GitHub Packages only hosts npm packages whose scope is the repository owner
# (@ffmathy), so it cannot host @fluffy-spoon/substitute, and the former job failed on every release.
on:
release:
types: [created]
# `published` also fires for a release that was saved as a draft first (`created` does not).
types: [published]

permissions:
contents: read

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm test
ci:
name: CI
uses: ./.github/workflows/nodejs.yml

publish-npm:
needs: build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm run build
- run: echo "tag=latest" >> $GITHUB_ENV
- name: Sets npm tag
if: contains(github.event.release.tag_name, 'beta')
run: echo "tag=beta" >> $GITHUB_ENV
- run: npm publish --access public --tag ${{ env.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

publish-github:
needs: build-test
name: Publish to npm
needs: ci
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# Lets npm publish with provenance (and with trusted publishing, if it is configured on npmjs.com).
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
show-progress: false
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm run build
- run: echo "tag=latest" >> $GITHUB_ENV
- name: Sets npm tag
if: contains(github.event.release.tag_name, 'beta')
run: echo "tag=beta" >> $GITHUB_ENV
- run: npm publish --tag ${{ env.tag }}
node-version-file: package.json
registry-url: https://registry.npmjs.org/
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Determine the npm dist-tag
id: dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
PRERELEASE: ${{ github.event.release.prerelease }}
run: |
version="$(node -p "require('./package.json').version")"
tag="$(node packaging/dist-tag.js "$RELEASE_TAG" "$version" "$PRERELEASE")"
echo "Publishing $version with the dist-tag $tag"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
# npm publish runs the prepack script, which builds dist/ from scratch.
- name: Publish
run: npm publish --provenance --access public --tag "$DIST_TAG"
env:
DIST_TAG: ${{ steps.dist-tag.outputs.tag }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,6 @@ ASALocalRun/

# Build
dist/
dist-spec/
fluffy-spoon-substitute-*.tgz
package/
Loading
Loading