@xylabs/ts-scripts-yarn3 5.0.32 → 5.0.34

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.
Files changed (172) hide show
  1. package/dist/actions/build.mjs.map +1 -1
  2. package/dist/actions/clean-docs.mjs.map +1 -1
  3. package/dist/actions/clean-eslint.mjs.map +1 -1
  4. package/dist/actions/clean-jest.mjs.map +1 -1
  5. package/dist/actions/clean.mjs.map +1 -1
  6. package/dist/actions/compile.mjs.map +1 -1
  7. package/dist/actions/copy-assets.mjs.map +1 -1
  8. package/dist/actions/cycle.mjs.map +1 -1
  9. package/dist/actions/dead.mjs.map +1 -1
  10. package/dist/actions/deploy-major.mjs.map +1 -1
  11. package/dist/actions/deploy-minor.mjs.map +1 -1
  12. package/dist/actions/deploy-next.mjs.map +1 -1
  13. package/dist/actions/deploy.mjs.map +1 -1
  14. package/dist/actions/deps.mjs.map +1 -1
  15. package/dist/actions/dupdeps.mjs.map +1 -1
  16. package/dist/actions/fix.mjs.map +1 -1
  17. package/dist/actions/gen-docs.mjs.map +1 -1
  18. package/dist/actions/gitignore-gen.mjs.map +1 -1
  19. package/dist/actions/gitlint-fix.mjs.map +1 -1
  20. package/dist/actions/gitlint.mjs.map +1 -1
  21. package/dist/actions/index.mjs +2 -2
  22. package/dist/actions/index.mjs.map +1 -1
  23. package/dist/actions/license.mjs.map +1 -1
  24. package/dist/actions/lint-clean.mjs.map +1 -1
  25. package/dist/actions/lint-profile.mjs.map +1 -1
  26. package/dist/actions/lint.mjs.map +1 -1
  27. package/dist/actions/npmignore-gen.mjs.map +1 -1
  28. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  29. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  30. package/dist/actions/package/clean.mjs.map +1 -1
  31. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  32. package/dist/actions/package/compile/compile.mjs +2 -2
  33. package/dist/actions/package/compile/compile.mjs.map +1 -1
  34. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  35. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  36. package/dist/actions/package/compile/index.mjs +2 -2
  37. package/dist/actions/package/compile/index.mjs.map +1 -1
  38. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  39. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  40. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  41. package/dist/actions/package/compile/packageCompileTsup.mjs +2 -2
  42. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  43. package/dist/actions/package/copy-assets.mjs.map +1 -1
  44. package/dist/actions/package/deps.mjs.map +1 -1
  45. package/dist/actions/package/gen-docs.mjs.map +1 -1
  46. package/dist/actions/package/index.mjs +2 -2
  47. package/dist/actions/package/index.mjs.map +1 -1
  48. package/dist/actions/package/publint.mjs.map +1 -1
  49. package/dist/actions/package/recompile.mjs +2 -2
  50. package/dist/actions/package/recompile.mjs.map +1 -1
  51. package/dist/actions/publint.mjs.map +1 -1
  52. package/dist/actions/rebuild.mjs.map +1 -1
  53. package/dist/actions/recompile.mjs.map +1 -1
  54. package/dist/actions/reinstall.mjs.map +1 -1
  55. package/dist/actions/relint.mjs.map +1 -1
  56. package/dist/actions/retest.mjs.map +1 -1
  57. package/dist/actions/sonar.mjs.map +1 -1
  58. package/dist/actions/statics.mjs.map +1 -1
  59. package/dist/actions/test.mjs.map +1 -1
  60. package/dist/actions/up.mjs.map +1 -1
  61. package/dist/actions/updo.mjs.map +1 -1
  62. package/dist/actions/upplug.mjs.map +1 -1
  63. package/dist/actions/upyarn.mjs.map +1 -1
  64. package/dist/actions/yarn3only.mjs.map +1 -1
  65. package/dist/bin/build.mjs.map +1 -1
  66. package/dist/bin/clean.mjs.map +1 -1
  67. package/dist/bin/compile-only.mjs.map +1 -1
  68. package/dist/bin/compile.mjs.map +1 -1
  69. package/dist/bin/cycle.mjs.map +1 -1
  70. package/dist/bin/dead.mjs.map +1 -1
  71. package/dist/bin/deploy-major.mjs.map +1 -1
  72. package/dist/bin/deploy-minor.mjs.map +1 -1
  73. package/dist/bin/deploy-next.mjs.map +1 -1
  74. package/dist/bin/deploy.mjs.map +1 -1
  75. package/dist/bin/deps.mjs.map +1 -1
  76. package/dist/bin/fix.mjs.map +1 -1
  77. package/dist/bin/gen-docs.mjs.map +1 -1
  78. package/dist/bin/gitlint-fix.mjs.map +1 -1
  79. package/dist/bin/gitlint.mjs.map +1 -1
  80. package/dist/bin/license.mjs.map +1 -1
  81. package/dist/bin/lint-clean.mjs.map +1 -1
  82. package/dist/bin/lint-fast.mjs.map +1 -1
  83. package/dist/bin/lint-profile.mjs.map +1 -1
  84. package/dist/bin/lint.mjs.map +1 -1
  85. package/dist/bin/package/build-only.mjs +2 -2
  86. package/dist/bin/package/build-only.mjs.map +1 -1
  87. package/dist/bin/package/build.mjs +2 -2
  88. package/dist/bin/package/build.mjs.map +1 -1
  89. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  90. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  91. package/dist/bin/package/clean.mjs.map +1 -1
  92. package/dist/bin/package/compile-only.mjs +2 -2
  93. package/dist/bin/package/compile-only.mjs.map +1 -1
  94. package/dist/bin/package/compile-tsup.mjs +2 -2
  95. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  96. package/dist/bin/package/compile.mjs +2 -2
  97. package/dist/bin/package/compile.mjs.map +1 -1
  98. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  99. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  100. package/dist/bin/package/deps.mjs.map +1 -1
  101. package/dist/bin/package/gen-docs.mjs.map +1 -1
  102. package/dist/bin/package/publint.mjs.map +1 -1
  103. package/dist/bin/package/recompile.mjs +2 -2
  104. package/dist/bin/package/recompile.mjs.map +1 -1
  105. package/dist/bin/publint.mjs.map +1 -1
  106. package/dist/bin/rebuild.mjs.map +1 -1
  107. package/dist/bin/recompile.mjs.map +1 -1
  108. package/dist/bin/reinstall.mjs.map +1 -1
  109. package/dist/bin/relint.mjs.map +1 -1
  110. package/dist/bin/sonar.mjs.map +1 -1
  111. package/dist/bin/test.mjs.map +1 -1
  112. package/dist/bin/up.mjs.map +1 -1
  113. package/dist/bin/updo.mjs.map +1 -1
  114. package/dist/bin/upplug.mjs.map +1 -1
  115. package/dist/bin/upyarn.mjs.map +1 -1
  116. package/dist/bin/xy-ts.mjs +1 -1
  117. package/dist/bin/xy-ts.mjs.map +1 -1
  118. package/dist/bin/xy.mjs +1 -1
  119. package/dist/bin/xy.mjs.map +1 -1
  120. package/dist/bin/yarn3only.mjs.map +1 -1
  121. package/dist/index.mjs +3 -3
  122. package/dist/index.mjs.map +1 -1
  123. package/dist/lib/checkResult.mjs.map +1 -1
  124. package/dist/lib/createBuildConfig.mjs.map +1 -1
  125. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  126. package/dist/lib/deleteGlob.mjs.map +1 -1
  127. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  128. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  129. package/dist/lib/dependencies/index.mjs.map +1 -1
  130. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  131. package/dist/lib/file/constants.mjs.map +1 -1
  132. package/dist/lib/file/fileLines.mjs.map +1 -1
  133. package/dist/lib/file/index.mjs.map +1 -1
  134. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  135. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  136. package/dist/lib/index.mjs.map +1 -1
  137. package/dist/lib/jsonFormatters.mjs.map +1 -1
  138. package/dist/lib/loadConfig.mjs.map +1 -1
  139. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  140. package/dist/lib/processEx.mjs.map +1 -1
  141. package/dist/lib/runSteps.mjs.map +1 -1
  142. package/dist/lib/runStepsAsync.mjs.map +1 -1
  143. package/dist/lib/runXy.mjs.map +1 -1
  144. package/dist/lib/runXyWithWarning.mjs.map +1 -1
  145. package/dist/lib/safeExit.mjs.map +1 -1
  146. package/dist/lib/string/empty.mjs.map +1 -1
  147. package/dist/lib/string/index.mjs.map +1 -1
  148. package/dist/lib/string/union.mjs.map +1 -1
  149. package/dist/lib/withErrnoException.mjs.map +1 -1
  150. package/dist/lib/withError.mjs.map +1 -1
  151. package/dist/lib/yarn/index.mjs.map +1 -1
  152. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  153. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  154. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  155. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  156. package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
  157. package/dist/loadPackageConfig.mjs.map +1 -1
  158. package/dist/xy/index.mjs +1 -1
  159. package/dist/xy/index.mjs.map +1 -1
  160. package/dist/xy/param.mjs.map +1 -1
  161. package/dist/xy/xy.mjs +1 -1
  162. package/dist/xy/xy.mjs.map +1 -1
  163. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  164. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  165. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  166. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  167. package/dist/xy/xyLintCommands.mjs.map +1 -1
  168. package/dist/xy/xyParseOptions.mjs +1 -1
  169. package/dist/xy/xyParseOptions.mjs.map +1 -1
  170. package/package.json +9 -9
  171. package/src/actions/package/compile/packageCompileTsup.ts +2 -2
  172. package/src/xy/xyParseOptions.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["runSteps.ts","checkResult.ts","processEx.ts","withError.ts","withErrnoException.ts","safeExit.ts"],"sourcesContent":["import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,SAASA,iBAAqD;AAC9D,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,C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qBC,aAAa,MAAMC,aAAAA;AAC7E,SAAOC,SAAS,MAAA;AACd,UAAMC,UAAUC,QAAQC,IAAIC;AAC5BC,YAAQC,IAAIC,OAAMC,MAAM,GAAGZ,IAAAA,KAASK,OAAAA,GAAU,CAAA;AAC9C,QAAIQ,cAAc;AAClB,eAAW,CAACC,GAAG,CAACC,SAASC,MAAMC,MAAAA,CAAO,KAAKhB,MAAMiB,QAAO,GAAI;AAC1D,UAAIf,WAAWW,CAAAA,GAAI;AACjBL,gBAAQC,IAAIC,OAAMQ,KAAKhB,WAAWW,CAAAA,CAAE,CAAA;MACtC;AACA,YAAMM,UAAUC,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA;AACxD,UAAIR,YAAY,UAAU,CAACS,WAAWJ,QAAQ,CAAA,CAAE,GAAG;AACjD,cAAM,IAAIK,MAAM,mBAAmBL,QAAQ,CAAA,CAAE,GAAG;MAClD;AACA,YAAMM,SACFC,UAAUZ,SAASM,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA,GAAM;QACjE,GAAGN;QACHW,UAAU;QACVrB,KAAK;UAAEsB,aAAa;UAAK,GAAGvB,QAAQC;QAAI;QACxCuB,OAAO;QACPC,OAAO;MACT,CAAA,EAAGL,UAAU;AACfM,kBAAYhC,MAAM0B,QAAQ,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;","names":["spawnSync","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult"]}
1
+ {"version":3,"sources":["../../src/lib/runSteps.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts"],"sourcesContent":["import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,SAASA,iBAAqD;AAC9D,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,WAAW;AAEX,IAAMC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,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;","names":["spawnSync","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["runStepsAsync.ts","checkResult.ts","processEx.ts","withError.ts","withErrnoException.ts","safeExit.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { ScriptStep } from './runSteps.ts'\nimport { safeExitAsync } from './safeExit.ts'\n\nexport const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {\n return new Promise<number>((resolve) => {\n const [command, args, config] = step\n if (message) {\n console.log(chalk.gray(message))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n spawn(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).on('close', (code) => {\n if (code) {\n console.error(\n chalk.red(\n `Command Exited With Non-Zero Result [${chalk.gray(code)}] | ${chalk.yellow(command)} ${chalk.white(\n Array.isArray(args) ? args.join(' ') : args,\n )}`,\n ),\n )\n checkResult(name, code, 'error', exitOnFail)\n resolve(code)\n } else {\n resolve(0)\n }\n })\n })\n}\n\nexport const runStepsAsync = async (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]) => {\n return await safeExitAsync(async () => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let result = 0\n for (const [i, step] of steps.entries()) {\n result += await runStepAsync(name, step, exitOnFail, messages?.[i])\n }\n return result\n })\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,SAASA,aAAa;AACtB,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,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AE,GAAG;IAClD;AACAM,UAAMb,SAASQ,MAAMC,QAAQR,IAAAA,IAAQA,OAAOA,KAAKS,MAAM,GAAA,GAAM;MAC3D,GAAGR;MACHY,KAAK;QAAEC,aAAa;QAAK,GAAGC,QAAQF;MAAI;MACxCG,OAAO;MACPC,OAAO;IACT,CAAA,EAAGC,GAAG,SAAS,CAACC,SAAAA;AACd,UAAIA,MAAM;AACRjB,gBAAQkB,MACNhB,OAAMiB,IACJ,wCAAwCjB,OAAMC,KAAKc,IAAAA,CAAAA,OAAYf,OAAMkB,OAAOvB,OAAAA,CAAAA,IAAYK,OAAMmB,MAC5FhB,MAAMC,QAAQR,IAAAA,IAAQA,KAAKwB,KAAK,GAAA,IAAOxB,IAAAA,CAAAA,EACtC,CAAA;AAGPyB,oBAAYhC,MAAM0B,MAAM,SAASxB,UAAAA;AACjCG,gBAAQqB,IAAAA;MACV,OAAO;AACLrB,gBAAQ,CAAA;MACV;IACF,CAAA;EACF,CAAA;AACF,GA/B4B;AAiCrB,IAAM4B,gBAAgB,8BAAOjC,MAAckC,OAAqBhC,aAAa,MAAMiC,aAAAA;AACxF,SAAO,MAAMC,cAAc,YAAA;AACzB,UAAMC,UAAUf,QAAQF,IAAIkB;AAC5B7B,YAAQC,IAAIC,OAAM4B,MAAM,GAAGvC,IAAAA,KAASqC,OAAAA,GAAU,CAAA;AAC9C,QAAIG,SAAS;AACb,eAAW,CAACC,GAAGxC,IAAAA,KAASiC,MAAMQ,QAAO,GAAI;AACvCF,gBAAU,MAAMzC,aAAaC,MAAMC,MAAMC,YAAYiC,WAAWM,CAAAA,CAAE;IACpE;AACA,WAAOD;EACT,CAAA;AACF,GAV6B;","names":["spawn","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExitAsync","func","exitOnFail","result","process","exit","ex","processEx","runStepAsync","name","step","exitOnFail","message","Promise","resolve","command","args","config","console","log","chalk","gray","argList","Array","isArray","split","existsSync","Error","spawn","env","FORCE_COLOR","process","shell","stdio","on","code","error","red","yellow","white","join","checkResult","runStepsAsync","steps","messages","safeExitAsync","pkgName","npm_package_name","green","result","i","entries"]}
1
+ {"version":3,"sources":["../../src/lib/runStepsAsync.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { ScriptStep } from './runSteps.ts'\nimport { safeExitAsync } from './safeExit.ts'\n\nexport const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {\n return new Promise<number>((resolve) => {\n const [command, args, config] = step\n if (message) {\n console.log(chalk.gray(message))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n spawn(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).on('close', (code) => {\n if (code) {\n console.error(\n chalk.red(\n `Command Exited With Non-Zero Result [${chalk.gray(code)}] | ${chalk.yellow(command)} ${chalk.white(\n Array.isArray(args) ? args.join(' ') : args,\n )}`,\n ),\n )\n checkResult(name, code, 'error', exitOnFail)\n resolve(code)\n } else {\n resolve(0)\n }\n })\n })\n}\n\nexport const runStepsAsync = async (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]) => {\n return await safeExitAsync(async () => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let result = 0\n for (const [i, step] of steps.entries()) {\n result += await runStepAsync(name, step, exitOnFail, messages?.[i])\n }\n return result\n })\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,SAASA,aAAa;AACtB,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,OAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,OAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,W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C,SAAAA;AACd,UAAIA,MAAM;AACRjB,gBAAQkB,MACNhB,OAAMiB,IACJ,wCAAwCjB,OAAMC,KAAKc,IAAAA,CAAAA,OAAYf,OAAMkB,OAAOvB,OAAAA,CAAAA,IAAYK,OAAMmB,MAC5FhB,MAAMC,QAAQR,IAAAA,IAAQA,KAAKwB,KAAK,GAAA,IAAOxB,IAAAA,CAAAA,EACtC,CAAA;AAGPyB,oBAAYhC,MAAM0B,MAAM,SAASxB,UAAAA;AACjCG,gBAAQqB,IAAAA;MACV,OAAO;AACLrB,gBAAQ,CAAA;MACV;IACF,CAAA;EACF,CAAA;AACF,GA/B4B;AAiCrB,IAAM4B,gBAAgB,8BAAOjC,MAAckC,OAAqBhC,aAAa,MAAMiC,aAAAA;AACxF,SAAO,MAAMC,cAAc,YAAA;AACzB,UAAMC,UAAUf,QAAQF,IAAIkB;AAC5B7B,YAAQC,IAAIC,OAAM4B,MAAM,GAAGvC,IAAAA,KAASqC,OAAAA,GAAU,CAAA;AAC9C,QAAIG,SAAS;AACb,eAAW,CAACC,GAAGxC,IAAAA,KAASiC,MAAMQ,QAAO,GAAI;AACvCF,gBAAU,MAAMzC,aAAaC,MAAMC,MAAMC,YAAYiC,WAAWM,CAAAA,CAAE;IACpE;AACA,WAAOD;EACT,CAAA;AACF,GAV6B;","names":["spawn","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExitAsync","func","exitOnFail","result","process","exit","ex","processEx","runStepAsync","name","step","exitOnFail","message","Promise","resolve","command","args","config","console","log","chalk","gray","argList","Array","isArray","split","existsSync","Error","spawn","env","FORCE_COLOR","process","shell","stdio","on","code","error","red","yellow","white","join","checkResult","runStepsAsync","steps","messages","safeExitAsync","pkgName","npm_package_name","green","result","i","entries"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["runSteps.ts","checkResult.ts","processEx.ts","withError.ts","withErrnoException.ts","safeExit.ts","runXy.ts"],"sourcesContent":["import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { runSteps } from './runSteps.ts'\n\nexport const runXy = (command: string) => {\n return runSteps(\n `XY [${command}]`,\n [['yarn', ['xy', command, ...process.argv.filter((value, index) => (index > 1 ? value : undefined))]]],\n )\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAqD;AAC9D,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,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YhC,MAAM0B,QAAQ,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;;;AMVjB,IAAM+B,QAAQ,wBAACC,YAAAA;AACpB,SAAOC,SACL,OAAOD,OAAAA,KACP;IAAC;MAAC;MAAQ;QAAC;QAAMA;WAAYE,QAAQC,KAAKC,OAAO,CAACC,OAAOC,UAAWA,QAAQ,IAAID,QAAQE,MAAAA;;;GAAc;AAE1G,GALqB;","names":["spawnSync","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","runXy","command","runSteps","process","argv","filter","value","index","undefined"]}
1
+ {"version":3,"sources":["../../src/lib/runSteps.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runXy.ts"],"sourcesContent":["import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { runSteps } from './runSteps.ts'\n\nexport const runXy = (command: string) => {\n return runSteps(\n `XY [${command}]`,\n [['yarn', ['xy', command, ...process.argv.filter((value, index) => (index > 1 ? value : undefined))]]],\n )\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAqD;AAC9D,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;;;ACHlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QA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SAAOC,SAAS,MAAA;AACd,UAAMC,UAAUC,QAAQC,IAAIC;AAC5BC,YAAQC,IAAIC,OAAMC,MAAM,GAAGZ,IAAAA,KAASK,OAAAA,GAAU,CAAA;AAC9C,QAAIQ,cAAc;AAClB,eAAW,CAACC,GAAG,CAACC,SAASC,MAAMC,MAAAA,CAAO,KAAKhB,MAAMiB,QAAO,GAAI;AAC1D,UAAIf,WAAWW,CAAAA,GAAI;AACjBL,gBAAQC,IAAIC,OAAMQ,KAAKhB,WAAWW,CAAAA,CAAE,CAAA;MACtC;AACA,YAAMM,UAAUC,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA;AACxD,UAAIR,YAAY,UAAU,CAACS,WAAWJ,QAAQ,CAAA,CAAE,GAAG;AACjD,cAAM,IAAIK,MAAM,mBAAmBL,QAAQ,CAAA,CAAE,GAAG;MAClD;AACA,YAAMM,SACFC,UAAUZ,SAASM,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA,GAAM;QACjE,GAAGN;QACHW,UAAU;QACVrB,KAAK;UAAEsB,aAAa;UAAK,GAAGvB,QAAQC;QAAI;QACxCuB,OAAO;QACPC,OAAO;MACT,CAAA,EAAGL,UAAU;AACfM,kBAAYhC,MAAM0B,QAAQ,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;;;AMVjB,IAAM+B,QAAQ,wBAACC,YAAAA;AACpB,SAAOC,SACL,OAAOD,OAAAA,KACP;IAAC;MAAC;MAAQ;QAAC;QAAMA;WAAYE,QAAQC,KAAKC,OAAO,CAACC,OAAOC,UAAWA,QAAQ,IAAID,QAAQE,MAAAA;;;GAAc;AAE1G,GALqB;","names":["spawnSync","existsSync","chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","runXy","command","runSteps","process","argv","filter","value","index","undefined"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["runXyWithWarning.ts"],"sourcesContent":["import chalk from 'chalk'\n\nexport const runXyWithWarning = (command: string) => {\n const commandString = `yarn ${command}`\n const commandXyString = `yarn xy ${command}`\n console.warn(chalk.yellow(`WARNING: [${chalk.white(commandString)}] is deprecated for XY Labs Scripts.`))\n console.warn(chalk.gray(`Did you mean [${chalk.magenta(commandXyString)}]?`))\n return 1\n}\n"],"mappings":";;;;AAAA,OAAOA,WAAW;AAEX,IAAMC,mBAAmB,wBAACC,YAAAA;AAC/B,QAAMC,gBAAgB,QAAQD,OAAAA;AAC9B,QAAME,kBAAkB,WAAWF,OAAAA;AACnCG,UAAQC,KAAKC,MAAMC,OAAO,aAAaD,MAAME,MAAMN,aAAAA,CAAAA,sCAAoD,CAAA;AACvGE,UAAQC,KAAKC,MAAMG,KAAK,iBAAiBH,MAAMI,QAAQP,eAAAA,CAAAA,IAAoB,CAAA;AAC3E,SAAO;AACT,GANgC;","names":["chalk","runXyWithWarning","command","commandString","commandXyString","console","warn","chalk","yellow","white","gray","magenta"]}
1
+ {"version":3,"sources":["../../src/lib/runXyWithWarning.ts"],"sourcesContent":["import chalk from 'chalk'\n\nexport const runXyWithWarning = (command: string) => {\n const commandString = `yarn ${command}`\n const commandXyString = `yarn xy ${command}`\n console.warn(chalk.yellow(`WARNING: [${chalk.white(commandString)}] is deprecated for XY Labs Scripts.`))\n console.warn(chalk.gray(`Did you mean [${chalk.magenta(commandXyString)}]?`))\n return 1\n}\n"],"mappings":";;;;AAAA,OAAOA,WAAW;AAEX,IAAMC,mBAAmB,wBAACC,YAAAA;AAC/B,QAAMC,gBAAgB,QAAQD,OAAAA;AAC9B,QAAME,kBAAkB,WAAWF,OAAAA;AACnCG,UAAQC,KAAKC,MAAMC,OAAO,aAAaD,MAAME,MAAMN,aAAAA,CAAAA,sCAAoD,CAAA;AACvGE,UAAQC,KAAKC,MAAMG,KAAK,iBAAiBH,MAAMI,QAAQP,eAAAA,CAAAA,IAAoB,CAAA;AAC3E,SAAO;AACT,GANgC;","names":["chalk","runXyWithWarning","command","commandString","commandXyString","console","warn","chalk","yellow","white","gray","magenta"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["processEx.ts","withError.ts","withErrnoException.ts","safeExit.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,OAAOA,WAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,MAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,MAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,WAAOJ,OAAMS,SAAS;EACxB,CAAA,KACGC,UAAUV,OAAO,CAACA,WAAAA;AACnBK,YAAQL,MAAMM,MAAMC,IAAI,GAAGP,OAAMW,IAAI,KAAKX,OAAMY,OAAO,EAAE,CAAA;AACzD,WAAO;EACT,CAAA,MACI,MAAA;AACFP,YAAQL,MAAMM,MAAMC,IAAI,qBAAqBM,KAAKC,UAAUf,IAAI,MAAM,CAAA,CAAA,EAAI,CAAA;AAC1E,WAAO;EACT,GAAA;AAEFgB,UAAQC,KAAKD,QAAQb,YAAYA,QAAAA;AACnC,GArByB;;;AGDzB,IAAMe,WAAW,wBAACC,MAAoBC,aAAa,SAAI;AACrD,MAAI;AACF,UAAMC,SAASF,KAAAA;AACf,QAAIE,UAAUD,YAAY;AACxBE,cAAQC,KAAKF,MAAAA;IACf;AACA,WAAOA;EACT,SAASG,IAAI;AACX,WAAOC,UAAUD,EAAAA;EACnB;AACF,GAViB;AAYjB,IAAME,gBAAgB,8BAAOP,MAA6BC,aAAa,SAAI;AACzE,MAAI;AACF,UAAMC,SAAS,MAAMF,KAAAA;AACrB,QAAIE,UAAUD,YAAY;AACxBE,cAAQC,KAAKF,MAAAA;IACf;AACA,WAAOA;EACT,SAASG,IAAI;AACX,WAAOC,UAAUD,EAAAA;EACnB;AACF,GAVsB;","names":["chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","safeExitAsync"]}
1
+ {"version":3,"sources":["../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n"],"mappings":";;;;AAAA,OAAOA,WAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,MAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,MAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,WAAOJ,OAAMS,SAAS;EACxB,CAAA,KACGC,UAAUV,OAAO,CAACA,WAAAA;AACnBK,YAAQL,MAAMM,MAAMC,IAAI,GAAGP,OAAMW,IAAI,KAAKX,OAAMY,OAAO,EAAE,CAAA;AACzD,WAAO;EACT,CAAA,MACI,MAAA;AACFP,YAAQL,MAAMM,MAAMC,IAAI,qBAAqBM,KAAKC,UAAUf,IAAI,MAAM,CAAA,CAAA,EAAI,CAAA;AAC1E,WAAO;EACT,GAAA;AAEFgB,UAAQC,KAAKD,QAAQb,YAAYA,QAAAA;AACnC,GArByB;;;AGDzB,IAAMe,WAAW,wBAACC,MAAoBC,aAAa,SAAI;AACrD,MAAI;AACF,UAAMC,SAASF,KAAAA;AACf,QAAIE,UAAUD,YAAY;AACxBE,cAAQC,KAAKF,MAAAA;IACf;AACA,WAAOA;EACT,SAASG,IAAI;AACX,WAAOC,UAAUD,EAAAA;EACnB;AACF,GAViB;AAYjB,IAAME,gBAAgB,8BAAOP,MAA6BC,aAAa,SAAI;AACzE,MAAI;AACF,UAAMC,SAAS,MAAMF,KAAAA;AACrB,QAAIE,UAAUD,YAAY;AACxBE,cAAQC,KAAKF,MAAAA;IACf;AACA,WAAOA;EACT,SAASG,IAAI;AACX,WAAOC,UAAUD,EAAAA;EACnB;AACF,GAVsB;","names":["chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","safeExitAsync"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["empty.ts"],"sourcesContent":["export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,UAAwCA,OAAOC,KAAAA,EAAOC,WAAW,GAAlE;AACd,IAAMC,WAAW,wBAACH,UAAwC,CAACD,MAAMC,KAAAA,GAAhD;","names":["empty","value","trim","length","notEmpty"]}
1
+ {"version":3,"sources":["../../../src/lib/string/empty.ts"],"sourcesContent":["export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,UAAwCA,OAAOC,KAAAA,EAAOC,WAAW,GAAlE;AACd,IAAMC,WAAW,wBAACH,UAAwC,CAACD,MAAMC,KAAAA,GAAhD;","names":["empty","value","trim","length","notEmpty"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["empty.ts","union.ts"],"sourcesContent":["export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n","export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,UAAwCA,OAAOC,KAAAA,EAAOC,WAAW,GAAlE;AACd,IAAMC,WAAW,wBAACH,UAAwC,CAACD,MAAMC,KAAAA,GAAhD;;;ACDjB,IAAMI,QAAQ,wBAACC,GAAaC,MAA6B,oBAAIC,IAAI;KAAI,IAAIA,IAAIF,CAAAA;KAAO,IAAIE,IAAID,CAAAA;CAAG,GAAjF;","names":["empty","value","trim","length","notEmpty","union","a","b","Set"]}
1
+ {"version":3,"sources":["../../../src/lib/string/empty.ts","../../../src/lib/string/union.ts"],"sourcesContent":["export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n","export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,UAAwCA,OAAOC,KAAAA,EAAOC,WAAW,GAAlE;AACd,IAAMC,WAAW,wBAACH,UAAwC,CAACD,MAAMC,KAAAA,GAAhD;;;ACDjB,IAAMI,QAAQ,wBAACC,GAAaC,MAA6B,oBAAIC,IAAI;KAAI,IAAIA,IAAIF,CAAAA;KAAO,IAAIE,IAAID,CAAAA;CAAG,GAAjF;","names":["empty","value","trim","length","notEmpty","union","a","b","Set"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["union.ts"],"sourcesContent":["export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,GAAaC,MAA6B,oBAAIC,IAAI;KAAI,IAAIA,IAAIF,CAAAA;KAAO,IAAIE,IAAID,CAAAA;CAAG,GAAjF;","names":["union","a","b","Set"]}
1
+ {"version":3,"sources":["../../../src/lib/string/union.ts"],"sourcesContent":["export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n"],"mappings":";;;;AAAO,IAAMA,QAAQ,wBAACC,GAAaC,MAA6B,oBAAIC,IAAI;KAAI,IAAIA,IAAIF,CAAAA;KAAO,IAAIE,IAAID,CAAAA;CAAG,GAAjF;","names":["union","a","b","Set"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["withError.ts","withErrnoException.ts"],"sourcesContent":["export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n"],"mappings":";;;;AAAO,IAAMA,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;","names":["withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined"]}
1
+ {"version":3,"sources":["../../src/lib/withError.ts","../../src/lib/withErrnoException.ts"],"sourcesContent":["export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n"],"mappings":";;;;AAAO,IAAMA,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;","names":["withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["withError.ts"],"sourcesContent":["export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n"],"mappings":";;;;AAAO,IAAMA,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;","names":["withError","ex","closure","predicate","name","message","undefined"]}
1
+ {"version":3,"sources":["../../src/lib/withError.ts"],"sourcesContent":["export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n"],"mappings":";;;;AAAO,IAAMA,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;","names":["withError","ex","closure","predicate","name","message","undefined"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["isYarnVersionOrGreater.ts","yarnWorkspaces.ts","yarnWorkspace.ts","yarnInitCwd.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nexport const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {\n const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })\n const version = result.stdout.toString().replaceAll('\\n', '')\n const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))\n const majorDelta = versionNumbers[0] - major\n const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])\n const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])\n\n const majorOk = majorDelta >= 0\n const minorOk = majorDelta > 0 || minorDelta >= 0\n const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0\n\n return [majorOk && minorOk && patchOk, version]\n}\n","import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n","export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAEnB,IAAMC,yBAAyB,wBAACC,OAAeC,OAAgBC,UAAAA;AACpE,QAAMC,SAASC,UAAU,QAAQ;IAAC;KAAO;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AACzE,QAAMC,UAAUJ,OAAOK,OAAOC,SAAQ,EAAGC,WAAW,MAAM,EAAA;AAC1D,QAAMC,iBAAiBJ,QAAQK,MAAM,GAAA,EAAKC,IAAIC,CAAAA,QAAOC,OAAOC,SAASF,GAAAA,CAAAA;AACrE,QAAMG,aAAaN,eAAe,CAAA,IAAKX;AACvC,QAAMkB,aAAaP,eAAe,CAAA,KAAMV,SAASU,eAAe,CAAA;AAChE,QAAMQ,aAAaR,eAAe,CAAA,KAAMT,SAASS,eAAe,CAAA;AAEhE,QAAMS,UAAUH,cAAc;AAC9B,QAAMI,UAAUJ,aAAa,KAAKC,cAAc;AAChD,QAAMI,UAAUL,aAAa,KAAKC,aAAa,KAAKC,cAAc;AAElE,SAAO;IAACC,WAAWC,WAAWC;IAASf;;AACzC,GAbsC;;;ACFtC,SAASgB,aAAAA,kBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,WAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;;;ACDvB,IAAMG,gBAAgB,wBAACC,QAAAA;AAC5B,QAAMC,YAAYC,eAAAA,EAAiBC,KAAK,CAAC,EAAEC,KAAI,MAAOA,SAASJ,GAAAA;AAC/D,MAAI,CAACC,UAAW,OAAM,IAAII,MAAM,aAAaL,GAAAA,YAAe;AAC5D,SAAOC;AACT,GAJ6B;;;ACHtB,IAAMK,WAAW,6BAAA;AACtB,MAAI,CAACC,QAAQC,IAAIF,SAAUG,SAAQC,MAAM,kBAAA;AACzC,SAAOH,QAAQC,IAAIF;AACrB,GAHwB;","names":["spawnSync","isYarnVersionOrGreater","major","minor","patch","result","spawnSync","encoding","shell","version","stdout","toString","replaceAll","versionNumbers","split","map","ver","Number","parseInt","majorDelta","minorDelta","patchDelta","majorOk","minorOk","patchOk","spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error","INIT_CWD","process","env","console","error"]}
1
+ {"version":3,"sources":["../../../src/lib/yarn/isYarnVersionOrGreater.ts","../../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../../src/lib/yarn/workspace/yarnWorkspace.ts","../../../src/lib/yarn/yarnInitCwd.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nexport const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {\n const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })\n const version = result.stdout.toString().replaceAll('\\n', '')\n const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))\n const majorDelta = versionNumbers[0] - major\n const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])\n const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])\n\n const majorOk = majorDelta >= 0\n const minorOk = majorDelta > 0 || minorDelta >= 0\n const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0\n\n return [majorOk && minorOk && patchOk, version]\n}\n","import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n","export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAEnB,IAAMC,yBAAyB,wBAACC,OAAeC,OAAgBC,UAAAA;AACpE,QAAMC,SAASC,UAAU,QAAQ;IAAC;KAAO;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AACzE,QAAMC,UAAUJ,OAAOK,OAAOC,SAAQ,EAAG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ding","shell","version","stdout","toString","replaceAll","versionNumbers","split","map","ver","Number","parseInt","majorDelta","minorDelta","patchDelta","majorOk","minorOk","patchOk","spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error","INIT_CWD","process","env","console","error"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["isYarnVersionOrGreater.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nexport const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {\n const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })\n const version = result.stdout.toString().replaceAll('\\n', '')\n const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))\n const majorDelta = versionNumbers[0] - major\n const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])\n const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])\n\n const majorOk = majorDelta >= 0\n const minorOk = majorDelta > 0 || minorDelta >= 0\n const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0\n\n return [majorOk && minorOk && patchOk, version]\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAEnB,IAAMC,yBAAyB,wBAACC,OAAeC,OAAgBC,UAAAA;AACpE,QAAMC,SAASC,UAAU,QAAQ;IAAC;KAAO;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AACzE,QAAMC,UAAUJ,OAAOK,OAAOC,SAAQ,EAAGC,WAAW,MAAM,EAAA;AAC1D,QAAMC,iBAAiBJ,QAAQK,MAAM,GAAA,EAAKC,IAAIC,CAAAA,QAAOC,OAAOC,SAASF,GAAAA,CAAAA;AACrE,QAAMG,aAAaN,eAAe,CAAA,IAAKX;AACvC,QAAMkB,aAAaP,eAAe,CAAA,KAAMV,SAASU,eAAe,CAAA;AAChE,QAAMQ,aAAaR,eAAe,CAAA,KAAMT,SAASS,eAAe,CAAA;AAEhE,QAAMS,UAAUH,cAAc;AAC9B,QAAMI,UAAUJ,aAAa,KAAKC,cAAc;AAChD,QAAMI,UAAUL,aAAa,KAAKC,aAAa,KAAKC,cAAc;AAElE,SAAO;IAACC,WAAWC,WAAWC;IAASf;;AACzC,GAbsC;","names":["spawnSync","isYarnVersionOrGreater","major","minor","patch","result","spawnSync","encoding","shell","version","stdout","toString","replaceAll","versionNumbers","split","map","ver","Number","parseInt","majorDelta","minorDelta","patchDelta","majorOk","minorOk","patchOk"]}
1
+ {"version":3,"sources":["../../../src/lib/yarn/isYarnVersionOrGreater.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nexport const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {\n const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })\n const version = result.stdout.toString().replaceAll('\\n', '')\n const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))\n const majorDelta = versionNumbers[0] - major\n const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])\n const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])\n\n const majorOk = majorDelta >= 0\n const minorOk = majorDelta > 0 || minorDelta >= 0\n const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0\n\n return [majorOk && minorOk && patchOk, version]\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAEnB,IAAMC,yBAAyB,wBAACC,OAAeC,OAAgBC,UAAAA;AACpE,QAAMC,SAASC,UAAU,QAAQ;IAAC;KAAO;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AACzE,QAAMC,UAAUJ,OAAOK,OAAOC,SAAQ,EAAGC,WAAW,MAAM,EAAA;AAC1D,QAAMC,iBAAiBJ,QAAQK,MAAM,GAAA,EAAKC,IAAIC,CAAAA,QAAOC,OAAOC,SAASF,GAAAA,CAAAA;AACrE,QAAMG,aAAaN,eAAe,CAAA,IAAKX;AACvC,QAAMkB,aAAaP,eAAe,CAAA,KAAMV,SAASU,eAAe,CAAA;AAChE,QAAMQ,aAAaR,eAAe,CAAA,KAAMT,SAASS,eAAe,CAAA;AAEhE,QAAMS,UAAUH,cAAc;AAC9B,QAAMI,UAAUJ,aAAa,KAAKC,cAAc;AAChD,QAAMI,UAAUL,aAAa,KAAKC,aAAa,KAAKC,cAAc;AAElE,SAAO;IAACC,WAAWC,WAAWC;IAASf;;AACzC,GAbsC;","names":["spawnSync","isYarnVersionOrGreater","major","minor","patch","result","spawnSync","encoding","shell","version","stdout","toString","replaceAll","versionNumbers","split","map","ver","Number","parseInt","majorDelta","minorDelta","patchDelta","majorOk","minorOk","patchOk"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["yarnWorkspaces.ts","yarnWorkspace.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;;;ACDvB,IAAMG,gBAAgB,wBAACC,QAAAA;AAC5B,QAAMC,YAAYC,eAAAA,EAAiBC,KAAK,CAAC,EAAEC,KAAI,MAAOA,SAASJ,GAAAA;AAC/D,MAAI,CAACC,UAAW,OAAM,IAAII,MAAM,aAAaL,GAAAA,YAAe;AAC5D,SAAOC;AACT,GAJ6B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error"]}
1
+ {"version":3,"sources":["../../../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../../../src/lib/yarn/workspace/yarnWorkspace.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;;;ACDvB,IAAMG,gBAAgB,wBAACC,QAAAA;AAC5B,QAAMC,YAAYC,eAAAA,EAAiBC,KAAK,CAAC,EAAEC,KAAI,MAAOA,SAASJ,GAAAA;AAC/D,MAAI,CAACC,UAAW,OAAM,IAAII,MAAM,aAAaL,GAAAA,YAAe;AAC5D,SAAOC;AACT,GAJ6B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["yarnWorkspaces.ts","yarnWorkspace.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;;;ACDvB,IAAMG,gBAAgB,wBAACC,QAAAA;AAC5B,QAAMC,YAAYC,eAAAA,EAAiBC,KAAK,CAAC,EAAEC,KAAI,MAAOA,SAASJ,GAAAA;AAC/D,MAAI,CAACC,UAAW,OAAM,IAAII,MAAM,aAAaL,GAAAA,YAAe;AAC5D,SAAOC;AACT,GAJ6B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error"]}
1
+ {"version":3,"sources":["../../../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../../../src/lib/yarn/workspace/yarnWorkspace.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;;;ACDvB,IAAMG,gBAAgB,wBAACC,QAAAA;AAC5B,QAAMC,YAAYC,eAAAA,EAAiBC,KAAK,CAAC,EAAEC,KAAI,MAAOA,SAASJ,GAAAA;AAC/D,MAAI,CAACC,UAAW,OAAM,IAAII,MAAM,aAAaL,GAAAA,YAAe;AAC5D,SAAOC;AACT,GAJ6B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse","yarnWorkspace","pkg","workspace","yarnWorkspaces","find","name","Error"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["yarnWorkspaces.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse"]}
1
+ {"version":3,"sources":["../../../../src/lib/yarn/workspace/yarnWorkspaces.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process'\n\nimport { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n"],"mappings":";;;;AAAA,SAASA,iBAAiB;AAInB,IAAMC,iBAAiB,6BAAA;AAC5B,QAAMC,SAASC,UAAU,QAAQ;IAAC;IAAc;IAAQ;IAAU;KAAgB;IAAEC,UAAU;IAAQC,OAAO;EAAK,CAAA;AAClH,MAAIH,OAAOI,OAAO;AAChB,UAAMJ,OAAOI;EACf;AACA,SACEJ,OAAOK,OACJC,SAAQ,EAGRC,MAAM,IAAA,EACNC,MAAM,GAAG,EAAC,EACVC,IAAI,CAACC,SAAAA;AACJ,WAAOC,KAAKC,MAAMF,IAAAA;EACpB,CAAA;AAEN,GAhB8B;","names":["spawnSync","yarnWorkspaces","result","spawnSync","encoding","shell","error","stdout","toString","split","slice","map","item","JSON","parse"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["yarnInitCwd.ts"],"sourcesContent":["export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n"],"mappings":";;;;AAAO,IAAMA,WAAW,6BAAA;AACtB,MAAI,CAACC,QAAQC,IAAIF,SAAUG,SAAQC,MAAM,kBAAA;AACzC,SAAOH,QAAQC,IAAIF;AACrB,GAHwB;","names":["INIT_CWD","process","env","console","error"]}
1
+ {"version":3,"sources":["../../../src/lib/yarn/yarnInitCwd.ts"],"sourcesContent":["export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n"],"mappings":";;;;AAAO,IAAMA,WAAW,6BAAA;AACtB,MAAI,CAACC,QAAQC,IAAIF,SAAUG,SAAQC,MAAM,kBAAA;AACzC,SAAOH,QAAQC,IAAIF;AACrB,GAHwB;","names":["INIT_CWD","process","env","console","error"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["loadPackageConfig.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\n\nimport { PackageJson } from 'types-package-json'\n\nexport type PackageJsonEx = PackageJson & { type: 'module' | 'commonjs' }\n\nexport const loadPackageConfig = async () => {\n const pkg = process.env.INIT_CWD\n\n const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: 'utf8' })\n\n return JSON.parse(pkgConfig) as PackageJsonEx\n}\n"],"mappings":";;;;AAAA,SAASA,gBAAgB;AAMlB,IAAMC,oBAAoB,mCAAA;AAC/B,QAAMC,MAAMC,QAAQC,IAAIC;AAExB,QAAMC,YAAY,MAAMC,SAAS,GAAGL,GAAAA,iBAAoB;IAAEM,UAAU;EAAO,CAAA;AAE3E,SAAOC,KAAKC,MAAMJ,SAAAA;AACpB,GANiC;","names":["readFile","loadPackageConfig","pkg","process","env","INIT_CWD","pkgConfig","readFile","encoding","JSON","parse"]}
1
+ {"version":3,"sources":["../src/loadPackageConfig.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\n\nimport { PackageJson } from 'types-package-json'\n\nexport type PackageJsonEx = PackageJson & { type: 'module' | 'commonjs' }\n\nexport const loadPackageConfig = async () => {\n const pkg = process.env.INIT_CWD\n\n const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: 'utf8' })\n\n return JSON.parse(pkgConfig) as PackageJsonEx\n}\n"],"mappings":";;;;AAAA,SAASA,gBAAgB;AAMlB,IAAMC,oBAAoB,mCAAA;AAC/B,QAAMC,MAAMC,QAAQC,IAAIC;AAExB,QAAMC,YAAY,MAAMC,SAAS,GAAGL,GAAAA,iBAAoB;IAAEM,UAAU;EAAO,CAAA;AAE3E,SAAOC,KAAKC,MAAMJ,SAAAA;AACpB,GANiC;","names":["readFile","loadPackageConfig","pkg","process","env","INIT_CWD","pkgConfig","readFile","encoding","JSON","parse"]}
package/dist/xy/index.mjs CHANGED
@@ -1880,7 +1880,7 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
1880
1880
  description: "Profile action",
1881
1881
  type: "boolean"
1882
1882
  }).option("types", {
1883
- default: "tsup",
1883
+ default: "tsc",
1884
1884
  choices: [
1885
1885
  "tsc",
1886
1886
  "tsup"