@xylabs/ts-scripts-yarn3 4.0.0-rc.8 → 4.0.0
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/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs +14 -4
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs +16 -4
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile.mjs +3 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.mjs +25 -110
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deploy-major.mjs.map +1 -1
- package/dist/actions/deploy-minor.mjs.map +1 -1
- package/dist/actions/deploy-next.mjs.map +1 -1
- package/dist/actions/deploy.mjs.map +1 -1
- package/dist/actions/deps.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs +3 -2
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/gitignore-gen.mjs.map +1 -1
- package/dist/actions/index.mjs +227 -56
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint-profile.mjs.map +1 -1
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/npmignore-gen.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.mjs +16 -2
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.mjs +16 -2
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/clean.mjs +17 -4
- package/dist/actions/package/clean.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +151 -11
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +145 -8
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +151 -11
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +148 -8
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +145 -8
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +3 -0
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/copy-assets.mjs.map +1 -1
- package/dist/actions/package/deps.mjs.map +1 -1
- package/dist/actions/package/gen-docs.mjs.map +1 -1
- package/dist/actions/package/index.mjs +205 -52
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/publint.mjs +3 -0
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +192 -39
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/rebuild.mjs.map +1 -1
- package/dist/actions/recompile.mjs +14 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.mjs.map +1 -1
- package/dist/actions/statics.mjs +3 -2
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/actions/test.mjs.map +1 -1
- package/dist/actions/up.mjs.map +1 -1
- package/dist/actions/updo.mjs.map +1 -1
- package/dist/actions/upplug.mjs.map +1 -1
- package/dist/actions/upyarn.mjs.map +1 -1
- package/dist/actions/yarn3only.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +14 -2
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +14 -2
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +15 -4
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +151 -11
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +3 -0
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +151 -11
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/deps.mjs.map +1 -1
- package/dist/bin/package/gen-docs.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +3 -0
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +170 -19
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +66 -33
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +66 -33
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.mjs +230 -58
- package/dist/index.mjs.map +1 -1
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/defaultBuildConfig.mjs.map +1 -1
- package/dist/lib/deleteGlob.mjs +19 -0
- package/dist/lib/deleteGlob.mjs.map +1 -0
- package/dist/lib/dependencies/DuplicateDetector.mjs +3 -2
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +3 -2
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/dependencies/index.mjs +3 -2
- package/dist/lib/dependencies/index.mjs.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
- package/dist/lib/file/fileLines.mjs.map +1 -1
- package/dist/lib/file/index.mjs.map +1 -1
- package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
- package/dist/lib/index.mjs +160 -5
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/loadConfig.mjs +143 -3
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/processEx.mjs.map +1 -1
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/lib/safeExit.mjs.map +1 -1
- package/dist/lib/withErrnoException.mjs.map +1 -1
- package/dist/lib/yarn/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/loadPackageConfig.mjs.map +1 -1
- package/dist/xy/index.mjs +66 -33
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/param.mjs.map +1 -1
- package/dist/xy/xy.mjs +66 -33
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +17 -3
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +14 -4
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyDeployCommands.mjs.map +1 -1
- package/dist/xy/xyInstallCommands.mjs +3 -2
- package/dist/xy/xyInstallCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +30 -22
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +53 -55
- package/src/actions/build.ts +3 -1
- package/src/actions/clean-docs.ts +2 -3
- package/src/actions/clean-eslint.ts +3 -2
- package/src/actions/clean.ts +3 -1
- package/src/actions/compile.ts +13 -3
- package/src/actions/cycle.ts +15 -4
- package/src/actions/deps.ts +6 -5
- package/src/actions/gen-docs.ts +3 -4
- package/src/actions/package/clean-outputs.ts +3 -2
- package/src/actions/package/clean-typescript.ts +3 -2
- package/src/actions/package/compile/XyConfig.ts +5 -13
- package/src/actions/package/compile/buildEntries.ts +1 -1
- package/src/actions/package/compile/compile.ts +3 -1
- package/src/actions/package/compile/copyTypeFiles.ts +1 -1
- package/src/actions/package/compile/getCompilerOptions.ts +10 -8
- package/src/actions/package/compile/packageCompileTsc.ts +11 -6
- package/src/actions/package/compile/packageCompileTscTypes.ts +5 -3
- package/src/actions/package/compile/packageCompileTsup.ts +6 -3
- package/src/actions/package/copy-assets.ts +1 -3
- package/src/actions/package/deps.ts +6 -2
- package/src/actions/package/gen-docs.ts +3 -1
- package/src/actions/package/publint.ts +8 -5
- package/src/actions/publint.ts +3 -1
- package/src/actions/recompile.ts +47 -8
- package/src/actions/reinstall.ts +3 -1
- package/src/lib/defaultBuildConfig.ts +11 -1
- package/src/lib/deleteGlob.ts +13 -0
- package/src/lib/dependencies/DuplicateDetector.ts +4 -4
- package/src/lib/file/ReadFileSyncOptions.ts +4 -1
- package/src/lib/file/fileLines.ts +9 -3
- package/src/lib/file/tryReadFileSync.ts +4 -2
- package/src/lib/generateIgnoreFiles.ts +3 -1
- package/src/lib/index.ts +1 -0
- package/src/lib/loadConfig.ts +3 -4
- package/src/lib/runSteps.ts +2 -1
- package/src/lib/runStepsAsync.ts +1 -1
- package/src/lib/runXy.ts +4 -1
- package/src/lib/withErrnoException.ts +3 -1
- package/src/lib/yarn/workspace/yarnWorkspace.ts +1 -1
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
- package/src/loadPackageConfig.ts +1 -1
- package/src/types.d.ts +23 -0
- package/src/xy/param.ts +2 -4
- package/src/xy/xyBuildCommands.ts +10 -20
- package/src/xy/xyCommonCommands.ts +4 -2
- package/src/xy/xyDeployCommands.ts +4 -2
- package/src/xy/xyInstallCommands.ts +5 -5
- package/src/xy/xyLintCommands.ts +6 -4
- package/src/xy/xyParseOptions.ts +3 -2
- package/tsup.config.ts +2 -6
- package/xy.config.ts +1 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/upplug.ts"],"sourcesContent":["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 !== undefined && ex.message !== undefined,\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>(ex: unknown, closure: (error: T) => number) => {\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 {
|
|
1
|
+
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/upplug.ts"],"sourcesContent":["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 !== undefined && ex.message !== undefined,\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 type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } 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 { runSteps } from '../lib/index.ts'\n\nexport const updateYarnPlugins = () => {\n return runSteps('Update Yarn Plugins', [\n ['yarn', ['plugin', 'import', 'https://mskelton.dev/yarn-outdated/v3']],\n ['yarn', ['plugin', 'import', 'version']],\n ['yarn', ['plugin', 'import', 'interactive-tools']],\n ['yarn', ['plugin', 'import', 'workspace-tools']],\n ])\n}\n"],"mappings":"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","names":["chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","undefined","message","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","spawnSync","existsSync","chalk","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","updateYarnPlugins","runSteps"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/upyarn.ts"],"sourcesContent":["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 !== undefined && ex.message !== undefined,\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>(ex: unknown, closure: (error: T) => number) => {\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 {
|
|
1
|
+
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/upyarn.ts"],"sourcesContent":["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 !== undefined && ex.message !== undefined,\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 type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } 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 { runSteps } from '../lib/index.ts'\n\nexport const updateYarnVersion = () => {\n return runSteps('Update Yarn Version', [['yarn', ['set', 'version', 'latest']]])\n}\n"],"mappings":"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","names":["chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","undefined","message","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","spawnSync","existsSync","chalk","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","updateYarnVersion","runSteps"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/yarn/isYarnVersionOrGreater.ts","../../src/actions/yarn3only.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 !== undefined && ex.message !== undefined,\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>(ex: unknown, closure: (error: T) => number) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","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 { isYarnVersionOrGreater, processEx } from '../lib/index.ts'\n\nexport const yarn3Only = () => {\n const [valid, version] = isYarnVersionOrGreater(3)\n if (!valid) {\n processEx(`Invalid Yarn version [${version}]`)\n }\n return 0\n}\n"],"mappings":";;;;AAAA,OAAOA,WAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAUA,IAAGG,SAASC,UAAaJ,IAAGK,YAAYD,WAAS;AAExE,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWI;AACjD,GAPyB;;;ACElB,IAAME,qBAAqB,
|
|
1
|
+
{"version":3,"sources":["../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/yarn/isYarnVersionOrGreater.ts","../../src/actions/yarn3only.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 !== undefined && ex.message !== undefined,\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","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 { isYarnVersionOrGreater, processEx } from '../lib/index.ts'\n\nexport const yarn3Only = () => {\n const [valid, version] = isYarnVersionOrGreater(3)\n if (!valid) {\n processEx(`Invalid Yarn version [${version}]`)\n }\n return 0\n}\n"],"mappings":";;;;AAAA,OAAOA,WAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAUA,IAAGG,SAASC,UAAaJ,IAAGK,YAAYD,WAAS;AAExE,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWI;AACjD,GAPyB;;;ACElB,IAAME,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;;;AGLzB,SAASe,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;;;ACA/B,IAAMgB,YAAY,6BAAA;AACvB,QAAM,CAACC,OAAOC,OAAAA,IAAWC,uBAAuB,CAAA;AAChD,MAAI,CAACF,OAAO;AACVG,cAAU,yBAAyBF,OAAAA,GAAU;EAC/C;AACA,SAAO;AACT,GANyB;","names":["chalk","withError","ex","closure","predicate","name","undefined","message","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","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","yarn3Only","valid","version","isYarnVersionOrGreater","processEx"]}
|
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
|
+
// src/lib/deleteGlob.ts
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import { glob } from "glob";
|
|
8
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
9
|
+
const files = glob.sync(globPath);
|
|
10
|
+
for (const file of files) {
|
|
11
|
+
fs.rmSync(file, {
|
|
12
|
+
recursive: true,
|
|
13
|
+
force: true
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, "deleteGlob");
|
|
17
|
+
|
|
5
18
|
// src/actions/package/clean-outputs.ts
|
|
6
19
|
import path from "node:path";
|
|
7
20
|
import chalk from "chalk";
|
|
8
|
-
import { rimraf } from "rimraf";
|
|
9
21
|
var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
10
22
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
11
23
|
const pkgName = process.env.npm_package_name;
|
|
@@ -15,7 +27,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
|
15
27
|
path.join(pkg, "docs")
|
|
16
28
|
];
|
|
17
29
|
console.log(chalk.green(`Cleaning Outputs [${pkgName}]`));
|
|
18
|
-
await Promise.all(folders.map((folder) =>
|
|
30
|
+
await Promise.all(folders.map((folder) => deleteGlob(folder)));
|
|
19
31
|
return 0;
|
|
20
32
|
}, "packageCleanOutputs");
|
|
21
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/package/clean-outputs.ts","../../../src/bin/package/clean-outputs.ts"],"sourcesContent":["import path from 'node:path'\n\nimport chalk from 'chalk'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/deleteGlob.ts","../../../src/actions/package/clean-outputs.ts","../../../src/bin/package/clean-outputs.ts"],"sourcesContent":["import fs from 'node:fs'\n\nimport { glob } from 'glob'\n\nexport const deleteGlob = (globPath: string) => {\n // Find all files matching the glob pattern\n const files = glob.sync(globPath)\n\n // Remove each file or directory\n for (const file of files) {\n fs.rmSync(file, { recursive: true, force: true })\n }\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanOutputs = async () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n const folders: string[] = [path.join(pkg, 'dist'), path.join(pkg, 'build'), path.join(pkg, 'docs')]\n console.log(chalk.green(`Cleaning Outputs [${pkgName}]`))\n\n await Promise.all(folders.map(folder => deleteGlob(folder)))\n\n return 0\n}\n","#!/usr/bin/env node\n\nimport { packageCleanOutputs } from '../../actions/index.ts'\n\npackageCleanOutputs()\n .then(() => {\n process.exit(0)\n })\n .catch((error) => {\n console.error(error)\n process.exit(1)\n })\n"],"mappings":";;;;;AAAA,OAAOA,QAAQ;AAEf,SAASC,YAAY;AAEd,IAAMC,aAAa,wBAACC,aAAAA;AAEzB,QAAMC,QAAQC,KAAKC,KAAKH,QAAAA;AAGxB,aAAWI,QAAQH,OAAO;AACxBI,OAAGC,OAAOF,MAAM;MAAEG,WAAW;MAAMC,OAAO;IAAK,CAAA;EACjD;AACF,GAR0B;;;ACJ1B,OAAOC,UAAU;AAEjB,OAAOC,WAAW;AAIX,IAAMC,sBAAsB,mCAAA;AACjC,QAAMC,MAAMC,QAAQC,IAAIC,YAAY;AACpC,QAAMC,UAAUH,QAAQC,IAAIG;AAC5B,QAAMC,UAAoB;IAACC,KAAKC,KAAKR,KAAK,MAAA;IAASO,KAAKC,KAAKR,KAAK,OAAA;IAAUO,KAAKC,KAAKR,KAAK,MAAA;;AAC3FS,UAAQC,IAAIC,MAAMC,MAAM,qBAAqBR,OAAAA,GAAU,CAAA;AAEvD,QAAMS,QAAQC,IAAIR,QAAQS,IAAIC,CAAAA,WAAUC,WAAWD,MAAAA,CAAAA,CAAAA;AAEnD,SAAO;AACT,GATmC;;;ACFnCE,oBAAAA,EACGC,KAAK,MAAA;AACJC,UAAQC,KAAK,CAAA;AACf,CAAA,EACCC,MAAM,CAACC,UAAAA;AACNC,UAAQD,MAAMA,KAAAA;AACdH,UAAQC,KAAK,CAAA;AACf,CAAA;","names":["fs","glob","deleteGlob","globPath","files","glob","sync","file","fs","rmSync","recursive","force","path","chalk","packageCleanOutputs","pkg","process","env","INIT_CWD","pkgName","npm_package_name","folders","path","join","console","log","chalk","green","Promise","all","map","folder","deleteGlob","packageCleanOutputs","then","process","exit","catch","error","console"]}
|
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
|
+
// src/lib/deleteGlob.ts
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import { glob } from "glob";
|
|
8
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
9
|
+
const files = glob.sync(globPath);
|
|
10
|
+
for (const file of files) {
|
|
11
|
+
fs.rmSync(file, {
|
|
12
|
+
recursive: true,
|
|
13
|
+
force: true
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, "deleteGlob");
|
|
17
|
+
|
|
5
18
|
// src/actions/package/clean-typescript.ts
|
|
6
19
|
import path from "node:path";
|
|
7
20
|
import chalk from "chalk";
|
|
8
|
-
import { rimraf } from "rimraf";
|
|
9
21
|
var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
10
22
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
11
23
|
const pkgName = process.env.npm_package_name;
|
|
@@ -15,7 +27,7 @@ var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
|
15
27
|
path.join(pkg, ".tsconfig.*"),
|
|
16
28
|
path.join(pkg, ".eslintcache")
|
|
17
29
|
];
|
|
18
|
-
await Promise.all(files.map((file) =>
|
|
30
|
+
await Promise.all(files.map((file) => deleteGlob(file)));
|
|
19
31
|
return 0;
|
|
20
32
|
}, "packageCleanTypescript");
|
|
21
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/package/clean-typescript.ts","../../../src/bin/package/clean-typescript.ts"],"sourcesContent":["import path from 'node:path'\n\nimport chalk from 'chalk'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/deleteGlob.ts","../../../src/actions/package/clean-typescript.ts","../../../src/bin/package/clean-typescript.ts"],"sourcesContent":["import fs from 'node:fs'\n\nimport { glob } from 'glob'\n\nexport const deleteGlob = (globPath: string) => {\n // Find all files matching the glob pattern\n const files = glob.sync(globPath)\n\n // Remove each file or directory\n for (const file of files) {\n fs.rmSync(file, { recursive: true, force: true })\n }\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanTypescript = async () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`Cleaning Typescript [${pkgName}]`))\n const files: string[] = [path.join(pkg, '*.tsbuildinfo'), path.join(pkg, '.tsconfig.*'), path.join(pkg, '.eslintcache')]\n\n await Promise.all(files.map(file => deleteGlob(file)))\n\n return 0\n}\n","#!/usr/bin/env node\n\nimport { packageCleanTypescript } from '../../actions/index.ts'\n\npackageCleanTypescript()\n .then(() => {\n process.exit(0)\n })\n .catch((error) => {\n console.error(error)\n process.exit(1)\n })\n"],"mappings":";;;;;AAAA,OAAOA,QAAQ;AAEf,SAASC,YAAY;AAEd,IAAMC,aAAa,wBAACC,aAAAA;AAEzB,QAAMC,QAAQC,KAAKC,KAAKH,QAAAA;AAGxB,aAAWI,QAAQH,OAAO;AACxBI,OAAGC,OAAOF,MAAM;MAAEG,WAAW;MAAMC,OAAO;IAAK,CAAA;EACjD;AACF,GAR0B;;;ACJ1B,OAAOC,UAAU;AAEjB,OAAOC,WAAW;AAIX,IAAMC,yBAAyB,mCAAA;AACpC,QAAMC,MAAMC,QAAQC,IAAIC,YAAY;AACpC,QAAMC,UAAUH,QAAQC,IAAIG;AAC5BC,UAAQC,IAAIC,MAAMC,MAAM,wBAAwBL,OAAAA,GAAU,CAAA;AAC1D,QAAMM,QAAkB;IAACC,KAAKC,KAAKZ,KAAK,eAAA;IAAkBW,KAAKC,KAAKZ,KAAK,aAAA;IAAgBW,KAAKC,KAAKZ,KAAK,cAAA;;AAExG,QAAMa,QAAQC,IAAIJ,MAAMK,IAAIC,CAAAA,SAAQC,WAAWD,IAAAA,CAAAA,CAAAA;AAE/C,SAAO;AACT,GATsC;;;ACFtCE,uBAAAA,EACGC,KAAK,MAAA;AACJC,UAAQC,KAAK,CAAA;AACf,CAAA,EACCC,MAAM,CAACC,UAAAA;AACNC,UAAQD,MAAMA,KAAAA;AACdH,UAAQC,KAAK,CAAA;AACf,CAAA;","names":["fs","glob","deleteGlob","globPath","files","glob","sync","file","fs","rmSync","recursive","force","path","chalk","packageCleanTypescript","pkg","process","env","INIT_CWD","pkgName","npm_package_name","console","log","chalk","green","files","path","join","Promise","all","map","file","deleteGlob","packageCleanTypescript","then","process","exit","catch","error","console"]}
|
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
|
+
// src/lib/deleteGlob.ts
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import { glob } from "glob";
|
|
8
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
9
|
+
const files = glob.sync(globPath);
|
|
10
|
+
for (const file of files) {
|
|
11
|
+
fs.rmSync(file, {
|
|
12
|
+
recursive: true,
|
|
13
|
+
force: true
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, "deleteGlob");
|
|
17
|
+
|
|
5
18
|
// src/actions/package/clean-outputs.ts
|
|
6
19
|
import path from "node:path";
|
|
7
20
|
import chalk from "chalk";
|
|
8
|
-
import { rimraf } from "rimraf";
|
|
9
21
|
var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
10
22
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
11
23
|
const pkgName = process.env.npm_package_name;
|
|
@@ -15,14 +27,13 @@ var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
|
15
27
|
path.join(pkg, "docs")
|
|
16
28
|
];
|
|
17
29
|
console.log(chalk.green(`Cleaning Outputs [${pkgName}]`));
|
|
18
|
-
await Promise.all(folders.map((folder) =>
|
|
30
|
+
await Promise.all(folders.map((folder) => deleteGlob(folder)));
|
|
19
31
|
return 0;
|
|
20
32
|
}, "packageCleanOutputs");
|
|
21
33
|
|
|
22
34
|
// src/actions/package/clean-typescript.ts
|
|
23
35
|
import path2 from "node:path";
|
|
24
36
|
import chalk2 from "chalk";
|
|
25
|
-
import { rimraf as rimraf2 } from "rimraf";
|
|
26
37
|
var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
27
38
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
28
39
|
const pkgName = process.env.npm_package_name;
|
|
@@ -32,7 +43,7 @@ var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
|
32
43
|
path2.join(pkg, ".tsconfig.*"),
|
|
33
44
|
path2.join(pkg, ".eslintcache")
|
|
34
45
|
];
|
|
35
|
-
await Promise.all(files.map((file) =>
|
|
46
|
+
await Promise.all(files.map((file) => deleteGlob(file)));
|
|
36
47
|
return 0;
|
|
37
48
|
}, "packageCleanTypescript");
|
|
38
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/package/clean-outputs.ts","../../../src/actions/package/clean-typescript.ts","../../../src/actions/package/clean.ts","../../../src/bin/package/clean.ts"],"sourcesContent":["import path from 'node:path'\n\nimport chalk from 'chalk'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/deleteGlob.ts","../../../src/actions/package/clean-outputs.ts","../../../src/actions/package/clean-typescript.ts","../../../src/actions/package/clean.ts","../../../src/bin/package/clean.ts"],"sourcesContent":["import fs from 'node:fs'\n\nimport { glob } from 'glob'\n\nexport const deleteGlob = (globPath: string) => {\n // Find all files matching the glob pattern\n const files = glob.sync(globPath)\n\n // Remove each file or directory\n for (const file of files) {\n fs.rmSync(file, { recursive: true, force: true })\n }\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanOutputs = async () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n const folders: string[] = [path.join(pkg, 'dist'), path.join(pkg, 'build'), path.join(pkg, 'docs')]\n console.log(chalk.green(`Cleaning Outputs [${pkgName}]`))\n\n await Promise.all(folders.map(folder => deleteGlob(folder)))\n\n return 0\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanTypescript = async () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`Cleaning Typescript [${pkgName}]`))\n const files: string[] = [path.join(pkg, '*.tsbuildinfo'), path.join(pkg, '.tsconfig.*'), path.join(pkg, '.eslintcache')]\n\n await Promise.all(files.map(file => deleteGlob(file)))\n\n return 0\n}\n","import { packageCleanOutputs } from './clean-outputs.ts'\nimport { packageCleanTypescript } from './clean-typescript.ts'\n\nexport const packageClean = async () => {\n return (await Promise.all([packageCleanOutputs(), packageCleanTypescript()])).reduce((prev, value) => prev + value, 0)\n}\n","#!/usr/bin/env node\n\nimport { packageClean } from '../../actions/index.ts'\n\npackageClean()\n .then(() => {\n process.exit(0)\n })\n .catch((error) => {\n console.error(error)\n process.exit(1)\n })\n"],"mappings":";;;;;AAAA,OAAOA,QAAQ;AAEf,SAASC,YAAY;AAEd,IAAMC,aAAa,wBAACC,aAAAA;AAEzB,QAAMC,QAAQC,KAAKC,KAAKH,QAAAA;AAGxB,aAAWI,QAAQH,OAAO;AACxBI,OAAGC,OAAOF,MAAM;MAAEG,WAAW;MAAMC,OAAO;IAAK,CAAA;EACjD;AACF,GAR0B;;;ACJ1B,OAAOC,UAAU;AAEjB,OAAOC,WAAW;AAIX,IAAMC,sBAAsB,mCAAA;AACjC,QAAMC,MAAMC,QAAQC,IAAIC,YAAY;AACpC,QAAMC,UAAUH,QAAQC,IAAIG;AAC5B,QAAMC,UAAoB;IAACC,KAAKC,KAAKR,KAAK,MAAA;IAASO,KAAKC,KAAKR,KAAK,OAAA;IAAUO,KAAKC,KAAKR,KAAK,MAAA;;AAC3FS,UAAQC,IAAIC,MAAMC,MAAM,qBAAqBR,OAAAA,GAAU,CAAA;AAEvD,QAAMS,QAAQC,IAAIR,QAAQS,IAAIC,CAAAA,WAAUC,WAAWD,MAAAA,CAAAA,CAAAA;AAEnD,SAAO;AACT,GATmC;;;ACNnC,OAAOE,WAAU;AAEjB,OAAOC,YAAW;AAIX,IAAMC,yBAAyB,mCAAA;AACpC,QAAMC,MAAMC,QAAQC,IAAIC,YAAY;AACpC,QAAMC,UAAUH,QAAQC,IAAIG;AAC5BC,UAAQC,IAAIC,OAAMC,MAAM,wBAAwBL,OAAAA,GAAU,CAAA;AAC1D,QAAMM,QAAkB;IAACC,MAAKC,KAAKZ,KAAK,eAAA;IAAkBW,MAAKC,KAAKZ,KAAK,aAAA;IAAgBW,MAAKC,KAAKZ,KAAK,cAAA;;AAExG,QAAMa,QAAQC,IAAIJ,MAAMK,IAAIC,CAAAA,SAAQC,WAAWD,IAAAA,CAAAA,CAAAA;AAE/C,SAAO;AACT,GATsC;;;ACH/B,IAAME,eAAe,mCAAA;AAC1B,UAAQ,MAAMC,QAAQC,IAAI;IAACC,oBAAAA;IAAuBC,uBAAAA;GAAyB,GAAGC,OAAO,CAACC,MAAMC,UAAUD,OAAOC,OAAO,CAAA;AACtH,GAF4B;;;ACC5BC,aAAAA,EACGC,KAAK,MAAA;AACJC,UAAQC,KAAK,CAAA;AACf,CAAA,EACCC,MAAM,CAACC,UAAAA;AACNC,UAAQD,MAAMA,KAAAA;AACdH,UAAQC,KAAK,CAAA;AACf,CAAA;","names":["fs","glob","deleteGlob","globPath","files","glob","sync","file","fs","rmSync","recursive","force","path","chalk","packageCleanOutputs","pkg","process","env","INIT_CWD","pkgName","npm_package_name","folders","path","join","console","log","chalk","green","Promise","all","map","folder","deleteGlob","path","chalk","packageCleanTypescript","pkg","process","env","INIT_CWD","pkgName","npm_package_name","console","log","chalk","green","files","path","join","Promise","all","map","file","deleteGlob","packageClean","Promise","all","packageCleanOutputs","packageCleanTypescript","reduce","prev","value","packageClean","then","process","exit","catch","error","console"]}
|
|
@@ -1,18 +1,158 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
|
|
29
|
+
// ../../node_modules/deepmerge/dist/cjs.js
|
|
30
|
+
var require_cjs = __commonJS({
|
|
31
|
+
"../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
32
|
+
"use strict";
|
|
33
|
+
var isMergeableObject = /* @__PURE__ */ __name(function isMergeableObject2(value) {
|
|
34
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
35
|
+
}, "isMergeableObject");
|
|
36
|
+
function isNonNullObject(value) {
|
|
37
|
+
return !!value && typeof value === "object";
|
|
38
|
+
}
|
|
39
|
+
__name(isNonNullObject, "isNonNullObject");
|
|
40
|
+
function isSpecial(value) {
|
|
41
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
42
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
43
|
+
}
|
|
44
|
+
__name(isSpecial, "isSpecial");
|
|
45
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
46
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
47
|
+
function isReactElement(value) {
|
|
48
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
49
|
+
}
|
|
50
|
+
__name(isReactElement, "isReactElement");
|
|
51
|
+
function emptyTarget(val) {
|
|
52
|
+
return Array.isArray(val) ? [] : {};
|
|
53
|
+
}
|
|
54
|
+
__name(emptyTarget, "emptyTarget");
|
|
55
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
56
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge3(emptyTarget(value), value, options) : value;
|
|
57
|
+
}
|
|
58
|
+
__name(cloneUnlessOtherwiseSpecified, "cloneUnlessOtherwiseSpecified");
|
|
59
|
+
function defaultArrayMerge(target, source, options) {
|
|
60
|
+
return target.concat(source).map(function(element) {
|
|
61
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
__name(defaultArrayMerge, "defaultArrayMerge");
|
|
65
|
+
function getMergeFunction(key, options) {
|
|
66
|
+
if (!options.customMerge) {
|
|
67
|
+
return deepmerge3;
|
|
68
|
+
}
|
|
69
|
+
var customMerge = options.customMerge(key);
|
|
70
|
+
return typeof customMerge === "function" ? customMerge : deepmerge3;
|
|
71
|
+
}
|
|
72
|
+
__name(getMergeFunction, "getMergeFunction");
|
|
73
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
74
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
75
|
+
return Object.propertyIsEnumerable.call(target, symbol);
|
|
76
|
+
}) : [];
|
|
77
|
+
}
|
|
78
|
+
__name(getEnumerableOwnPropertySymbols, "getEnumerableOwnPropertySymbols");
|
|
79
|
+
function getKeys(target) {
|
|
80
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
81
|
+
}
|
|
82
|
+
__name(getKeys, "getKeys");
|
|
83
|
+
function propertyIsOnObject(object, property) {
|
|
84
|
+
try {
|
|
85
|
+
return property in object;
|
|
86
|
+
} catch (_) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
__name(propertyIsOnObject, "propertyIsOnObject");
|
|
91
|
+
function propertyIsUnsafe(target, key) {
|
|
92
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
93
|
+
}
|
|
94
|
+
__name(propertyIsUnsafe, "propertyIsUnsafe");
|
|
95
|
+
function mergeObject(target, source, options) {
|
|
96
|
+
var destination = {};
|
|
97
|
+
if (options.isMergeableObject(target)) {
|
|
98
|
+
getKeys(target).forEach(function(key) {
|
|
99
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
getKeys(source).forEach(function(key) {
|
|
103
|
+
if (propertyIsUnsafe(target, key)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
107
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
108
|
+
} else {
|
|
109
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return destination;
|
|
113
|
+
}
|
|
114
|
+
__name(mergeObject, "mergeObject");
|
|
115
|
+
function deepmerge3(target, source, options) {
|
|
116
|
+
options = options || {};
|
|
117
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
118
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
119
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
120
|
+
var sourceIsArray = Array.isArray(source);
|
|
121
|
+
var targetIsArray = Array.isArray(target);
|
|
122
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
123
|
+
if (!sourceAndTargetTypesMatch) {
|
|
124
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
125
|
+
} else if (sourceIsArray) {
|
|
126
|
+
return options.arrayMerge(target, source, options);
|
|
127
|
+
} else {
|
|
128
|
+
return mergeObject(target, source, options);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
__name(deepmerge3, "deepmerge");
|
|
132
|
+
deepmerge3.all = /* @__PURE__ */ __name(function deepmergeAll(array, options) {
|
|
133
|
+
if (!Array.isArray(array)) {
|
|
134
|
+
throw new Error("first argument should be an array");
|
|
135
|
+
}
|
|
136
|
+
return array.reduce(function(prev, next) {
|
|
137
|
+
return deepmerge3(prev, next, options);
|
|
138
|
+
}, {});
|
|
139
|
+
}, "deepmergeAll");
|
|
140
|
+
var deepmerge_1 = deepmerge3;
|
|
141
|
+
module.exports = deepmerge_1;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
4
144
|
|
|
5
145
|
// src/bin/package/compile-only.ts
|
|
6
146
|
import chalk5 from "chalk";
|
|
7
147
|
|
|
8
148
|
// src/lib/loadConfig.ts
|
|
149
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
9
150
|
import chalk from "chalk";
|
|
10
151
|
import { cosmiconfig } from "cosmiconfig";
|
|
11
|
-
import merge from "lodash/merge.js";
|
|
12
152
|
var config;
|
|
13
153
|
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
14
154
|
if (config) {
|
|
15
|
-
return
|
|
155
|
+
return (0, import_deepmerge.default)(config, params ?? {});
|
|
16
156
|
}
|
|
17
157
|
const cosmicConfigResult = await cosmiconfig("xy", {
|
|
18
158
|
cache: true
|
|
@@ -22,7 +162,7 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
|
22
162
|
if (configFilePath) {
|
|
23
163
|
console.log(chalk.gray(`Loading config from ${configFilePath}`));
|
|
24
164
|
}
|
|
25
|
-
return
|
|
165
|
+
return (0, import_deepmerge.default)(config, params ?? {});
|
|
26
166
|
}, "loadConfig");
|
|
27
167
|
|
|
28
168
|
// src/actions/package/compile/compile.ts
|
|
@@ -31,8 +171,11 @@ import chalk4 from "chalk";
|
|
|
31
171
|
// src/actions/package/publint.ts
|
|
32
172
|
import { promises as fs } from "node:fs";
|
|
33
173
|
import chalk2 from "chalk";
|
|
174
|
+
import sortPackageJson from "sort-package-json";
|
|
34
175
|
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
35
176
|
const pkgDir = process.env.INIT_CWD;
|
|
177
|
+
const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
178
|
+
await fs.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
36
179
|
const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
37
180
|
console.log(chalk2.green(`Publint: ${pkg.name}`));
|
|
38
181
|
console.log(chalk2.gray(pkgDir));
|
|
@@ -76,17 +219,14 @@ import { createProgramFromConfig } from "tsc-prog";
|
|
|
76
219
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
|
|
77
220
|
|
|
78
221
|
// src/actions/package/compile/getCompilerOptions.ts
|
|
222
|
+
var import_deepmerge2 = __toESM(require_cjs(), 1);
|
|
79
223
|
import { createRequire } from "node:module";
|
|
80
|
-
import merge2 from "lodash/merge.js";
|
|
81
224
|
import { findConfigFile, readConfigFile, sys } from "typescript";
|
|
82
225
|
var getNested = /* @__PURE__ */ __name((config2) => {
|
|
83
226
|
if (config2.extends) {
|
|
84
227
|
const require2 = createRequire(import.meta.url);
|
|
85
228
|
const opts = require2(config2.extends);
|
|
86
|
-
return {
|
|
87
|
-
...getNested(opts),
|
|
88
|
-
...config2.compilerOptions
|
|
89
|
-
};
|
|
229
|
+
return (0, import_deepmerge2.default)(getNested(opts), config2.compilerOptions ?? {});
|
|
90
230
|
}
|
|
91
231
|
return config2.compilerOptions;
|
|
92
232
|
}, "getNested");
|
|
@@ -94,10 +234,10 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename) => {
|
|
|
94
234
|
const config2 = readConfigFile(filename, sys.readFile).config;
|
|
95
235
|
return getNested(config2);
|
|
96
236
|
}, "getCompilerOptionsJSONFollowExtends");
|
|
97
|
-
var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.json") => {
|
|
237
|
+
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
|
|
98
238
|
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
99
|
-
const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
|
|
100
|
-
return
|
|
239
|
+
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
240
|
+
return (0, import_deepmerge2.default)(configFileCompilerOptions, options);
|
|
101
241
|
}, "getCompilerOptions");
|
|
102
242
|
|
|
103
243
|
// src/actions/package/compile/packageCompileTsc.ts
|