@vwala/tooling-config 1.6.0 → 1.7.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.
@@ -26,7 +26,7 @@ Install `@vwala/tooling-config` at the repository root beside `biome.json` or `b
26
26
  "!**/generated/**",
27
27
  "!**/__generated__/**",
28
28
  "!**/__tests__/**",
29
- "!**/test-support/**",
29
+ "!**/__test-support__/**",
30
30
  "!**/fixtures/**",
31
31
  "!**/__fixtures__/**",
32
32
  "!**/vendor/**",
@@ -54,7 +54,7 @@ Install `@vwala/tooling-config` at the repository root beside `biome.json` or `b
54
54
  "!**/generated/**",
55
55
  "!**/__generated__/**",
56
56
  "!**/__tests__/**",
57
- "!**/test-support/**",
57
+ "!**/__test-support__/**",
58
58
  "!**/fixtures/**",
59
59
  "!**/__fixtures__/**",
60
60
  "!**/vendor/**",
@@ -51,7 +51,7 @@ Append these exclusions to both `includes` arrays above so editor diagnostics ha
51
51
  "!**/node_modules/**", "!**/.git/**", "!**/dist/**", "!**/build/**",
52
52
  "!**/.next/**", "!**/.expo/**", "!**/coverage/**",
53
53
  "!**/generated/**", "!**/__generated__/**", "!**/__tests__/**",
54
- "!**/test-support/**", "!**/fixtures/**", "!**/__fixtures__/**",
54
+ "!**/__test-support__/**", "!**/fixtures/**", "!**/__fixtures__/**",
55
55
  "!**/vendor/**", "!**/vendored/**", "!**/*.test.*", "!**/*.spec.*",
56
56
  "!**/*.d.ts", "!**/*.d.mts", "!**/*.d.cts"
57
57
  ]
@@ -108,7 +108,7 @@ Use the helper's sequenced watch mode, with a package script for alias rewriting
108
108
  pnpm exec compile-react-library --project tsconfig.build.json --format esm --watch --after build:finish
109
109
  ```
110
110
 
111
- `build:finish` must finish before the next rebuild starts. The watch helper owns TypeScript emission too; do not start `tsc --watch` alongside it. Compiler-on/off comparisons use the same helper and post-build script.
111
+ `build:finish` must finish before the next rebuild starts. The watch helper owns TypeScript emission too; do not start `tsc --watch` alongside it. Compiler-on/off comparisons use the same helper and post-build script. `compile-react-library` also runs on Windows, where stopping a watch build force-stops the whole build process tree with `taskkill /T /F`.
112
112
 
113
113
  The watcher observes TypeScript sources and the selected build tsconfig. Restart it after changing an inherited tsconfig outside the package. The helper preserves the configured JSX runtime and maps; it does not add JavaScript downlevel transforms for older runtime targets. A contradictory `.mts`/CommonJS or `.cts`/ESM request fails explicitly.
114
114
 
package/README.md CHANGED
@@ -116,7 +116,7 @@ They are warnings because the convention applies to new code and asks that exist
116
116
 
117
117
  `check-naming` (see [Convention checks](#convention-checks)) supplies the two halves the rules cannot express — folder names, which Biome never sees, and an error for files **added since the base ref**, which no static severity can express. Existing offenders are printed as warnings and leave the exit code at 0; a new file or a new folder that breaks the convention exits 1. The base ref defaults to `origin/main` — set `NAMING_BASE_REF` for a differently named default branch, and note that a shallow CI clone that cannot resolve it degrades the check to warnings only, so fetch enough history for `git merge-base` to work.
118
118
 
119
- `__tests__`, `__mocks__`, `_scripts`, hidden folders, and the `[slug]` / `(group)` / `@slot` segments Next.js and Expo give meaning to are exempt from the folder check.
119
+ `__tests__`, `__test-support__`, `__mocks__`, `_scripts`, hidden folders, and the `[slug]` / `(group)` / `@slot` segments Next.js and Expo give meaning to are exempt from the folder check.
120
120
 
121
121
  Filenames that carry a routing marker — a leading `_` (`_layout.tsx`), or a `+` or `[` anywhere (`+not-found.tsx`, `hello+api.ts`, `[id].tsx`, `[...slug].tsx`) — are exempt from both `useFilenamingConvention` and `check-naming`, because Expo Router and Next.js own those names. Only the filename counts: `payment_service.ts` still fails, and so does `fooBar.ts` inside `_scripts/`.
122
122
 
@@ -144,6 +144,8 @@ All three are errors, which is a departure from the [naming](#naming) rules and
144
144
 
145
145
  `use-tests-folder-location` can only check syntax — a GritQL plugin cannot see its own file path. The path-level halves of that convention — no `tests/` folder, no non-test files in `__tests__/`, no production code importing test code — are the second of the [convention checks](#convention-checks).
146
146
 
147
+ Test utilities live in `__test-support__/`, named like `__tests__/` so both read as test-only. The legacy `test-support/` name is still treated as test code by every check and shipped glob — test layout, module context, package exports, `no-uuid-type-assertion`, and the React Compiler scope — so a repository can upgrade this package before it renames its folders. Names that are not folders keep `test-support`: a `test-support.ts` barrel and the `"./test-support"` export it backs.
148
+
147
149
  ---
148
150
 
149
151
  ## Convention checks
@@ -168,7 +170,7 @@ Some conventions are about paths and manifests rather than syntax, and Biome rea
168
170
  | `package exports` | Every `packages/**` manifest declares an `exports` map of explicit subpaths, with no legacy `main`/`module`/`types` and no dangling targets — see [package exports](#package-exports). |
169
171
  | `agent skills` | [`.agents/skills/` is the only copy](#agent-skills); other agent directories mirror it with symlinks. |
170
172
  | `agent docs` | [`CLAUDE.md` is a symlink to `AGENTS.md`](#agent-briefs), never a second copy. |
171
- | `module context` | [Every module under `packages/modules/` declares its domain language](#module-glossaries) in `CONTEXT.md`. |
173
+ | `module context` | [Every module under `packages/modules/` declares its domain language](#module-glossaries) in `GLOSSARY.md`; a legacy `CONTEXT.md` still passes with a warning while repositories migrate. |
172
174
 
173
175
  Wire that single script into your own preflight and new checks arrive with an upgrade, rather than as another `&&` you have to add by hand. It runs every check even after one fails — a bad filename and a misplaced test are independent problems, and seeing both in one run beats fixing one to discover the other. Each check is still a standalone script under `src/**/_scripts/` if you want to run one on its own.
174
176
 
@@ -221,14 +223,16 @@ Both files are optional. A repository with neither passes, and so does one with
221
223
 
222
224
  ### Module glossaries
223
225
 
224
- Every package under `packages/modules/` owns a bounded area of the business, so every one of them declares its domain language in `CONTEXT.md`.
226
+ Every package under `packages/modules/` owns a bounded area of the business, so every one of them declares its domain language in `GLOSSARY.md`.
225
227
 
226
228
  Without it each module invents its own words for the same thing — one calls it an order, the next a purchase, the third a transaction — and the cost only shows up later, when the three have to talk to each other and nobody can say whether they mean the same thing. `packages/platform/` and `packages/tooling/` are excluded on purpose: they hold code with no domain knowledge, so they have no domain language to declare.
227
229
 
228
- A module is identified by its `package.json`, at any depth. Modules nest (`packages/modules/act/enrich/`) and may be scoped (`packages/modules/@acme/invoicing/`), so every manifest counts — including one at a grouping level that has modules beneath it, because a directory carrying a manifest is a package and a package here is a module. Manifests below `node_modules/`, `src/`, `dist/`, `build/`, `__tests__/`, `test-support/` or `fixtures/` are skipped; a workspace package never has one of those as an ancestor, so excluding by folder rather than by depth is what keeps a fixture's manifest from registering as a module of its own.
230
+ A module is identified by its `package.json`, at any depth. Modules nest (`packages/modules/act/enrich/`) and may be scoped (`packages/modules/@acme/invoicing/`), so every manifest counts — including one at a grouping level that has modules beneath it, because a directory carrying a manifest is a package and a package here is a module. Manifests below `node_modules/`, `src/`, `dist/`, `build/`, `__tests__/`, `__test-support__/`, `test-support/` or `fixtures/` are skipped; a workspace package never has one of those as an ancestor, so excluding by folder rather than by depth is what keeps a fixture's manifest from registering as a module of its own.
229
231
 
230
232
  Existence and non-emptiness are all that is checked. The convention asks for a glossary written as terms crystallise, and a checker that demanded headings and a minimum term count would only teach people to satisfy it with a heading and a fake term.
231
233
 
234
+ The file used to be called `CONTEXT.md`, and repositories are migrating to the new name. Until they have, a module whose only glossary is a legacy `CONTEXT.md` still passes, with a warning that names the file and asks for the rename; the empty and symlink rules apply to it as they would to `GLOSSARY.md`. A module with both files fails instead — two glossaries for one module drift apart, so merge `CONTEXT.md` into `GLOSSARY.md` and delete it. Legacy support will be removed in a later release.
235
+
232
236
  ---
233
237
 
234
238
  ## Package manager
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vwala/tooling-config",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "description": "Shared tooling configuration for Vwala repositories",
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "src",
16
16
  ".vwala/docs",
17
17
  "!src/**/__tests__",
18
- "!src/**/test-support"
18
+ "!src/**/__test-support__"
19
19
  ],
20
20
  "bin": {
21
21
  "compile-react-library": "./src/react-compiler/build/compile-react-library.mjs",
@@ -42,6 +42,7 @@
42
42
  "@babel/traverse": "7.29.8",
43
43
  "babel-plugin-react-compiler": "1.0.0",
44
44
  "commitlint-config-gitmoji": "^2.3.1",
45
+ "cross-spawn": "7.0.6",
45
46
  "jsonc-parser": "3.3.1"
46
47
  },
47
48
  "scripts": {
@@ -33,10 +33,11 @@ const IGNORED_PREFIXES = [".agents/", ".claude/", ".husky/"];
33
33
  const SOURCE_FILE = /\.[cm]?[jt]sx?$/;
34
34
  const KEBAB_CASE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
35
35
  // Folder names that are a convention in their own right rather than a name:
36
- // the test and story folders, the `_scripts` prefix this package uses for
37
- // runnable helpers, anything hidden, and the bracket/paren/@ segments that
38
- // Next.js and Expo routing give meaning to.
39
- const RESERVED_FOLDER = /^(__[a-z]+__|_[a-z-]+|\..+|\[.+\]|\(.+\)|@.+|\+.+)$/;
36
+ // the test, test-support and story folders, the `_scripts` prefix this package
37
+ // uses for runnable helpers, anything hidden, and the bracket/paren/@ segments
38
+ // that Next.js and Expo routing give meaning to.
39
+ const RESERVED_FOLDER =
40
+ /^(__[a-z]+(-[a-z]+)*__|_[a-z-]+|\..+|\[.+\]|\(.+\)|@.+|\+.+)$/;
40
41
  // Filenames that carry a router's marker — Expo's `_layout` and `+not-found`,
41
42
  // its `+api` suffix, a `[param]` / `[...slug]` segment — follow whatever that
42
43
  // framework enforces, which is not ours to second-guess.
@@ -81,6 +81,7 @@
81
81
  "includes": [
82
82
  "**",
83
83
  "!**/__tests__/**",
84
+ "!**/__test-support__/**",
84
85
  "!**/test-support/**",
85
86
  "!**/*.test.ts",
86
87
  "!**/*.test.tsx"
@@ -9,18 +9,21 @@
9
9
  * tracked files.
10
10
  *
11
11
  * 1. No folder named `tests` or `test` — test files live in `__tests__/`, test
12
- * utilities in `test-support/`.
13
- * 2. No non-test file inside `__tests__/` — utilities belong in `test-support/`.
14
- * This is the check that catches helpers drifting back in.
15
- * 3. Production code must not import from `test-support/` or `__tests__/`.
12
+ * utilities in `__test-support__/`.
13
+ * 2. No non-test file inside `__tests__/` — utilities belong in
14
+ * `__test-support__/`. This is the check that catches helpers drifting back
15
+ * in.
16
+ * 3. Production code must not import from `__test-support__/` or `__tests__/`.
17
+ * The legacy `test-support/` folder name is still recognized on both sides,
18
+ * so a repository can upgrade before its folders are renamed.
16
19
  * Two things are deliberately exempt, because in both the import is the
17
20
  * point rather than a leak:
18
21
  * - Storybook apps, whose whole job is rendering real fixtures, and whose
19
22
  * story helpers are not always named `*.stories.tsx`;
20
23
  * - `test-support.ts` barrels, which re-export a package's own
21
- * `test-support/` through a published `"./test-support"` export. The
22
- * camelCase spelling is still accepted, because the kebab-case filename
23
- * rule only reaches code written since it shipped.
24
+ * `__test-support__/` through a published `"./test-support"` export.
25
+ * The camelCase spelling is still accepted, because the kebab-case
26
+ * filename rule only reaches code written since it shipped.
24
27
  *
25
28
  * See: .agents/skills/vwala-conventions/references/test-style.md
26
29
  */
@@ -32,6 +35,7 @@ const TEST_FILE = /\.test\.[cm]?[jt]sx?$/;
32
35
  const STORY_FILE =
33
36
  /(\.stories\.[jt]sx?$|\/__stories__\/|^apps\/[^/]*storybook[^/]*\/)/;
34
37
  const TEST_SUPPORT_BARREL = /(^|\/)(test-support|testSupport)\.[cm]?ts$/;
38
+ const TEST_FOLDER = /(^|\/)(__tests__|__test-support__|test-support)\//;
35
39
 
36
40
  const files = execFileSync("git", ["ls-files"], {
37
41
  encoding: "utf8",
@@ -48,7 +52,7 @@ const violations = [];
48
52
  for (const file of files) {
49
53
  if (/(^|\/)tests?\//.test(file)) {
50
54
  violations.push(
51
- `${file}\n Folder named "tests"/"test". Test files go in __tests__/, utilities in test-support/.`,
55
+ `${file}\n Folder named "tests"/"test". Test files go in __tests__/, utilities in __test-support__/.`,
52
56
  );
53
57
  }
54
58
 
@@ -58,7 +62,7 @@ for (const file of files) {
58
62
  !file.endsWith(".md")
59
63
  ) {
60
64
  violations.push(
61
- `${file}\n Non-test file inside __tests__/. Test utilities belong in test-support/.`,
65
+ `${file}\n Non-test file inside __tests__/. Test utilities belong in __test-support__/.`,
62
66
  );
63
67
  }
64
68
  }
@@ -69,7 +73,7 @@ const productionSources = files.filter(
69
73
  !TEST_FILE.test(file) &&
70
74
  !STORY_FILE.test(file) &&
71
75
  !TEST_SUPPORT_BARREL.test(file) &&
72
- !/\/(__tests__|test-support)\//.test(file) &&
76
+ !TEST_FOLDER.test(file) &&
73
77
  !/\.config\.[cm]?[jt]s$/.test(file),
74
78
  );
75
79
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * Every package under `packages/modules/` owns a bounded area of the business,
4
- * so every one of them declares its domain language in `CONTEXT.md`.
4
+ * so every one of them declares its domain language in `GLOSSARY.md`.
5
5
  *
6
6
  * Without it each module invents its own words for the same thing — one calls
7
7
  * it an order, the next a purchase, the third a transaction — and the cost only
@@ -15,9 +15,15 @@
15
15
  * and a minimum term count would only teach people to satisfy it with a heading
16
16
  * and a fake term.
17
17
  *
18
+ * The file used to be called `CONTEXT.md`. While repositories migrate, a legacy
19
+ * `CONTEXT.md` that is a module's only glossary still passes with a warning to
20
+ * rename it, and the empty and symlink rules apply to it as they would to
21
+ * `GLOSSARY.md`. A module that has both files fails, because two glossaries for
22
+ * one module drift apart. Legacy support goes away in a later release.
23
+ *
18
24
  * Biome cannot express this. A missing file has no syntax to parse.
19
25
  *
20
- * See: .agents/skills/vwala-conventions/references/domain-language-in-context-md.md
26
+ * See: .agents/skills/vwala-conventions/references/domain-language-in-glossary-md.md
21
27
  * See: .agents/skills/vwala-conventions/references/monorepo-structure.md
22
28
  */
23
29
  import {
@@ -28,7 +34,8 @@ import {
28
34
 
29
35
  const MODULES_ROOT = "packages/modules/";
30
36
  const MANIFEST = "package.json";
31
- const CONTEXT_FILE = "CONTEXT.md";
37
+ const GLOSSARY_FILE = "GLOSSARY.md";
38
+ const LEGACY_GLOSSARY_FILE = "CONTEXT.md";
32
39
 
33
40
  /**
34
41
  * Folders a workspace package never has as an ancestor. A `package.json` below
@@ -41,6 +48,7 @@ const NOT_A_PACKAGE_ROOT = new Set([
41
48
  "dist",
42
49
  "build",
43
50
  "__tests__",
51
+ "__test-support__",
44
52
  "test-support",
45
53
  "fixtures",
46
54
  ]);
@@ -74,43 +82,68 @@ const modules = entries
74
82
  .sort();
75
83
 
76
84
  const violations = [];
85
+ const warnings = [];
77
86
 
78
87
  for (const module of modules) {
79
- const contextPath = `${module}${CONTEXT_FILE}`;
80
- const context = byPath.get(contextPath);
88
+ const glossaryPath = `${module}${GLOSSARY_FILE}`;
89
+ const legacyPath = `${module}${LEGACY_GLOSSARY_FILE}`;
90
+ const current = byPath.get(glossaryPath);
91
+ const legacy = byPath.get(legacyPath);
92
+ const glossary = current ?? legacy;
81
93
 
82
- if (context === undefined) {
83
- // macOS filesystems are case-insensitive, so a `Context.md` looks present
94
+ if (glossary === undefined) {
95
+ // macOS filesystems are case-insensitive, so a `Glossary.md` looks present
84
96
  // in an editor while git tracks the name that was actually committed.
85
97
  // Saying which is which beats "missing" on a file the author can see.
86
- const miscased = entries.find(
87
- (entry) =>
88
- entry.path.toLowerCase() === contextPath.toLowerCase() &&
89
- entry.path !== contextPath,
98
+ const miscased = entries.find((entry) =>
99
+ [glossaryPath, legacyPath].some(
100
+ (expected) => entry.path.toLowerCase() === expected.toLowerCase(),
101
+ ),
90
102
  );
91
103
 
92
104
  violations.push(
93
105
  miscased === undefined
94
- ? `${contextPath}\n Missing. Every module under ${MODULES_ROOT} declares its domain language in ${CONTEXT_FILE}.`
95
- : `${miscased.path}\n Wrong case. Rename it to ${CONTEXT_FILE}.`,
106
+ ? `${glossaryPath}\n Missing. Every module under ${MODULES_ROOT} declares its domain language in ${GLOSSARY_FILE}.`
107
+ : `${miscased.path}\n Wrong case. Rename it to ${GLOSSARY_FILE}.`,
96
108
  );
97
109
  continue;
98
110
  }
99
111
 
100
- if (context.mode === SYMLINK_MODE) {
112
+ if (legacy !== undefined) {
113
+ if (current === undefined) {
114
+ warnings.push(
115
+ `${legacyPath}\n Legacy name. Rename it to ${GLOSSARY_FILE}.`,
116
+ );
117
+ } else {
118
+ violations.push(
119
+ `${legacyPath}\n Second glossary. Merge it into ${GLOSSARY_FILE} and delete it.`,
120
+ );
121
+ }
122
+ }
123
+
124
+ if (glossary.mode === SYMLINK_MODE) {
101
125
  violations.push(
102
- `${contextPath}\n Symlink. A module's domain language is its own; it cannot be borrowed from another module.`,
126
+ `${glossary.path}\n Symlink. A module's domain language is its own; it cannot be borrowed from another module.`,
103
127
  );
104
128
  continue;
105
129
  }
106
130
 
107
- if (readBlob({ sha: context.sha }).trim() === "") {
131
+ if (readBlob({ sha: glossary.sha }).trim() === "") {
108
132
  violations.push(
109
- `${contextPath}\n Empty. Write the module's terms, or the file is a placeholder that says nothing.`,
133
+ `${glossary.path}\n Empty. Write the module's terms, or the file is a placeholder that says nothing.`,
110
134
  );
111
135
  }
112
136
  }
113
137
 
138
+ if (warnings.length > 0) {
139
+ console.warn(
140
+ `\n ! ${warnings.length} module glossary file(s) still named ${LEGACY_GLOSSARY_FILE} — accepted while repositories migrate to ${GLOSSARY_FILE}:\n`,
141
+ );
142
+ for (const warning of warnings) {
143
+ console.warn(` ${warning}\n`);
144
+ }
145
+ }
146
+
114
147
  if (violations.length > 0) {
115
148
  console.error(`\n ✖ ${violations.length} module-context violation(s):\n`);
116
149
  for (const violation of violations) {
@@ -64,7 +64,7 @@ const LIBRARY_MANIFEST = /^packages\//;
64
64
  // A manifest under one of these is test data — a consumer testing a package
65
65
  // generator commits fixture manifests — not a workspace package.
66
66
  const FIXTURE_MANIFEST =
67
- /\/(__tests__|__fixtures__|test-support|node_modules)\//;
67
+ /\/(__tests__|__fixtures__|__test-support__|test-support|node_modules)\//;
68
68
  const IGNORED_PREFIXES = [".agents/", ".claude/"];
69
69
 
70
70
  // npm names are lowercase; the scope is what stops `ui` colliding with an
@@ -1,4 +1,27 @@
1
- import { spawn } from "node:child_process";
1
+ import { spawnSync } from "node:child_process";
2
+ import spawn from "cross-spawn";
3
+
4
+ const isWindows = process.platform === "win32";
5
+
6
+ function stopProcessTree(pid) {
7
+ if (isWindows) {
8
+ const result = spawnSync("taskkill", ["/pid", String(pid), "/T", "/F"], {
9
+ stdio: "ignore",
10
+ windowsHide: true,
11
+ });
12
+ if (result.error) {
13
+ throw result.error;
14
+ }
15
+ return;
16
+ }
17
+ try {
18
+ process.kill(-pid, "SIGTERM");
19
+ } catch (error) {
20
+ if (error.code !== "ESRCH") {
21
+ throw error;
22
+ }
23
+ }
24
+ }
2
25
 
3
26
  /** Own one sequential build command and its descendant process lifetime. */
4
27
  export function createBuildCommandProcess() {
@@ -12,8 +35,9 @@ export function createBuildCommandProcess() {
12
35
  return new Promise((resolve, reject) => {
13
36
  const child = spawn("pnpm", args, {
14
37
  cwd,
15
- detached: true,
38
+ detached: !isWindows,
16
39
  stdio: ["ignore", "pipe", "pipe"],
40
+ windowsHide: true,
17
41
  });
18
42
  active = child;
19
43
  let stdout = "";
@@ -45,13 +69,7 @@ export function createBuildCommandProcess() {
45
69
  stop() {
46
70
  stopped = true;
47
71
  if (active?.pid) {
48
- try {
49
- process.kill(-active.pid, "SIGTERM");
50
- } catch (error) {
51
- if (error.code !== "ESRCH") {
52
- throw error;
53
- }
54
- }
72
+ stopProcessTree(active.pid);
55
73
  }
56
74
  },
57
75
  };
@@ -1,17 +1,15 @@
1
- import { execFileSync } from "node:child_process";
2
1
  import path from "node:path";
2
+ import { runPnpmSync } from "./run-pnpm-sync.mjs";
3
3
 
4
4
  export function readBuildProject(projectPath) {
5
5
  const configPath = path.resolve(projectPath);
6
6
  const directory = path.dirname(configPath);
7
- const config = JSON.parse(
8
- execFileSync(
9
- "pnpm",
10
- ["exec", "tsc", "--project", configPath, "--showConfig"],
11
- { cwd: directory, encoding: "utf8" },
12
- ),
7
+ const { compilerOptions: options, files } = JSON.parse(
8
+ runPnpmSync({
9
+ args: ["exec", "tsc", "--project", configPath, "--showConfig"],
10
+ cwd: directory,
11
+ }),
13
12
  );
14
- const { compilerOptions: options, files } = config;
15
13
  if (!options.rootDir || !options.outDir) {
16
14
  throw new Error(
17
15
  "React library builds require explicit rootDir and outDir in the build tsconfig.",
@@ -0,0 +1,23 @@
1
+ import spawn from "cross-spawn";
2
+
3
+ export function runPnpmSync({ args, cwd }) {
4
+ const result = spawn.sync("pnpm", args, {
5
+ cwd,
6
+ encoding: "utf8",
7
+ windowsHide: true,
8
+ });
9
+ if (result.stderr) {
10
+ process.stderr.write(result.stderr);
11
+ }
12
+ if (result.error) {
13
+ throw result.error;
14
+ }
15
+ if (result.status !== 0) {
16
+ const message = `Command failed: pnpm ${args.join(" ")}`;
17
+ throw Object.assign(
18
+ new Error(result.stderr ? `${message}\n${result.stderr}` : message),
19
+ { stdout: result.stdout, stderr: result.stderr },
20
+ );
21
+ }
22
+ return result.stdout;
23
+ }
@@ -9,6 +9,7 @@ const excludedDirectories = [
9
9
  "generated",
10
10
  "__generated__",
11
11
  "__tests__",
12
+ "__test-support__",
12
13
  "test-support",
13
14
  "fixtures",
14
15
  "__fixtures__",