@storm-software/workspace-tools 1.296.81 → 1.296.84
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/README.md +1 -1
- package/config/base.json +13 -14
- package/config/recommended.json +17 -15
- package/dist/{chunk-SZWM7COV.js → chunk-3G7PNDZ5.js} +15 -2
- package/dist/chunk-5BGCA73V.mjs +39 -0
- package/dist/{chunk-3VIV3TF3.js → chunk-CSH4G6YP.js} +11 -5
- package/dist/{chunk-QC5ON3X4.mjs → chunk-DEHA5C77.mjs} +15 -2
- package/dist/{chunk-Q36BH543.mjs → chunk-E2PVUX2W.mjs} +25 -209
- package/dist/{chunk-YXDHTGAK.js → chunk-FETI3TYM.js} +47 -35
- package/dist/{chunk-2OB3TJFJ.mjs → chunk-FQ7VZ2JR.mjs} +1 -1
- package/dist/{chunk-C2QNKR3W.mjs → chunk-G35OKYMG.mjs} +1 -1
- package/dist/{chunk-TM2CRDJW.js → chunk-HN5UXNLM.js} +33 -12
- package/dist/{chunk-2UJDNCR7.mjs → chunk-HU2ZYTZL.mjs} +44 -32
- package/dist/{chunk-2F7AZHRH.js → chunk-ILSI74FW.js} +49 -20
- package/dist/chunk-KSEB2U7B.js +318 -0
- package/dist/{chunk-EHJC5RYU.mjs → chunk-M7W3EPWR.mjs} +2 -2
- package/dist/{chunk-323C3SE6.js → chunk-MYALGFOC.js} +3 -3
- package/dist/chunk-OGB3BDE5.js +39 -0
- package/dist/{chunk-77B77QNY.mjs → chunk-VQYZG5YE.mjs} +33 -12
- package/dist/{chunk-NNDVMJGY.mjs → chunk-WTASIX7S.mjs} +17 -15
- package/dist/{chunk-R4GXDUM2.mjs → chunk-WU2HALDD.mjs} +11 -5
- package/dist/{chunk-WCUI5X7P.js → chunk-WYV2VL6T.js} +17 -15
- package/dist/{chunk-NTTC774E.mjs → chunk-XSHN3XHD.mjs} +39 -10
- package/dist/{chunk-EEMND2GI.js → chunk-ZM4LIWD4.js} +3 -3
- package/dist/{chunk-2R2MHEOI.js → chunk-ZO6ZPXB7.js} +5 -5
- package/dist/executors.js +10 -9
- package/dist/executors.mjs +11 -10
- package/dist/generators.js +10 -9
- package/dist/generators.mjs +9 -8
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +54 -28
- package/dist/index.mjs +59 -33
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +2 -2
- package/dist/src/executors/npm-publish/executor.js +3 -2
- package/dist/src/executors/npm-publish/executor.mjs +2 -1
- package/dist/src/generators/browser-library/generator.js +4 -4
- package/dist/src/generators/browser-library/generator.mjs +3 -3
- package/dist/src/generators/neutral-library/generator.js +4 -4
- package/dist/src/generators/neutral-library/generator.mjs +3 -3
- package/dist/src/generators/node-library/generator.js +4 -4
- package/dist/src/generators/node-library/generator.mjs +3 -3
- package/dist/src/generators/preset/generator.js +4 -3
- package/dist/src/generators/preset/generator.mjs +3 -2
- package/dist/src/plugins/rust/cargo-toml.js +6 -2
- package/dist/src/plugins/rust/cargo-toml.mjs +5 -1
- package/dist/src/plugins/rust/index.js +6 -2
- package/dist/src/plugins/rust/index.mjs +5 -1
- package/dist/src/plugins/typescript/index.js +19 -14
- package/dist/src/plugins/typescript/index.mjs +20 -15
- package/dist/src/plugins/typescript/tsdown.js +16 -11
- package/dist/src/plugins/typescript/tsdown.mjs +16 -11
- package/dist/src/plugins/typescript/tsup.js +16 -11
- package/dist/src/plugins/typescript/tsup.mjs +16 -11
- package/dist/src/plugins/typescript/untyped-schema.js +15 -7
- package/dist/src/plugins/typescript/untyped-schema.mjs +15 -7
- package/dist/src/utils/index.d.mts +4 -3
- package/dist/src/utils/index.d.ts +4 -3
- package/dist/src/utils/index.js +37 -10
- package/dist/src/utils/index.mjs +45 -18
- package/dist/src/utils/lock-file.d.mts +16 -4
- package/dist/src/utils/lock-file.d.ts +16 -4
- package/dist/src/utils/lock-file.js +12 -2
- package/dist/src/utils/lock-file.mjs +11 -1
- package/dist/src/utils/nx-json.js +2 -2
- package/dist/src/utils/nx-json.mjs +1 -1
- package/dist/src/utils/package-manager.d.mts +33 -0
- package/dist/src/utils/package-manager.d.ts +33 -0
- package/dist/src/utils/package-manager.js +14 -0
- package/dist/src/utils/package-manager.mjs +15 -0
- package/dist/src/utils/versions.d.mts +11 -2
- package/dist/src/utils/versions.d.ts +11 -2
- package/dist/src/utils/versions.js +10 -2
- package/dist/src/utils/versions.mjs +11 -3
- package/package.json +15 -10
- package/dist/chunk-F6U5OQR6.js +0 -502
- /package/dist/{chunk-DO2X7OZO.js → chunk-CVKUY5YY.js} +0 -0
- /package/dist/{chunk-XCVH63OO.mjs → chunk-QCN77EOQ.mjs} +0 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
+
var _chunkHN5UXNLMjs = require('./chunk-HN5UXNLM.js');
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunk3G7PNDZ5js = require('./chunk-3G7PNDZ5.js');
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
var _chunkQSTZP7MXjs = require('./chunk-QSTZP7MX.js');
|
|
@@ -14,10 +18,15 @@ var _chunkQSTZP7MXjs = require('./chunk-QSTZP7MX.js');
|
|
|
14
18
|
|
|
15
19
|
|
|
16
20
|
|
|
21
|
+
|
|
17
22
|
var _devkit = require('@nx/devkit');
|
|
18
23
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
19
24
|
async function presetGeneratorFn(tree, options) {
|
|
20
25
|
const projectRoot = ".";
|
|
26
|
+
const packageManager = _nullishCoalesce(options.packageManager, () => ( "pnpm"));
|
|
27
|
+
const packageManagerVersion = _chunk3G7PNDZ5js.packageManagerVersions[packageManager];
|
|
28
|
+
const pmc = _devkit.getPackageManagerCommand.call(void 0, packageManager);
|
|
29
|
+
const lockFileName = _chunkHN5UXNLMjs.getLockFileName.call(void 0, packageManager);
|
|
21
30
|
options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
|
|
22
31
|
options.namespace ??= options.organization;
|
|
23
32
|
_devkit.addProjectConfiguration.call(void 0, tree, `@${options.namespace}/${options.name}`, {
|
|
@@ -85,11 +94,6 @@ async function presetGeneratorFn(tree, options) {
|
|
|
85
94
|
type: "github",
|
|
86
95
|
url: `${options.repositoryUrl}.git`
|
|
87
96
|
};
|
|
88
|
-
json.packageManager ??= "pnpm@10.3.0";
|
|
89
|
-
json.engines ??= {
|
|
90
|
-
node: ">=20.11.0",
|
|
91
|
-
pnpm: ">=10.3.0"
|
|
92
|
-
};
|
|
93
97
|
json.prettier = "@storm-software/prettier/config.json";
|
|
94
98
|
json.nx ??= {
|
|
95
99
|
includedScripts: [
|
|
@@ -106,14 +110,14 @@ async function presetGeneratorFn(tree, options) {
|
|
|
106
110
|
"release"
|
|
107
111
|
]
|
|
108
112
|
};
|
|
109
|
-
json.scripts.adr = "
|
|
110
|
-
json.scripts["adr-preview"] = "
|
|
111
|
-
json.scripts.prepare =
|
|
112
|
-
json.scripts.preinstall =
|
|
113
|
-
json.scripts["install-csb"] = "corepack enable &&
|
|
113
|
+
json.scripts.adr = pmc.run("log4brains", "adr new");
|
|
114
|
+
json.scripts["adr-preview"] = pmc.run("log4brains", "preview");
|
|
115
|
+
json.scripts.prepare = `${pmc.addDev} lefthook && ${packageManager} lefthook install`;
|
|
116
|
+
json.scripts.preinstall = `npx -y only-allow ${packageManager}`;
|
|
117
|
+
json.scripts["install-csb"] = packageManager === "bun" ? "bun install" : `corepack enable && ${pmc.install}`;
|
|
114
118
|
json.scripts.clean = "rimraf dist && rimraf --glob packages/**/dist && rimraf --glob tools/**/dist && rimraf --glob docs/**/dist && rimraf --glob apps/**/dist && rimraf --glob libs/**/dist";
|
|
115
|
-
json.scripts.nuke =
|
|
116
|
-
json.scripts.prebuild =
|
|
119
|
+
json.scripts.nuke = `nx clear-cache && rimraf .nx/cache && rimraf .nx/workspace-data && ${packageManager} clean && rimraf ${lockFileName} && rimraf --glob packages/**/node_modules && rimraf --glob tools/**/node_modules && rimraf node_modules`;
|
|
120
|
+
json.scripts.prebuild = `${packageManager} clean`;
|
|
117
121
|
json.scripts.build = "nx affected -t build --parallel=5";
|
|
118
122
|
json.scripts["build-all"] = "nx run-many -t build --all --parallel=5";
|
|
119
123
|
json.scripts["build-prod"] = "nx run-many -t build --all --prod --parallel=5";
|
|
@@ -128,45 +132,53 @@ async function presetGeneratorFn(tree, options) {
|
|
|
128
132
|
}
|
|
129
133
|
json.scripts.nx = "nx";
|
|
130
134
|
json.scripts.graph = "nx graph";
|
|
131
|
-
json.scripts.lint = "pnpm storm-lint all --skip-cspell --skip-alex";
|
|
132
135
|
if (options.includeApps) {
|
|
133
136
|
json.scripts.start = "nx serve";
|
|
134
|
-
json.scripts.storybook = "
|
|
137
|
+
json.scripts.storybook = pmc.run("storybook", "dev -p 6006");
|
|
135
138
|
}
|
|
136
139
|
json.scripts.help = "nx help";
|
|
137
140
|
json.scripts["dep-graph"] = "nx dep-graph";
|
|
138
141
|
json.scripts["local-registry"] = `nx local-registry @${options.namespace}/${options.name}`;
|
|
139
142
|
json.scripts.e2e = "nx e2e";
|
|
140
143
|
if (options.includeApps) {
|
|
141
|
-
json.scripts.test =
|
|
142
|
-
json.scripts["test-storybook"] =
|
|
144
|
+
json.scripts.test = `nx test && ${packageManager} test-storybook`;
|
|
145
|
+
json.scripts["test-storybook"] = `${packageManager} test-storybook`;
|
|
143
146
|
} else {
|
|
144
147
|
json.scripts.test = "nx test";
|
|
145
148
|
}
|
|
146
|
-
json.scripts.
|
|
147
|
-
json.scripts
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
json.scripts.commit = pmc.run("storm-git", "commit");
|
|
150
|
+
json.scripts["api-extractor"] = pmc.run(
|
|
151
|
+
"storm-docs",
|
|
152
|
+
'api-extractor --outputPath="docs/api-reference" --clean'
|
|
153
|
+
);
|
|
154
|
+
json.scripts.release = pmc.run("storm-git", "release");
|
|
150
155
|
json.scripts.format = "nx format:write";
|
|
151
|
-
json.scripts["format-sherif"] =
|
|
152
|
-
json.scripts["format-toml"] =
|
|
153
|
-
json.scripts["format-readme"] =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
json.scripts["
|
|
158
|
-
json.scripts
|
|
159
|
-
json.
|
|
156
|
+
json.scripts["format-sherif"] = `${pmc.exec} sherif -f -i typescript -i react -i react-dom`;
|
|
157
|
+
json.scripts["format-toml"] = `${pmc.exec} taplo format --config="./node_modules/@storm-software/linting-tools/taplo/config.toml" --cache-path="./node_modules/.cache/storm/taplo"`;
|
|
158
|
+
json.scripts["format-readme"] = pmc.run(
|
|
159
|
+
"storm-git",
|
|
160
|
+
'readme --templates="tools/readme-templates"'
|
|
161
|
+
);
|
|
162
|
+
json.scripts["format-prettier"] = `${pmc.exec} prettier --write --ignore-unknown --no-error-on-unmatched-pattern --cache && git update-index`;
|
|
163
|
+
json.scripts.lint = pmc.run("storm-lint", "all --skip-cspell");
|
|
164
|
+
json.scripts["lint-knip"] = `${pmc.exec} knip`;
|
|
165
|
+
json.scripts["lint-sherif"] = `${pmc.exec} sherif -i typescript -i react -i react-dom`;
|
|
166
|
+
json.scripts["lint-ls"] = `${pmc.exec} ls-lint --config="./node_modules/@storm-software/linting-tools/ls-lint/ls-lint.yml"`;
|
|
167
|
+
json.packageManager ??= `${packageManager}@${packageManagerVersion}`;
|
|
160
168
|
json.engines = {
|
|
161
|
-
node: `>=${
|
|
162
|
-
|
|
169
|
+
node: `>=${_chunk3G7PNDZ5js.nodeVersion}`,
|
|
170
|
+
[packageManager]: `>=${packageManagerVersion}`
|
|
163
171
|
};
|
|
164
172
|
return json;
|
|
165
173
|
});
|
|
166
174
|
_devkit.generateFiles.call(void 0, tree, path.join(__dirname, "files"), projectRoot, {
|
|
167
175
|
...options,
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
packageManager,
|
|
177
|
+
packageManagerVersion,
|
|
178
|
+
pnpmVersion: _chunk3G7PNDZ5js.pnpmVersion,
|
|
179
|
+
nodeVersion: _chunk3G7PNDZ5js.nodeVersion,
|
|
180
|
+
lockFileName,
|
|
181
|
+
exec: pmc.exec
|
|
170
182
|
});
|
|
171
183
|
await _devkit.formatFiles.call(void 0, tree);
|
|
172
184
|
let dependencies = {
|
|
@@ -21,10 +21,17 @@ var _yarnparser = require('nx/src/plugins/js/lock-file/yarn-parser');
|
|
|
21
21
|
var YARN_LOCK_FILE = "yarn.lock";
|
|
22
22
|
var NPM_LOCK_FILE = "package-lock.json";
|
|
23
23
|
var PNPM_LOCK_FILE = "pnpm-lock.yaml";
|
|
24
|
-
var
|
|
24
|
+
var BUN_LOCK_FILE = "bun.lock";
|
|
25
|
+
var LOCK_FILES = [
|
|
26
|
+
YARN_LOCK_FILE,
|
|
27
|
+
NPM_LOCK_FILE,
|
|
28
|
+
PNPM_LOCK_FILE,
|
|
29
|
+
BUN_LOCK_FILE
|
|
30
|
+
];
|
|
25
31
|
var YARN_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, YARN_LOCK_FILE);
|
|
26
32
|
var NPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, NPM_LOCK_FILE);
|
|
27
33
|
var PNPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, PNPM_LOCK_FILE);
|
|
34
|
+
var BUN_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, BUN_LOCK_FILE);
|
|
28
35
|
function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
|
29
36
|
try {
|
|
30
37
|
if (packageManager === "yarn") {
|
|
@@ -97,21 +104,30 @@ function lockFileExists(packageManager) {
|
|
|
97
104
|
if (packageManager === "npm") {
|
|
98
105
|
return _fs.existsSync.call(void 0, NPM_LOCK_PATH);
|
|
99
106
|
}
|
|
107
|
+
if (packageManager === "bun") {
|
|
108
|
+
return _fs.existsSync.call(void 0, BUN_LOCK_PATH) || _fs.existsSync.call(void 0, _path.join.call(void 0, _devkit.workspaceRoot, "bun.lockb"));
|
|
109
|
+
}
|
|
100
110
|
throw new Error(
|
|
101
111
|
`Unknown package manager ${packageManager} or lock file missing`
|
|
102
112
|
);
|
|
103
113
|
}
|
|
114
|
+
var LOCK_FILE_BY_PACKAGE_MANAGER = {
|
|
115
|
+
npm: "package-lock.json",
|
|
116
|
+
yarn: "yarn.lock",
|
|
117
|
+
pnpm: "pnpm-lock.yaml",
|
|
118
|
+
bun: "bun.lock"
|
|
119
|
+
};
|
|
120
|
+
var OTHER_LOCK_FILES = {
|
|
121
|
+
npm: ["yarn.lock", "pnpm-lock.yaml", "bun.lock", "bun.lockb"],
|
|
122
|
+
yarn: ["package-lock.json", "pnpm-lock.yaml", "bun.lock", "bun.lockb"],
|
|
123
|
+
pnpm: ["package-lock.json", "yarn.lock", "bun.lock", "bun.lockb"],
|
|
124
|
+
bun: ["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb"]
|
|
125
|
+
};
|
|
104
126
|
function getLockFileName(packageManager) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return PNPM_LOCK_FILE;
|
|
110
|
-
}
|
|
111
|
-
if (packageManager === "npm") {
|
|
112
|
-
return NPM_LOCK_FILE;
|
|
113
|
-
}
|
|
114
|
-
throw new Error(`Unknown package manager: ${packageManager}`);
|
|
127
|
+
return LOCK_FILE_BY_PACKAGE_MANAGER[packageManager];
|
|
128
|
+
}
|
|
129
|
+
function getOtherLockFileNames(packageManager) {
|
|
130
|
+
return OTHER_LOCK_FILES[packageManager];
|
|
115
131
|
}
|
|
116
132
|
function errorBodyLines(originalError, additionalInfo = []) {
|
|
117
133
|
const result = [
|
|
@@ -145,4 +161,9 @@ function isPostInstallProcess() {
|
|
|
145
161
|
|
|
146
162
|
|
|
147
163
|
|
|
148
|
-
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
exports.YARN_LOCK_FILE = YARN_LOCK_FILE; exports.NPM_LOCK_FILE = NPM_LOCK_FILE; exports.PNPM_LOCK_FILE = PNPM_LOCK_FILE; exports.BUN_LOCK_FILE = BUN_LOCK_FILE; exports.LOCK_FILES = LOCK_FILES; exports.YARN_LOCK_PATH = YARN_LOCK_PATH; exports.NPM_LOCK_PATH = NPM_LOCK_PATH; exports.PNPM_LOCK_PATH = PNPM_LOCK_PATH; exports.BUN_LOCK_PATH = BUN_LOCK_PATH; exports.getLockFileNodes = getLockFileNodes; exports.getLockFileDependencies = getLockFileDependencies; exports.lockFileExists = lockFileExists; exports.LOCK_FILE_BY_PACKAGE_MANAGER = LOCK_FILE_BY_PACKAGE_MANAGER; exports.OTHER_LOCK_FILES = OTHER_LOCK_FILES; exports.getLockFileName = getLockFileName; exports.getOtherLockFileNames = getOtherLockFileNames;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getLockFileName
|
|
3
|
+
} from "./chunk-VQYZG5YE.mjs";
|
|
1
4
|
import {
|
|
2
5
|
nodeVersion,
|
|
6
|
+
packageManagerVersions,
|
|
3
7
|
pnpmVersion
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DEHA5C77.mjs";
|
|
5
9
|
import {
|
|
6
10
|
withRunGenerator
|
|
7
11
|
} from "./chunk-Y5BPWYHW.mjs";
|
|
@@ -15,12 +19,17 @@ import {
|
|
|
15
19
|
addProjectConfiguration,
|
|
16
20
|
formatFiles,
|
|
17
21
|
generateFiles,
|
|
22
|
+
getPackageManagerCommand,
|
|
18
23
|
joinPathFragments,
|
|
19
24
|
updateJson
|
|
20
25
|
} from "@nx/devkit";
|
|
21
26
|
import * as path from "node:path";
|
|
22
27
|
async function presetGeneratorFn(tree, options) {
|
|
23
28
|
const projectRoot = ".";
|
|
29
|
+
const packageManager = options.packageManager ?? "pnpm";
|
|
30
|
+
const packageManagerVersion = packageManagerVersions[packageManager];
|
|
31
|
+
const pmc = getPackageManagerCommand(packageManager);
|
|
32
|
+
const lockFileName = getLockFileName(packageManager);
|
|
24
33
|
options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
|
|
25
34
|
options.namespace ??= options.organization;
|
|
26
35
|
addProjectConfiguration(tree, `@${options.namespace}/${options.name}`, {
|
|
@@ -88,11 +97,6 @@ async function presetGeneratorFn(tree, options) {
|
|
|
88
97
|
type: "github",
|
|
89
98
|
url: `${options.repositoryUrl}.git`
|
|
90
99
|
};
|
|
91
|
-
json.packageManager ??= "pnpm@10.3.0";
|
|
92
|
-
json.engines ??= {
|
|
93
|
-
node: ">=20.11.0",
|
|
94
|
-
pnpm: ">=10.3.0"
|
|
95
|
-
};
|
|
96
100
|
json.prettier = "@storm-software/prettier/config.json";
|
|
97
101
|
json.nx ??= {
|
|
98
102
|
includedScripts: [
|
|
@@ -109,14 +113,14 @@ async function presetGeneratorFn(tree, options) {
|
|
|
109
113
|
"release"
|
|
110
114
|
]
|
|
111
115
|
};
|
|
112
|
-
json.scripts.adr = "
|
|
113
|
-
json.scripts["adr-preview"] = "
|
|
114
|
-
json.scripts.prepare =
|
|
115
|
-
json.scripts.preinstall =
|
|
116
|
-
json.scripts["install-csb"] = "corepack enable &&
|
|
116
|
+
json.scripts.adr = pmc.run("log4brains", "adr new");
|
|
117
|
+
json.scripts["adr-preview"] = pmc.run("log4brains", "preview");
|
|
118
|
+
json.scripts.prepare = `${pmc.addDev} lefthook && ${packageManager} lefthook install`;
|
|
119
|
+
json.scripts.preinstall = `npx -y only-allow ${packageManager}`;
|
|
120
|
+
json.scripts["install-csb"] = packageManager === "bun" ? "bun install" : `corepack enable && ${pmc.install}`;
|
|
117
121
|
json.scripts.clean = "rimraf dist && rimraf --glob packages/**/dist && rimraf --glob tools/**/dist && rimraf --glob docs/**/dist && rimraf --glob apps/**/dist && rimraf --glob libs/**/dist";
|
|
118
|
-
json.scripts.nuke =
|
|
119
|
-
json.scripts.prebuild =
|
|
122
|
+
json.scripts.nuke = `nx clear-cache && rimraf .nx/cache && rimraf .nx/workspace-data && ${packageManager} clean && rimraf ${lockFileName} && rimraf --glob packages/**/node_modules && rimraf --glob tools/**/node_modules && rimraf node_modules`;
|
|
123
|
+
json.scripts.prebuild = `${packageManager} clean`;
|
|
120
124
|
json.scripts.build = "nx affected -t build --parallel=5";
|
|
121
125
|
json.scripts["build-all"] = "nx run-many -t build --all --parallel=5";
|
|
122
126
|
json.scripts["build-prod"] = "nx run-many -t build --all --prod --parallel=5";
|
|
@@ -131,45 +135,53 @@ async function presetGeneratorFn(tree, options) {
|
|
|
131
135
|
}
|
|
132
136
|
json.scripts.nx = "nx";
|
|
133
137
|
json.scripts.graph = "nx graph";
|
|
134
|
-
json.scripts.lint = "pnpm storm-lint all --skip-cspell --skip-alex";
|
|
135
138
|
if (options.includeApps) {
|
|
136
139
|
json.scripts.start = "nx serve";
|
|
137
|
-
json.scripts.storybook = "
|
|
140
|
+
json.scripts.storybook = pmc.run("storybook", "dev -p 6006");
|
|
138
141
|
}
|
|
139
142
|
json.scripts.help = "nx help";
|
|
140
143
|
json.scripts["dep-graph"] = "nx dep-graph";
|
|
141
144
|
json.scripts["local-registry"] = `nx local-registry @${options.namespace}/${options.name}`;
|
|
142
145
|
json.scripts.e2e = "nx e2e";
|
|
143
146
|
if (options.includeApps) {
|
|
144
|
-
json.scripts.test =
|
|
145
|
-
json.scripts["test-storybook"] =
|
|
147
|
+
json.scripts.test = `nx test && ${packageManager} test-storybook`;
|
|
148
|
+
json.scripts["test-storybook"] = `${packageManager} test-storybook`;
|
|
146
149
|
} else {
|
|
147
150
|
json.scripts.test = "nx test";
|
|
148
151
|
}
|
|
149
|
-
json.scripts.
|
|
150
|
-
json.scripts
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
json.scripts.commit = pmc.run("storm-git", "commit");
|
|
153
|
+
json.scripts["api-extractor"] = pmc.run(
|
|
154
|
+
"storm-docs",
|
|
155
|
+
'api-extractor --outputPath="docs/api-reference" --clean'
|
|
156
|
+
);
|
|
157
|
+
json.scripts.release = pmc.run("storm-git", "release");
|
|
153
158
|
json.scripts.format = "nx format:write";
|
|
154
|
-
json.scripts["format-sherif"] =
|
|
155
|
-
json.scripts["format-toml"] =
|
|
156
|
-
json.scripts["format-readme"] =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
json.scripts["
|
|
161
|
-
json.scripts
|
|
162
|
-
json.
|
|
159
|
+
json.scripts["format-sherif"] = `${pmc.exec} sherif -f -i typescript -i react -i react-dom`;
|
|
160
|
+
json.scripts["format-toml"] = `${pmc.exec} taplo format --config="./node_modules/@storm-software/linting-tools/taplo/config.toml" --cache-path="./node_modules/.cache/storm/taplo"`;
|
|
161
|
+
json.scripts["format-readme"] = pmc.run(
|
|
162
|
+
"storm-git",
|
|
163
|
+
'readme --templates="tools/readme-templates"'
|
|
164
|
+
);
|
|
165
|
+
json.scripts["format-prettier"] = `${pmc.exec} prettier --write --ignore-unknown --no-error-on-unmatched-pattern --cache && git update-index`;
|
|
166
|
+
json.scripts.lint = pmc.run("storm-lint", "all --skip-cspell");
|
|
167
|
+
json.scripts["lint-knip"] = `${pmc.exec} knip`;
|
|
168
|
+
json.scripts["lint-sherif"] = `${pmc.exec} sherif -i typescript -i react -i react-dom`;
|
|
169
|
+
json.scripts["lint-ls"] = `${pmc.exec} ls-lint --config="./node_modules/@storm-software/linting-tools/ls-lint/ls-lint.yml"`;
|
|
170
|
+
json.packageManager ??= `${packageManager}@${packageManagerVersion}`;
|
|
163
171
|
json.engines = {
|
|
164
172
|
node: `>=${nodeVersion}`,
|
|
165
|
-
|
|
173
|
+
[packageManager]: `>=${packageManagerVersion}`
|
|
166
174
|
};
|
|
167
175
|
return json;
|
|
168
176
|
});
|
|
169
177
|
generateFiles(tree, path.join(__dirname, "files"), projectRoot, {
|
|
170
178
|
...options,
|
|
179
|
+
packageManager,
|
|
180
|
+
packageManagerVersion,
|
|
171
181
|
pnpmVersion,
|
|
172
|
-
nodeVersion
|
|
182
|
+
nodeVersion,
|
|
183
|
+
lockFileName,
|
|
184
|
+
exec: pmc.exec
|
|
173
185
|
});
|
|
174
186
|
await formatFiles(tree);
|
|
175
187
|
let dependencies = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
-
var
|
|
3
|
+
var _chunk3G7PNDZ5js = require('./chunk-3G7PNDZ5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -155,16 +155,45 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
if (tree.exists("package.json") && normalized.importPath) {
|
|
158
|
-
_devkit.updateJson.call(void 0, tree, "package.json", (json) =>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
_devkit.updateJson.call(void 0, tree, "package.json", (json) => {
|
|
159
|
+
if (_optionalChain([config, 'optionalAccess', _10 => _10.packageManager]) === "yarn") {
|
|
160
|
+
return {
|
|
161
|
+
...json,
|
|
162
|
+
resolutions: {
|
|
163
|
+
..._optionalChain([json, 'optionalAccess', _11 => _11.resolutions]),
|
|
164
|
+
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (_optionalChain([config, 'optionalAccess', _12 => _12.packageManager]) === "npm") {
|
|
169
|
+
return {
|
|
170
|
+
...json,
|
|
171
|
+
overrides: {
|
|
172
|
+
..._optionalChain([json, 'optionalAccess', _13 => _13.overrides]),
|
|
173
|
+
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
if (_optionalChain([config, 'optionalAccess', _14 => _14.packageManager]) === "bun") {
|
|
178
|
+
return {
|
|
179
|
+
...json,
|
|
180
|
+
overrides: {
|
|
181
|
+
..._optionalChain([json, 'optionalAccess', _15 => _15.overrides]),
|
|
182
|
+
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
166
185
|
}
|
|
167
|
-
|
|
186
|
+
return {
|
|
187
|
+
...json,
|
|
188
|
+
pnpm: {
|
|
189
|
+
..._optionalChain([json, 'optionalAccess', _16 => _16.pnpm]),
|
|
190
|
+
overrides: {
|
|
191
|
+
..._optionalChain([json, 'optionalAccess', _17 => _17.pnpm, 'optionalAccess', _18 => _18.overrides]),
|
|
192
|
+
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
});
|
|
168
197
|
}
|
|
169
198
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
170
199
|
_chunkCQDBLKPFjs.joinPaths.call(void 0,
|
|
@@ -178,10 +207,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
178
207
|
]);
|
|
179
208
|
if (tree.exists("package.json")) {
|
|
180
209
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
181
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
210
|
+
if (_optionalChain([packageJson, 'optionalAccess', _19 => _19.repository])) {
|
|
182
211
|
repository = packageJson.repository;
|
|
183
212
|
}
|
|
184
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
213
|
+
if (_optionalChain([packageJson, 'optionalAccess', _20 => _20.description])) {
|
|
185
214
|
description = packageJson.description;
|
|
186
215
|
}
|
|
187
216
|
}
|
|
@@ -218,22 +247,22 @@ function getOutputPath(options) {
|
|
|
218
247
|
function createProjectTsConfigJson(tree, options) {
|
|
219
248
|
const tsconfig = {
|
|
220
249
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
221
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
250
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.tsconfigOptions]), () => ( {})),
|
|
222
251
|
compilerOptions: {
|
|
223
252
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
224
253
|
outDir: _chunkCQDBLKPFjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
225
254
|
noEmit: true,
|
|
226
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
255
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _22 => _22.tsconfigOptions, 'optionalAccess', _23 => _23.compilerOptions]), () => ( {}))
|
|
227
256
|
},
|
|
228
|
-
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
257
|
+
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.tsconfigOptions, 'optionalAccess', _25 => _25.files]), () => ( []))],
|
|
229
258
|
include: [
|
|
230
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
259
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.tsconfigOptions, 'optionalAccess', _27 => _27.include]), () => ( [])),
|
|
231
260
|
"src/**/*.ts",
|
|
232
261
|
"src/**/*.js",
|
|
233
262
|
"bin/**/*"
|
|
234
263
|
],
|
|
235
264
|
exclude: [
|
|
236
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
265
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _28 => _28.tsconfigOptions, 'optionalAccess', _29 => _29.exclude]), () => ( [])),
|
|
237
266
|
"jest.config.ts",
|
|
238
267
|
"src/**/*.spec.ts",
|
|
239
268
|
"src/**/*.test.ts"
|
|
@@ -243,8 +272,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
243
272
|
}
|
|
244
273
|
async function normalizeOptions(tree, options, config) {
|
|
245
274
|
let importPath = options.importPath;
|
|
246
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
247
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
275
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _30 => _30.namespace])) {
|
|
276
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _31 => _31.namespace])}/${options.name}`;
|
|
248
277
|
}
|
|
249
278
|
if (options.publishable) {
|
|
250
279
|
if (!importPath) {
|
|
@@ -257,7 +286,7 @@ async function normalizeOptions(tree, options, config) {
|
|
|
257
286
|
if (options.publishable === false && options.buildable === false) {
|
|
258
287
|
bundler = "none";
|
|
259
288
|
}
|
|
260
|
-
const { Linter } = _devkit.ensurePackage.call(void 0, "@nx/eslint",
|
|
289
|
+
const { Linter } = _devkit.ensurePackage.call(void 0, "@nx/eslint", _chunk3G7PNDZ5js.nxVersion);
|
|
261
290
|
const rootProject = false;
|
|
262
291
|
const {
|
|
263
292
|
projectName,
|