@williamthorsen/nmr 0.9.2 → 0.11.0
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/README.md +11 -9
- package/dist/esm/.cache +1 -1
- package/dist/esm/cli.js +10 -2
- package/dist/esm/default-scripts.js +6 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
- package/dist/esm/registries.d.ts +0 -5
- package/dist/esm/registries.js +0 -67
package/README.md
CHANGED
|
@@ -133,6 +133,7 @@ These scripts are available out of the box. Repo-wide config (tier 2) and per-pa
|
|
|
133
133
|
| ------------------ | -------------------------------------------------------- |
|
|
134
134
|
| `build` | `compile`, `generate-typings` |
|
|
135
135
|
| `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
|
|
136
|
+
| `check:fixable` | `fmt:check`, `lint:check` |
|
|
136
137
|
| `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage` |
|
|
137
138
|
| `clean` | `pnpm exec rimraf dist/*` |
|
|
138
139
|
| `compile` | `tsx ../../config/build.ts` |
|
|
@@ -172,10 +173,11 @@ Packages with a `vitest.integration.config.ts` file get different test commands.
|
|
|
172
173
|
|
|
173
174
|
#### Check and quality
|
|
174
175
|
|
|
175
|
-
| Command
|
|
176
|
-
|
|
|
177
|
-
| `check`
|
|
178
|
-
| `check:
|
|
176
|
+
| Command | Runs |
|
|
177
|
+
| --------------- | -------------------------------------------------------- |
|
|
178
|
+
| `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
|
|
179
|
+
| `check:fixable` | `fmt:check`, `lint:check` |
|
|
180
|
+
| `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage` |
|
|
179
181
|
|
|
180
182
|
#### Test
|
|
181
183
|
|
|
@@ -210,11 +212,11 @@ Packages with a `vitest.integration.config.ts` file get different test commands.
|
|
|
210
212
|
|
|
211
213
|
#### Audit
|
|
212
214
|
|
|
213
|
-
| Command | Runs
|
|
214
|
-
| ------------ |
|
|
215
|
-
| `audit` | `audit:prod`, `audit:dev`
|
|
216
|
-
| `audit:dev` | `pnpm
|
|
217
|
-
| `audit:prod` | `pnpm
|
|
215
|
+
| Command | Runs |
|
|
216
|
+
| ------------ | ----------------------------- |
|
|
217
|
+
| `audit` | `audit:prod`, `audit:dev` |
|
|
218
|
+
| `audit:dev` | `pnpm exec audit-deps --dev` |
|
|
219
|
+
| `audit:prod` | `pnpm exec audit-deps --prod` |
|
|
218
220
|
|
|
219
221
|
#### Dependencies
|
|
220
222
|
|
package/dist/esm/.cache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c78bf7d8a9e046770c7c8de71f6bf1424bd0919ce2c557d53fc83d984a4528f8
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from "node:path";
|
|
1
2
|
import process from "node:process";
|
|
2
3
|
import { resolveContext } from "./context.js";
|
|
3
4
|
import { generateHelp } from "./help.js";
|
|
@@ -105,14 +106,21 @@ async function main() {
|
|
|
105
106
|
console.error(`Unknown command: ${command}`);
|
|
106
107
|
process.exit(1);
|
|
107
108
|
}
|
|
109
|
+
const packageName = path.basename(packageDir);
|
|
108
110
|
if (resolved.command === "") {
|
|
109
111
|
if (!parsed.quiet) {
|
|
110
|
-
console.info(
|
|
112
|
+
console.info(`\u26D4 ${packageName}: Override script is defined but empty. Skipping.`);
|
|
113
|
+
}
|
|
114
|
+
process.exit(0);
|
|
115
|
+
}
|
|
116
|
+
if (resolved.command === ":") {
|
|
117
|
+
if (!parsed.quiet) {
|
|
118
|
+
console.info(`\u26D4 ${packageName}: Override script is a no-op. Skipping.`);
|
|
111
119
|
}
|
|
112
120
|
process.exit(0);
|
|
113
121
|
}
|
|
114
122
|
if (resolved.source === "package" && !parsed.quiet && registry[command] !== void 0) {
|
|
115
|
-
console.info(
|
|
123
|
+
console.info(`\u{1F4E6} ${packageName}: Using override script: ${resolved.command}`);
|
|
116
124
|
}
|
|
117
125
|
const substitutedCommand = applyDevBin(resolved.command, context.config.devBin, context.monorepoRoot);
|
|
118
126
|
const fullCommand = substitutedCommand + passthrough;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const commonWorkspaceScripts = {
|
|
2
2
|
build: ["compile", "generate-typings"],
|
|
3
3
|
check: ["typecheck", "fmt:check", "lint:check", "test"],
|
|
4
|
+
"check:fixable": ["fmt:check", "lint:check"],
|
|
4
5
|
"check:strict": ["typecheck", "fmt:check", "lint:strict", "test:coverage"],
|
|
5
6
|
clean: "pnpm exec rimraf dist/*",
|
|
6
7
|
compile: "tsx ../../config/build.ts",
|
|
@@ -27,12 +28,13 @@ const standardTestScripts = {
|
|
|
27
28
|
};
|
|
28
29
|
const rootScripts = {
|
|
29
30
|
audit: ["audit:prod", "audit:dev"],
|
|
30
|
-
"audit:dev": "pnpm
|
|
31
|
-
"audit:prod": "pnpm
|
|
31
|
+
"audit:dev": "pnpm exec audit-deps --dev",
|
|
32
|
+
"audit:prod": "pnpm exec audit-deps --prod",
|
|
32
33
|
build: "pnpm --recursive exec nmr build",
|
|
33
34
|
check: ["typecheck", "fmt:check", "lint:check", "test"],
|
|
34
|
-
"check:
|
|
35
|
-
|
|
35
|
+
"check:fixable": ["fmt:check", "lint:check"],
|
|
36
|
+
"check:strict": ["typecheck", "fmt:check", "lint:strict", "test:coverage"],
|
|
37
|
+
ci: ["build", "check:strict", "audit"],
|
|
36
38
|
clean: "pnpm --recursive exec nmr clean",
|
|
37
39
|
fix: ["lint", "fmt"],
|
|
38
40
|
fmt: `sh -c 'prettier --list-different --write "\${@:-.}"' --`,
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.11.0";
|
package/dist/esm/version.js
CHANGED
package/package.json
CHANGED
package/dist/esm/registries.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type ScriptValue = string | string[];
|
|
2
|
-
export type ScriptRegistry = Record<string, ScriptValue>;
|
|
3
|
-
declare function getDefaultWorkspaceScripts(useIntTests: boolean): ScriptRegistry;
|
|
4
|
-
declare function getDefaultRootScripts(): ScriptRegistry;
|
|
5
|
-
export { getDefaultRootScripts, getDefaultWorkspaceScripts };
|
package/dist/esm/registries.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
function getDefaultWorkspaceScripts(useIntTests) {
|
|
2
|
-
const commonScripts = {
|
|
3
|
-
build: ["compile", "generate-typings"],
|
|
4
|
-
check: ["typecheck", "fmt:check", "lint:check", "test"],
|
|
5
|
-
"check:strict": ["typecheck", "fmt:check", "lint:strict", "test:coverage"],
|
|
6
|
-
clean: "pnpm exec rimraf dist/*",
|
|
7
|
-
compile: "tsx ../../config/build.ts",
|
|
8
|
-
fmt: "prettier --list-different --write .",
|
|
9
|
-
"fmt:check": "prettier --check .",
|
|
10
|
-
"generate-typings": "tsc --project tsconfig.generate-typings.json",
|
|
11
|
-
lint: "eslint --fix .",
|
|
12
|
-
"lint:check": "eslint .",
|
|
13
|
-
"lint:strict": "strict-lint",
|
|
14
|
-
typecheck: "tsgo --noEmit",
|
|
15
|
-
"view-coverage": "open coverage/index.html"
|
|
16
|
-
};
|
|
17
|
-
const integrationTestOverrides = {
|
|
18
|
-
test: "pnpm exec vitest --config=vitest.standalone.config.ts",
|
|
19
|
-
"test:coverage": "pnpm exec vitest --config=vitest.standalone.config.ts --coverage",
|
|
20
|
-
"test:integration": "pnpm exec vitest --config=vitest.integration.config.ts",
|
|
21
|
-
"test:watch": "pnpm exec vitest --config=vitest.standalone.config.ts --watch"
|
|
22
|
-
};
|
|
23
|
-
const standardTestOverrides = {
|
|
24
|
-
test: "pnpm exec vitest",
|
|
25
|
-
"test:coverage": "pnpm exec vitest --coverage",
|
|
26
|
-
"test:watch": "pnpm exec vitest --watch"
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
...commonScripts,
|
|
30
|
-
...useIntTests ? integrationTestOverrides : standardTestOverrides
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function getDefaultRootScripts() {
|
|
34
|
-
return {
|
|
35
|
-
audit: ["audit:prod", "audit:dev"],
|
|
36
|
-
"audit:dev": "pnpm dlx audit-ci@^6 --config .audit-ci/config.dev.json5",
|
|
37
|
-
"audit:prod": "pnpm dlx audit-ci@^6 --config .audit-ci/config.prod.json5",
|
|
38
|
-
build: "pnpm --recursive exec nmr build",
|
|
39
|
-
check: ["typecheck", "fmt:check", "lint:check", "test"],
|
|
40
|
-
"check:strict": ["typecheck", "fmt:check", "audit", "lint:strict", "test:coverage"],
|
|
41
|
-
ci: ["build", "check:strict"],
|
|
42
|
-
fmt: `sh -c 'prettier --list-different --write "\${@:-.}"' --`,
|
|
43
|
-
"fmt:check": `sh -c 'prettier --check "\${@:-.}"' --`,
|
|
44
|
-
lint: "nmr root:lint && pnpm --recursive exec nmr lint",
|
|
45
|
-
"lint:check": "nmr root:lint:check && pnpm --recursive exec nmr lint:check",
|
|
46
|
-
"lint:strict": "nmr root:lint:strict && pnpm --recursive exec nmr lint:strict",
|
|
47
|
-
outdated: "pnpm outdated --compatible --recursive",
|
|
48
|
-
"outdated:latest": "pnpm outdated --recursive",
|
|
49
|
-
"report-overrides": "nmr-report-overrides",
|
|
50
|
-
"root:lint": "eslint --fix --ignore-pattern 'packages/**' .",
|
|
51
|
-
"root:lint:check": "eslint --ignore-pattern 'packages/**' .",
|
|
52
|
-
"root:lint:strict": "strict-lint --ignore-pattern 'packages/**' .",
|
|
53
|
-
"root:test": "vitest --config ./vitest.root.config.ts",
|
|
54
|
-
"root:typecheck": "tsgo --noEmit",
|
|
55
|
-
"sync-pnpm-version": "nmr-sync-pnpm-version",
|
|
56
|
-
test: "nmr root:test && pnpm --recursive exec nmr test",
|
|
57
|
-
"test:coverage": "nmr root:test && pnpm --recursive exec nmr test:coverage",
|
|
58
|
-
"test:watch": "vitest --watch",
|
|
59
|
-
typecheck: "nmr root:typecheck && pnpm --recursive exec nmr typecheck",
|
|
60
|
-
update: "pnpm update --recursive",
|
|
61
|
-
"update:latest": "pnpm update --latest --recursive"
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
getDefaultRootScripts,
|
|
66
|
-
getDefaultWorkspaceScripts
|
|
67
|
-
};
|