@10stars/config 17.0.5 → 17.0.7
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 +1 -1
- package/src/index.ts +4 -4
- package/src/{link-remote.ts → linking/link-remote.ts} +9 -3
- package/src/vanilla-extract/patch-vanilla-extract.ts +24 -10
- /package/src/{link-packages.ts → linking/link-packages.ts} +0 -0
- /package/src/{colors.ts → run/colors.ts} +0 -0
- /package/src/{runner.ts → run/runner.ts} +0 -0
package/package.json
CHANGED
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 {
|
|
7
|
-
import {
|
|
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 {
|
|
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"
|
|
@@ -37,8 +37,14 @@ interface LinkRemoteOptions {
|
|
|
37
37
|
type Sibling = { abs: string; ref: string | null }
|
|
38
38
|
|
|
39
39
|
// execFile (not a shell) so branch names / refs / SHAs can't inject shell syntax.
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// quiet: ignore the child's stderr (used by tryGit, whose callers tolerate failure — otherwise
|
|
41
|
+
// git's "fatal: …" for an expected miss, e.g. `describe` on a tagless shallow clone, spams the log).
|
|
42
|
+
const git = (args: string[], cwd?: string, quiet = false): string =>
|
|
43
|
+
execFileSync(`git`, args, {
|
|
44
|
+
cwd,
|
|
45
|
+
encoding: `utf8`,
|
|
46
|
+
...(quiet && { stdio: [`ignore`, `pipe`, `ignore`] }),
|
|
47
|
+
}).trim()
|
|
42
48
|
|
|
43
49
|
const execFileAsync = promisify(execFile)
|
|
44
50
|
|
|
@@ -51,7 +57,7 @@ const gitAsync = (args: string[], cwd?: string): Promise<unknown> =>
|
|
|
51
57
|
|
|
52
58
|
const tryGit = (args: string[], cwd?: string): string | null => {
|
|
53
59
|
try {
|
|
54
|
-
return git(args, cwd)
|
|
60
|
+
return git(args, cwd, true) // quiet: failure is expected/tolerated, so don't leak git's stderr
|
|
55
61
|
} catch {
|
|
56
62
|
return null
|
|
57
63
|
}
|
|
@@ -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
|
-
//
|
|
27
|
-
//
|
|
28
|
-
// node_modules
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
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
|
|
36
|
-
if (entry.
|
|
37
|
-
|
|
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
|