targeted-mutation 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +21 -0
- package/README.md +111 -2
- package/bin/tmt-compile.mjs +46 -0
- package/bin/tmt.mjs +117 -0
- package/build/typescript-syntax/LICENSE.txt +55 -0
- package/build/typescript-syntax/ThirdPartyNoticeText.txt +193 -0
- package/build/typescript-syntax/typescript-syntax.cjs +43 -0
- package/docs/analysis.md +218 -0
- package/docs/compiler.md +462 -0
- package/docs/development.md +61 -0
- package/docs/how-it-works.svg +188 -0
- package/docs/l1.md +94 -0
- package/docs/performance.md +647 -0
- package/docs/releasing.md +48 -0
- package/package.json +49 -4
- package/src/analysis.mjs +689 -0
- package/src/assertion-session.mjs +93 -0
- package/src/assertion-strength.mjs +795 -0
- package/src/builtin-mutations.mjs +755 -0
- package/src/builtin-switches.mjs +642 -0
- package/src/change-undone.mjs +524 -0
- package/src/cli-output.mjs +166 -0
- package/src/compiler-compat.cjs +108 -0
- package/src/compiler-maps.cjs +60 -0
- package/src/compiler-routes.cjs +391 -0
- package/src/compiler.cjs +98 -0
- package/src/compiler.mjs +1 -0
- package/src/conventional.mjs +172 -0
- package/src/displacement.mjs +19 -0
- package/src/extract.mjs +135 -0
- package/src/fallback-process.mjs +14 -0
- package/src/in-parallel.mjs +20 -0
- package/src/lean-replay.mjs +39 -0
- package/src/operator-analysis.mjs +123 -0
- package/src/playwright.mjs +139 -0
- package/src/probe-runtime.mjs +50 -0
- package/src/probe.mjs +170 -0
- package/src/prototype.mjs +230 -0
- package/src/regex-mutations.mjs +102 -0
- package/src/runner-process.mjs +59 -0
- package/src/runtime-binaries.mjs +50 -0
- package/src/scope.mjs +202 -0
- package/src/source-text.mjs +49 -0
- package/src/standard-plan.mjs +308 -0
- package/src/standard-runner.mjs +185 -0
- package/src/standard-session.mjs +362 -0
- package/src/standard-setup.mjs +20 -0
- package/src/targeted-gaps.mjs +85 -0
- package/src/threshold.mjs +185 -0
- package/src/trace-buffer.mjs +126 -0
- package/src/typescript-bindings.mjs +243 -0
- package/src/typescript-compiler.mjs +59 -0
- package/src/typescript-extraction.mjs +354 -0
- package/src/typescript-grammar.mjs +923 -0
- package/src/vitest-reporter.mjs +64 -0
- package/src/vitest.mjs +262 -0
- package/src/witness-analysis.mjs +234 -0
- package/src/witness-contracts.mjs +110 -0
- package/src/witness-discovery.mjs +239 -0
- package/src/witness-fixtures.mjs +149 -0
- package/src/witness-order.mjs +83 -0
- package/src/witness-rules.mjs +254 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
A release publishes five npm packages at the same version: `targeted-mutation` and one `@targeted-mutation/tmt-<os>-<cpu>` package for each of `darwin-arm64`, `darwin-x64`, `linux-arm64` and `linux-x64`. The main package lists the platform packages as optional dependencies, so npm installs the one that matches the machine.
|
|
4
|
+
|
|
5
|
+
The `Release` workflow builds each platform package on a runner of that platform, installs and tests the packages, and publishes the platform packages before the main package. A re-run skips versions that are already on the registry. Workflows run only while the repository is public.
|
|
6
|
+
|
|
7
|
+
## One-time setup
|
|
8
|
+
|
|
9
|
+
1. Create the `targeted-mutation` organization on npmjs.com. It owns the `@targeted-mutation` scope.
|
|
10
|
+
2. In the GitHub repository, create an environment named `npm`. Restrict it to tags matching `v*` and add required reviewers if a release should need approval.
|
|
11
|
+
|
|
12
|
+
## First release (token)
|
|
13
|
+
|
|
14
|
+
npm configures trusted publishing per package, and a package must exist before it can be configured. The first release therefore uses a token.
|
|
15
|
+
|
|
16
|
+
1. On npmjs.com create a granular access token with read and write permission for all packages. A token limited to the `@targeted-mutation` scope cannot create the unscoped `targeted-mutation` package, and the release would stop at its last step. Give it a short expiry and enable the option that lets the token bypass two-factor authentication: a workflow cannot answer a prompt, and creating new packages is refused without it.
|
|
17
|
+
2. Store it as the secret `NPM_TOKEN` of the `npm` environment (not as a repository secret).
|
|
18
|
+
3. Set the version in `package.json` and `package-lock.json`, update `CHANGELOG.md`, merge, and push the tag: `git tag v0.1.0 && git push origin v0.1.0`.
|
|
19
|
+
4. After the workflow succeeds, check `npm view targeted-mutation` and install it in an empty project.
|
|
20
|
+
|
|
21
|
+
## Switch to trusted publishing
|
|
22
|
+
|
|
23
|
+
Do this once, right after the first release.
|
|
24
|
+
|
|
25
|
+
1. For each of the five packages, open Settings on npmjs.com, add a trusted publisher of type GitHub Actions, and enter the repository owner and name, the workflow file `release.yml` and the environment `npm`. If the form offers a choice of permissions, allow publishing directly with `npm publish`.
|
|
26
|
+
2. Delete the `NPM_TOKEN` environment secret and revoke the token on npmjs.com.
|
|
27
|
+
3. In each package's settings, require two-factor authentication and disallow tokens.
|
|
28
|
+
|
|
29
|
+
With the secret gone, the publish step writes no token and npm authenticates through OIDC. This needs npm 11.5.1 or later, which the workflow's Node.js release includes; the step prints the npm version. A new trusted publisher configuration must be used by a successful publish soon after it is created, so plan the second release (a patch release is enough) within that window.
|
|
30
|
+
|
|
31
|
+
## Later releases
|
|
32
|
+
|
|
33
|
+
1. Set the version, update `CHANGELOG.md`, merge.
|
|
34
|
+
2. Push the tag `v<version>`. The tag must equal the package version or the publish step stops.
|
|
35
|
+
|
|
36
|
+
If a run fails part-way, fix the cause and re-run it. Published platform packages are skipped and the main package is published last, so an installable main package always has its binaries.
|
|
37
|
+
|
|
38
|
+
## Local checks
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm run pack:runtime # build/packages/*.tgz for this machine
|
|
42
|
+
npm run test:package # install both archives in an empty project and run every profile
|
|
43
|
+
node scripts/publish-packages.mjs build/packages --dry-run # needs all five archives
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Workflow dependencies
|
|
47
|
+
|
|
48
|
+
Actions are pinned by the lockfile `.github/workflows/actions.lock`. After changing a `uses:` line run `gh actions-lock` and commit the lockfile. `gh actions-lock --verify` checks it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "targeted-mutation",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Find the tests a JavaScript or TypeScript suite is missing by trying small, targeted source edits against it.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mutation-testing",
|
|
7
|
+
"testing",
|
|
8
|
+
"test-quality",
|
|
9
|
+
"typescript",
|
|
10
|
+
"javascript",
|
|
11
|
+
"vitest",
|
|
12
|
+
"playwright",
|
|
13
|
+
"boundary-value"
|
|
14
|
+
],
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"author": "Tatsuo Kaniwa",
|
|
17
|
+
"homepage": "https://github.com/t-k/targeted-mutation-ts#readme",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/t-k/targeted-mutation-ts.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/t-k/targeted-mutation-ts/issues"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"bin": {
|
|
27
|
+
"targeted-mutation": "bin/tmt.mjs",
|
|
28
|
+
"tmts": "bin/tmt.mjs"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": "^22.18.0 || >=24.11.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"typescript": ">=5.9.3 <7"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"bin/",
|
|
38
|
+
"src/",
|
|
39
|
+
"build/typescript-syntax/",
|
|
40
|
+
"docs/",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"NOTICE"
|
|
44
|
+
],
|
|
45
|
+
"optionalDependencies": {
|
|
46
|
+
"@targeted-mutation/tmt-darwin-arm64": "0.1.1",
|
|
47
|
+
"@targeted-mutation/tmt-darwin-x64": "0.1.1",
|
|
48
|
+
"@targeted-mutation/tmt-linux-arm64": "0.1.1",
|
|
49
|
+
"@targeted-mutation/tmt-linux-x64": "0.1.1"
|
|
50
|
+
}
|
|
51
|
+
}
|