@xylabs/ts-scripts-yarn3 7.4.25 → 7.4.27
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/dist/actions/index.mjs +22 -5
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/retest.mjs +27 -5
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/test.mjs +23 -4
- package/dist/actions/test.mjs.map +1 -1
- package/dist/bin/xy.mjs +36 -13
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.mjs +36 -13
- package/dist/index.mjs.map +1 -1
- package/dist/xy/common/index.mjs +36 -13
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/common/retestCommand.mjs +34 -9
- package/dist/xy/common/retestCommand.mjs.map +1 -1
- package/dist/xy/common/testCommand.mjs +30 -8
- package/dist/xy/common/testCommand.mjs.map +1 -1
- package/dist/xy/index.mjs +36 -13
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +36 -13
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/xy/xyParseOptions.ts","../../src/lib/tryRunLocalScript.ts"],"sourcesContent":["import type { Argv } from 'yargs'\nimport yargs from 'yargs'\
|
|
1
|
+
{"version":3,"sources":["../../src/xy/xyParseOptions.ts","../../src/lib/tryRunLocalScript.ts"],"sourcesContent":["import type { Argv } from 'yargs'\nimport yargs from 'yargs'\nimport { hideBin } from 'yargs/helpers'\n\nimport { tryRunLocalScript } from '../lib/index.ts'\n\nexport const xyParseOptions = (): Argv => {\n return yargs(hideBin(process.argv))\n .scriptName('yarn xy')\n .middleware((argv) => {\n const commandName = argv._[0] as string\n if (commandName && argv._.length <= 1) {\n const result = tryRunLocalScript(commandName)\n if (result !== undefined) {\n process.exit(result)\n }\n }\n }, true)\n .option('jobs', {\n alias: 'j',\n default: undefined,\n description: 'Max parallel jobs',\n type: 'number',\n })\n .option('verbose', {\n alias: 'v',\n default: false,\n description: 'Run with verbose logging',\n type: 'boolean',\n })\n .option('incremental', {\n alias: 'i',\n default: false,\n description: 'Attempt to perform the action only on changed packages',\n type: 'boolean',\n })\n .option('profile', {\n alias: 'p',\n default: false,\n description: 'Profile action',\n type: 'boolean',\n })\n}\n","import { spawnSync } from 'node:child_process'\nimport { readFileSync } from 'node:fs'\nimport PATH from 'node:path'\n\nimport chalk from 'chalk'\n\n/**\n * Attempts to run a local root package.json script instead of the built-in\n * xy command. Returns the exit code if the override ran, or undefined if\n * no override applies (no matching script or recursion guard).\n */\nexport function tryRunLocalScript(commandName: string): number | undefined {\n // Prevent infinite recursion if the local script calls yarn xy\n if (process.env.XY_LOCAL_SCRIPT === '1') return undefined\n\n // Check if root package.json has a matching script\n const rootPkgPath = PATH.resolve(process.cwd(), 'package.json')\n let rootPkg: { scripts?: Record<string, string> }\n try {\n rootPkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'))\n } catch {\n return undefined\n }\n\n if (!rootPkg.scripts?.[commandName]) return undefined\n\n console.log(chalk.blue(`Delegating \"${commandName}\" to local script`))\n const result = spawnSync('yarn', ['run', commandName], {\n cwd: process.cwd(),\n encoding: 'utf8',\n env: {\n FORCE_COLOR: '3', ...process.env, XY_LOCAL_SCRIPT: '1',\n },\n shell: true,\n stdio: 'inherit',\n })\n return result.status ?? 1\n}\n"],"mappings":";AACA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACFxB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AAEjB,OAAO,WAAW;AAOX,SAAS,kBAAkB,aAAyC;AAEzE,MAAI,QAAQ,IAAI,oBAAoB,IAAK,QAAO;AAGhD,QAAM,cAAc,KAAK,QAAQ,QAAQ,IAAI,GAAG,cAAc;AAC9D,MAAI;AACJ,MAAI;AACF,cAAU,KAAK,MAAM,aAAa,a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
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/ts-scripts-yarn3",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.27",
|
|
4
4
|
"description": "TypeScript project scripts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xylabs",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@types/parse-git-config": "~3.0.4",
|
|
94
94
|
"@types/picomatch": "~4.0.2",
|
|
95
95
|
"@types/yargs": "~17.0.35",
|
|
96
|
-
"@xylabs/tsconfig": "~7.4.
|
|
96
|
+
"@xylabs/tsconfig": "~7.4.27",
|
|
97
97
|
"esbuild": "0.27.4",
|
|
98
98
|
"types-package-json": "~2.0.39",
|
|
99
99
|
"typescript": "^5.9.3",
|