@storm-software/workspace-tools 1.279.3 → 1.281.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/CHANGELOG.md +46 -0
- package/README.md +2 -1
- package/dist/{chunk-MZEFNYBT.js → chunk-2FLQWXE5.js} +2 -2
- package/dist/{chunk-KRAHIMKO.js → chunk-2NF3YUV5.js} +2 -2
- package/dist/{chunk-KX7XTUYW.js → chunk-3NGWW4TI.js} +552 -249
- package/dist/{chunk-N46RWKEK.mjs → chunk-3ZRR5MT7.mjs} +2 -2
- package/dist/{chunk-63DISBXN.js → chunk-4S36VQAW.js} +2 -2
- package/dist/{chunk-5KP5KWGU.mjs → chunk-75U5BCHL.mjs} +1 -1
- package/dist/{chunk-RMWG74QA.mjs → chunk-7IJVTV2B.mjs} +2 -2
- package/dist/{chunk-CHSTJ3AR.js → chunk-7ZX63ESB.js} +7 -5
- package/dist/{chunk-JCEMECUD.mjs → chunk-BPG3OMCI.mjs} +1 -1
- package/dist/{chunk-PYS5P7QE.mjs → chunk-BVSY5RGQ.mjs} +552 -249
- package/dist/{chunk-DJLGYPRA.js → chunk-BWORIUPC.js} +2 -2
- package/dist/{chunk-JX3KVFO5.js → chunk-CH5FES5E.js} +2 -2
- package/dist/{chunk-UGBVA3KE.mjs → chunk-CKTQUYMO.mjs} +7 -5
- package/dist/{chunk-GNIDPNI3.mjs → chunk-EIG2GLLA.mjs} +1 -1
- package/dist/{chunk-UGJVZ6LI.js → chunk-G7Q436PD.js} +2 -2
- package/dist/{chunk-GWT4ZQ6Y.js → chunk-G7XAPBVN.js} +2 -2
- package/dist/{chunk-LVIDSVDC.mjs → chunk-HJHJTEFF.mjs} +1 -1
- package/dist/{chunk-V2UGPEY2.mjs → chunk-HOCWBZG4.mjs} +2 -2
- package/dist/{chunk-FVGLL54Y.mjs → chunk-HQD7CMHA.mjs} +2 -2
- package/dist/{chunk-5EK4H7VB.mjs → chunk-IPJSQ4JM.mjs} +1 -1
- package/dist/{chunk-47X3OTR5.mjs → chunk-JJKB5LJY.mjs} +1 -1
- package/dist/{chunk-64LWOWPE.mjs → chunk-JXUTCXYW.mjs} +1 -1
- package/dist/{chunk-2AZFAMT2.mjs → chunk-KNFTKCYF.mjs} +1 -1
- package/dist/{chunk-WASXXREW.mjs → chunk-MNHMPN5N.mjs} +1 -1
- package/dist/{chunk-ZVL2TRR6.js → chunk-N35Q2KYG.js} +2 -2
- package/dist/{chunk-YEUILWDR.js → chunk-RBIKWDFC.js} +2 -2
- package/dist/{chunk-CCMBHSV7.mjs → chunk-S6I7KEIX.mjs} +3 -3
- package/dist/{chunk-G3YKHGPE.js → chunk-SZGFK6EV.js} +2 -2
- package/dist/{chunk-ESFH6QVE.js → chunk-TARBFSCL.js} +2 -2
- package/dist/{chunk-5FBIPGPD.mjs → chunk-VLRI6BBL.mjs} +1 -1
- package/dist/{chunk-47VSL76K.mjs → chunk-VYBW3BAP.mjs} +1 -1
- package/dist/{chunk-UTAJHUJL.js → chunk-WMO5LTRB.js} +4 -4
- package/dist/{chunk-VR3OLKAI.js → chunk-XMZ6TDUE.js} +2 -2
- package/dist/{chunk-YBUD4GFC.js → chunk-Y7EP2VC4.js} +2 -2
- package/dist/{chunk-K7FEZWBA.mjs → chunk-Z6PFI3J5.mjs} +1 -1
- package/dist/{chunk-ARTBWDR4.js → chunk-Z7GL7LZ5.js} +2 -2
- package/dist/{chunk-AH253N44.js → chunk-ZPKT334B.js} +2 -2
- package/dist/{executor-DJb8r-Zb.d.mts → executor-BKX42Sw7.d.mts} +1 -1
- package/dist/{executor-BZYJEb9V.d.ts → executor-CkNxaoIY.d.ts} +1 -1
- package/dist/{executor-CUlX29YN.d.mts → executor-D3PNL4CV.d.mts} +1 -1
- package/dist/{executor-CysN0MTH.d.ts → executor-DPM2Z36c.d.ts} +1 -1
- package/dist/{executor-CwENKkEy.d.mts → executor-GBuel7B7.d.mts} +1 -1
- package/dist/{executor-Bez_tWxf.d.mts → executor-aDXEPVsT.d.mts} +1 -1
- package/dist/{executor-D3Tip-ad.d.ts → executor-foxQoOAn.d.ts} +1 -1
- package/dist/{executor-_WT0Qd2F.d.ts → executor-rXyqR2O7.d.ts} +1 -1
- package/dist/executors.d.mts +6 -5
- package/dist/executors.d.ts +6 -5
- package/dist/executors.js +12 -12
- package/dist/executors.mjs +12 -12
- package/dist/{generator-DpjPMueC.d.ts → generator-Atoj4M31.d.ts} +2 -2
- package/dist/{generator-Biz_Ai4B.d.ts → generator-B8wuX3dQ.d.ts} +1 -1
- package/dist/{generator-DKZjOzNw.d.mts → generator-BBL6R81T.d.mts} +2 -2
- package/dist/{generator-ujd2pu2I.d.ts → generator-BrHx51q7.d.ts} +2 -2
- package/dist/{generator-CYCzda2K.d.mts → generator-C89d9hiO.d.mts} +2 -2
- package/dist/{generator-D7tljo-K.d.mts → generator-CA85Rjt_.d.mts} +1 -1
- package/dist/{generator-CVPI52z3.d.mts → generator-Cl7VLDBp.d.mts} +2 -2
- package/dist/{generator-De9XOTip.d.mts → generator-DY4LnD3U.d.mts} +2 -2
- package/dist/{generator-o2v2Q4At.d.mts → generator-DuzhU6Nt.d.mts} +1 -1
- package/dist/{generator-Dyk2TjIp.d.ts → generator-Lo6Lesoa.d.ts} +1 -1
- package/dist/{generator-CmkSA-dv.d.ts → generator-ggEO-y1w.d.ts} +2 -2
- package/dist/{generator-Dk1ihwF-.d.ts → generator-l6HKZhyL.d.ts} +2 -2
- package/dist/generators.d.mts +9 -8
- package/dist/generators.d.ts +9 -8
- package/dist/generators.js +9 -9
- package/dist/generators.mjs +9 -9
- package/dist/index.d.mts +13 -12
- package/dist/index.d.ts +13 -12
- package/dist/index.js +19 -19
- package/dist/index.mjs +19 -19
- package/dist/src/base/base-executor.d.mts +3 -2
- package/dist/src/base/base-executor.d.ts +3 -2
- package/dist/src/base/base-executor.js +3 -3
- package/dist/src/base/base-executor.mjs +3 -3
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-generator.d.mts +3 -2
- package/dist/src/base/base-generator.d.ts +3 -2
- package/dist/src/base/base-generator.js +3 -3
- package/dist/src/base/base-generator.mjs +3 -3
- package/dist/src/base/base-generator.untyped.mjs +1 -1
- package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
- package/dist/src/base/index.d.mts +3 -2
- package/dist/src/base/index.d.ts +3 -2
- package/dist/src/base/index.js +4 -4
- package/dist/src/base/index.mjs +4 -4
- package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
- package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
- package/dist/src/executors/cargo-build/executor.js +4 -4
- package/dist/src/executors/cargo-build/executor.mjs +4 -4
- package/dist/src/executors/cargo-build/untyped.mjs +1 -1
- package/dist/src/executors/cargo-check/executor.js +4 -4
- package/dist/src/executors/cargo-check/executor.mjs +4 -4
- package/dist/src/executors/cargo-check/untyped.mjs +1 -1
- package/dist/src/executors/cargo-clippy/executor.js +4 -4
- package/dist/src/executors/cargo-clippy/executor.mjs +4 -4
- package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
- package/dist/src/executors/cargo-doc/executor.js +4 -4
- package/dist/src/executors/cargo-doc/executor.mjs +4 -4
- package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
- package/dist/src/executors/cargo-format/executor.js +4 -4
- package/dist/src/executors/cargo-format/executor.mjs +4 -4
- package/dist/src/executors/cargo-format/untyped.mjs +1 -1
- package/dist/src/executors/cargo-publish/executor.mjs +1 -1
- package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
- package/dist/src/executors/clean-package/executor.d.mts +2 -1
- package/dist/src/executors/clean-package/executor.d.ts +2 -1
- package/dist/src/executors/clean-package/executor.js +3 -3
- package/dist/src/executors/clean-package/executor.mjs +3 -3
- package/dist/src/executors/clean-package/untyped.mjs +1 -1
- package/dist/src/executors/esbuild/executor.d.mts +3 -2
- package/dist/src/executors/esbuild/executor.d.ts +3 -2
- package/dist/src/executors/esbuild/executor.js +4 -4
- package/dist/src/executors/esbuild/executor.mjs +4 -4
- package/dist/src/executors/esbuild/untyped.mjs +1 -1
- package/dist/src/executors/npm-publish/executor.mjs +1 -1
- package/dist/src/executors/npm-publish/untyped.mjs +1 -1
- package/dist/src/executors/size-limit/executor.d.mts +3 -2
- package/dist/src/executors/size-limit/executor.d.ts +3 -2
- package/dist/src/executors/size-limit/executor.js +4 -4
- package/dist/src/executors/size-limit/executor.mjs +4 -4
- package/dist/src/executors/size-limit/untyped.mjs +1 -1
- package/dist/src/executors/typia/executor.d.mts +3 -2
- package/dist/src/executors/typia/executor.d.ts +3 -2
- package/dist/src/executors/typia/executor.js +4 -4
- package/dist/src/executors/typia/executor.mjs +4 -4
- package/dist/src/executors/typia/untyped.mjs +1 -1
- package/dist/src/executors/unbuild/executor.d.mts +3 -2
- package/dist/src/executors/unbuild/executor.d.ts +3 -2
- package/dist/src/executors/unbuild/executor.js +4 -4
- package/dist/src/executors/unbuild/executor.mjs +4 -4
- package/dist/src/executors/unbuild/untyped.mjs +1 -1
- package/dist/src/generators/browser-library/generator.d.mts +4 -3
- package/dist/src/generators/browser-library/generator.d.ts +4 -3
- package/dist/src/generators/browser-library/generator.js +4 -4
- package/dist/src/generators/browser-library/generator.mjs +4 -4
- package/dist/src/generators/browser-library/untyped.mjs +1 -1
- package/dist/src/generators/config-schema/generator.d.mts +4 -3
- package/dist/src/generators/config-schema/generator.d.ts +4 -3
- package/dist/src/generators/config-schema/generator.js +4 -4
- package/dist/src/generators/config-schema/generator.mjs +4 -4
- package/dist/src/generators/config-schema/untyped.mjs +1 -1
- package/dist/src/generators/init/init.mjs +1 -1
- package/dist/src/generators/init/untyped.mjs +1 -1
- package/dist/src/generators/neutral-library/generator.d.mts +4 -3
- package/dist/src/generators/neutral-library/generator.d.ts +4 -3
- package/dist/src/generators/neutral-library/generator.js +4 -4
- package/dist/src/generators/neutral-library/generator.mjs +4 -4
- package/dist/src/generators/neutral-library/untyped.mjs +1 -1
- package/dist/src/generators/node-library/generator.d.mts +4 -3
- package/dist/src/generators/node-library/generator.d.ts +4 -3
- package/dist/src/generators/node-library/generator.js +4 -4
- package/dist/src/generators/node-library/generator.mjs +4 -4
- package/dist/src/generators/node-library/untyped.mjs +1 -1
- package/dist/src/generators/preset/generator.d.mts +4 -3
- package/dist/src/generators/preset/generator.d.ts +4 -3
- package/dist/src/generators/preset/generator.js +4 -4
- package/dist/src/generators/preset/generator.mjs +4 -4
- package/dist/src/generators/preset/untyped.mjs +1 -1
- package/dist/src/generators/release-version/generator.d.mts +3 -2
- package/dist/src/generators/release-version/generator.d.ts +3 -2
- package/dist/src/generators/release-version/generator.js +3 -3
- package/dist/src/generators/release-version/generator.mjs +3 -3
- package/dist/src/generators/release-version/untyped.mjs +1 -1
- package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
- package/dist/src/plugins/rust/index.mjs +1 -1
- package/dist/src/plugins/typescript/index.d.mts +47 -2
- package/dist/src/plugins/typescript/index.d.ts +47 -2
- package/dist/src/plugins/typescript/index.js +435 -5
- package/dist/src/plugins/typescript/index.mjs +436 -6
- package/dist/src/plugins/typescript/tsup.mjs +1 -1
- package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
- package/dist/src/types.d.mts +3 -2
- package/dist/src/types.d.ts +3 -2
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/apply-workspace-tokens.d.mts +2 -1
- package/dist/src/utils/apply-workspace-tokens.d.ts +2 -1
- package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
- package/dist/src/utils/cargo.mjs +1 -1
- package/dist/src/utils/create-cli-options.mjs +1 -1
- package/dist/src/utils/get-project-configurations.mjs +1 -1
- package/dist/src/utils/index.d.mts +3 -2
- package/dist/src/utils/index.d.ts +3 -2
- package/dist/src/utils/index.mjs +1 -1
- package/dist/src/utils/lock-file.mjs +1 -1
- package/dist/src/utils/nx-json.mjs +1 -1
- package/dist/src/utils/package-helpers.mjs +1 -1
- package/dist/src/utils/plugin-helpers.mjs +1 -1
- package/dist/src/utils/pnpm-deps-update.mjs +1 -1
- package/dist/src/utils/project-tags.d.mts +3 -2
- package/dist/src/utils/project-tags.d.ts +3 -2
- package/dist/src/utils/project-tags.mjs +1 -1
- package/dist/src/utils/typia-transform.mjs +1 -1
- package/dist/src/utils/versions.mjs +1 -1
- package/dist/{types-DXRPpxuL.d.mts → types-BuQFM0Hk.d.mts} +1 -1
- package/dist/types-Ca7EE8eb.d.mts +226 -0
- package/dist/types-Ca7EE8eb.d.ts +226 -0
- package/dist/{types-ifEQCCcO.d.ts → types-yDwoa0v2.d.ts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-D7XLAFS5.mjs +0 -434
- package/dist/chunk-QDQ5YUCN.js +0 -434
- package/dist/src/plugins/typescript/project-config.d.mts +0 -37
- package/dist/src/plugins/typescript/project-config.d.ts +0 -37
- package/dist/src/plugins/typescript/project-config.js +0 -11
- package/dist/src/plugins/typescript/project-config.mjs +0 -11
- package/dist/types-DWiPwz5j.d.mts +0 -218
- package/dist/types-DWiPwz5j.d.ts +0 -218
|
@@ -1,11 +1,441 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var _chunkNSSJMQFDjs = require('../../../chunk-NSSJMQFD.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkAX3RSZT7js = require('../../../chunk-AX3RSZT7.js');
|
|
7
11
|
require('../../../chunk-3RG5ZIWI.js');
|
|
8
12
|
|
|
13
|
+
// src/plugins/typescript/index.ts
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _devkit = require('@nx/devkit');
|
|
17
|
+
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
18
|
+
var _fs = require('fs');
|
|
19
|
+
var _path = require('path');
|
|
20
|
+
var _nxjsonjs = require('nx/src/config/nx-json.js');
|
|
21
|
+
var _fileutils = require('nx/src/utils/fileutils');
|
|
22
|
+
var _packagejson = require('nx/src/utils/package-json');
|
|
23
|
+
var _pkgtypes = require('pkg-types');
|
|
24
|
+
var name = "storm-software/typescript";
|
|
25
|
+
var createNodesV2 = [
|
|
26
|
+
"{project.json,**/project.json}",
|
|
27
|
+
async (configFiles, options = { includeApps: true }, context) => {
|
|
28
|
+
const nxJson = _nxjsonjs.readNxJson.call(void 0, context.workspaceRoot);
|
|
29
|
+
return _devkit.createNodesFromFiles.call(void 0,
|
|
30
|
+
async (file, options2 = { includeApps: true }, context2) => {
|
|
31
|
+
try {
|
|
32
|
+
const packageJson = createPackageJson(file, context2.workspaceRoot);
|
|
33
|
+
if (!packageJson) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
const tsconfig = await createTsconfig(file, context2.workspaceRoot);
|
|
37
|
+
if (!tsconfig) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
const projectConfig = createProjectFromPackageJsonNextToProjectJson(
|
|
41
|
+
file,
|
|
42
|
+
packageJson
|
|
43
|
+
);
|
|
44
|
+
if (_optionalChain([options2, 'optionalAccess', _ => _.includeApps]) === false && projectConfig.projectType === "application") {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
const root = _chunkNSSJMQFDjs.getRoot.call(void 0, projectConfig.root, context2);
|
|
48
|
+
const enableMarkdownlint = _optionalChain([options2, 'optionalAccess', _2 => _2.enableMarkdownlint]) !== false;
|
|
49
|
+
const enableEslint = _optionalChain([options2, 'optionalAccess', _3 => _3.enableEslint]) !== false;
|
|
50
|
+
const enableTypeCheck = _optionalChain([options2, 'optionalAccess', _4 => _4.enableTypeCheck]) !== false;
|
|
51
|
+
const targets = _packagejson.readTargetsFromPackageJson.call(void 0,
|
|
52
|
+
packageJson,
|
|
53
|
+
nxJson,
|
|
54
|
+
projectConfig.root,
|
|
55
|
+
context2.workspaceRoot
|
|
56
|
+
);
|
|
57
|
+
if (_path.join.call(void 0, context2.workspaceRoot, projectConfig.root).startsWith(
|
|
58
|
+
_path.join.call(void 0, context2.workspaceRoot, "tools")
|
|
59
|
+
) && _optionalChain([options2, 'optionalAccess', _5 => _5.lintInternalTools]) !== true) {
|
|
60
|
+
targets.lint ??= {
|
|
61
|
+
dependsOn: ["^lint"],
|
|
62
|
+
executor: "nx:run-commands",
|
|
63
|
+
options: {
|
|
64
|
+
command: "echo 'Skipping linting of internal tools package \"{projectName}\". This can be changed by setting `lintInternalTools` to `true` in the Storm TypeScript plugin options.' "
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
} else {
|
|
68
|
+
targets["lint-ls"] ??= {
|
|
69
|
+
cache: true,
|
|
70
|
+
inputs: ["linting", "typescript", "^production"],
|
|
71
|
+
dependsOn: ["^lint-ls"],
|
|
72
|
+
executor: "nx:run-commands",
|
|
73
|
+
options: {
|
|
74
|
+
command: 'pnpm exec ls-lint --config="node_modules/@storm-software/linting-tools/ls-lint/.ls-lint.yml" '
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
if (enableMarkdownlint) {
|
|
78
|
+
targets["lint-markdown"] ??= {
|
|
79
|
+
cache: true,
|
|
80
|
+
inputs: [
|
|
81
|
+
"linting",
|
|
82
|
+
"{projectRoot}/**/*.md",
|
|
83
|
+
"{projectRoot}/**/*.mdx"
|
|
84
|
+
],
|
|
85
|
+
outputs: ["{projectRoot}/**/*.md", "{projectRoot}/**/*.mdx"],
|
|
86
|
+
dependsOn: ["^lint-markdown"],
|
|
87
|
+
executor: "nx:run-commands",
|
|
88
|
+
options: {
|
|
89
|
+
command: 'pnpm exec markdownlint-cli2 "{projectRoot}/*.{md,mdx}" "{projectRoot}/**/*.{md,mdx}" --config "node_modules/@storm-software/markdownlint/config/base.markdownlint-cli2.jsonc" --fix'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (enableTypeCheck) {
|
|
94
|
+
targets["lint:tsc"] ??= {
|
|
95
|
+
cache: true,
|
|
96
|
+
inputs: ["typescript", "^production"],
|
|
97
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
98
|
+
executor: "nx:run-commands",
|
|
99
|
+
dependsOn: ["^lint:tsc"],
|
|
100
|
+
options: {
|
|
101
|
+
command: `pnpm exec tsc --noEmit --pretty --project ${_path.join.call(void 0,
|
|
102
|
+
projectConfig.root,
|
|
103
|
+
"tsconfig.json"
|
|
104
|
+
)}`
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (enableEslint) {
|
|
109
|
+
let eslintConfig = checkEslintConfigAtPath(projectConfig.root);
|
|
110
|
+
if (!eslintConfig) {
|
|
111
|
+
eslintConfig = checkEslintConfigAtPath(context2.workspaceRoot);
|
|
112
|
+
}
|
|
113
|
+
if (eslintConfig) {
|
|
114
|
+
targets.lint ??= {
|
|
115
|
+
cache: true,
|
|
116
|
+
inputs: ["linting", "typescript", "^production"],
|
|
117
|
+
outputs: [
|
|
118
|
+
"{projectRoot}/**/*.{ts,tsx,js,jsx,json,md,mdx,yaml,yml,html,css,scss,sass,less,graphql,gql}"
|
|
119
|
+
],
|
|
120
|
+
dependsOn: [
|
|
121
|
+
enableMarkdownlint ? "lint-markdown" : void 0,
|
|
122
|
+
enableTypeCheck ? "lint:tsc" : void 0,
|
|
123
|
+
"^lint"
|
|
124
|
+
].filter(Boolean),
|
|
125
|
+
executor: "@nx/eslint:lint",
|
|
126
|
+
options: {
|
|
127
|
+
format: "stylish",
|
|
128
|
+
fix: true,
|
|
129
|
+
errorOnUnmatchedPattern: false,
|
|
130
|
+
cache: true,
|
|
131
|
+
cacheLocation: "{workspaceRoot}/node_modules/.cache/eslint/{projectRoot}",
|
|
132
|
+
eslintConfig
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
targets["format-toml"] ??= {
|
|
139
|
+
cache: true,
|
|
140
|
+
inputs: ["linting", "{projectRoot}/**/*.toml"],
|
|
141
|
+
outputs: ["{projectRoot}/**/*.toml"],
|
|
142
|
+
dependsOn: ["^format-toml"],
|
|
143
|
+
executor: "nx:run-commands",
|
|
144
|
+
options: {
|
|
145
|
+
command: 'pnpm exec taplo format --config="node_modules/@storm-software/linting-tools/taplo/config.toml" --cache-path="node_modules/.cache/taplo/{projectRoot}" --colors="always" "{projectRoot}/*.toml" "{projectRoot}/**/*.toml" '
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
targets["format-readme"] ??= {
|
|
149
|
+
cache: true,
|
|
150
|
+
inputs: [
|
|
151
|
+
"linting",
|
|
152
|
+
"documentation",
|
|
153
|
+
"{projectRoot}/{README.md,package.json,Cargo.toml,executors.json,generators.json}"
|
|
154
|
+
],
|
|
155
|
+
outputs: ["{projectRoot}/README.md"],
|
|
156
|
+
dependsOn: ["^format-readme"],
|
|
157
|
+
executor: "nx:run-commands",
|
|
158
|
+
options: {
|
|
159
|
+
command: 'pnpm exec storm-git readme --templates="tools/readme-templates" --project="{projectName}"'
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
targets["format-prettier"] ??= {
|
|
163
|
+
cache: true,
|
|
164
|
+
inputs: ["linting", "typescript", "^production"],
|
|
165
|
+
outputs: ["{projectRoot}/**/*"],
|
|
166
|
+
dependsOn: ["^format-prettier"],
|
|
167
|
+
executor: "nx:run-commands",
|
|
168
|
+
options: {
|
|
169
|
+
command: 'pnpm exec prettier "{projectRoot}/**/*" --write --ignore-unknown --no-error-on-unmatched-pattern --config="node_modules/@storm-software/prettier/config.json" --ignore-path="node_modules/@storm-software/prettier/.prettierignore" --cache --cache-location="node_modules/.cache/prettier/{projectRoot}" '
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
targets.format ??= {
|
|
173
|
+
cache: true,
|
|
174
|
+
inputs: ["linting", "typescript", "^production"],
|
|
175
|
+
outputs: ["{projectRoot}/**/*"],
|
|
176
|
+
dependsOn: [
|
|
177
|
+
"format-readme",
|
|
178
|
+
"format-toml",
|
|
179
|
+
"format-prettier",
|
|
180
|
+
"^format"
|
|
181
|
+
],
|
|
182
|
+
executor: "nx:run-commands",
|
|
183
|
+
options: {
|
|
184
|
+
command: `echo 'Formatting the project files in "{projectRoot}"' `
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
targets.clean ??= {
|
|
188
|
+
cache: true,
|
|
189
|
+
executor: "nx:run-commands",
|
|
190
|
+
inputs: ["typescript", "^production"],
|
|
191
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
192
|
+
options: {
|
|
193
|
+
command: "pnpm exec rimraf dist/{projectRoot}",
|
|
194
|
+
color: true,
|
|
195
|
+
cwd: "{workspaceRoot}"
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
targets.rebuild ??= {
|
|
199
|
+
cache: false,
|
|
200
|
+
executor: "nx:run-commands",
|
|
201
|
+
dependsOn: ["clean", "^build"],
|
|
202
|
+
inputs: ["typescript", "^production"],
|
|
203
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
204
|
+
options: {
|
|
205
|
+
command: `pnpm exec nx run ${projectConfig.name}:build`
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
if (checkJestConfigAtPath(projectConfig.root)) {
|
|
209
|
+
targets.test ??= {
|
|
210
|
+
cache: true,
|
|
211
|
+
executor: "@nx/jest:jest",
|
|
212
|
+
inputs: ["testing", "typescript", "^production"],
|
|
213
|
+
outputs: ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
214
|
+
defaultConfiguration: "development",
|
|
215
|
+
options: {
|
|
216
|
+
jestConfig: "{projectRoot}/jest.config.ts",
|
|
217
|
+
passWithNoTests: true
|
|
218
|
+
},
|
|
219
|
+
configurations: {
|
|
220
|
+
development: {
|
|
221
|
+
ci: false,
|
|
222
|
+
codeCoverage: true
|
|
223
|
+
},
|
|
224
|
+
production: {
|
|
225
|
+
ci: true,
|
|
226
|
+
codeCoverage: true
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
targets["docs"] ??= {
|
|
232
|
+
cache: true,
|
|
233
|
+
inputs: ["linting", "documentation", "typescript", "^production"],
|
|
234
|
+
outputs: ["{projectRoot}/docs"],
|
|
235
|
+
dependsOn: ["build", "format-readme", "lint-docs", "^docs"],
|
|
236
|
+
options: {}
|
|
237
|
+
};
|
|
238
|
+
targets["size-limit"] ??= {
|
|
239
|
+
cache: true,
|
|
240
|
+
inputs: ["testing", "typescript", "^production"],
|
|
241
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
242
|
+
dependsOn: ["build", "^size-limit"],
|
|
243
|
+
options: {}
|
|
244
|
+
};
|
|
245
|
+
const isPrivate = _nullishCoalesce(packageJson.private, () => ( false));
|
|
246
|
+
if (!isPrivate) {
|
|
247
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
248
|
+
projectConfig,
|
|
249
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Registry.TAG_ID,
|
|
250
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Registry.NPM,
|
|
251
|
+
{ overwrite: true }
|
|
252
|
+
);
|
|
253
|
+
targets["nx-release-publish"] = {
|
|
254
|
+
cache: false,
|
|
255
|
+
dependsOn: ["build", "size-limit", "^nx-release-publish"],
|
|
256
|
+
executor: "@storm-software/workspace-tools:npm-publish",
|
|
257
|
+
options: {}
|
|
258
|
+
};
|
|
259
|
+
if (projectConfig.projectType === "application" || _chunkAX3RSZT7js.isEqualProjectTag.call(void 0,
|
|
260
|
+
projectConfig,
|
|
261
|
+
_chunkAX3RSZT7js.ProjectTagConstants.ProjectType.TAG_ID,
|
|
262
|
+
_chunkAX3RSZT7js.ProjectTagConstants.ProjectType.APPLICATION
|
|
263
|
+
) || _chunkAX3RSZT7js.isEqualProjectTag.call(void 0,
|
|
264
|
+
projectConfig,
|
|
265
|
+
_chunkAX3RSZT7js.ProjectTagConstants.DistStyle.TAG_ID,
|
|
266
|
+
_chunkAX3RSZT7js.ProjectTagConstants.DistStyle.CLEAN
|
|
267
|
+
)) {
|
|
268
|
+
targets["clean-package"] ??= {
|
|
269
|
+
cache: true,
|
|
270
|
+
dependsOn: ["build"],
|
|
271
|
+
inputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
272
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
273
|
+
executor: "@storm-software/workspace-tools:clean-package",
|
|
274
|
+
options: {
|
|
275
|
+
cleanReadMe: true,
|
|
276
|
+
cleanComments: true
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
_optionalChain([targets, 'access', _6 => _6["nx-release-publish"], 'access', _7 => _7.dependsOn, 'optionalAccess', _8 => _8.push, 'call', _9 => _9("clean-package")]);
|
|
280
|
+
_optionalChain([targets, 'access', _10 => _10["size-limit"], 'access', _11 => _11.dependsOn, 'optionalAccess', _12 => _12.push, 'call', _13 => _13("clean-package")]);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
284
|
+
projectConfig,
|
|
285
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.TAG_ID,
|
|
286
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.TYPESCRIPT,
|
|
287
|
+
{ overwrite: true }
|
|
288
|
+
);
|
|
289
|
+
const platform = _chunkNSSJMQFDjs.getProjectPlatform.call(void 0, projectConfig);
|
|
290
|
+
switch (platform) {
|
|
291
|
+
case "worker":
|
|
292
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
293
|
+
projectConfig,
|
|
294
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.TAG_ID,
|
|
295
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.WORKER,
|
|
296
|
+
{ overwrite: true }
|
|
297
|
+
);
|
|
298
|
+
break;
|
|
299
|
+
case "node":
|
|
300
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
301
|
+
projectConfig,
|
|
302
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.TAG_ID,
|
|
303
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.NODE,
|
|
304
|
+
{ overwrite: true }
|
|
305
|
+
);
|
|
306
|
+
break;
|
|
307
|
+
case "browser":
|
|
308
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
309
|
+
projectConfig,
|
|
310
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.TAG_ID,
|
|
311
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.BROWSER,
|
|
312
|
+
{ overwrite: true }
|
|
313
|
+
);
|
|
314
|
+
break;
|
|
315
|
+
default:
|
|
316
|
+
_chunkAX3RSZT7js.addProjectTag.call(void 0,
|
|
317
|
+
projectConfig,
|
|
318
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.TAG_ID,
|
|
319
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Platform.NEUTRAL,
|
|
320
|
+
{ overwrite: true }
|
|
321
|
+
);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
_chunkAX3RSZT7js.setDefaultProjectTags.call(void 0, projectConfig, name);
|
|
325
|
+
return {
|
|
326
|
+
projects: {
|
|
327
|
+
[root]: _defu2.default.call(void 0,
|
|
328
|
+
{
|
|
329
|
+
root,
|
|
330
|
+
targets,
|
|
331
|
+
release: {
|
|
332
|
+
version: {
|
|
333
|
+
generator: "@storm-software/workspace-tools:release-version"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
projectConfig
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
} catch (e) {
|
|
342
|
+
console.error(e);
|
|
343
|
+
return {};
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
configFiles,
|
|
347
|
+
options,
|
|
348
|
+
context
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
];
|
|
352
|
+
function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
|
|
353
|
+
const { nx, name: name2 } = packageJson;
|
|
354
|
+
const root = _path.dirname.call(void 0, projectJsonPath);
|
|
355
|
+
return {
|
|
356
|
+
...nx,
|
|
357
|
+
name: name2,
|
|
358
|
+
root,
|
|
359
|
+
targets: {}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function createPackageJson(projectJsonPath, workspaceRoot) {
|
|
363
|
+
try {
|
|
364
|
+
const root = _path.dirname.call(void 0, projectJsonPath);
|
|
365
|
+
const packageJsonPath = _path.join.call(void 0, workspaceRoot, root, "package.json");
|
|
366
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
return _fileutils.readJsonFile.call(void 0, packageJsonPath);
|
|
370
|
+
} catch (e) {
|
|
371
|
+
console.warn(e);
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
async function createTsconfig(projectJsonPath, workspaceRoot) {
|
|
376
|
+
try {
|
|
377
|
+
const root = _path.dirname.call(void 0, projectJsonPath);
|
|
378
|
+
const tsconfigJsonPath = _path.join.call(void 0, workspaceRoot, root, "tsconfig.json");
|
|
379
|
+
if (!_fs.existsSync.call(void 0, tsconfigJsonPath)) {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
return _pkgtypes.readTSConfig.call(void 0, tsconfigJsonPath);
|
|
383
|
+
} catch (e) {
|
|
384
|
+
console.warn(e);
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function checkEslintConfigAtPath(directory) {
|
|
389
|
+
const hasEslintConfigFile = (fileName) => {
|
|
390
|
+
return _fs.existsSync.call(void 0, _path.join.call(void 0, directory, fileName));
|
|
391
|
+
};
|
|
392
|
+
if (hasEslintConfigFile(".eslintrc.js")) {
|
|
393
|
+
return ".eslintrc.js";
|
|
394
|
+
} else if (hasEslintConfigFile(".eslintrc.cjs")) {
|
|
395
|
+
return ".eslintrc.cjs";
|
|
396
|
+
} else if (hasEslintConfigFile(".eslintrc.yaml")) {
|
|
397
|
+
return ".eslintrc.yaml";
|
|
398
|
+
} else if (hasEslintConfigFile(".eslintrc.yml")) {
|
|
399
|
+
return ".eslintrc.yml";
|
|
400
|
+
} else if (hasEslintConfigFile(".eslintrc.json")) {
|
|
401
|
+
return ".eslintrc.json";
|
|
402
|
+
} else if (hasEslintConfigFile(".eslintrc")) {
|
|
403
|
+
return ".eslintrc";
|
|
404
|
+
} else if (hasEslintConfigFile("eslint.config.js")) {
|
|
405
|
+
return "eslint.config.js";
|
|
406
|
+
} else if (hasEslintConfigFile("eslint.config.cjs")) {
|
|
407
|
+
return "eslint.config.cjs";
|
|
408
|
+
} else if (hasEslintConfigFile("eslint.config.mjs")) {
|
|
409
|
+
return "eslint.config.mjs";
|
|
410
|
+
} else if (hasEslintConfigFile("eslint.config.ts")) {
|
|
411
|
+
return "eslint.config.ts";
|
|
412
|
+
} else if (hasEslintConfigFile("eslint.config.cts")) {
|
|
413
|
+
return "eslint.config.cts";
|
|
414
|
+
} else if (hasEslintConfigFile("eslint.config.mts")) {
|
|
415
|
+
return "eslint.config.mts";
|
|
416
|
+
}
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
function checkJestConfigAtPath(directory) {
|
|
420
|
+
const hasJestConfigFile = (fileName) => {
|
|
421
|
+
return _fs.existsSync.call(void 0, _path.join.call(void 0, directory, fileName));
|
|
422
|
+
};
|
|
423
|
+
if (hasJestConfigFile("eslint.config.js")) {
|
|
424
|
+
return "jest.config.js";
|
|
425
|
+
} else if (hasJestConfigFile("eslint.config.cjs")) {
|
|
426
|
+
return "jest.config.cjs";
|
|
427
|
+
} else if (hasJestConfigFile("eslint.config.mjs")) {
|
|
428
|
+
return "jest.config.mjs";
|
|
429
|
+
} else if (hasJestConfigFile("eslint.config.ts")) {
|
|
430
|
+
return "jest.config.ts";
|
|
431
|
+
} else if (hasJestConfigFile("jest.config.cts")) {
|
|
432
|
+
return "jest.config.cts";
|
|
433
|
+
} else if (hasJestConfigFile("jest.config.mts")) {
|
|
434
|
+
return "jest.config.mts";
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
|
|
9
439
|
|
|
10
440
|
|
|
11
|
-
exports.createNodesV2 =
|
|
441
|
+
exports.createNodesV2 = createNodesV2; exports.name = name;
|