@storm-software/workspace-tools 1.10.13 → 1.10.14
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 +7 -0
- package/index.js +48 -49
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +56 -55
- package/src/executors/tsup/get-config.js +21726 -33182
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.10.13](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.10.12...workspace-tools-v1.10.13) (2023-11-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Update entry creation code in tsup build ([6c8b12f](https://github.com/storm-software/storm-ops/commit/6c8b12fd6ae01659f004525cc4dfdbab484e3096))
|
|
7
|
+
|
|
1
8
|
## [1.10.12](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.10.11...workspace-tools-v1.10.12) (2023-11-24)
|
|
2
9
|
|
|
3
10
|
|
package/index.js
CHANGED
|
@@ -4206,12 +4206,12 @@ var require_install_packages_task = __commonJS({
|
|
|
4206
4206
|
var child_process_1 = require("child_process");
|
|
4207
4207
|
var path_1 = require("path");
|
|
4208
4208
|
var nx_1 = require_nx();
|
|
4209
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
4209
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments3 } = (0, nx_1.requireNx)();
|
|
4210
4210
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
4211
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
4211
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments3(cwd, "package.json")) && !alwaysRun) {
|
|
4212
4212
|
return;
|
|
4213
4213
|
}
|
|
4214
|
-
const packageJsonValue = tree.read(
|
|
4214
|
+
const packageJsonValue = tree.read(joinPathFragments3(cwd, "package.json"), "utf-8");
|
|
4215
4215
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
4216
4216
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
4217
4217
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -222808,7 +222808,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
222808
222808
|
var nx_1 = require_nx();
|
|
222809
222809
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
222810
222810
|
var names_1 = require_names();
|
|
222811
|
-
var { joinPathFragments:
|
|
222811
|
+
var { joinPathFragments: joinPathFragments3, normalizePath, logger, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
222812
222812
|
var deprecationWarning = stripIndents`
|
|
222813
222813
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
222814
222814
|
Please provide the exact project name and root in the future.`;
|
|
@@ -222884,14 +222884,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
222884
222884
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
222885
222885
|
asProvidedProjectDirectory = directory;
|
|
222886
222886
|
} else {
|
|
222887
|
-
asProvidedProjectDirectory =
|
|
222887
|
+
asProvidedProjectDirectory = joinPathFragments3(relativeCwd, directory);
|
|
222888
222888
|
}
|
|
222889
222889
|
} else if (options.rootProject) {
|
|
222890
222890
|
asProvidedProjectDirectory = ".";
|
|
222891
222891
|
} else {
|
|
222892
222892
|
asProvidedProjectDirectory = relativeCwd;
|
|
222893
222893
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
222894
|
-
asProvidedProjectDirectory =
|
|
222894
|
+
asProvidedProjectDirectory = joinPathFragments3(relativeCwd, asProvidedProjectName);
|
|
222895
222895
|
}
|
|
222896
222896
|
}
|
|
222897
222897
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -222924,7 +222924,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
222924
222924
|
const derivedSimpleProjectName = name;
|
|
222925
222925
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
222926
222926
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
222927
|
-
derivedProjectDirectory =
|
|
222927
|
+
derivedProjectDirectory = joinPathFragments3(layoutDirectory, derivedProjectDirectory);
|
|
222928
222928
|
}
|
|
222929
222929
|
let derivedImportPath;
|
|
222930
222930
|
if (options.projectType === "library") {
|
|
@@ -468022,7 +468022,7 @@ __export(workspace_tools_exports, {
|
|
|
468022
468022
|
module.exports = __toCommonJS(workspace_tools_exports);
|
|
468023
468023
|
|
|
468024
468024
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
468025
|
-
var
|
|
468025
|
+
var import_devkit = __toESM(require_devkit());
|
|
468026
468026
|
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
468027
468027
|
var import_js = __toESM(require_src());
|
|
468028
468028
|
|
|
@@ -474210,11 +474210,10 @@ var import_tsup2 = __toESM(require_dist5());
|
|
|
474210
474210
|
var import_find_workspace_root = require("nx/src/utils/find-workspace-root.js");
|
|
474211
474211
|
|
|
474212
474212
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
474213
|
-
var import_devkit = __toESM(require_devkit());
|
|
474214
474213
|
var import_tsup = __toESM(require_dist5());
|
|
474215
474214
|
|
|
474216
474215
|
// packages/workspace-tools/src/generators/init/init.ts
|
|
474217
|
-
var
|
|
474216
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
474218
474217
|
|
|
474219
474218
|
// packages/workspace-tools/src/utils/versions.ts
|
|
474220
474219
|
var tsupVersion = "^7.2.0";
|
|
@@ -474238,7 +474237,7 @@ var pnpmVersion = "8.10.2";
|
|
|
474238
474237
|
|
|
474239
474238
|
// packages/workspace-tools/src/generators/init/init.ts
|
|
474240
474239
|
async function stormInitGenerator(tree, schema) {
|
|
474241
|
-
const task = (0,
|
|
474240
|
+
const task = (0, import_devkit2.addDependenciesToPackageJson)(
|
|
474242
474241
|
tree,
|
|
474243
474242
|
{
|
|
474244
474243
|
"nx": nxVersion,
|
|
@@ -474250,19 +474249,19 @@ async function stormInitGenerator(tree, schema) {
|
|
|
474250
474249
|
{}
|
|
474251
474250
|
);
|
|
474252
474251
|
if (!schema.skipFormat) {
|
|
474253
|
-
await (0,
|
|
474252
|
+
await (0, import_devkit2.formatFiles)(tree);
|
|
474254
474253
|
}
|
|
474255
474254
|
return task;
|
|
474256
474255
|
}
|
|
474257
474256
|
|
|
474258
474257
|
// packages/workspace-tools/src/generators/node-library/generator.ts
|
|
474259
|
-
var
|
|
474258
|
+
var import_devkit4 = __toESM(require_devkit());
|
|
474260
474259
|
var import_js2 = __toESM(require_src());
|
|
474261
474260
|
var import_init = __toESM(require_init());
|
|
474262
474261
|
var import_generator = __toESM(require_generator());
|
|
474263
474262
|
|
|
474264
474263
|
// packages/workspace-tools/src/generators/node-library/normalize-options.ts
|
|
474265
|
-
var
|
|
474264
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
474266
474265
|
var import_project_name_and_root_utils = __toESM(require_project_name_and_root_utils());
|
|
474267
474266
|
async function normalizeOptions(tree, options) {
|
|
474268
474267
|
if (options.publishable) {
|
|
@@ -474276,7 +474275,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474276
474275
|
if (options.publishable === false && options.buildable === false) {
|
|
474277
474276
|
bundler = "none";
|
|
474278
474277
|
}
|
|
474279
|
-
const { Linter } = (0,
|
|
474278
|
+
const { Linter } = (0, import_devkit3.ensurePackage)("@nx/eslint", nxVersion);
|
|
474280
474279
|
const {
|
|
474281
474280
|
projectName,
|
|
474282
474281
|
names: projectNames,
|
|
@@ -474292,7 +474291,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474292
474291
|
callingGenerator: "@nx/js:library"
|
|
474293
474292
|
});
|
|
474294
474293
|
options.rootProject = projectRoot === ".";
|
|
474295
|
-
const normalized = (0,
|
|
474294
|
+
const normalized = (0, import_devkit3.names)(projectNames.projectFileName);
|
|
474296
474295
|
const fileName = normalized.fileName;
|
|
474297
474296
|
return {
|
|
474298
474297
|
js: false,
|
|
@@ -474320,7 +474319,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474320
474319
|
|
|
474321
474320
|
// packages/workspace-tools/src/generators/node-library/generator.ts
|
|
474322
474321
|
async function nodeLibraryGenerator(tree, schema) {
|
|
474323
|
-
const filesDir = (0,
|
|
474322
|
+
const filesDir = (0, import_devkit4.joinPathFragments)(__dirname, "./files");
|
|
474324
474323
|
const options = await normalizeOptions(tree, schema);
|
|
474325
474324
|
const tasks = [];
|
|
474326
474325
|
tasks.push(
|
|
@@ -474330,7 +474329,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474330
474329
|
})
|
|
474331
474330
|
);
|
|
474332
474331
|
tasks.push(
|
|
474333
|
-
(0,
|
|
474332
|
+
(0, import_devkit4.addDependenciesToPackageJson)(
|
|
474334
474333
|
tree,
|
|
474335
474334
|
{},
|
|
474336
474335
|
{
|
|
@@ -474343,22 +474342,22 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474343
474342
|
if (options.publishable) {
|
|
474344
474343
|
tasks.push(await (0, import_generator.default)(tree, { ...options, skipFormat: true }));
|
|
474345
474344
|
}
|
|
474346
|
-
const { className, name, propertyName } = (0,
|
|
474345
|
+
const { className, name, propertyName } = (0, import_devkit4.names)(
|
|
474347
474346
|
options.projectNames.projectFileName
|
|
474348
474347
|
);
|
|
474349
474348
|
createProjectTsConfigJson(tree, options);
|
|
474350
|
-
(0,
|
|
474349
|
+
(0, import_devkit4.addProjectConfiguration)(tree, options.name, {
|
|
474351
474350
|
root: options.directory,
|
|
474352
474351
|
projectType: "library",
|
|
474353
|
-
sourceRoot: (0,
|
|
474352
|
+
sourceRoot: (0, import_devkit4.joinPathFragments)(options.directory, "src"),
|
|
474354
474353
|
targets: {
|
|
474355
474354
|
build: {
|
|
474356
474355
|
executor: "@storm-software/workspace-tools:tsup",
|
|
474357
474356
|
outputs: ["{options.outputPath}"],
|
|
474358
474357
|
options: {
|
|
474359
474358
|
outputPath: getOutputPath(options),
|
|
474360
|
-
tsConfig: (0,
|
|
474361
|
-
project: (0,
|
|
474359
|
+
tsConfig: (0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
474360
|
+
project: (0, import_devkit4.joinPathFragments)(options.projectRoot, "package.json"),
|
|
474362
474361
|
defaultConfiguration: "production",
|
|
474363
474362
|
platform: "node"
|
|
474364
474363
|
},
|
|
@@ -474377,7 +474376,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474377
474376
|
test: {}
|
|
474378
474377
|
}
|
|
474379
474378
|
});
|
|
474380
|
-
(0,
|
|
474379
|
+
(0, import_devkit4.generateFiles)(tree, filesDir, options.projectRoot, {
|
|
474381
474380
|
...options,
|
|
474382
474381
|
dot: ".",
|
|
474383
474382
|
className,
|
|
@@ -474387,7 +474386,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474387
474386
|
cliCommand: "nx",
|
|
474388
474387
|
strict: void 0,
|
|
474389
474388
|
tmpl: "",
|
|
474390
|
-
offsetFromRoot: (0,
|
|
474389
|
+
offsetFromRoot: (0, import_devkit4.offsetFromRoot)(options.projectRoot),
|
|
474391
474390
|
buildable: options.bundler && options.bundler !== "none",
|
|
474392
474391
|
hasUnitTestRunner: options.unitTestRunner !== "none"
|
|
474393
474392
|
});
|
|
@@ -474397,16 +474396,16 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474397
474396
|
};
|
|
474398
474397
|
let description = schema.description ?? "\u26A1 A Storm package used to create modern, scalable web applications.";
|
|
474399
474398
|
if (tree.exists("package.json")) {
|
|
474400
|
-
const packageJson = (0,
|
|
474399
|
+
const packageJson = (0, import_devkit4.readJson)(tree, "package.json");
|
|
474401
474400
|
packageJson?.repository && (repository = packageJson.repository);
|
|
474402
474401
|
packageJson?.description && (description = packageJson.description);
|
|
474403
474402
|
}
|
|
474404
|
-
const packageJsonPath = (0,
|
|
474403
|
+
const packageJsonPath = (0, import_devkit4.joinPathFragments)(
|
|
474405
474404
|
options.projectRoot,
|
|
474406
474405
|
"package.json"
|
|
474407
474406
|
);
|
|
474408
474407
|
if (tree.exists(packageJsonPath)) {
|
|
474409
|
-
(0,
|
|
474408
|
+
(0, import_devkit4.updateJson)(tree, packageJsonPath, (json) => {
|
|
474410
474409
|
json.name = options.importPath;
|
|
474411
474410
|
json.version = "0.0.1";
|
|
474412
474411
|
if (json.private && (options.publishable || options.rootProject)) {
|
|
@@ -474430,7 +474429,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474430
474429
|
};
|
|
474431
474430
|
});
|
|
474432
474431
|
} else {
|
|
474433
|
-
(0,
|
|
474432
|
+
(0, import_devkit4.writeJson)(tree, packageJsonPath, {
|
|
474434
474433
|
name: options.importPath,
|
|
474435
474434
|
version: "0.0.1",
|
|
474436
474435
|
description,
|
|
@@ -474446,7 +474445,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474446
474445
|
});
|
|
474447
474446
|
}
|
|
474448
474447
|
if (tree.exists("package.json")) {
|
|
474449
|
-
(0,
|
|
474448
|
+
(0, import_devkit4.updateJson)(tree, "package.json", (json) => ({
|
|
474450
474449
|
...json,
|
|
474451
474450
|
pnpm: {
|
|
474452
474451
|
...json?.pnpm,
|
|
@@ -474458,32 +474457,32 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474458
474457
|
}));
|
|
474459
474458
|
}
|
|
474460
474459
|
(0, import_js2.addTsConfigPath)(tree, options.importPath, [
|
|
474461
|
-
(0,
|
|
474460
|
+
(0, import_devkit4.joinPathFragments)(
|
|
474462
474461
|
options.projectRoot,
|
|
474463
474462
|
"./src",
|
|
474464
474463
|
"index." + (options.js ? "js" : "ts")
|
|
474465
474464
|
)
|
|
474466
474465
|
]);
|
|
474467
|
-
(0, import_js2.addTsConfigPath)(tree, (0,
|
|
474468
|
-
(0,
|
|
474466
|
+
(0, import_js2.addTsConfigPath)(tree, (0, import_devkit4.joinPathFragments)(options.importPath, "/*"), [
|
|
474467
|
+
(0, import_devkit4.joinPathFragments)(options.projectRoot, "./src", "/*")
|
|
474469
474468
|
]);
|
|
474470
474469
|
if (tree.exists("package.json")) {
|
|
474471
|
-
const packageJson = (0,
|
|
474470
|
+
const packageJson = (0, import_devkit4.readJson)(tree, "package.json");
|
|
474472
474471
|
packageJson?.repository && (repository = packageJson.repository);
|
|
474473
474472
|
packageJson?.description && (description = packageJson.description);
|
|
474474
474473
|
}
|
|
474475
|
-
const tsconfigPath = (0,
|
|
474474
|
+
const tsconfigPath = (0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json");
|
|
474476
474475
|
if (tree.exists(tsconfigPath)) {
|
|
474477
|
-
(0,
|
|
474476
|
+
(0, import_devkit4.updateJson)(tree, tsconfigPath, (json) => {
|
|
474478
474477
|
json.composite ??= true;
|
|
474479
474478
|
return json;
|
|
474480
474479
|
});
|
|
474481
474480
|
} else {
|
|
474482
|
-
(0,
|
|
474483
|
-
extends: `${(0,
|
|
474481
|
+
(0, import_devkit4.writeJson)(tree, tsconfigPath, {
|
|
474482
|
+
extends: `${(0, import_devkit4.offsetFromRoot)(options.projectRoot)}tsconfig.base.json`,
|
|
474484
474483
|
composite: true,
|
|
474485
474484
|
compilerOptions: {
|
|
474486
|
-
outDir: `${(0,
|
|
474485
|
+
outDir: `${(0, import_devkit4.offsetFromRoot)(options.projectRoot)}dist/out-tsc`
|
|
474487
474486
|
},
|
|
474488
474487
|
files: [],
|
|
474489
474488
|
include: ["src/**/*.ts", "src/**/*.js"],
|
|
@@ -474492,20 +474491,20 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474492
474491
|
}
|
|
474493
474492
|
const lintCallback = await addLint(tree, options);
|
|
474494
474493
|
tasks.push(lintCallback);
|
|
474495
|
-
await (0,
|
|
474494
|
+
await (0, import_devkit4.formatFiles)(tree);
|
|
474496
474495
|
}
|
|
474497
474496
|
async function addLint(tree, options) {
|
|
474498
|
-
const { lintProjectGenerator } = (0,
|
|
474497
|
+
const { lintProjectGenerator } = (0, import_devkit4.ensurePackage)("@nx/eslint", nxVersion);
|
|
474499
474498
|
const { mapLintPattern } = (
|
|
474500
474499
|
// nx-ignore-next-line
|
|
474501
474500
|
require_lint_project()
|
|
474502
474501
|
);
|
|
474503
|
-
const projectConfiguration = (0,
|
|
474502
|
+
const projectConfiguration = (0, import_devkit4.readProjectConfiguration)(tree, options.name);
|
|
474504
474503
|
const task = lintProjectGenerator(tree, {
|
|
474505
474504
|
project: options.name,
|
|
474506
474505
|
linter: options.linter,
|
|
474507
474506
|
skipFormat: true,
|
|
474508
|
-
tsConfigPaths: [(0,
|
|
474507
|
+
tsConfigPaths: [(0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json")],
|
|
474509
474508
|
unitTestRunner: options.unitTestRunner,
|
|
474510
474509
|
eslintFilePatterns: [
|
|
474511
474510
|
mapLintPattern(
|
|
@@ -474576,15 +474575,15 @@ function getOutputPath(options) {
|
|
|
474576
474575
|
} else {
|
|
474577
474576
|
parts.push(options.projectRoot);
|
|
474578
474577
|
}
|
|
474579
|
-
return (0,
|
|
474578
|
+
return (0, import_devkit4.joinPathFragments)(...parts);
|
|
474580
474579
|
}
|
|
474581
474580
|
function createProjectTsConfigJson(tree, options) {
|
|
474582
474581
|
const tsconfig = {
|
|
474583
474582
|
extends: options.rootProject ? void 0 : (0, import_js2.getRelativePathToRootTsConfig)(tree, options.projectRoot),
|
|
474584
474583
|
compilerOptions: {
|
|
474585
474584
|
...options.rootProject ? import_js2.tsConfigBaseOptions : {},
|
|
474586
|
-
outDir: (0,
|
|
474587
|
-
(0,
|
|
474585
|
+
outDir: (0, import_devkit4.joinPathFragments)(
|
|
474586
|
+
(0, import_devkit4.offsetFromRoot)(options.projectRoot),
|
|
474588
474587
|
"dist/out-tsc"
|
|
474589
474588
|
),
|
|
474590
474589
|
noEmit: true
|
|
@@ -474593,15 +474592,15 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
474593
474592
|
include: ["src/**/*.ts", "src/**/*.js", "bin/**/*"],
|
|
474594
474593
|
exclude: ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
|
474595
474594
|
};
|
|
474596
|
-
(0,
|
|
474595
|
+
(0, import_devkit4.writeJson)(
|
|
474597
474596
|
tree,
|
|
474598
|
-
(0,
|
|
474597
|
+
(0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
474599
474598
|
tsconfig
|
|
474600
474599
|
);
|
|
474601
474600
|
}
|
|
474602
474601
|
|
|
474603
474602
|
// packages/workspace-tools/src/generators/preset/generator.ts
|
|
474604
|
-
var
|
|
474603
|
+
var import_devkit5 = __toESM(require_devkit());
|
|
474605
474604
|
// Annotate the CommonJS export names for ESM import in node:
|
|
474606
474605
|
0 && (module.exports = {
|
|
474607
474606
|
eslintVersion,
|