@xylabs/ts-scripts-yarn3 3.15.16 → 4.0.0-rc.11
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/compile.mjs +3 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/cycle.mjs +32 -110
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +131 -307
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +57 -259
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +57 -259
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +54 -339
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +72 -277
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +58 -263
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/recompile.mjs +14 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +59 -261
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +56 -341
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +59 -261
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +60 -265
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +56 -27
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +56 -27
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +143 -319
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +56 -27
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +56 -27
- 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/xyLintCommands.mjs +37 -22
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +11 -20
- package/src/actions/compile.ts +2 -2
- package/src/actions/cycle.ts +21 -4
- package/src/actions/package/compile/XyConfig.ts +2 -2
- package/src/actions/package/compile/packageCompileTsc.ts +1 -1
- package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
- package/src/actions/package/compile/packageCompileTsup.ts +54 -130
- package/src/actions/package/recompile.ts +1 -1
- package/src/actions/recompile.ts +2 -1
- package/src/types.d.ts +23 -0
- package/src/xy/xyLintCommands.ts +2 -2
- package/tsup.config.ts +1 -1
- package/dist/actions/build.cjs +0 -208
- package/dist/actions/build.cjs.map +0 -1
- package/dist/actions/clean-docs.cjs +0 -74
- package/dist/actions/clean-docs.cjs.map +0 -1
- package/dist/actions/clean-eslint.cjs +0 -53
- package/dist/actions/clean-eslint.cjs.map +0 -1
- package/dist/actions/clean-jest.cjs +0 -147
- package/dist/actions/clean-jest.cjs.map +0 -1
- package/dist/actions/clean.cjs +0 -192
- package/dist/actions/clean.cjs.map +0 -1
- package/dist/actions/compile.cjs +0 -217
- package/dist/actions/compile.cjs.map +0 -1
- package/dist/actions/copy-assets.cjs +0 -121
- package/dist/actions/copy-assets.cjs.map +0 -1
- package/dist/actions/cycle.cjs +0 -156
- package/dist/actions/cycle.cjs.map +0 -1
- package/dist/actions/dead.cjs +0 -148
- package/dist/actions/dead.cjs.map +0 -1
- package/dist/actions/deploy-major.cjs +0 -160
- package/dist/actions/deploy-major.cjs.map +0 -1
- package/dist/actions/deploy-minor.cjs +0 -160
- package/dist/actions/deploy-minor.cjs.map +0 -1
- package/dist/actions/deploy-next.cjs +0 -160
- package/dist/actions/deploy-next.cjs.map +0 -1
- package/dist/actions/deploy.cjs +0 -160
- package/dist/actions/deploy.cjs.map +0 -1
- package/dist/actions/deps.cjs +0 -205
- package/dist/actions/deps.cjs.map +0 -1
- package/dist/actions/dupdeps.cjs +0 -226
- package/dist/actions/dupdeps.cjs.map +0 -1
- package/dist/actions/fix.cjs +0 -149
- package/dist/actions/fix.cjs.map +0 -1
- package/dist/actions/gen-docs.cjs +0 -186
- package/dist/actions/gen-docs.cjs.map +0 -1
- package/dist/actions/gitignore-gen.cjs +0 -138
- package/dist/actions/gitignore-gen.cjs.map +0 -1
- package/dist/actions/gitlint-fix.cjs +0 -69
- package/dist/actions/gitlint-fix.cjs.map +0 -1
- package/dist/actions/gitlint.cjs +0 -84
- package/dist/actions/gitlint.cjs.map +0 -1
- package/dist/actions/index.cjs +0 -2600
- package/dist/actions/index.cjs.map +0 -1
- package/dist/actions/license.cjs +0 -133
- package/dist/actions/license.cjs.map +0 -1
- package/dist/actions/lint-clean.cjs +0 -227
- package/dist/actions/lint-clean.cjs.map +0 -1
- package/dist/actions/lint-profile.cjs +0 -153
- package/dist/actions/lint-profile.cjs.map +0 -1
- package/dist/actions/lint.cjs +0 -217
- package/dist/actions/lint.cjs.map +0 -1
- package/dist/actions/npmignore-gen.cjs +0 -138
- package/dist/actions/npmignore-gen.cjs.map +0 -1
- package/dist/actions/package/clean-outputs.cjs +0 -56
- package/dist/actions/package/clean-outputs.cjs.map +0 -1
- package/dist/actions/package/clean-typescript.cjs +0 -56
- package/dist/actions/package/clean-typescript.cjs.map +0 -1
- package/dist/actions/package/clean.cjs +0 -83
- package/dist/actions/package/clean.cjs.map +0 -1
- package/dist/actions/package/compile/XyConfig.cjs +0 -19
- package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
- package/dist/actions/package/compile/buildEntries.cjs +0 -68
- package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
- package/dist/actions/package/compile/compile.cjs +0 -565
- package/dist/actions/package/compile/compile.cjs.map +0 -1
- package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
- package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
- package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
- package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
- package/dist/actions/package/compile/index.cjs +0 -571
- package/dist/actions/package/compile/index.cjs.map +0 -1
- package/dist/actions/package/compile/inputs.cjs +0 -79
- package/dist/actions/package/compile/inputs.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
- package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
- package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
- package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
- package/dist/actions/package/copy-assets.cjs +0 -88
- package/dist/actions/package/copy-assets.cjs.map +0 -1
- package/dist/actions/package/deps.cjs +0 -214
- package/dist/actions/package/deps.cjs.map +0 -1
- package/dist/actions/package/gen-docs.cjs +0 -148
- package/dist/actions/package/gen-docs.cjs.map +0 -1
- package/dist/actions/package/index.cjs +0 -968
- package/dist/actions/package/index.cjs.map +0 -1
- package/dist/actions/package/publint.cjs +0 -80
- package/dist/actions/package/publint.cjs.map +0 -1
- package/dist/actions/package/recompile.cjs +0 -617
- package/dist/actions/package/recompile.cjs.map +0 -1
- package/dist/actions/publint.cjs +0 -237
- package/dist/actions/publint.cjs.map +0 -1
- package/dist/actions/rebuild.cjs +0 -148
- package/dist/actions/rebuild.cjs.map +0 -1
- package/dist/actions/recompile.cjs +0 -232
- package/dist/actions/recompile.cjs.map +0 -1
- package/dist/actions/reinstall.cjs +0 -183
- package/dist/actions/reinstall.cjs.map +0 -1
- package/dist/actions/relint.cjs +0 -185
- package/dist/actions/relint.cjs.map +0 -1
- package/dist/actions/retest.cjs +0 -154
- package/dist/actions/retest.cjs.map +0 -1
- package/dist/actions/sonar.cjs +0 -149
- package/dist/actions/sonar.cjs.map +0 -1
- package/dist/actions/statics.cjs +0 -234
- package/dist/actions/statics.cjs.map +0 -1
- package/dist/actions/test.cjs +0 -147
- package/dist/actions/test.cjs.map +0 -1
- package/dist/actions/up.cjs +0 -144
- package/dist/actions/up.cjs.map +0 -1
- package/dist/actions/updo.cjs +0 -152
- package/dist/actions/updo.cjs.map +0 -1
- package/dist/actions/upplug.cjs +0 -172
- package/dist/actions/upplug.cjs.map +0 -1
- package/dist/actions/upyarn.cjs +0 -148
- package/dist/actions/upyarn.cjs.map +0 -1
- package/dist/actions/yarn3only.cjs +0 -106
- package/dist/actions/yarn3only.cjs.map +0 -1
- package/dist/bin/build.cjs +0 -39
- package/dist/bin/build.cjs.map +0 -1
- package/dist/bin/clean.cjs +0 -39
- package/dist/bin/clean.cjs.map +0 -1
- package/dist/bin/compile-only.cjs +0 -39
- package/dist/bin/compile-only.cjs.map +0 -1
- package/dist/bin/compile.cjs +0 -39
- package/dist/bin/compile.cjs.map +0 -1
- package/dist/bin/cycle.cjs +0 -39
- package/dist/bin/cycle.cjs.map +0 -1
- package/dist/bin/dead.cjs +0 -39
- package/dist/bin/dead.cjs.map +0 -1
- package/dist/bin/deploy-major.cjs +0 -39
- package/dist/bin/deploy-major.cjs.map +0 -1
- package/dist/bin/deploy-minor.cjs +0 -39
- package/dist/bin/deploy-minor.cjs.map +0 -1
- package/dist/bin/deploy-next.cjs +0 -39
- package/dist/bin/deploy-next.cjs.map +0 -1
- package/dist/bin/deploy.cjs +0 -39
- package/dist/bin/deploy.cjs.map +0 -1
- package/dist/bin/deps.cjs +0 -39
- package/dist/bin/deps.cjs.map +0 -1
- package/dist/bin/fix.cjs +0 -39
- package/dist/bin/fix.cjs.map +0 -1
- package/dist/bin/gen-docs.cjs +0 -39
- package/dist/bin/gen-docs.cjs.map +0 -1
- package/dist/bin/gitlint-fix.cjs +0 -39
- package/dist/bin/gitlint-fix.cjs.map +0 -1
- package/dist/bin/gitlint.cjs +0 -39
- package/dist/bin/gitlint.cjs.map +0 -1
- package/dist/bin/license.cjs +0 -39
- package/dist/bin/license.cjs.map +0 -1
- package/dist/bin/lint-clean.cjs +0 -39
- package/dist/bin/lint-clean.cjs.map +0 -1
- package/dist/bin/lint-fast.cjs +0 -39
- package/dist/bin/lint-fast.cjs.map +0 -1
- package/dist/bin/lint-profile.cjs +0 -39
- package/dist/bin/lint-profile.cjs.map +0 -1
- package/dist/bin/lint.cjs +0 -39
- package/dist/bin/lint.cjs.map +0 -1
- package/dist/bin/package/clean-outputs.cjs +0 -51
- package/dist/bin/package/clean-outputs.cjs.map +0 -1
- package/dist/bin/package/clean-typescript.cjs +0 -51
- package/dist/bin/package/clean-typescript.cjs.map +0 -1
- package/dist/bin/package/clean.cjs +0 -76
- package/dist/bin/package/clean.cjs.map +0 -1
- package/dist/bin/package/compile-only.cjs +0 -564
- package/dist/bin/package/compile-only.cjs.map +0 -1
- package/dist/bin/package/compile-tsup.cjs +0 -519
- package/dist/bin/package/compile-tsup.cjs.map +0 -1
- package/dist/bin/package/compile.cjs +0 -567
- package/dist/bin/package/compile.cjs.map +0 -1
- package/dist/bin/package/copy-assets-cjs.cjs +0 -86
- package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
- package/dist/bin/package/copy-assets-esm.cjs +0 -86
- package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
- package/dist/bin/package/deps.cjs +0 -208
- package/dist/bin/package/deps.cjs.map +0 -1
- package/dist/bin/package/gen-docs.cjs +0 -143
- package/dist/bin/package/gen-docs.cjs.map +0 -1
- package/dist/bin/package/publint.cjs +0 -77
- package/dist/bin/package/publint.cjs.map +0 -1
- package/dist/bin/package/recompile.cjs +0 -611
- package/dist/bin/package/recompile.cjs.map +0 -1
- package/dist/bin/publint.cjs +0 -39
- package/dist/bin/publint.cjs.map +0 -1
- package/dist/bin/rebuild.cjs +0 -39
- package/dist/bin/rebuild.cjs.map +0 -1
- package/dist/bin/recompile.cjs +0 -39
- package/dist/bin/recompile.cjs.map +0 -1
- package/dist/bin/reinstall.cjs +0 -39
- package/dist/bin/reinstall.cjs.map +0 -1
- package/dist/bin/relint.cjs +0 -39
- package/dist/bin/relint.cjs.map +0 -1
- package/dist/bin/sonar.cjs +0 -39
- package/dist/bin/sonar.cjs.map +0 -1
- package/dist/bin/test.cjs +0 -39
- package/dist/bin/test.cjs.map +0 -1
- package/dist/bin/up.cjs +0 -39
- package/dist/bin/up.cjs.map +0 -1
- package/dist/bin/updo.cjs +0 -39
- package/dist/bin/updo.cjs.map +0 -1
- package/dist/bin/upplug.cjs +0 -39
- package/dist/bin/upplug.cjs.map +0 -1
- package/dist/bin/upyarn.cjs +0 -39
- package/dist/bin/upyarn.cjs.map +0 -1
- package/dist/bin/xy-ts.cjs +0 -1890
- package/dist/bin/xy-ts.cjs.map +0 -1
- package/dist/bin/xy.cjs +0 -1890
- package/dist/bin/xy.cjs.map +0 -1
- package/dist/bin/yarn3only.cjs +0 -39
- package/dist/bin/yarn3only.cjs.map +0 -1
- package/dist/index.cjs +0 -3129
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -359
- package/dist/lib/checkResult.cjs +0 -52
- package/dist/lib/checkResult.cjs.map +0 -1
- package/dist/lib/createBuildConfig.cjs +0 -93
- package/dist/lib/createBuildConfig.cjs.map +0 -1
- package/dist/lib/defaultBuildConfig.cjs +0 -52
- package/dist/lib/defaultBuildConfig.cjs.map +0 -1
- package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
- package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
- package/dist/lib/dependencies/index.cjs +0 -211
- package/dist/lib/dependencies/index.cjs.map +0 -1
- package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
- package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
- package/dist/lib/file/constants.cjs +0 -34
- package/dist/lib/file/constants.cjs.map +0 -1
- package/dist/lib/file/fileLines.cjs +0 -58
- package/dist/lib/file/fileLines.cjs.map +0 -1
- package/dist/lib/file/index.cjs +0 -74
- package/dist/lib/file/index.cjs.map +0 -1
- package/dist/lib/file/tryReadFileSync.cjs +0 -42
- package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
- package/dist/lib/generateIgnoreFiles.cjs +0 -132
- package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
- package/dist/lib/index.cjs +0 -614
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/jsonFormatters.cjs +0 -37
- package/dist/lib/jsonFormatters.cjs.map +0 -1
- package/dist/lib/loadConfig.cjs +0 -59
- package/dist/lib/loadConfig.cjs.map +0 -1
- package/dist/lib/parsedPackageJSON.cjs +0 -37
- package/dist/lib/parsedPackageJSON.cjs.map +0 -1
- package/dist/lib/processEx.cjs +0 -72
- package/dist/lib/processEx.cjs.map +0 -1
- package/dist/lib/runSteps.cjs +0 -134
- package/dist/lib/runSteps.cjs.map +0 -1
- package/dist/lib/runStepsAsync.cjs +0 -147
- package/dist/lib/runStepsAsync.cjs.map +0 -1
- package/dist/lib/runXy.cjs +0 -150
- package/dist/lib/runXy.cjs.map +0 -1
- package/dist/lib/runXyWithWarning.cjs +0 -49
- package/dist/lib/runXyWithWarning.cjs.map +0 -1
- package/dist/lib/safeExit.cjs +0 -100
- package/dist/lib/safeExit.cjs.map +0 -1
- package/dist/lib/string/empty.cjs +0 -35
- package/dist/lib/string/empty.cjs.map +0 -1
- package/dist/lib/string/index.cjs +0 -45
- package/dist/lib/string/index.cjs.map +0 -1
- package/dist/lib/string/union.cjs +0 -35
- package/dist/lib/string/union.cjs.map +0 -1
- package/dist/lib/withErrnoException.cjs +0 -41
- package/dist/lib/withErrnoException.cjs.map +0 -1
- package/dist/lib/withError.cjs +0 -34
- package/dist/lib/withError.cjs.map +0 -1
- package/dist/lib/yarn/index.cjs +0 -93
- package/dist/lib/yarn/index.cjs.map +0 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
- package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
- package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/index.cjs +0 -60
- package/dist/lib/yarn/workspace/index.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
- package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
- package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
- package/dist/loadPackageConfig.cjs +0 -39
- package/dist/loadPackageConfig.cjs.map +0 -1
- package/dist/types.d.cjs +0 -2
- package/dist/types.d.cjs.map +0 -1
- package/dist/xy/index.cjs +0 -1909
- package/dist/xy/index.cjs.map +0 -1
- package/dist/xy/param.cjs +0 -36
- package/dist/xy/param.cjs.map +0 -1
- package/dist/xy/xy.cjs +0 -1895
- package/dist/xy/xy.cjs.map +0 -1
- package/dist/xy/xyBuildCommands.cjs +0 -595
- package/dist/xy/xyBuildCommands.cjs.map +0 -1
- package/dist/xy/xyCommonCommands.cjs +0 -723
- package/dist/xy/xyCommonCommands.cjs.map +0 -1
- package/dist/xy/xyDeployCommands.cjs +0 -263
- package/dist/xy/xyDeployCommands.cjs.map +0 -1
- package/dist/xy/xyInstallCommands.cjs +0 -508
- package/dist/xy/xyInstallCommands.cjs.map +0 -1
- package/dist/xy/xyLintCommands.cjs +0 -466
- package/dist/xy/xyLintCommands.cjs.map +0 -1
- package/dist/xy/xyParseOptions.cjs +0 -84
- package/dist/xy/xyParseOptions.cjs.map +0 -1
|
@@ -1,968 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
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;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/actions/package/index.ts
|
|
32
|
-
var package_exports = {};
|
|
33
|
-
__export(package_exports, {
|
|
34
|
-
packageClean: () => packageClean,
|
|
35
|
-
packageCleanOutputs: () => packageCleanOutputs,
|
|
36
|
-
packageCleanTypescript: () => packageCleanTypescript,
|
|
37
|
-
packageCompile: () => packageCompile,
|
|
38
|
-
packageCompileTsc: () => packageCompileTsc,
|
|
39
|
-
packageCompileTsup: () => packageCompileTsup,
|
|
40
|
-
packageCopyAssets: () => packageCopyAssets,
|
|
41
|
-
packageDeps: () => packageDeps,
|
|
42
|
-
packageGenDocs: () => packageGenDocs,
|
|
43
|
-
packagePublint: () => packagePublint,
|
|
44
|
-
packageRecompile: () => packageRecompile
|
|
45
|
-
});
|
|
46
|
-
module.exports = __toCommonJS(package_exports);
|
|
47
|
-
|
|
48
|
-
// src/actions/package/clean-outputs.ts
|
|
49
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
50
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
51
|
-
var import_rimraf = require("rimraf");
|
|
52
|
-
var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
53
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
54
|
-
const pkgName = process.env.npm_package_name;
|
|
55
|
-
const folders = [
|
|
56
|
-
import_node_path.default.join(pkg, "dist"),
|
|
57
|
-
import_node_path.default.join(pkg, "build"),
|
|
58
|
-
import_node_path.default.join(pkg, "docs")
|
|
59
|
-
];
|
|
60
|
-
console.log(import_chalk.default.green(`Cleaning Outputs [${pkgName}]`));
|
|
61
|
-
await Promise.all(folders.map((folder) => (0, import_rimraf.rimraf)(folder)));
|
|
62
|
-
return 0;
|
|
63
|
-
}, "packageCleanOutputs");
|
|
64
|
-
|
|
65
|
-
// src/actions/package/clean-typescript.ts
|
|
66
|
-
var import_node_path2 = __toESM(require("path"), 1);
|
|
67
|
-
var import_chalk2 = __toESM(require("chalk"), 1);
|
|
68
|
-
var import_rimraf2 = require("rimraf");
|
|
69
|
-
var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
70
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
71
|
-
const pkgName = process.env.npm_package_name;
|
|
72
|
-
console.log(import_chalk2.default.green(`Cleaning Typescript [${pkgName}]`));
|
|
73
|
-
const files = [
|
|
74
|
-
import_node_path2.default.join(pkg, "*.tsbuildinfo"),
|
|
75
|
-
import_node_path2.default.join(pkg, ".tsconfig.*"),
|
|
76
|
-
import_node_path2.default.join(pkg, ".eslintcache")
|
|
77
|
-
];
|
|
78
|
-
await Promise.all(files.map((file) => (0, import_rimraf2.rimraf)(file)));
|
|
79
|
-
return 0;
|
|
80
|
-
}, "packageCleanTypescript");
|
|
81
|
-
|
|
82
|
-
// src/actions/package/clean.ts
|
|
83
|
-
var packageClean = /* @__PURE__ */ __name(async () => {
|
|
84
|
-
return (await Promise.all([
|
|
85
|
-
packageCleanOutputs(),
|
|
86
|
-
packageCleanTypescript()
|
|
87
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
88
|
-
}, "packageClean");
|
|
89
|
-
|
|
90
|
-
// src/actions/package/compile/compile.ts
|
|
91
|
-
var import_chalk8 = __toESM(require("chalk"), 1);
|
|
92
|
-
|
|
93
|
-
// src/lib/checkResult.ts
|
|
94
|
-
var import_chalk3 = __toESM(require("chalk"), 1);
|
|
95
|
-
var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
|
|
96
|
-
if (result) {
|
|
97
|
-
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
98
|
-
const chalkFunc = level === "error" ? import_chalk3.default.red : import_chalk3.default.yellow;
|
|
99
|
-
console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
|
|
100
|
-
if (exitOnFail) {
|
|
101
|
-
process.exit(result);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}, "checkResult");
|
|
105
|
-
|
|
106
|
-
// src/lib/loadConfig.ts
|
|
107
|
-
var import_chalk4 = __toESM(require("chalk"), 1);
|
|
108
|
-
var import_cosmiconfig = require("cosmiconfig");
|
|
109
|
-
var import_merge = __toESM(require("lodash/merge.js"), 1);
|
|
110
|
-
var config;
|
|
111
|
-
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
112
|
-
if (config) {
|
|
113
|
-
return (0, import_merge.default)({}, config, params);
|
|
114
|
-
}
|
|
115
|
-
const cosmicConfigResult = await (0, import_cosmiconfig.cosmiconfig)("xy", {
|
|
116
|
-
cache: true
|
|
117
|
-
}).search();
|
|
118
|
-
config = cosmicConfigResult?.config;
|
|
119
|
-
const configFilePath = cosmicConfigResult?.filepath;
|
|
120
|
-
if (configFilePath) {
|
|
121
|
-
console.log(import_chalk4.default.gray(`Loading config from ${configFilePath}`));
|
|
122
|
-
}
|
|
123
|
-
return (0, import_merge.default)({}, config, params);
|
|
124
|
-
}, "loadConfig");
|
|
125
|
-
|
|
126
|
-
// src/actions/package/publint.ts
|
|
127
|
-
var import_node_fs = require("fs");
|
|
128
|
-
var import_chalk5 = __toESM(require("chalk"), 1);
|
|
129
|
-
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
130
|
-
const pkgDir = process.env.INIT_CWD;
|
|
131
|
-
const pkg = JSON.parse(await import_node_fs.promises.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
132
|
-
console.log(import_chalk5.default.green(`Publint: ${pkg.name}`));
|
|
133
|
-
console.log(import_chalk5.default.gray(pkgDir));
|
|
134
|
-
const { publint } = await import("publint");
|
|
135
|
-
const { messages } = await publint({
|
|
136
|
-
level: "suggestion",
|
|
137
|
-
pkgDir,
|
|
138
|
-
strict: true
|
|
139
|
-
});
|
|
140
|
-
const { formatMessage } = await import("publint/utils");
|
|
141
|
-
const validMessage = /* @__PURE__ */ __name((_message) => {
|
|
142
|
-
return true;
|
|
143
|
-
}, "validMessage");
|
|
144
|
-
const validMessages = messages.filter(validMessage);
|
|
145
|
-
for (const message of validMessages) {
|
|
146
|
-
switch (message.type) {
|
|
147
|
-
case "error": {
|
|
148
|
-
console.error(import_chalk5.default.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
case "warning": {
|
|
152
|
-
console.warn(import_chalk5.default.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
default: {
|
|
156
|
-
console.log(import_chalk5.default.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (params?.verbose) {
|
|
162
|
-
console.log(import_chalk5.default.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
163
|
-
}
|
|
164
|
-
return validMessages.filter((message) => message.type === "error").length;
|
|
165
|
-
}, "packagePublint");
|
|
166
|
-
|
|
167
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
168
|
-
var import_node_process = require("process");
|
|
169
|
-
var import_chalk6 = __toESM(require("chalk"), 1);
|
|
170
|
-
var import_tsc_prog = require("tsc-prog");
|
|
171
|
-
var import_typescript2 = require("typescript");
|
|
172
|
-
|
|
173
|
-
// src/actions/package/compile/getCompilerOptions.ts
|
|
174
|
-
var import_node_module = require("module");
|
|
175
|
-
var import_merge2 = __toESM(require("lodash/merge.js"), 1);
|
|
176
|
-
var import_typescript = require("typescript");
|
|
177
|
-
var import_meta = {};
|
|
178
|
-
var getNested = /* @__PURE__ */ __name((config2) => {
|
|
179
|
-
if (config2.extends) {
|
|
180
|
-
const require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
181
|
-
const opts = require2(config2.extends);
|
|
182
|
-
return {
|
|
183
|
-
...getNested(opts),
|
|
184
|
-
...config2.compilerOptions
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
return config2.compilerOptions;
|
|
188
|
-
}, "getNested");
|
|
189
|
-
var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename) => {
|
|
190
|
-
const config2 = (0, import_typescript.readConfigFile)(filename, import_typescript.sys.readFile).config;
|
|
191
|
-
return getNested(config2);
|
|
192
|
-
}, "getCompilerOptionsJSONFollowExtends");
|
|
193
|
-
var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.json") => {
|
|
194
|
-
const configFileName = (0, import_typescript.findConfigFile)("./", import_typescript.sys.fileExists, tsconfig);
|
|
195
|
-
const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
|
|
196
|
-
return (0, import_merge2.default)({}, configFileCompilerOptions, options);
|
|
197
|
-
}, "getCompilerOptions");
|
|
198
|
-
|
|
199
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
200
|
-
var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
|
|
201
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process.cwd)();
|
|
202
|
-
const publint = config2?.publint ?? true;
|
|
203
|
-
const verbose = config2?.verbose ?? false;
|
|
204
|
-
const formatHost = {
|
|
205
|
-
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
206
|
-
getCurrentDirectory: /* @__PURE__ */ __name(() => pkg, "getCurrentDirectory"),
|
|
207
|
-
getNewLine: /* @__PURE__ */ __name(() => "\n", "getNewLine")
|
|
208
|
-
};
|
|
209
|
-
if (verbose) {
|
|
210
|
-
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
211
|
-
}
|
|
212
|
-
const compilerOptions = {
|
|
213
|
-
...await getCompilerOptions({
|
|
214
|
-
outDir: "dist",
|
|
215
|
-
removeComments: true,
|
|
216
|
-
rootDir: "src"
|
|
217
|
-
}),
|
|
218
|
-
...compilerOptionsParam,
|
|
219
|
-
...noEmit === void 0 ? {} : {
|
|
220
|
-
noEmit
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const program = (0, import_tsc_prog.createProgramFromConfig)({
|
|
224
|
-
basePath: pkg ?? (0, import_node_process.cwd)(),
|
|
225
|
-
compilerOptions,
|
|
226
|
-
exclude: [
|
|
227
|
-
"dist",
|
|
228
|
-
"docs",
|
|
229
|
-
"**/*.spec.*",
|
|
230
|
-
"**/*.stories.*",
|
|
231
|
-
"src/**/spec/**/*"
|
|
232
|
-
],
|
|
233
|
-
include: [
|
|
234
|
-
"src"
|
|
235
|
-
]
|
|
236
|
-
});
|
|
237
|
-
const results = (0, import_typescript2.getPreEmitDiagnostics)(program);
|
|
238
|
-
for (const diag of results) {
|
|
239
|
-
const lineAndChar = diag.file ? (0, import_typescript2.getLineAndCharacterOfPosition)(diag.file, diag.start ?? 0) : {
|
|
240
|
-
character: 0,
|
|
241
|
-
line: 0
|
|
242
|
-
};
|
|
243
|
-
console.log(import_chalk6.default.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
244
|
-
console.log((0, import_typescript2.formatDiagnosticsWithColorAndContext)([
|
|
245
|
-
diag
|
|
246
|
-
], formatHost));
|
|
247
|
-
}
|
|
248
|
-
return results.reduce((prev, diag) => prev + diag.category === import_typescript2.DiagnosticCategory.Error ? 1 : 0, 0) || (publint ? await packagePublint() : 0);
|
|
249
|
-
}, "packageCompileTsc");
|
|
250
|
-
|
|
251
|
-
// src/actions/package/compile/packageCompileTsup.ts
|
|
252
|
-
var import_merge3 = __toESM(require("lodash/merge.js"), 1);
|
|
253
|
-
var import_tsup = require("tsup");
|
|
254
|
-
|
|
255
|
-
// src/actions/package/compile/inputs.ts
|
|
256
|
-
var import_promises = require("fs/promises");
|
|
257
|
-
var import_glob = require("glob");
|
|
258
|
-
var getAllInputs2 = /* @__PURE__ */ __name((folder) => {
|
|
259
|
-
return import_glob.glob.sync(`${folder}/**/*.*`, {
|
|
260
|
-
ignore: [
|
|
261
|
-
"**/*.spec.*",
|
|
262
|
-
"**/*.stories.*",
|
|
263
|
-
"**/spec/**/*"
|
|
264
|
-
],
|
|
265
|
-
posix: true
|
|
266
|
-
});
|
|
267
|
-
}, "getAllInputs2");
|
|
268
|
-
|
|
269
|
-
// src/actions/package/compile/buildEntries.ts
|
|
270
|
-
var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) => {
|
|
271
|
-
switch (entryMode) {
|
|
272
|
-
case "platform": {
|
|
273
|
-
if (verbose) console.log("buildEntries [platform]");
|
|
274
|
-
return [
|
|
275
|
-
`${folder}/index-node.ts`,
|
|
276
|
-
`${folder}/index-browser.ts`
|
|
277
|
-
];
|
|
278
|
-
}
|
|
279
|
-
case "all": {
|
|
280
|
-
if (verbose) console.log("buildEntries [all]");
|
|
281
|
-
return getAllInputs2(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".story."));
|
|
282
|
-
}
|
|
283
|
-
default: {
|
|
284
|
-
if (verbose) console.log("buildEntries [single]");
|
|
285
|
-
return [
|
|
286
|
-
`${folder}/index.ts`
|
|
287
|
-
];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}, "buildEntries");
|
|
291
|
-
|
|
292
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
293
|
-
var import_node_process2 = require("process");
|
|
294
|
-
var import_chalk7 = __toESM(require("chalk"), 1);
|
|
295
|
-
var import_tsc_prog2 = require("tsc-prog");
|
|
296
|
-
var import_typescript3 = require("typescript");
|
|
297
|
-
|
|
298
|
-
// src/actions/package/compile/copyTypeFiles.ts
|
|
299
|
-
var import_promises2 = require("fs/promises");
|
|
300
|
-
var import_async_mutex = require("async-mutex");
|
|
301
|
-
var copyFileMutex = new import_async_mutex.Mutex();
|
|
302
|
-
var getDistTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
303
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
304
|
-
return (await (0, import_promises2.readdir)(outDir, {
|
|
305
|
-
recursive: true
|
|
306
|
-
})).filter((file) => file.endsWith("d.ts")).map((file) => `${outDir}/${file}`);
|
|
307
|
-
}, "getDistTypeFiles");
|
|
308
|
-
var getDistTypeMapFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
309
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
310
|
-
return (await (0, import_promises2.readdir)(outDir, {
|
|
311
|
-
recursive: true
|
|
312
|
-
})).filter((file) => file.endsWith("d.ts.map")).map((file) => `${outDir}/${file}`);
|
|
313
|
-
}, "getDistTypeMapFiles");
|
|
314
|
-
var copyTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
315
|
-
await copyFileMutex.runExclusive(async () => {
|
|
316
|
-
const distTypeFiles = await getDistTypeFiles(compilerOptions);
|
|
317
|
-
await Promise.all(distTypeFiles.map(async (file) => {
|
|
318
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts", "d.mts"));
|
|
319
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts", "d.cts"));
|
|
320
|
-
}));
|
|
321
|
-
const distTypeMapFiles = await getDistTypeMapFiles(compilerOptions);
|
|
322
|
-
await Promise.all(distTypeMapFiles.map(async (file) => {
|
|
323
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts.map", "d.mts.map"));
|
|
324
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts.map", "d.cts.map"));
|
|
325
|
-
}));
|
|
326
|
-
});
|
|
327
|
-
}, "copyTypeFiles");
|
|
328
|
-
|
|
329
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
330
|
-
var packageCompileTscTypes = /* @__PURE__ */ __name(async (folder = "src", { verbose } = {}, compilerOptionsParam, generateMts = true) => {
|
|
331
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process2.cwd)();
|
|
332
|
-
if (verbose) {
|
|
333
|
-
console.log(`Compiling types with TSC [${pkg}]`);
|
|
334
|
-
}
|
|
335
|
-
const compilerOptions = {
|
|
336
|
-
...await getCompilerOptions({
|
|
337
|
-
declaration: true,
|
|
338
|
-
emitDeclarationOnly: true,
|
|
339
|
-
outDir: "dist",
|
|
340
|
-
removeComments: true,
|
|
341
|
-
skipDefaultLibCheck: true,
|
|
342
|
-
skipLibCheck: true,
|
|
343
|
-
sourceMap: true
|
|
344
|
-
}),
|
|
345
|
-
...compilerOptionsParam
|
|
346
|
-
};
|
|
347
|
-
const files = buildEntries(folder, "all");
|
|
348
|
-
const result = (0, import_tsc_prog2.createProgramFromConfig)({
|
|
349
|
-
basePath: pkg ?? (0, import_node_process2.cwd)(),
|
|
350
|
-
compilerOptions,
|
|
351
|
-
exclude: [
|
|
352
|
-
"dist",
|
|
353
|
-
"docs",
|
|
354
|
-
"**/*.spec.*",
|
|
355
|
-
"**/*.stories.*",
|
|
356
|
-
"src/**/spec/**/*"
|
|
357
|
-
],
|
|
358
|
-
files
|
|
359
|
-
}).emit();
|
|
360
|
-
const diagResults = result.diagnostics.length;
|
|
361
|
-
for (const diag of result.diagnostics) {
|
|
362
|
-
switch (diag.category) {
|
|
363
|
-
case import_typescript3.DiagnosticCategory.Error: {
|
|
364
|
-
console.error(import_chalk7.default.red(diag.messageText));
|
|
365
|
-
console.error(import_chalk7.default.grey(pkg));
|
|
366
|
-
console.error(import_chalk7.default.blue(diag.file?.fileName));
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
case import_typescript3.DiagnosticCategory.Warning: {
|
|
370
|
-
console.error(import_chalk7.default.yellow(diag.messageText));
|
|
371
|
-
console.error(import_chalk7.default.grey(pkg));
|
|
372
|
-
console.error(import_chalk7.default.blue(diag.file?.fileName));
|
|
373
|
-
break;
|
|
374
|
-
}
|
|
375
|
-
case import_typescript3.DiagnosticCategory.Suggestion: {
|
|
376
|
-
console.error(import_chalk7.default.white(diag.messageText));
|
|
377
|
-
console.error(import_chalk7.default.grey(pkg));
|
|
378
|
-
console.error(import_chalk7.default.blue(diag.file?.fileName));
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
if (generateMts) {
|
|
384
|
-
await copyTypeFiles(compilerOptions);
|
|
385
|
-
}
|
|
386
|
-
return diagResults;
|
|
387
|
-
}, "packageCompileTscTypes");
|
|
388
|
-
|
|
389
|
-
// src/actions/package/compile/packageCompileTsup.ts
|
|
390
|
-
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
|
|
391
|
-
const outDir = options?.outDir ?? "dist";
|
|
392
|
-
const entry = buildEntries(folder, entryMode);
|
|
393
|
-
const optionsResult = (0, import_tsup.defineConfig)({
|
|
394
|
-
bundle: true,
|
|
395
|
-
cjsInterop: true,
|
|
396
|
-
clean: true,
|
|
397
|
-
dts: false,
|
|
398
|
-
entry,
|
|
399
|
-
format: [
|
|
400
|
-
"cjs",
|
|
401
|
-
"esm"
|
|
402
|
-
],
|
|
403
|
-
// minify: true,
|
|
404
|
-
outDir,
|
|
405
|
-
silent: true,
|
|
406
|
-
sourcemap: true,
|
|
407
|
-
splitting: false,
|
|
408
|
-
// terserOptions: { format: { comments: false } },
|
|
409
|
-
tsconfig: "tsconfig.json",
|
|
410
|
-
...options
|
|
411
|
-
});
|
|
412
|
-
const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
|
|
413
|
-
optionsResult
|
|
414
|
-
]).flatMap(async (options2) => {
|
|
415
|
-
const result = typeof options2 === "function" ? await options2({}) : [
|
|
416
|
-
options2
|
|
417
|
-
];
|
|
418
|
-
return Array.isArray(result) ? result : [
|
|
419
|
-
result
|
|
420
|
-
];
|
|
421
|
-
}))).flat();
|
|
422
|
-
await Promise.all(optionsList.map((options2) => (0, import_tsup.build)(options2)));
|
|
423
|
-
await packageCompileTscTypes(folder, {
|
|
424
|
-
verbose
|
|
425
|
-
}, {
|
|
426
|
-
outDir
|
|
427
|
-
});
|
|
428
|
-
return 0;
|
|
429
|
-
}, "compileFolder");
|
|
430
|
-
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
431
|
-
const compile = config2?.compile;
|
|
432
|
-
const publint = config2?.publint ?? true;
|
|
433
|
-
const verbose = config2?.verbose ?? false;
|
|
434
|
-
if (verbose) {
|
|
435
|
-
console.log(`Compiling with TSUP [Depth: ${compile?.depth}]`);
|
|
436
|
-
}
|
|
437
|
-
const compileForNode = compile?.node ?? {
|
|
438
|
-
src: {}
|
|
439
|
-
};
|
|
440
|
-
const compileForBrowser = compile?.browser ?? {
|
|
441
|
-
src: {}
|
|
442
|
-
};
|
|
443
|
-
const compileForNeutral = compile?.neutral ?? {
|
|
444
|
-
src: {}
|
|
445
|
-
};
|
|
446
|
-
return await packageCompileTsc(true, {
|
|
447
|
-
publint: false,
|
|
448
|
-
verbose
|
|
449
|
-
}) || (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
450
|
-
const inEsBuildOptions = typeof compile?.node?.esbuildOptions === "object" ? compile?.node?.esbuildOptions : {};
|
|
451
|
-
return folder ? await compileFolder(folder, compile?.entryMode, {
|
|
452
|
-
bundle: true,
|
|
453
|
-
format: [
|
|
454
|
-
"cjs",
|
|
455
|
-
"esm"
|
|
456
|
-
],
|
|
457
|
-
loader: (0, import_merge3.default)({}, {
|
|
458
|
-
".gif": "copy",
|
|
459
|
-
".html": "copy",
|
|
460
|
-
".jpg": "copy",
|
|
461
|
-
".json": "json",
|
|
462
|
-
".png": "copy",
|
|
463
|
-
".svg": "copy",
|
|
464
|
-
".webp": "copy"
|
|
465
|
-
}, inEsBuildOptions?.loader),
|
|
466
|
-
// minify: true,
|
|
467
|
-
outDir: "dist/node",
|
|
468
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
469
|
-
js: ".mjs"
|
|
470
|
-
} : {
|
|
471
|
-
js: ".cjs"
|
|
472
|
-
}, "outExtension"),
|
|
473
|
-
platform: "node",
|
|
474
|
-
skipNodeModulesBundle: true,
|
|
475
|
-
sourcemap: true,
|
|
476
|
-
target: "node16",
|
|
477
|
-
// terserOptions: { format: { comments: false } },
|
|
478
|
-
...compile?.tsup?.options,
|
|
479
|
-
...typeof options === "object" ? options : {}
|
|
480
|
-
}, verbose) : 0;
|
|
481
|
-
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
482
|
-
const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === "object" ? compile?.browser?.esbuildOptions : {};
|
|
483
|
-
return folder ? (await Promise.all([
|
|
484
|
-
compileFolder(folder, compile?.entryMode, {
|
|
485
|
-
bundle: true,
|
|
486
|
-
format: [
|
|
487
|
-
"cjs"
|
|
488
|
-
],
|
|
489
|
-
loader: (0, import_merge3.default)({}, {
|
|
490
|
-
".gif": "copy",
|
|
491
|
-
".html": "copy",
|
|
492
|
-
".jpg": "copy",
|
|
493
|
-
".json": "json",
|
|
494
|
-
".png": "copy",
|
|
495
|
-
".svg": "copy",
|
|
496
|
-
".webp": "copy"
|
|
497
|
-
}, inEsBuildOptions?.loader),
|
|
498
|
-
// minify: true,
|
|
499
|
-
outDir: "dist/browser",
|
|
500
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
501
|
-
js: ".mjs"
|
|
502
|
-
} : {
|
|
503
|
-
js: ".cjs"
|
|
504
|
-
}, "outExtension"),
|
|
505
|
-
platform: "browser",
|
|
506
|
-
skipNodeModulesBundle: true,
|
|
507
|
-
sourcemap: true,
|
|
508
|
-
target: "esnext",
|
|
509
|
-
// terserOptions: { format: { comments: false } },
|
|
510
|
-
...compile?.tsup?.options,
|
|
511
|
-
...typeof options === "object" ? options : {}
|
|
512
|
-
}, verbose),
|
|
513
|
-
compileFolder(folder, compile?.entryMode, {
|
|
514
|
-
bundle: true,
|
|
515
|
-
format: [
|
|
516
|
-
"esm"
|
|
517
|
-
],
|
|
518
|
-
loader: (0, import_merge3.default)({}, {
|
|
519
|
-
".gif": "copy",
|
|
520
|
-
".html": "copy",
|
|
521
|
-
".jpg": "copy",
|
|
522
|
-
".json": "json",
|
|
523
|
-
".png": "copy",
|
|
524
|
-
".svg": "copy",
|
|
525
|
-
".webp": "copy"
|
|
526
|
-
}, inEsBuildOptions?.loader),
|
|
527
|
-
// minify: true,
|
|
528
|
-
outDir: "dist/browser",
|
|
529
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
530
|
-
js: ".mjs"
|
|
531
|
-
} : {
|
|
532
|
-
js: ".cjs"
|
|
533
|
-
}, "outExtension"),
|
|
534
|
-
platform: "browser",
|
|
535
|
-
skipNodeModulesBundle: true,
|
|
536
|
-
sourcemap: true,
|
|
537
|
-
target: "esnext",
|
|
538
|
-
// terserOptions: { format: { comments: false } },
|
|
539
|
-
...compile?.tsup?.options,
|
|
540
|
-
...typeof options === "object" ? options : {}
|
|
541
|
-
}, verbose)
|
|
542
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
543
|
-
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
544
|
-
const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === "object" ? compile?.neutral?.esbuildOptions : {};
|
|
545
|
-
return folder ? (await Promise.all([
|
|
546
|
-
compileFolder(folder, compile?.entryMode, {
|
|
547
|
-
bundle: true,
|
|
548
|
-
format: [
|
|
549
|
-
"cjs"
|
|
550
|
-
],
|
|
551
|
-
loader: (0, import_merge3.default)({}, {
|
|
552
|
-
".gif": "copy",
|
|
553
|
-
".html": "copy",
|
|
554
|
-
".jpg": "copy",
|
|
555
|
-
".json": "json",
|
|
556
|
-
".png": "copy",
|
|
557
|
-
".svg": "copy",
|
|
558
|
-
".webp": "copy"
|
|
559
|
-
}, inEsBuildOptions?.loader),
|
|
560
|
-
// minify: true,
|
|
561
|
-
outDir: "dist/neutral",
|
|
562
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
563
|
-
js: ".mjs"
|
|
564
|
-
} : {
|
|
565
|
-
js: ".cjs"
|
|
566
|
-
}, "outExtension"),
|
|
567
|
-
platform: "neutral",
|
|
568
|
-
skipNodeModulesBundle: true,
|
|
569
|
-
sourcemap: true,
|
|
570
|
-
target: "esnext",
|
|
571
|
-
// terserOptions: { format: { comments: false } },
|
|
572
|
-
...compile?.tsup?.options,
|
|
573
|
-
...typeof options === "object" ? options : {}
|
|
574
|
-
}, verbose),
|
|
575
|
-
compileFolder(folder, compile?.entryMode, {
|
|
576
|
-
bundle: true,
|
|
577
|
-
format: [
|
|
578
|
-
"esm"
|
|
579
|
-
],
|
|
580
|
-
loader: (0, import_merge3.default)({}, {
|
|
581
|
-
".gif": "copy",
|
|
582
|
-
".html": "copy",
|
|
583
|
-
".jpg": "copy",
|
|
584
|
-
".json": "json",
|
|
585
|
-
".png": "copy",
|
|
586
|
-
".svg": "copy",
|
|
587
|
-
".webp": "copy"
|
|
588
|
-
}, inEsBuildOptions?.loader),
|
|
589
|
-
// minify: true,
|
|
590
|
-
outDir: "dist/neutral",
|
|
591
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
592
|
-
js: ".mjs"
|
|
593
|
-
} : {
|
|
594
|
-
js: ".cjs"
|
|
595
|
-
}, "outExtension"),
|
|
596
|
-
platform: "neutral",
|
|
597
|
-
skipNodeModulesBundle: true,
|
|
598
|
-
sourcemap: true,
|
|
599
|
-
target: "esnext",
|
|
600
|
-
// terserOptions: { format: { comments: false } },
|
|
601
|
-
...compile?.tsup?.options,
|
|
602
|
-
...typeof options === "object" ? options : {}
|
|
603
|
-
}, verbose)
|
|
604
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
605
|
-
}))).reduce((prev, value) => prev + value, 0) || (publint ? await packagePublint() : 0);
|
|
606
|
-
}, "packageCompileTsup");
|
|
607
|
-
|
|
608
|
-
// src/actions/package/compile/compile.ts
|
|
609
|
-
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
610
|
-
const pkg = process.env.INIT_CWD;
|
|
611
|
-
console.log(import_chalk8.default.green(`Compiling ${pkg}`));
|
|
612
|
-
const config2 = await loadConfig(inConfig);
|
|
613
|
-
const publint = config2.publint;
|
|
614
|
-
const mode = config2.compile?.mode ?? "tsup";
|
|
615
|
-
let result = 0;
|
|
616
|
-
switch (mode) {
|
|
617
|
-
case "tsc": {
|
|
618
|
-
result += await packageCompileTsc(void 0, config2);
|
|
619
|
-
break;
|
|
620
|
-
}
|
|
621
|
-
case "tsup": {
|
|
622
|
-
result += await packageCompileTsup(config2);
|
|
623
|
-
break;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
return result + (publint ? await packagePublint(config2) : 0);
|
|
627
|
-
}, "packageCompile");
|
|
628
|
-
|
|
629
|
-
// src/actions/package/copy-assets.ts
|
|
630
|
-
var import_posix = __toESM(require("path/posix"), 1);
|
|
631
|
-
var import_chalk9 = __toESM(require("chalk"), 1);
|
|
632
|
-
var import_cpy = __toESM(require("cpy"), 1);
|
|
633
|
-
var copyTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
634
|
-
try {
|
|
635
|
-
const values = await (0, import_cpy.default)([
|
|
636
|
-
"**/*.jpg",
|
|
637
|
-
"**/*.png",
|
|
638
|
-
"**/*.gif",
|
|
639
|
-
"**/*.svg",
|
|
640
|
-
"**/*.webp",
|
|
641
|
-
"**/*.sass",
|
|
642
|
-
"**/*.scss",
|
|
643
|
-
"**/*.gif",
|
|
644
|
-
"**/*.css"
|
|
645
|
-
], `../dist/${target}`, {
|
|
646
|
-
cwd: import_posix.default.join(location, "src"),
|
|
647
|
-
flat: false
|
|
648
|
-
});
|
|
649
|
-
if (values.length > 0) {
|
|
650
|
-
console.log(import_chalk9.default.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
651
|
-
}
|
|
652
|
-
for (const value of values) {
|
|
653
|
-
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
654
|
-
}
|
|
655
|
-
return 0;
|
|
656
|
-
} catch (ex) {
|
|
657
|
-
const error = ex;
|
|
658
|
-
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
659
|
-
return 1;
|
|
660
|
-
}
|
|
661
|
-
}, "copyTargetAssets");
|
|
662
|
-
var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
663
|
-
const pkg = process.env.INIT_CWD ?? "./";
|
|
664
|
-
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
665
|
-
switch (target) {
|
|
666
|
-
case "esm": {
|
|
667
|
-
return await copyTargetAssets("esm", pkgName, pkg);
|
|
668
|
-
}
|
|
669
|
-
case "cjs": {
|
|
670
|
-
return await copyTargetAssets("cjs", pkgName, pkg);
|
|
671
|
-
}
|
|
672
|
-
default: {
|
|
673
|
-
return await copyTargetAssets("esm", pkgName, pkg) || await copyTargetAssets("cjs", pkgName, pkg);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}, "packageCopyAssets");
|
|
677
|
-
|
|
678
|
-
// src/actions/package/deps.ts
|
|
679
|
-
var import_node_fs2 = require("fs");
|
|
680
|
-
var import_node_process3 = require("process");
|
|
681
|
-
var import_chalk10 = __toESM(require("chalk"), 1);
|
|
682
|
-
var import_depcheck = __toESM(require("depcheck"), 1);
|
|
683
|
-
var special = import_depcheck.default.special;
|
|
684
|
-
var defaultIgnorePatterns = [
|
|
685
|
-
"*.d.ts",
|
|
686
|
-
"dist",
|
|
687
|
-
".*",
|
|
688
|
-
"node_modules"
|
|
689
|
-
];
|
|
690
|
-
var defaultIgnoreDevDeps = [
|
|
691
|
-
"@xylabs/ts-scripts-yarn3",
|
|
692
|
-
"@xylabs/tsconfig",
|
|
693
|
-
"@xylabs/tsconfig-dom",
|
|
694
|
-
"@xylabs/tsconfig-react",
|
|
695
|
-
"@xylabs/tsconfig-jest",
|
|
696
|
-
"typescript"
|
|
697
|
-
];
|
|
698
|
-
var defaultIgnoreDevPatterns = [
|
|
699
|
-
"*.stories.*",
|
|
700
|
-
"*.spec.*",
|
|
701
|
-
"spec",
|
|
702
|
-
"stories",
|
|
703
|
-
"tsconfig.json"
|
|
704
|
-
];
|
|
705
|
-
var reportUnused = /* @__PURE__ */ __name((name, unused) => {
|
|
706
|
-
if (unused.length > 0) {
|
|
707
|
-
const message = [
|
|
708
|
-
import_chalk10.default.yellow(`${unused.length} Unused ${name}`)
|
|
709
|
-
];
|
|
710
|
-
for (const value of unused) message.push(import_chalk10.default.gray(` ${value}`));
|
|
711
|
-
console.log(message.join("\n"));
|
|
712
|
-
}
|
|
713
|
-
}, "reportUnused");
|
|
714
|
-
var reportMissing = /* @__PURE__ */ __name((name, missing) => {
|
|
715
|
-
if (Object.keys(missing).length > 0) {
|
|
716
|
-
const message = [
|
|
717
|
-
import_chalk10.default.yellow(`${Object.entries(missing).length} Missing ${name}`)
|
|
718
|
-
];
|
|
719
|
-
for (const [key, value] of Object.entries(missing)) {
|
|
720
|
-
message.push(`${key}`, import_chalk10.default.gray(` ${value.at(0)}`));
|
|
721
|
-
}
|
|
722
|
-
console.log(import_chalk10.default.yellow(message.join("\n")));
|
|
723
|
-
}
|
|
724
|
-
}, "reportMissing");
|
|
725
|
-
var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
726
|
-
const packageContent = (0, import_node_fs2.existsSync)(`${pkg}/package.json`) ? JSON.parse((0, import_node_fs2.readFileSync)(`${pkg}/package.json`, {
|
|
727
|
-
encoding: "utf8"
|
|
728
|
-
})) : void 0;
|
|
729
|
-
const [srcUnused, allUnused] = await Promise.all([
|
|
730
|
-
(0, import_depcheck.default)(`${pkg}/src`, {
|
|
731
|
-
ignoreMatches,
|
|
732
|
-
ignorePatterns: [
|
|
733
|
-
...defaultIgnoreDevPatterns,
|
|
734
|
-
...defaultIgnorePatterns
|
|
735
|
-
],
|
|
736
|
-
package: packageContent
|
|
737
|
-
}),
|
|
738
|
-
(0, import_depcheck.default)(`${pkg}/.`, {
|
|
739
|
-
ignoreMatches: [
|
|
740
|
-
...ignoreMatches,
|
|
741
|
-
...defaultIgnoreDevDeps
|
|
742
|
-
],
|
|
743
|
-
ignorePatterns: [
|
|
744
|
-
...defaultIgnorePatterns
|
|
745
|
-
],
|
|
746
|
-
package: packageContent,
|
|
747
|
-
specials: [
|
|
748
|
-
special.eslint,
|
|
749
|
-
special.babel,
|
|
750
|
-
special.bin,
|
|
751
|
-
special.prettier,
|
|
752
|
-
special.jest,
|
|
753
|
-
special.mocha
|
|
754
|
-
]
|
|
755
|
-
})
|
|
756
|
-
]);
|
|
757
|
-
const unusedDeps = srcUnused.dependencies;
|
|
758
|
-
const unusedDevDeps = allUnused.devDependencies;
|
|
759
|
-
const usedDeps = srcUnused.using;
|
|
760
|
-
const usedDevDeps = allUnused.using;
|
|
761
|
-
const missing = {
|
|
762
|
-
...srcUnused.missing,
|
|
763
|
-
...allUnused.missing
|
|
764
|
-
};
|
|
765
|
-
const { invalidDirs, invalidFiles } = allUnused;
|
|
766
|
-
return {
|
|
767
|
-
invalidDirs,
|
|
768
|
-
invalidFiles,
|
|
769
|
-
missing,
|
|
770
|
-
unusedDeps,
|
|
771
|
-
unusedDevDeps,
|
|
772
|
-
usedDeps,
|
|
773
|
-
usedDevDeps
|
|
774
|
-
};
|
|
775
|
-
}, "analyzeDeps");
|
|
776
|
-
var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
777
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process3.cwd)();
|
|
778
|
-
const pkgName = process.env.npm_package_name;
|
|
779
|
-
const packageContent = (0, import_node_fs2.existsSync)(`${pkg}/package.json`) ? JSON.parse((0, import_node_fs2.readFileSync)(`${pkg}/package.json`, {
|
|
780
|
-
encoding: "utf8"
|
|
781
|
-
})) : void 0;
|
|
782
|
-
const rawIgnore = (0, import_node_fs2.existsSync)(`${pkg}/.depcheckrc`) ? (0, import_node_fs2.readFileSync)(`${pkg}/.depcheckrc`, {
|
|
783
|
-
encoding: "utf8"
|
|
784
|
-
}).replace("ignores:", '"ignores":') : void 0;
|
|
785
|
-
let ignoreMatches = [];
|
|
786
|
-
try {
|
|
787
|
-
ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
|
|
788
|
-
} catch (ex) {
|
|
789
|
-
const error = ex;
|
|
790
|
-
console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
|
|
791
|
-
}
|
|
792
|
-
const { invalidDirs, invalidFiles, unusedDeps, unusedDevDeps, usedDeps, usedDevDeps, missing } = await analyzeDeps(pkg, ignoreMatches);
|
|
793
|
-
const declaredDeps = Object.keys(packageContent.dependencies ?? {});
|
|
794
|
-
const declaredPeerDeps = Object.keys(packageContent.peerDependencies ?? {});
|
|
795
|
-
const declaredDevDeps = Object.keys(packageContent.devDependencies ?? {});
|
|
796
|
-
const missingDeps = Object.keys(usedDeps).filter((key) => !declaredDeps.includes(key) && !declaredPeerDeps.includes(key) && !key.startsWith("@types/"));
|
|
797
|
-
const missingDevDeps = Object.keys(usedDevDeps).filter((key) => !declaredDevDeps.includes(key) && !declaredDeps.includes(key));
|
|
798
|
-
const missingDepsObject = {};
|
|
799
|
-
for (const key of missingDeps) {
|
|
800
|
-
missingDepsObject[key] = missing[key] ?? [
|
|
801
|
-
`devDep should be dep [${key}]`
|
|
802
|
-
];
|
|
803
|
-
}
|
|
804
|
-
const missingDevDepsObject = {};
|
|
805
|
-
for (const key of missingDevDeps) {
|
|
806
|
-
if (missing[key]) {
|
|
807
|
-
missingDevDepsObject[key] = missing[key];
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
const errorCounts = [
|
|
811
|
-
unusedDeps.length,
|
|
812
|
-
unusedDevDeps.length,
|
|
813
|
-
Object.entries(invalidDirs).length,
|
|
814
|
-
Object.entries(invalidFiles).length,
|
|
815
|
-
Object.entries(missingDepsObject).length,
|
|
816
|
-
Object.entries(missingDevDepsObject).length
|
|
817
|
-
];
|
|
818
|
-
const errorCount = errorCounts.reduce((prev, count) => prev + count, 0);
|
|
819
|
-
if (errorCount > 0) {
|
|
820
|
-
console.log(`Deps [${pkgName}] = (${JSON.stringify(errorCounts)})`);
|
|
821
|
-
} else {
|
|
822
|
-
console.log(`Deps [${pkgName}] - Ok`);
|
|
823
|
-
}
|
|
824
|
-
reportUnused("dependencies", unusedDeps);
|
|
825
|
-
reportUnused("devDependencies", unusedDevDeps);
|
|
826
|
-
if (Object.entries(invalidDirs).length > 0) {
|
|
827
|
-
for (const [key, value] of Object.entries(invalidDirs)) console.warn(import_chalk10.default.gray(`Invalid Dir: ${key}: ${value}`));
|
|
828
|
-
}
|
|
829
|
-
if (Object.entries(invalidFiles).length > 0) {
|
|
830
|
-
for (const [key, value] of Object.entries(invalidFiles)) console.warn(import_chalk10.default.gray(`Invalid File: ${key}: ${value}`));
|
|
831
|
-
}
|
|
832
|
-
reportMissing("dependencies", missingDepsObject);
|
|
833
|
-
reportMissing("devDependencies", missingDevDepsObject);
|
|
834
|
-
checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
|
|
835
|
-
return 0;
|
|
836
|
-
}, "packageDeps");
|
|
837
|
-
|
|
838
|
-
// src/actions/package/gen-docs.ts
|
|
839
|
-
var import_node_fs3 = require("fs");
|
|
840
|
-
var import_node_path3 = __toESM(require("path"), 1);
|
|
841
|
-
var import_chalk11 = __toESM(require("chalk"), 1);
|
|
842
|
-
var import_typedoc = require("typedoc");
|
|
843
|
-
var ExitCodes = {
|
|
844
|
-
CompileError: 3,
|
|
845
|
-
ExceptionThrown: 6,
|
|
846
|
-
NoEntryPoints: 2,
|
|
847
|
-
Ok: 0,
|
|
848
|
-
OptionError: 1,
|
|
849
|
-
OutputError: 5,
|
|
850
|
-
ValidationError: 4
|
|
851
|
-
};
|
|
852
|
-
var packageGenDocs = /* @__PURE__ */ __name(async () => {
|
|
853
|
-
const pkg = process.env.INIT_CWD;
|
|
854
|
-
if (pkg && !(0, import_node_fs3.existsSync)(import_node_path3.default.join(pkg, "typedoc.json"))) {
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
const app = await import_typedoc.Application.bootstrap({
|
|
858
|
-
entryPointStrategy: "merge",
|
|
859
|
-
entryPoints: [
|
|
860
|
-
`${pkg}/src/**/*.ts`,
|
|
861
|
-
`${pkg}/packages/*/dist/docs.json`
|
|
862
|
-
],
|
|
863
|
-
excludeExternals: true,
|
|
864
|
-
json: `${pkg}/dist/docs.json`,
|
|
865
|
-
logLevel: "Error",
|
|
866
|
-
tsconfig: `${pkg}/tsconfig.json`
|
|
867
|
-
});
|
|
868
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(0));
|
|
869
|
-
app.options.addReader(new import_typedoc.TypeDocReader());
|
|
870
|
-
app.options.addReader(new import_typedoc.TSConfigReader());
|
|
871
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(300));
|
|
872
|
-
return await runTypeDoc(app);
|
|
873
|
-
}, "packageGenDocs");
|
|
874
|
-
var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
875
|
-
const pkgName = process.env.npm_package_name;
|
|
876
|
-
if (app.options.getValue("version")) {
|
|
877
|
-
console.log(app.toString());
|
|
878
|
-
return ExitCodes.Ok;
|
|
879
|
-
}
|
|
880
|
-
if (app.options.getValue("showConfig")) {
|
|
881
|
-
console.log(app.options.getRawValues());
|
|
882
|
-
return ExitCodes.Ok;
|
|
883
|
-
}
|
|
884
|
-
if (app.logger.hasErrors()) {
|
|
885
|
-
return ExitCodes.OptionError;
|
|
886
|
-
}
|
|
887
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
888
|
-
return ExitCodes.OptionError;
|
|
889
|
-
}
|
|
890
|
-
if (app.options.getValue("entryPoints").length === 0) {
|
|
891
|
-
app.logger.error("No entry points provided");
|
|
892
|
-
return ExitCodes.NoEntryPoints;
|
|
893
|
-
}
|
|
894
|
-
if (app.options.getValue("watch")) {
|
|
895
|
-
app.convertAndWatch(async (project2) => {
|
|
896
|
-
const out = app.options.getValue("out");
|
|
897
|
-
if (out) {
|
|
898
|
-
await app.generateDocs(project2, out);
|
|
899
|
-
}
|
|
900
|
-
const json = app.options.getValue("json");
|
|
901
|
-
if (json) {
|
|
902
|
-
await app.generateJson(project2, json);
|
|
903
|
-
}
|
|
904
|
-
if (!out && !json) {
|
|
905
|
-
await app.generateDocs(project2, "./docs");
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
return ExitCodes.Ok;
|
|
909
|
-
}
|
|
910
|
-
const project = await app.convert();
|
|
911
|
-
if (!project) {
|
|
912
|
-
return ExitCodes.CompileError;
|
|
913
|
-
}
|
|
914
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
915
|
-
return ExitCodes.CompileError;
|
|
916
|
-
}
|
|
917
|
-
app.validate(project);
|
|
918
|
-
if (app.logger.hasErrors()) {
|
|
919
|
-
return ExitCodes.ValidationError;
|
|
920
|
-
}
|
|
921
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
922
|
-
return ExitCodes.ValidationError;
|
|
923
|
-
}
|
|
924
|
-
if (app.options.getValue("emit") !== "none") {
|
|
925
|
-
const out = app.options.getValue("out");
|
|
926
|
-
if (out) {
|
|
927
|
-
await app.generateDocs(project, out);
|
|
928
|
-
}
|
|
929
|
-
const json = app.options.getValue("json");
|
|
930
|
-
if (json) {
|
|
931
|
-
await app.generateJson(project, json);
|
|
932
|
-
}
|
|
933
|
-
if (!out && !json) {
|
|
934
|
-
await app.generateDocs(project, "./docs");
|
|
935
|
-
}
|
|
936
|
-
if (app.logger.hasErrors()) {
|
|
937
|
-
return ExitCodes.OutputError;
|
|
938
|
-
}
|
|
939
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
940
|
-
return ExitCodes.OutputError;
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
console.log(import_chalk11.default.green(`${pkgName} - Ok`));
|
|
944
|
-
return ExitCodes.Ok;
|
|
945
|
-
}, "runTypeDoc");
|
|
946
|
-
|
|
947
|
-
// src/actions/package/recompile.ts
|
|
948
|
-
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
949
|
-
return (await Promise.all([
|
|
950
|
-
packageClean(),
|
|
951
|
-
packageCompile()
|
|
952
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
953
|
-
}, "packageRecompile");
|
|
954
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
955
|
-
0 && (module.exports = {
|
|
956
|
-
packageClean,
|
|
957
|
-
packageCleanOutputs,
|
|
958
|
-
packageCleanTypescript,
|
|
959
|
-
packageCompile,
|
|
960
|
-
packageCompileTsc,
|
|
961
|
-
packageCompileTsup,
|
|
962
|
-
packageCopyAssets,
|
|
963
|
-
packageDeps,
|
|
964
|
-
packageGenDocs,
|
|
965
|
-
packagePublint,
|
|
966
|
-
packageRecompile
|
|
967
|
-
});
|
|
968
|
-
//# sourceMappingURL=index.cjs.map
|