@storm-software/workspace-tools 1.10.13 → 1.10.15
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 +15 -0
- package/index.js +63 -60
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +71 -66
- package/src/executors/tsup/get-config.js +22924 -34376
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.10.14](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.10.13...workspace-tools-v1.10.14) (2023-11-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Resolved issue with bad import ([e795302](https://github.com/storm-software/storm-ops/commit/e795302f766b5fea4e27c60ffdc09cade02041e1))
|
|
7
|
+
* **workspace-tools:** Update path joins in tsup build ([696a0a3](https://github.com/storm-software/storm-ops/commit/696a0a3d487009b00fb50915fb0c62db40f728dc))
|
|
8
|
+
|
|
9
|
+
## [1.10.13](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.10.12...workspace-tools-v1.10.13) (2023-11-24)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **workspace-tools:** Update entry creation code in tsup build ([6c8b12f](https://github.com/storm-software/storm-ops/commit/6c8b12fd6ae01659f004525cc4dfdbab484e3096))
|
|
15
|
+
|
|
1
16
|
## [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
17
|
|
|
3
18
|
|
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") {
|
|
@@ -408390,9 +408390,9 @@ var require_brace_expansion2 = __commonJS({
|
|
|
408390
408390
|
}
|
|
408391
408391
|
});
|
|
408392
408392
|
|
|
408393
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
408393
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
408394
408394
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
408395
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
408395
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
408396
408396
|
"use strict";
|
|
408397
408397
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
408398
408398
|
var version = "8.0.0";
|
|
@@ -410039,9 +410039,9 @@ var require_resolve_from = __commonJS({
|
|
|
410039
410039
|
}
|
|
410040
410040
|
});
|
|
410041
410041
|
|
|
410042
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
410042
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-GQ77QZBO.js
|
|
410043
410043
|
var require_chunk_GQ77QZBO = __commonJS({
|
|
410044
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
410044
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
|
|
410045
410045
|
"use strict";
|
|
410046
410046
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
410047
410047
|
function _interopRequireDefault(obj) {
|
|
@@ -410320,9 +410320,9 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
410320
410320
|
}
|
|
410321
410321
|
});
|
|
410322
410322
|
|
|
410323
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
410323
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-UIX4URMV.js
|
|
410324
410324
|
var require_chunk_UIX4URMV = __commonJS({
|
|
410325
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
410325
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
|
|
410326
410326
|
"use strict";
|
|
410327
410327
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
410328
410328
|
function _interopRequireWildcard(obj) {
|
|
@@ -411256,9 +411256,9 @@ var require_dist2 = __commonJS({
|
|
|
411256
411256
|
}
|
|
411257
411257
|
});
|
|
411258
411258
|
|
|
411259
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
411259
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-7G76EW2R.js
|
|
411260
411260
|
var require_chunk_7G76EW2R = __commonJS({
|
|
411261
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
411261
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
|
|
411262
411262
|
"use strict";
|
|
411263
411263
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
411264
411264
|
function _interopRequireDefault(obj) {
|
|
@@ -465064,9 +465064,9 @@ var require_chokidar = __commonJS({
|
|
|
465064
465064
|
}
|
|
465065
465065
|
});
|
|
465066
465066
|
|
|
465067
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
465067
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/index.js
|
|
465068
465068
|
var require_dist5 = __commonJS({
|
|
465069
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
465069
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=zzk24ms45z5ppmax4s6zmxue6y_@microsoft+api-extractor@7.38.3_@swc+core@1._uvbeqfdidhcbckjrwrnblat7fi/node_modules/tsup/dist/index.js"(exports) {
|
|
465070
465070
|
"use strict";
|
|
465071
465071
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
465072
465072
|
function _interopRequireDefault(obj) {
|
|
@@ -467382,9 +467382,13 @@ var require_dist5 = __commonJS({
|
|
|
467382
467382
|
declarationDir,
|
|
467383
467383
|
emitDeclarationOnly: true
|
|
467384
467384
|
},
|
|
467385
|
+
files: [
|
|
467386
|
+
...rawTsconfig.data.files,
|
|
467387
|
+
`${options.projectRoot}/**/*`
|
|
467388
|
+
],
|
|
467385
467389
|
include: [
|
|
467386
467390
|
...rawTsconfig.data.include,
|
|
467387
|
-
|
|
467391
|
+
`${options.projectRoot}/**/*`
|
|
467388
467392
|
]
|
|
467389
467393
|
},
|
|
467390
467394
|
_typescript2.default.sys,
|
|
@@ -468022,7 +468026,7 @@ __export(workspace_tools_exports, {
|
|
|
468022
468026
|
module.exports = __toCommonJS(workspace_tools_exports);
|
|
468023
468027
|
|
|
468024
468028
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
468025
|
-
var
|
|
468029
|
+
var import_devkit = __toESM(require_devkit());
|
|
468026
468030
|
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
468027
468031
|
var import_js = __toESM(require_src());
|
|
468028
468032
|
|
|
@@ -474210,11 +474214,10 @@ var import_tsup2 = __toESM(require_dist5());
|
|
|
474210
474214
|
var import_find_workspace_root = require("nx/src/utils/find-workspace-root.js");
|
|
474211
474215
|
|
|
474212
474216
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
474213
|
-
var import_devkit = __toESM(require_devkit());
|
|
474214
474217
|
var import_tsup = __toESM(require_dist5());
|
|
474215
474218
|
|
|
474216
474219
|
// packages/workspace-tools/src/generators/init/init.ts
|
|
474217
|
-
var
|
|
474220
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
474218
474221
|
|
|
474219
474222
|
// packages/workspace-tools/src/utils/versions.ts
|
|
474220
474223
|
var tsupVersion = "^7.2.0";
|
|
@@ -474238,7 +474241,7 @@ var pnpmVersion = "8.10.2";
|
|
|
474238
474241
|
|
|
474239
474242
|
// packages/workspace-tools/src/generators/init/init.ts
|
|
474240
474243
|
async function stormInitGenerator(tree, schema) {
|
|
474241
|
-
const task = (0,
|
|
474244
|
+
const task = (0, import_devkit2.addDependenciesToPackageJson)(
|
|
474242
474245
|
tree,
|
|
474243
474246
|
{
|
|
474244
474247
|
"nx": nxVersion,
|
|
@@ -474250,19 +474253,19 @@ async function stormInitGenerator(tree, schema) {
|
|
|
474250
474253
|
{}
|
|
474251
474254
|
);
|
|
474252
474255
|
if (!schema.skipFormat) {
|
|
474253
|
-
await (0,
|
|
474256
|
+
await (0, import_devkit2.formatFiles)(tree);
|
|
474254
474257
|
}
|
|
474255
474258
|
return task;
|
|
474256
474259
|
}
|
|
474257
474260
|
|
|
474258
474261
|
// packages/workspace-tools/src/generators/node-library/generator.ts
|
|
474259
|
-
var
|
|
474262
|
+
var import_devkit4 = __toESM(require_devkit());
|
|
474260
474263
|
var import_js2 = __toESM(require_src());
|
|
474261
474264
|
var import_init = __toESM(require_init());
|
|
474262
474265
|
var import_generator = __toESM(require_generator());
|
|
474263
474266
|
|
|
474264
474267
|
// packages/workspace-tools/src/generators/node-library/normalize-options.ts
|
|
474265
|
-
var
|
|
474268
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
474266
474269
|
var import_project_name_and_root_utils = __toESM(require_project_name_and_root_utils());
|
|
474267
474270
|
async function normalizeOptions(tree, options) {
|
|
474268
474271
|
if (options.publishable) {
|
|
@@ -474276,7 +474279,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474276
474279
|
if (options.publishable === false && options.buildable === false) {
|
|
474277
474280
|
bundler = "none";
|
|
474278
474281
|
}
|
|
474279
|
-
const { Linter } = (0,
|
|
474282
|
+
const { Linter } = (0, import_devkit3.ensurePackage)("@nx/eslint", nxVersion);
|
|
474280
474283
|
const {
|
|
474281
474284
|
projectName,
|
|
474282
474285
|
names: projectNames,
|
|
@@ -474292,7 +474295,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474292
474295
|
callingGenerator: "@nx/js:library"
|
|
474293
474296
|
});
|
|
474294
474297
|
options.rootProject = projectRoot === ".";
|
|
474295
|
-
const normalized = (0,
|
|
474298
|
+
const normalized = (0, import_devkit3.names)(projectNames.projectFileName);
|
|
474296
474299
|
const fileName = normalized.fileName;
|
|
474297
474300
|
return {
|
|
474298
474301
|
js: false,
|
|
@@ -474320,7 +474323,7 @@ async function normalizeOptions(tree, options) {
|
|
|
474320
474323
|
|
|
474321
474324
|
// packages/workspace-tools/src/generators/node-library/generator.ts
|
|
474322
474325
|
async function nodeLibraryGenerator(tree, schema) {
|
|
474323
|
-
const filesDir = (0,
|
|
474326
|
+
const filesDir = (0, import_devkit4.joinPathFragments)(__dirname, "./files");
|
|
474324
474327
|
const options = await normalizeOptions(tree, schema);
|
|
474325
474328
|
const tasks = [];
|
|
474326
474329
|
tasks.push(
|
|
@@ -474330,7 +474333,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474330
474333
|
})
|
|
474331
474334
|
);
|
|
474332
474335
|
tasks.push(
|
|
474333
|
-
(0,
|
|
474336
|
+
(0, import_devkit4.addDependenciesToPackageJson)(
|
|
474334
474337
|
tree,
|
|
474335
474338
|
{},
|
|
474336
474339
|
{
|
|
@@ -474343,22 +474346,22 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474343
474346
|
if (options.publishable) {
|
|
474344
474347
|
tasks.push(await (0, import_generator.default)(tree, { ...options, skipFormat: true }));
|
|
474345
474348
|
}
|
|
474346
|
-
const { className, name, propertyName } = (0,
|
|
474349
|
+
const { className, name, propertyName } = (0, import_devkit4.names)(
|
|
474347
474350
|
options.projectNames.projectFileName
|
|
474348
474351
|
);
|
|
474349
474352
|
createProjectTsConfigJson(tree, options);
|
|
474350
|
-
(0,
|
|
474353
|
+
(0, import_devkit4.addProjectConfiguration)(tree, options.name, {
|
|
474351
474354
|
root: options.directory,
|
|
474352
474355
|
projectType: "library",
|
|
474353
|
-
sourceRoot: (0,
|
|
474356
|
+
sourceRoot: (0, import_devkit4.joinPathFragments)(options.directory, "src"),
|
|
474354
474357
|
targets: {
|
|
474355
474358
|
build: {
|
|
474356
474359
|
executor: "@storm-software/workspace-tools:tsup",
|
|
474357
474360
|
outputs: ["{options.outputPath}"],
|
|
474358
474361
|
options: {
|
|
474359
474362
|
outputPath: getOutputPath(options),
|
|
474360
|
-
tsConfig: (0,
|
|
474361
|
-
project: (0,
|
|
474363
|
+
tsConfig: (0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
474364
|
+
project: (0, import_devkit4.joinPathFragments)(options.projectRoot, "package.json"),
|
|
474362
474365
|
defaultConfiguration: "production",
|
|
474363
474366
|
platform: "node"
|
|
474364
474367
|
},
|
|
@@ -474377,7 +474380,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474377
474380
|
test: {}
|
|
474378
474381
|
}
|
|
474379
474382
|
});
|
|
474380
|
-
(0,
|
|
474383
|
+
(0, import_devkit4.generateFiles)(tree, filesDir, options.projectRoot, {
|
|
474381
474384
|
...options,
|
|
474382
474385
|
dot: ".",
|
|
474383
474386
|
className,
|
|
@@ -474387,7 +474390,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474387
474390
|
cliCommand: "nx",
|
|
474388
474391
|
strict: void 0,
|
|
474389
474392
|
tmpl: "",
|
|
474390
|
-
offsetFromRoot: (0,
|
|
474393
|
+
offsetFromRoot: (0, import_devkit4.offsetFromRoot)(options.projectRoot),
|
|
474391
474394
|
buildable: options.bundler && options.bundler !== "none",
|
|
474392
474395
|
hasUnitTestRunner: options.unitTestRunner !== "none"
|
|
474393
474396
|
});
|
|
@@ -474397,16 +474400,16 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474397
474400
|
};
|
|
474398
474401
|
let description = schema.description ?? "\u26A1 A Storm package used to create modern, scalable web applications.";
|
|
474399
474402
|
if (tree.exists("package.json")) {
|
|
474400
|
-
const packageJson = (0,
|
|
474403
|
+
const packageJson = (0, import_devkit4.readJson)(tree, "package.json");
|
|
474401
474404
|
packageJson?.repository && (repository = packageJson.repository);
|
|
474402
474405
|
packageJson?.description && (description = packageJson.description);
|
|
474403
474406
|
}
|
|
474404
|
-
const packageJsonPath = (0,
|
|
474407
|
+
const packageJsonPath = (0, import_devkit4.joinPathFragments)(
|
|
474405
474408
|
options.projectRoot,
|
|
474406
474409
|
"package.json"
|
|
474407
474410
|
);
|
|
474408
474411
|
if (tree.exists(packageJsonPath)) {
|
|
474409
|
-
(0,
|
|
474412
|
+
(0, import_devkit4.updateJson)(tree, packageJsonPath, (json) => {
|
|
474410
474413
|
json.name = options.importPath;
|
|
474411
474414
|
json.version = "0.0.1";
|
|
474412
474415
|
if (json.private && (options.publishable || options.rootProject)) {
|
|
@@ -474430,7 +474433,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474430
474433
|
};
|
|
474431
474434
|
});
|
|
474432
474435
|
} else {
|
|
474433
|
-
(0,
|
|
474436
|
+
(0, import_devkit4.writeJson)(tree, packageJsonPath, {
|
|
474434
474437
|
name: options.importPath,
|
|
474435
474438
|
version: "0.0.1",
|
|
474436
474439
|
description,
|
|
@@ -474446,7 +474449,7 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474446
474449
|
});
|
|
474447
474450
|
}
|
|
474448
474451
|
if (tree.exists("package.json")) {
|
|
474449
|
-
(0,
|
|
474452
|
+
(0, import_devkit4.updateJson)(tree, "package.json", (json) => ({
|
|
474450
474453
|
...json,
|
|
474451
474454
|
pnpm: {
|
|
474452
474455
|
...json?.pnpm,
|
|
@@ -474458,32 +474461,32 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474458
474461
|
}));
|
|
474459
474462
|
}
|
|
474460
474463
|
(0, import_js2.addTsConfigPath)(tree, options.importPath, [
|
|
474461
|
-
(0,
|
|
474464
|
+
(0, import_devkit4.joinPathFragments)(
|
|
474462
474465
|
options.projectRoot,
|
|
474463
474466
|
"./src",
|
|
474464
474467
|
"index." + (options.js ? "js" : "ts")
|
|
474465
474468
|
)
|
|
474466
474469
|
]);
|
|
474467
|
-
(0, import_js2.addTsConfigPath)(tree, (0,
|
|
474468
|
-
(0,
|
|
474470
|
+
(0, import_js2.addTsConfigPath)(tree, (0, import_devkit4.joinPathFragments)(options.importPath, "/*"), [
|
|
474471
|
+
(0, import_devkit4.joinPathFragments)(options.projectRoot, "./src", "/*")
|
|
474469
474472
|
]);
|
|
474470
474473
|
if (tree.exists("package.json")) {
|
|
474471
|
-
const packageJson = (0,
|
|
474474
|
+
const packageJson = (0, import_devkit4.readJson)(tree, "package.json");
|
|
474472
474475
|
packageJson?.repository && (repository = packageJson.repository);
|
|
474473
474476
|
packageJson?.description && (description = packageJson.description);
|
|
474474
474477
|
}
|
|
474475
|
-
const tsconfigPath = (0,
|
|
474478
|
+
const tsconfigPath = (0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json");
|
|
474476
474479
|
if (tree.exists(tsconfigPath)) {
|
|
474477
|
-
(0,
|
|
474480
|
+
(0, import_devkit4.updateJson)(tree, tsconfigPath, (json) => {
|
|
474478
474481
|
json.composite ??= true;
|
|
474479
474482
|
return json;
|
|
474480
474483
|
});
|
|
474481
474484
|
} else {
|
|
474482
|
-
(0,
|
|
474483
|
-
extends: `${(0,
|
|
474485
|
+
(0, import_devkit4.writeJson)(tree, tsconfigPath, {
|
|
474486
|
+
extends: `${(0, import_devkit4.offsetFromRoot)(options.projectRoot)}tsconfig.base.json`,
|
|
474484
474487
|
composite: true,
|
|
474485
474488
|
compilerOptions: {
|
|
474486
|
-
outDir: `${(0,
|
|
474489
|
+
outDir: `${(0, import_devkit4.offsetFromRoot)(options.projectRoot)}dist/out-tsc`
|
|
474487
474490
|
},
|
|
474488
474491
|
files: [],
|
|
474489
474492
|
include: ["src/**/*.ts", "src/**/*.js"],
|
|
@@ -474492,20 +474495,20 @@ async function nodeLibraryGenerator(tree, schema) {
|
|
|
474492
474495
|
}
|
|
474493
474496
|
const lintCallback = await addLint(tree, options);
|
|
474494
474497
|
tasks.push(lintCallback);
|
|
474495
|
-
await (0,
|
|
474498
|
+
await (0, import_devkit4.formatFiles)(tree);
|
|
474496
474499
|
}
|
|
474497
474500
|
async function addLint(tree, options) {
|
|
474498
|
-
const { lintProjectGenerator } = (0,
|
|
474501
|
+
const { lintProjectGenerator } = (0, import_devkit4.ensurePackage)("@nx/eslint", nxVersion);
|
|
474499
474502
|
const { mapLintPattern } = (
|
|
474500
474503
|
// nx-ignore-next-line
|
|
474501
474504
|
require_lint_project()
|
|
474502
474505
|
);
|
|
474503
|
-
const projectConfiguration = (0,
|
|
474506
|
+
const projectConfiguration = (0, import_devkit4.readProjectConfiguration)(tree, options.name);
|
|
474504
474507
|
const task = lintProjectGenerator(tree, {
|
|
474505
474508
|
project: options.name,
|
|
474506
474509
|
linter: options.linter,
|
|
474507
474510
|
skipFormat: true,
|
|
474508
|
-
tsConfigPaths: [(0,
|
|
474511
|
+
tsConfigPaths: [(0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json")],
|
|
474509
474512
|
unitTestRunner: options.unitTestRunner,
|
|
474510
474513
|
eslintFilePatterns: [
|
|
474511
474514
|
mapLintPattern(
|
|
@@ -474576,15 +474579,15 @@ function getOutputPath(options) {
|
|
|
474576
474579
|
} else {
|
|
474577
474580
|
parts.push(options.projectRoot);
|
|
474578
474581
|
}
|
|
474579
|
-
return (0,
|
|
474582
|
+
return (0, import_devkit4.joinPathFragments)(...parts);
|
|
474580
474583
|
}
|
|
474581
474584
|
function createProjectTsConfigJson(tree, options) {
|
|
474582
474585
|
const tsconfig = {
|
|
474583
474586
|
extends: options.rootProject ? void 0 : (0, import_js2.getRelativePathToRootTsConfig)(tree, options.projectRoot),
|
|
474584
474587
|
compilerOptions: {
|
|
474585
474588
|
...options.rootProject ? import_js2.tsConfigBaseOptions : {},
|
|
474586
|
-
outDir: (0,
|
|
474587
|
-
(0,
|
|
474589
|
+
outDir: (0, import_devkit4.joinPathFragments)(
|
|
474590
|
+
(0, import_devkit4.offsetFromRoot)(options.projectRoot),
|
|
474588
474591
|
"dist/out-tsc"
|
|
474589
474592
|
),
|
|
474590
474593
|
noEmit: true
|
|
@@ -474593,15 +474596,15 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
474593
474596
|
include: ["src/**/*.ts", "src/**/*.js", "bin/**/*"],
|
|
474594
474597
|
exclude: ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
|
474595
474598
|
};
|
|
474596
|
-
(0,
|
|
474599
|
+
(0, import_devkit4.writeJson)(
|
|
474597
474600
|
tree,
|
|
474598
|
-
(0,
|
|
474601
|
+
(0, import_devkit4.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
474599
474602
|
tsconfig
|
|
474600
474603
|
);
|
|
474601
474604
|
}
|
|
474602
474605
|
|
|
474603
474606
|
// packages/workspace-tools/src/generators/preset/generator.ts
|
|
474604
|
-
var
|
|
474607
|
+
var import_devkit5 = __toESM(require_devkit());
|
|
474605
474608
|
// Annotate the CommonJS export names for ESM import in node:
|
|
474606
474609
|
0 && (module.exports = {
|
|
474607
474610
|
eslintVersion,
|