@10stars/config 17.0.5 → 17.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10stars/config",
3
- "version": "17.0.5",
3
+ "version": "17.0.6",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "config": "./src/index.ts"
package/src/index.ts CHANGED
@@ -3,11 +3,11 @@ import { execSync } from "node:child_process"
3
3
  import fs from "node:fs/promises"
4
4
  import path from "node:path"
5
5
 
6
- import { resetColorIndex } from "./colors"
7
- import { checkIsMonorepo, dedupeSingletons, linkPackages, linkSelf } from "./link-packages"
8
- import { dedupeRemote, linkRemote } from "./link-remote"
6
+ import { checkIsMonorepo, dedupeSingletons, linkPackages, linkSelf } from "./linking/link-packages"
7
+ import { dedupeRemote, linkRemote } from "./linking/link-remote"
9
8
  import { setupOverrides } from "./manage-overrides"
10
- import { runConcurrently, type CommandConfig } from "./runner"
9
+ import { resetColorIndex } from "./run/colors"
10
+ import { runConcurrently, type CommandConfig } from "./run/runner"
11
11
  import { setupSideEffects } from "./vanilla-extract/manage-side-effects"
12
12
  import { patchVanillaExtract } from "./vanilla-extract/patch-vanilla-extract"
13
13
  import { setupVSCode } from "./vscode-config"
@@ -23,18 +23,32 @@ const PATCHED = String.raw`/(?:^|[/\\])css\.(js|cjs|mjs|jsx|ts|tsx)(\?used)?$/`
23
23
  export const patchVanillaExtract = async (cwd: string): Promise<boolean> => {
24
24
  const nodeModules = path.join(cwd, `node_modules`)
25
25
 
26
- // Recursively collect `@vanilla-extract/integration/dist/*.js` WITHOUT following directory
27
- // symlinks. A `file:` self-dep (e.g. frontend-toolkit's `frontend-toolkit: file:.` creates
28
- // node_modules/frontend-toolkit -> .) makes symlink-following recurse forever Bun.Glob does,
29
- // even with `followSymlinks: false`. A linked sibling patches its own VE during its own install,
30
- // and this repo's own copy is hoisted as a real dir, so real-dir-only recursion is sufficient.
31
- const integrationDist = /[/\\]@vanilla-extract[/\\]integration[/\\]dist[/\\][^/\\]+\.js$/
26
+ // Collect every real `@vanilla-extract/integration/dist/*.js`. VE always sits directly under a
27
+ // `node_modules` dir, so we read each node_modules' own integration/dist and recurse ONLY into
28
+ // *nested* node_modules never into package source trees. (A flat hoisted tree is hundreds of
29
+ // packages; recursing each one's dist/esm/cjs/… was the bulk of the old cost.) Symlinks are
30
+ // skipped: a `file:` self-dep links node_modules/<pkg> -> repo root, so following links recurses
31
+ // forever also why Bun.Glob (which follows links even with `followSymlinks: false`) can't be
32
+ // used. A linked sibling patches its own VE during its own install; this repo's copy is hoisted
33
+ // as a real dir, so real-dir-only descent finds every copy that this install must patch.
32
34
  const findFiles = async (dir: string, out: string[] = []): Promise<string[]> => {
35
+ const distDir = path.join(dir, `@vanilla-extract`, `integration`, `dist`)
36
+ for (const entry of await fs.readdir(distDir, { withFileTypes: true }).catch(() => [])) {
37
+ if (entry.isFile() && entry.name.endsWith(`.js`)) out.push(path.join(distDir, entry.name))
38
+ }
39
+
33
40
  for (const entry of await fs.readdir(dir, { withFileTypes: true }).catch(() => [])) {
34
- if (entry.isSymbolicLink()) continue
35
- const full = path.join(dir, entry.name)
36
- if (entry.isDirectory()) await findFiles(full, out)
37
- else if (entry.isFile() && integrationDist.test(full)) out.push(full)
41
+ if (entry.isSymbolicLink() || !entry.isDirectory()) continue
42
+ const pkgDir = path.join(dir, entry.name)
43
+ if (entry.name.startsWith(`@`)) {
44
+ // scoped packages nest a level deeper: node_modules/@scope/<pkg>/node_modules
45
+ for (const scoped of await fs.readdir(pkgDir, { withFileTypes: true }).catch(() => [])) {
46
+ if (scoped.isSymbolicLink() || !scoped.isDirectory()) continue
47
+ await findFiles(path.join(pkgDir, scoped.name, `node_modules`), out)
48
+ }
49
+ } else {
50
+ await findFiles(path.join(pkgDir, `node_modules`), out)
51
+ }
38
52
  }
39
53
  return out
40
54
  }
File without changes
File without changes
File without changes