@xylabs/ts-scripts-yarn3 3.2.42 → 3.3.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/clean-docs.js +2 -2
- package/dist/actions/clean-docs.js.map +1 -1
- package/dist/actions/clean-docs.mjs +1 -1
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.js +2 -2
- package/dist/actions/clean-eslint.js.map +1 -1
- package/dist/actions/clean-eslint.mjs +1 -1
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/compile.js.map +1 -1
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.js +9 -6
- package/dist/actions/copy-assets.js.map +1 -1
- package/dist/actions/copy-assets.mjs +9 -6
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.js +1 -1
- package/dist/actions/cycle.js.map +1 -1
- package/dist/actions/cycle.mjs +1 -1
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/gitlint-fix.js +4 -4
- package/dist/actions/gitlint-fix.js.map +1 -1
- package/dist/actions/gitlint-fix.mjs +1 -1
- package/dist/actions/gitlint-fix.mjs.map +1 -1
- package/dist/actions/gitlint.js +6 -6
- package/dist/actions/gitlint.js.map +1 -1
- package/dist/actions/gitlint.mjs +6 -6
- package/dist/actions/gitlint.mjs.map +1 -1
- package/dist/actions/license.js +11 -11
- package/dist/actions/license.js.map +1 -1
- package/dist/actions/license.mjs +11 -11
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint-clean.js +2 -2
- package/dist/actions/lint-clean.js.map +1 -1
- package/dist/actions/lint-clean.mjs +1 -1
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint.js +4 -4
- package/dist/actions/lint.js.map +1 -1
- package/dist/actions/lint.mjs +4 -4
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.js +6 -6
- package/dist/actions/package/clean-outputs.js.map +1 -1
- package/dist/actions/package/clean-outputs.mjs +2 -2
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.js +3 -3
- package/dist/actions/package/clean-typescript.js.map +1 -1
- package/dist/actions/package/clean-typescript.mjs +1 -1
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.js +6 -4
- package/dist/actions/package/compile/buildEntries.js.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs +6 -4
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.js +1 -1
- package/dist/actions/package/compile/copyTypeFiles.js.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.js +1 -1
- package/dist/actions/package/compile/getCompilerOptions.js.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.js +2 -2
- package/dist/actions/package/compile/inputs.js.map +1 -1
- package/dist/actions/package/compile/inputs.mjs +2 -2
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.js +8 -8
- package/dist/actions/package/compile/packageCompileTsc.js.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +6 -6
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.js +13 -10
- package/dist/actions/package/compile/packageCompileTscTypes.js.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +11 -8
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.js +5 -5
- package/dist/actions/package/compile/packageCompileTsup.js.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +5 -5
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/copy-assets.js +9 -6
- package/dist/actions/package/copy-assets.js.map +1 -1
- package/dist/actions/package/copy-assets.mjs +9 -6
- package/dist/actions/package/copy-assets.mjs.map +1 -1
- package/dist/actions/package/deps.js +23 -21
- package/dist/actions/package/deps.js.map +1 -1
- package/dist/actions/package/deps.mjs +19 -17
- package/dist/actions/package/deps.mjs.map +1 -1
- package/dist/actions/package/gen-docs.js +2 -4
- package/dist/actions/package/gen-docs.js.map +1 -1
- package/dist/actions/package/gen-docs.mjs +2 -4
- package/dist/actions/package/gen-docs.mjs.map +1 -1
- package/dist/actions/package/publint.js +10 -7
- package/dist/actions/package/publint.js.map +1 -1
- package/dist/actions/package/publint.mjs +9 -6
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/reinstall.js +3 -3
- package/dist/actions/reinstall.js.map +1 -1
- package/dist/actions/reinstall.mjs +1 -1
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.js +2 -2
- package/dist/actions/relint.js.map +1 -1
- package/dist/actions/relint.mjs +1 -1
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/createBuildConfig.js +4 -4
- package/dist/lib/createBuildConfig.js.map +1 -1
- package/dist/lib/createBuildConfig.mjs +3 -3
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.js +6 -6
- package/dist/lib/dependencies/DuplicateDetector.js.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs +4 -4
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.js +10 -7
- package/dist/lib/dependencies/detectDuplicateDependencies.js.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +9 -6
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.js +1 -1
- package/dist/lib/file/ReadFileSyncOptions.js.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
- package/dist/lib/jsonFormatters.js +2 -2
- package/dist/lib/jsonFormatters.js.map +1 -1
- package/dist/lib/jsonFormatters.mjs +2 -2
- package/dist/lib/jsonFormatters.mjs.map +1 -1
- package/dist/lib/parsedPackageJSON.js +2 -2
- package/dist/lib/parsedPackageJSON.js.map +1 -1
- package/dist/lib/parsedPackageJSON.mjs +1 -1
- package/dist/lib/parsedPackageJSON.mjs.map +1 -1
- package/dist/lib/runSteps.js +6 -7
- package/dist/lib/runSteps.js.map +1 -1
- package/dist/lib/runSteps.mjs +4 -5
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.js +7 -7
- package/dist/lib/runStepsAsync.js.map +1 -1
- package/dist/lib/runStepsAsync.mjs +5 -5
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.js +3 -3
- package/dist/lib/yarn/isYarnVersionOrGreater.js.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs +2 -2
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.js +2 -2
- package/dist/lib/yarn/workspace/yarnWorkspaces.js.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/loadPackageConfig.js +1 -1
- package/dist/loadPackageConfig.js.map +1 -1
- package/dist/loadPackageConfig.mjs +1 -1
- package/dist/loadPackageConfig.mjs.map +1 -1
- package/dist/xy/xyLintCommands.js.map +1 -1
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +13 -13
- package/src/actions/clean-docs.ts +2 -1
- package/src/actions/clean-eslint.ts +2 -1
- package/src/actions/compile.ts +2 -2
- package/src/actions/copy-assets.ts +11 -6
- package/src/actions/cycle.ts +1 -1
- package/src/actions/gitlint-fix.ts +2 -1
- package/src/actions/gitlint.ts +6 -6
- package/src/actions/license.ts +44 -40
- package/src/actions/lint-clean.ts +2 -1
- package/src/actions/lint.ts +4 -4
- package/src/actions/package/clean-outputs.ts +3 -2
- package/src/actions/package/clean-typescript.ts +2 -1
- package/src/actions/package/compile/buildEntries.ts +6 -4
- package/src/actions/package/compile/copyTypeFiles.ts +2 -1
- package/src/actions/package/compile/getCompilerOptions.ts +1 -1
- package/src/actions/package/compile/inputs.ts +3 -2
- package/src/actions/package/compile/packageCompileTsc.ts +7 -5
- package/src/actions/package/compile/packageCompileTscTypes.ts +11 -7
- package/src/actions/package/compile/packageCompileTsup.ts +11 -13
- package/src/actions/package/copy-assets.ts +10 -6
- package/src/actions/package/deps.ts +19 -20
- package/src/actions/package/gen-docs.ts +2 -4
- package/src/actions/package/publint.ts +10 -6
- package/src/actions/reinstall.ts +2 -1
- package/src/actions/relint.ts +2 -1
- package/src/lib/createBuildConfig.ts +3 -3
- package/src/lib/dependencies/DuplicateDetector.ts +6 -4
- package/src/lib/dependencies/detectDuplicateDependencies.ts +9 -6
- package/src/lib/file/ReadFileSyncOptions.ts +1 -1
- package/src/lib/jsonFormatters.ts +2 -2
- package/src/lib/parsedPackageJSON.ts +1 -1
- package/src/lib/runSteps.ts +5 -5
- package/src/lib/runStepsAsync.ts +6 -5
- package/src/lib/yarn/isYarnVersionOrGreater.ts +2 -2
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
- package/src/loadPackageConfig.ts +2 -1
- package/src/xy/xyLintCommands.ts +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/loadPackageConfig.ts"],"sourcesContent":["import { readFile } from 'fs/promises'\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,SAAS,gBAAgB;
|
|
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,SAAS,gBAAgB;AAMlB,MAAM,oBAAoB,YAAY;AAC3C,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,YAAY,MAAM,SAAS,GAAG,GAAG,iBAAiB,EAAE,UAAU,OAAO,CAAC;AAE5E,SAAO,KAAK,MAAM,SAAS;AAC7B;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode
|
|
1
|
+
{"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode =\n argv.fix ? fix()\n : argv.profile ? lintProfile()\n : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":"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","names":["chalk"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode
|
|
1
|
+
{"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode =\n argv.fix ? fix()\n : argv.profile ? lintProfile()\n : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAGlB,SAAS,OAAO,KAAK,MAAM,aAAa,SAAS,QAAQ,aAAa;AAE/D,MAAM,iBAAiB,CAAC,SAAe;AAC5C,SAAO,KACJ;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,OAAO;AACrC,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WACN,KAAK,MAAM,IAAI,IACb,KAAK,UAAU,YAAY,IAC3B,MAAM,KAAK,EAAE,KAAK,KAAK,QAAkB,CAAC;AAC9C,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,KAAK;AACnC,cAAQ,WAAW,IAAI;AACvB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,UAAI,KAAK;AAAS,gBAAQ,IAAI,WAAW;AACzC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WAAW,OAAO;AAC1B,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,SAAS;AACvC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WAAW,MAAM,QAAQ,EAAE,KAAK,KAAK,SAAmB,SAAS,CAAC,CAAC,KAAK,QAAQ,CAAC;AACzF,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO;AAAA,IACT;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,aAAa;AAC3C,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AACJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
61
61
|
"@rollup/plugin-json": "^6.1.0",
|
|
62
62
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
63
|
-
"@types/node": "^20.11.
|
|
63
|
+
"@types/node": "^20.11.19",
|
|
64
64
|
"@types/yargs": "^17.0.32",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
66
|
-
"@typescript-eslint/parser": "^6.
|
|
67
|
-
"@xylabs/tsconfig": "~3.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
66
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
67
|
+
"@xylabs/tsconfig": "~3.3.0",
|
|
68
68
|
"async-mutex": "^0.4.1",
|
|
69
69
|
"chalk": "^4.1.2",
|
|
70
70
|
"cosmiconfig": "^9.0.0",
|
|
@@ -84,25 +84,25 @@
|
|
|
84
84
|
"license-checker": "^25.0.1",
|
|
85
85
|
"lodash": "^4.17.21",
|
|
86
86
|
"node-cmd": "^5.0.0",
|
|
87
|
-
"npm-check-updates": "^16.14.
|
|
87
|
+
"npm-check-updates": "^16.14.15",
|
|
88
88
|
"npm-package-json-lint": "^7.1.0",
|
|
89
89
|
"npm-package-json-lint-config-default": "^6.0.0",
|
|
90
90
|
"parse-git-config": "^3.0.0",
|
|
91
|
-
"prettier": "^3.2.
|
|
91
|
+
"prettier": "^3.2.5",
|
|
92
92
|
"publint": "^0.2.7",
|
|
93
93
|
"reflect-metadata": "^0.2.1",
|
|
94
94
|
"rimraf": "^4.4.1",
|
|
95
|
-
"rollup": "^4.
|
|
95
|
+
"rollup": "^4.12.0",
|
|
96
96
|
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
|
|
97
97
|
"rollup-plugin-node-externals": "^6.1.2",
|
|
98
98
|
"supertest": "^6.3.4",
|
|
99
|
-
"ts-jest": "^29.1.
|
|
99
|
+
"ts-jest": "^29.1.2",
|
|
100
100
|
"ts-node": "^10.9.2",
|
|
101
101
|
"ts-prune": "^0.10.3",
|
|
102
102
|
"tsc-prog": "^2.3.0",
|
|
103
103
|
"tslib": "^2.6.2",
|
|
104
|
-
"tsup": "^8.0.
|
|
105
|
-
"typedoc": "^0.25.
|
|
104
|
+
"tsup": "^8.0.2",
|
|
105
|
+
"typedoc": "^0.25.8",
|
|
106
106
|
"types-package-json": "^2.0.39",
|
|
107
107
|
"yargs": "^17.7.2"
|
|
108
108
|
},
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"@types/license-checker": "^25.0.6",
|
|
113
113
|
"@types/lodash": "^4.14.202",
|
|
114
114
|
"@types/parse-git-config": "^3.0.4",
|
|
115
|
-
"@xylabs/eslint-config": "~3.
|
|
116
|
-
"@xylabs/tsconfig": "~3.
|
|
115
|
+
"@xylabs/eslint-config": "~3.3.0",
|
|
116
|
+
"@xylabs/tsconfig": "~3.3.0",
|
|
117
117
|
"publint": "^0.2.7",
|
|
118
118
|
"typescript": "^5.3.3"
|
|
119
119
|
},
|
|
@@ -169,6 +169,6 @@
|
|
|
169
169
|
"package-clean": "echo Not cleaning..."
|
|
170
170
|
},
|
|
171
171
|
"sideEffects": false,
|
|
172
|
-
"version": "3.
|
|
172
|
+
"version": "3.3.0",
|
|
173
173
|
"type": "commonjs"
|
|
174
174
|
}
|
package/src/actions/compile.ts
CHANGED
|
@@ -25,8 +25,8 @@ export const compile = ({ verbose, target, pkg, incremental, publint }: CompileP
|
|
|
25
25
|
export const compilePackage = ({ target, pkg, publint = true }: CompilePackageParams) => {
|
|
26
26
|
const targetOptions = target ? ['-t', target] : []
|
|
27
27
|
|
|
28
|
-
return publint
|
|
29
|
-
|
|
28
|
+
return publint ?
|
|
29
|
+
runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
|
|
30
30
|
: runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import path from 'node:path/posix'
|
|
2
|
+
|
|
1
3
|
import chalk from 'chalk'
|
|
2
4
|
import cpy from 'cpy'
|
|
3
|
-
import path from 'path/posix'
|
|
4
5
|
|
|
5
6
|
import { yarnWorkspaces } from '../lib'
|
|
6
7
|
|
|
@@ -19,9 +20,9 @@ const copyPackageTargetAssets = async (target: 'esm' | 'cjs', name: string, loca
|
|
|
19
20
|
parents: true,
|
|
20
21
|
},
|
|
21
22
|
)
|
|
22
|
-
|
|
23
|
+
for (const value of values) {
|
|
23
24
|
console.log(`${value.split('/').pop()} => ./dist/${target}`)
|
|
24
|
-
}
|
|
25
|
+
}
|
|
25
26
|
return 0
|
|
26
27
|
} catch (reason) {
|
|
27
28
|
console.log(`Copy Failed: ${name}: ${reason}`)
|
|
@@ -48,6 +49,7 @@ const copyTargetAssets = async (target: 'esm' | 'cjs', pkg?: string) => {
|
|
|
48
49
|
return await copyPackageTargetAssets(target, name, location)
|
|
49
50
|
}),
|
|
50
51
|
)
|
|
52
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
51
53
|
return results.reduce((prev, result) => prev || result, 0)
|
|
52
54
|
}
|
|
53
55
|
return 0
|
|
@@ -55,11 +57,14 @@ const copyTargetAssets = async (target: 'esm' | 'cjs', pkg?: string) => {
|
|
|
55
57
|
|
|
56
58
|
export const copyAssets = async ({ target, pkg }: CopyAssetsParams) => {
|
|
57
59
|
switch (target) {
|
|
58
|
-
case 'esm':
|
|
60
|
+
case 'esm': {
|
|
59
61
|
return await copyTargetAssets('esm', pkg)
|
|
60
|
-
|
|
62
|
+
}
|
|
63
|
+
case 'cjs': {
|
|
61
64
|
return await copyTargetAssets('cjs', pkg)
|
|
62
|
-
|
|
65
|
+
}
|
|
66
|
+
default: {
|
|
63
67
|
return (await copyTargetAssets('esm', pkg)) || (await copyTargetAssets('cjs', pkg))
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
}
|
package/src/actions/cycle.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { runSteps } from '../lib'
|
|
|
2
2
|
|
|
3
3
|
export const cycle = () => {
|
|
4
4
|
const rules = ['"\'import/no-cycle\': [1, { maxDepth: 6 }]"', "\"'import/no-internal-modules': ['off']\""]
|
|
5
|
-
return runSteps('Cycle', [['yarn', ['eslint', ...rules.
|
|
5
|
+
return runSteps('Cycle', [['yarn', ['eslint', ...rules.flatMap((rule) => ['--rule', rule]), '--cache', '.']]])
|
|
6
6
|
}
|
package/src/actions/gitlint.ts
CHANGED
|
@@ -19,16 +19,16 @@ export const gitlint = () => {
|
|
|
19
19
|
valid++
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
if (gitConfig.core.autocrlf
|
|
23
|
-
warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
|
|
24
|
-
} else {
|
|
22
|
+
if (gitConfig.core.autocrlf === false) {
|
|
25
23
|
valid++
|
|
24
|
+
} else {
|
|
25
|
+
warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
if (gitConfig.core.eol
|
|
29
|
-
warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
|
|
30
|
-
} else {
|
|
28
|
+
if (gitConfig.core.eol === 'lf') {
|
|
31
29
|
valid++
|
|
30
|
+
} else {
|
|
31
|
+
warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const resultMessages: string[] = []
|
package/src/actions/license.ts
CHANGED
|
@@ -9,7 +9,7 @@ export const license = async (pkg?: string) => {
|
|
|
9
9
|
return pkg === undefined || name === pkg
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
const exclude
|
|
12
|
+
const exclude = new Set([
|
|
13
13
|
'MIT',
|
|
14
14
|
'MIT*',
|
|
15
15
|
'ISC',
|
|
@@ -26,52 +26,56 @@ export const license = async (pkg?: string) => {
|
|
|
26
26
|
'LGPL-3.0',
|
|
27
27
|
'LGPL-3.0-or-later',
|
|
28
28
|
'Python-2.0',
|
|
29
|
-
]
|
|
29
|
+
])
|
|
30
30
|
|
|
31
31
|
console.log(chalk.green('License Checker'))
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
license
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
(
|
|
35
|
+
await Promise.all(
|
|
36
|
+
workspaceList.map(({ location, name }) => {
|
|
37
|
+
return new Promise<number>((resolve) => {
|
|
38
|
+
init({ production: true, start: location }, (error, packages) => {
|
|
39
|
+
if (error) {
|
|
40
|
+
console.error(chalk.red(`License Checker [${name}] Error`))
|
|
41
|
+
console.error(chalk.gray(error))
|
|
42
|
+
console.log('\n')
|
|
43
|
+
resolve(1)
|
|
44
|
+
} else {
|
|
45
|
+
console.log(chalk.green(`License Checker [${name}]`))
|
|
46
|
+
let count = 0
|
|
47
|
+
for (const [name, info] of Object.entries(packages)) {
|
|
48
|
+
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses]
|
|
49
|
+
for (let license of licenses) {
|
|
50
|
+
if (license) {
|
|
51
|
+
//remove surrounding parens on some string
|
|
52
|
+
if (license[0] === '(' && license.at(-1) === ')') {
|
|
53
|
+
license = license.slice(1, -2)
|
|
54
|
+
}
|
|
55
|
+
//get list of OR licenses from string
|
|
56
|
+
const orLicenses = license.split(' OR ')
|
|
57
|
+
let orLicenseFound = false
|
|
58
|
+
for (const orLicense of orLicenses) {
|
|
59
|
+
if (exclude.has(orLicense)) {
|
|
60
|
+
orLicenseFound = true
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!orLicenseFound) {
|
|
64
|
+
count++
|
|
65
|
+
console.warn(chalk.yellow(`${name}: Package License not allowed [${license}]`))
|
|
60
66
|
}
|
|
61
|
-
})
|
|
62
|
-
if (!orLicenseFound) {
|
|
63
|
-
count++
|
|
64
|
-
console.warn(chalk.yellow(`${name}: Package License not allowed [${license}]`))
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
69
|
+
}
|
|
70
|
+
console.log('\n')
|
|
71
|
+
resolve(count)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
72
74
|
})
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
+
}),
|
|
76
|
+
)
|
|
75
77
|
)
|
|
76
|
-
|
|
78
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
79
|
+
.reduce((prev, value) => prev || value, 0)
|
|
80
|
+
)
|
|
77
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rmSync } from 'fs'
|
|
1
|
+
import { rmSync } from 'node:fs'
|
|
2
2
|
|
|
3
3
|
import { yarnWorkspaces } from '../lib'
|
|
4
4
|
import { lint } from './lint'
|
|
@@ -18,6 +18,7 @@ export const lintClean = () => {
|
|
|
18
18
|
return 1
|
|
19
19
|
}
|
|
20
20
|
})
|
|
21
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
21
22
|
.reduce((prev, result) => prev || result, 0)
|
|
22
23
|
return result || lint()
|
|
23
24
|
}
|
package/src/actions/lint.ts
CHANGED
|
@@ -17,19 +17,19 @@ const dumpMessages = (lintResults: ESLint.LintResult[]) => {
|
|
|
17
17
|
const colors: ('white' | 'red' | 'yellow')[] = ['white', 'yellow', 'red']
|
|
18
18
|
const severity: string[] = ['none', 'warning', 'error']
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
for (const lintResult of lintResults) {
|
|
21
21
|
if (lintResult.messages.length > 0) {
|
|
22
22
|
console.log(chalk.gray(`${lintResult.filePath}`))
|
|
23
|
-
lintResult.messages
|
|
23
|
+
for (const message of lintResult.messages) {
|
|
24
24
|
console.log(
|
|
25
25
|
chalk.gray(`\t${message.line}:${message.column}`),
|
|
26
26
|
chalk[colors[message.severity]](`\t${severity[message.severity]}`),
|
|
27
27
|
chalk.white(`\t${message.message}`),
|
|
28
28
|
chalk.gray(`\t${message.ruleId}`),
|
|
29
29
|
)
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export const lintPackage = async ({ pkg }: LintParams) => {
|
|
@@ -3,15 +3,17 @@ import { EntryMode } from './XyConfig'
|
|
|
3
3
|
|
|
4
4
|
export const buildEntries = (folder: string, entryMode?: EntryMode, verbose = false) => {
|
|
5
5
|
switch (entryMode) {
|
|
6
|
-
case 'platform':
|
|
6
|
+
case 'platform': {
|
|
7
7
|
if (verbose) console.log('buildEntries [platform]')
|
|
8
8
|
return [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]
|
|
9
|
-
|
|
9
|
+
}
|
|
10
|
+
case 'all': {
|
|
10
11
|
if (verbose) console.log('buildEntries [all]')
|
|
11
12
|
return getAllInputs2(folder).filter((entry) => !entry.includes('.spec.') && !entry.includes('.story.'))
|
|
12
|
-
|
|
13
|
-
default:
|
|
13
|
+
}
|
|
14
|
+
default: {
|
|
14
15
|
if (verbose) console.log('buildEntries [single]')
|
|
15
16
|
return [`${folder}/index.ts`]
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -10,7 +10,7 @@ export const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerO
|
|
|
10
10
|
opts = getCompilerOptionsJSONFollowExtends(requirePath)
|
|
11
11
|
}
|
|
12
12
|
if (config?.error) {
|
|
13
|
-
throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)
|
|
13
|
+
throw new Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
return { ...opts, ...config.compilerOptions }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { readdir } from 'fs/promises'
|
|
1
|
+
import { readdir } from 'node:fs/promises'
|
|
2
|
+
|
|
2
3
|
import { glob } from 'glob'
|
|
3
4
|
|
|
4
5
|
export const getInputs = async (subDir?: string) => {
|
|
@@ -20,7 +21,7 @@ export const getInputDirs = async (depth: number = 0) => {
|
|
|
20
21
|
.map((file) => {
|
|
21
22
|
const pathParts = file.path?.split('/') ?? []
|
|
22
23
|
pathParts.shift()
|
|
23
|
-
if (pathParts.length) {
|
|
24
|
+
if (pathParts.length > 0) {
|
|
24
25
|
const root = pathParts.join('/')
|
|
25
26
|
return `${root}/${file.name}`
|
|
26
27
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { cwd } from 'node:process'
|
|
2
|
+
|
|
1
3
|
import chalk from 'chalk'
|
|
2
|
-
import { cwd } from 'process'
|
|
3
4
|
import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
|
|
4
5
|
import {
|
|
5
6
|
CompilerOptions,
|
|
@@ -36,8 +37,8 @@ export const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig,
|
|
|
36
37
|
outDir: 'dist',
|
|
37
38
|
rootDir: 'src',
|
|
38
39
|
}),
|
|
39
|
-
...
|
|
40
|
-
...(noEmit
|
|
40
|
+
...compilerOptionsParam,
|
|
41
|
+
...(noEmit === undefined ? {} : { noEmit }),
|
|
41
42
|
} as TsConfigCompilerOptions
|
|
42
43
|
|
|
43
44
|
const program = createProgramFromConfig({
|
|
@@ -49,11 +50,12 @@ export const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig,
|
|
|
49
50
|
|
|
50
51
|
const results = getPreEmitDiagnostics(program)
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
for (const diag of results) {
|
|
53
54
|
const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }
|
|
54
55
|
console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))
|
|
55
56
|
console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))
|
|
56
|
-
}
|
|
57
|
+
}
|
|
57
58
|
|
|
59
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
58
60
|
return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0) || (publint ? await packagePublint() : 0)
|
|
59
61
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { cwd } from 'node:process'
|
|
2
|
+
|
|
1
3
|
import chalk from 'chalk'
|
|
2
|
-
import { cwd } from 'process'
|
|
3
4
|
import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
|
|
4
5
|
import { CompilerOptions, DiagnosticCategory } from 'typescript'
|
|
5
6
|
|
|
@@ -29,7 +30,7 @@ export const packageCompileTscTypes = async (
|
|
|
29
30
|
skipLibCheck: true,
|
|
30
31
|
sourceMap: true,
|
|
31
32
|
}),
|
|
32
|
-
...
|
|
33
|
+
...compilerOptionsParam,
|
|
33
34
|
} as TsConfigCompilerOptions
|
|
34
35
|
|
|
35
36
|
//calling all here since the types do not get rolled up
|
|
@@ -43,25 +44,28 @@ export const packageCompileTscTypes = async (
|
|
|
43
44
|
}).emit()
|
|
44
45
|
|
|
45
46
|
const diagResults = result.diagnostics.length
|
|
46
|
-
result.diagnostics
|
|
47
|
+
for (const diag of result.diagnostics) {
|
|
47
48
|
switch (diag.category) {
|
|
48
|
-
case DiagnosticCategory.Error:
|
|
49
|
+
case DiagnosticCategory.Error: {
|
|
49
50
|
console.error(chalk.red(diag.messageText))
|
|
50
51
|
console.error(chalk.grey(pkg))
|
|
51
52
|
console.error(chalk.blue(diag.file?.fileName))
|
|
52
53
|
break
|
|
53
|
-
|
|
54
|
+
}
|
|
55
|
+
case DiagnosticCategory.Warning: {
|
|
54
56
|
console.error(chalk.yellow(diag.messageText))
|
|
55
57
|
console.error(chalk.grey(pkg))
|
|
56
58
|
console.error(chalk.blue(diag.file?.fileName))
|
|
57
59
|
break
|
|
58
|
-
|
|
60
|
+
}
|
|
61
|
+
case DiagnosticCategory.Suggestion: {
|
|
59
62
|
console.error(chalk.white(diag.messageText))
|
|
60
63
|
console.error(chalk.grey(pkg))
|
|
61
64
|
console.error(chalk.blue(diag.file?.fileName))
|
|
62
65
|
break
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
|
-
}
|
|
68
|
+
}
|
|
65
69
|
if (generateMts) {
|
|
66
70
|
await copyTypeFiles(compilerOptions)
|
|
67
71
|
}
|
|
@@ -27,12 +27,10 @@ const compileFolder = async (folder: string, entryMode: EntryMode = 'single', op
|
|
|
27
27
|
})
|
|
28
28
|
const optionsList = (
|
|
29
29
|
await Promise.all(
|
|
30
|
-
(Array.isArray(optionsResult) ? optionsResult : [optionsResult])
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
.flat(),
|
|
30
|
+
(Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {
|
|
31
|
+
const result = typeof options === 'function' ? await options({}) : [options]
|
|
32
|
+
return Array.isArray(result) ? result : [result]
|
|
33
|
+
}),
|
|
36
34
|
)
|
|
37
35
|
).flat()
|
|
38
36
|
|
|
@@ -59,8 +57,8 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
59
57
|
await Promise.all(
|
|
60
58
|
Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
61
59
|
const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}
|
|
62
|
-
return folder
|
|
63
|
-
|
|
60
|
+
return folder ?
|
|
61
|
+
await compileFolder(
|
|
64
62
|
folder,
|
|
65
63
|
compile?.entryMode,
|
|
66
64
|
{
|
|
@@ -75,7 +73,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
75
73
|
platform: 'node',
|
|
76
74
|
skipNodeModulesBundle: true,
|
|
77
75
|
target: 'node16',
|
|
78
|
-
...
|
|
76
|
+
...compile?.tsup?.options,
|
|
79
77
|
...(typeof options === 'object' ? options : {}),
|
|
80
78
|
},
|
|
81
79
|
verbose,
|
|
@@ -88,8 +86,8 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
88
86
|
await Promise.all(
|
|
89
87
|
Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
90
88
|
const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}
|
|
91
|
-
return folder
|
|
92
|
-
|
|
89
|
+
return folder ?
|
|
90
|
+
(
|
|
93
91
|
await Promise.all([
|
|
94
92
|
compileFolder(
|
|
95
93
|
folder,
|
|
@@ -107,7 +105,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
107
105
|
platform: 'browser',
|
|
108
106
|
skipNodeModulesBundle: true,
|
|
109
107
|
target: 'esnext',
|
|
110
|
-
...
|
|
108
|
+
...compile?.tsup?.options,
|
|
111
109
|
...(typeof options === 'object' ? options : {}),
|
|
112
110
|
},
|
|
113
111
|
verbose,
|
|
@@ -128,7 +126,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
128
126
|
platform: 'browser',
|
|
129
127
|
skipNodeModulesBundle: true,
|
|
130
128
|
target: 'esnext',
|
|
131
|
-
...
|
|
129
|
+
...compile?.tsup?.options,
|
|
132
130
|
...(typeof options === 'object' ? options : {}),
|
|
133
131
|
},
|
|
134
132
|
verbose,
|