@storm-software/workspace-tools 1.29.0 → 1.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "private": false,
5
5
  "description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
6
6
  "keywords": [
@@ -117216,22 +117216,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
117216
117216
  platform,
117217
117217
  ...rest
117218
117218
  }) {
117219
- const entry = globSync(
117220
- [
117221
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
117222
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
117223
- "**/*.{ts,tsx}"
117224
- ),
117225
- ...additionalEntryPoints ?? []
117226
- ],
117227
- {
117228
- withFileTypes: true
117229
- }
117230
- ).reduce((ret, filePath) => {
117219
+ const entryPoints = [];
117220
+ if (rest.entry) {
117221
+ entryPoints.push(rest.entry);
117222
+ }
117223
+ if (rest.packageAll !== false) {
117224
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
117225
+ }
117226
+ if (additionalEntryPoints) {
117227
+ entryPoints.push(...additionalEntryPoints);
117228
+ }
117229
+ const entry = globSync(entryPoints, {
117230
+ withFileTypes: true
117231
+ }).reduce((ret, filePath) => {
117231
117232
  let propertyKey = (0, import_devkit.joinPathFragments)(
117232
117233
  filePath.path,
117233
117234
  removeExtension(filePath.name)
117234
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117235
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117235
117236
  if (propertyKey) {
117236
117237
  while (propertyKey.startsWith("/")) {
117237
117238
  propertyKey = propertyKey.substring(1);
@@ -117374,7 +117375,7 @@ ${Object.keys(options).map(
117374
117375
  options.external
117375
117376
  );
117376
117377
  }
117377
- const externalDependencies = options.external.reduce((acc, name) => {
117378
+ let externalDependencies = options.external.reduce((acc, name) => {
117378
117379
  const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
117379
117380
  if (externalNode) {
117380
117381
  acc.push({
@@ -117382,22 +117383,20 @@ ${Object.keys(options).map(
117382
117383
  outputs: [],
117383
117384
  node: externalNode
117384
117385
  });
117385
- } else {
117386
- const workspaceNode = context.projectGraph.nodes[name];
117387
- if (workspaceNode) {
117388
- acc.push({
117389
- name,
117390
- outputs: [],
117391
- node: workspaceNode
117392
- });
117393
- }
117394
117386
  }
117395
117387
  return acc;
117396
117388
  }, []);
117397
- options.verbose && console.log(`Added the following external dependencies:
117398
- ${externalDependencies.map((dep) => {
117399
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117400
- }).join("\n")}`);
117389
+ externalDependencies = implicitDependencies.reduce((acc, name) => {
117390
+ const internalNode = context.projectGraph.nodes[name];
117391
+ if (internalNode) {
117392
+ acc.push({
117393
+ name,
117394
+ outputs: [],
117395
+ node: internalNode
117396
+ });
117397
+ }
117398
+ return acc;
117399
+ }, externalDependencies);
117401
117400
  if (options.bundle === false) {
117402
117401
  for (const thirdPartyDependency of (0, import_get_extra_dependencies.getExtraDependencies)(
117403
117402
  context.projectName,
@@ -117410,6 +117409,10 @@ ${externalDependencies.map((dep) => {
117410
117409
  }
117411
117410
  }
117412
117411
  }
117412
+ console.log(`Building with the following dependencies marked as external:
117413
+ ${externalDependencies.map((dep) => {
117414
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117415
+ }).join("\n")}`);
117413
117416
  const prettierOptions = {
117414
117417
  plugins: ["prettier-plugin-packagejson"],
117415
117418
  trailingComma: "none",
@@ -117691,6 +117694,7 @@ var applyDefaultOptions = (options) => {
117691
117694
  options.apiReport ??= true;
117692
117695
  options.docModel ??= true;
117693
117696
  options.tsdocMetadata ??= true;
117697
+ options.packageAll ??= true;
117694
117698
  options.define ??= {};
117695
117699
  options.env ??= {};
117696
117700
  options.verbose ??= !!process.env.CI;
@@ -88613,22 +88613,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
88613
88613
  platform,
88614
88614
  ...rest
88615
88615
  }) {
88616
- const entry = globSync(
88617
- [
88618
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
88619
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
88620
- "**/*.{ts,tsx}"
88621
- ),
88622
- ...additionalEntryPoints ?? []
88623
- ],
88624
- {
88625
- withFileTypes: true
88626
- }
88627
- ).reduce((ret, filePath) => {
88616
+ const entryPoints = [];
88617
+ if (rest.entry) {
88618
+ entryPoints.push(rest.entry);
88619
+ }
88620
+ if (rest.packageAll !== false) {
88621
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
88622
+ }
88623
+ if (additionalEntryPoints) {
88624
+ entryPoints.push(...additionalEntryPoints);
88625
+ }
88626
+ const entry = globSync(entryPoints, {
88627
+ withFileTypes: true
88628
+ }).reduce((ret, filePath) => {
88628
88629
  let propertyKey = (0, import_devkit.joinPathFragments)(
88629
88630
  filePath.path,
88630
88631
  removeExtension(filePath.name)
88631
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
88632
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
88632
88633
  if (propertyKey) {
88633
88634
  while (propertyKey.startsWith("/")) {
88634
88635
  propertyKey = propertyKey.substring(1);
@@ -37,4 +37,5 @@ export type TsupExecutorSchema = Omit<
37
37
  splitting?: boolean;
38
38
  treeshake?: boolean;
39
39
  generatePackageJson?: boolean;
40
+ packageAll?: boolean;
40
41
  };
@@ -71,6 +71,11 @@
71
71
  "description": "Should the source files be added to the distribution folder in an `src` directory.",
72
72
  "default": false
73
73
  },
74
+ "packageAll": {
75
+ "type": "boolean",
76
+ "description": "Should the build run for each file contained in the package individually.",
77
+ "default": true
78
+ },
74
79
  "generatePackageJson": {
75
80
  "type": "boolean",
76
81
  "description": "Should a package.json file be generated in the output folder or should the existing one be copied in.",
@@ -117247,22 +117247,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
117247
117247
  platform,
117248
117248
  ...rest
117249
117249
  }) {
117250
- const entry = globSync(
117251
- [
117252
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
117253
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
117254
- "**/*.{ts,tsx}"
117255
- ),
117256
- ...additionalEntryPoints ?? []
117257
- ],
117258
- {
117259
- withFileTypes: true
117260
- }
117261
- ).reduce((ret, filePath) => {
117250
+ const entryPoints = [];
117251
+ if (rest.entry) {
117252
+ entryPoints.push(rest.entry);
117253
+ }
117254
+ if (rest.packageAll !== false) {
117255
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
117256
+ }
117257
+ if (additionalEntryPoints) {
117258
+ entryPoints.push(...additionalEntryPoints);
117259
+ }
117260
+ const entry = globSync(entryPoints, {
117261
+ withFileTypes: true
117262
+ }).reduce((ret, filePath) => {
117262
117263
  let propertyKey = (0, import_devkit.joinPathFragments)(
117263
117264
  filePath.path,
117264
117265
  removeExtension(filePath.name)
117265
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
117267
  if (propertyKey) {
117267
117268
  while (propertyKey.startsWith("/")) {
117268
117269
  propertyKey = propertyKey.substring(1);
@@ -117405,7 +117406,7 @@ ${Object.keys(options).map(
117405
117406
  options.external
117406
117407
  );
117407
117408
  }
117408
- const externalDependencies = options.external.reduce((acc, name) => {
117409
+ let externalDependencies = options.external.reduce((acc, name) => {
117409
117410
  const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
117410
117411
  if (externalNode) {
117411
117412
  acc.push({
@@ -117413,22 +117414,20 @@ ${Object.keys(options).map(
117413
117414
  outputs: [],
117414
117415
  node: externalNode
117415
117416
  });
117416
- } else {
117417
- const workspaceNode = context.projectGraph.nodes[name];
117418
- if (workspaceNode) {
117419
- acc.push({
117420
- name,
117421
- outputs: [],
117422
- node: workspaceNode
117423
- });
117424
- }
117425
117417
  }
117426
117418
  return acc;
117427
117419
  }, []);
117428
- options.verbose && console.log(`Added the following external dependencies:
117429
- ${externalDependencies.map((dep) => {
117430
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117431
- }).join("\n")}`);
117420
+ externalDependencies = implicitDependencies.reduce((acc, name) => {
117421
+ const internalNode = context.projectGraph.nodes[name];
117422
+ if (internalNode) {
117423
+ acc.push({
117424
+ name,
117425
+ outputs: [],
117426
+ node: internalNode
117427
+ });
117428
+ }
117429
+ return acc;
117430
+ }, externalDependencies);
117432
117431
  if (options.bundle === false) {
117433
117432
  for (const thirdPartyDependency of (0, import_get_extra_dependencies.getExtraDependencies)(
117434
117433
  context.projectName,
@@ -117441,6 +117440,10 @@ ${externalDependencies.map((dep) => {
117441
117440
  }
117442
117441
  }
117443
117442
  }
117443
+ console.log(`Building with the following dependencies marked as external:
117444
+ ${externalDependencies.map((dep) => {
117445
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117446
+ }).join("\n")}`);
117444
117447
  const prettierOptions = {
117445
117448
  plugins: ["prettier-plugin-packagejson"],
117446
117449
  trailingComma: "none",
@@ -117722,6 +117725,7 @@ var applyDefaultOptions = (options) => {
117722
117725
  options.apiReport ??= true;
117723
117726
  options.docModel ??= true;
117724
117727
  options.tsdocMetadata ??= true;
117728
+ options.packageAll ??= true;
117725
117729
  options.define ??= {};
117726
117730
  options.env ??= {};
117727
117731
  options.verbose ??= !!process.env.CI;
@@ -117247,22 +117247,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
117247
117247
  platform,
117248
117248
  ...rest
117249
117249
  }) {
117250
- const entry = globSync(
117251
- [
117252
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
117253
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
117254
- "**/*.{ts,tsx}"
117255
- ),
117256
- ...additionalEntryPoints ?? []
117257
- ],
117258
- {
117259
- withFileTypes: true
117260
- }
117261
- ).reduce((ret, filePath) => {
117250
+ const entryPoints = [];
117251
+ if (rest.entry) {
117252
+ entryPoints.push(rest.entry);
117253
+ }
117254
+ if (rest.packageAll !== false) {
117255
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
117256
+ }
117257
+ if (additionalEntryPoints) {
117258
+ entryPoints.push(...additionalEntryPoints);
117259
+ }
117260
+ const entry = globSync(entryPoints, {
117261
+ withFileTypes: true
117262
+ }).reduce((ret, filePath) => {
117262
117263
  let propertyKey = (0, import_devkit.joinPathFragments)(
117263
117264
  filePath.path,
117264
117265
  removeExtension(filePath.name)
117265
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
117267
  if (propertyKey) {
117267
117268
  while (propertyKey.startsWith("/")) {
117268
117269
  propertyKey = propertyKey.substring(1);
@@ -117405,7 +117406,7 @@ ${Object.keys(options).map(
117405
117406
  options.external
117406
117407
  );
117407
117408
  }
117408
- const externalDependencies = options.external.reduce((acc, name) => {
117409
+ let externalDependencies = options.external.reduce((acc, name) => {
117409
117410
  const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
117410
117411
  if (externalNode) {
117411
117412
  acc.push({
@@ -117413,22 +117414,20 @@ ${Object.keys(options).map(
117413
117414
  outputs: [],
117414
117415
  node: externalNode
117415
117416
  });
117416
- } else {
117417
- const workspaceNode = context.projectGraph.nodes[name];
117418
- if (workspaceNode) {
117419
- acc.push({
117420
- name,
117421
- outputs: [],
117422
- node: workspaceNode
117423
- });
117424
- }
117425
117417
  }
117426
117418
  return acc;
117427
117419
  }, []);
117428
- options.verbose && console.log(`Added the following external dependencies:
117429
- ${externalDependencies.map((dep) => {
117430
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117431
- }).join("\n")}`);
117420
+ externalDependencies = implicitDependencies.reduce((acc, name) => {
117421
+ const internalNode = context.projectGraph.nodes[name];
117422
+ if (internalNode) {
117423
+ acc.push({
117424
+ name,
117425
+ outputs: [],
117426
+ node: internalNode
117427
+ });
117428
+ }
117429
+ return acc;
117430
+ }, externalDependencies);
117432
117431
  if (options.bundle === false) {
117433
117432
  for (const thirdPartyDependency of (0, import_get_extra_dependencies.getExtraDependencies)(
117434
117433
  context.projectName,
@@ -117441,6 +117440,10 @@ ${externalDependencies.map((dep) => {
117441
117440
  }
117442
117441
  }
117443
117442
  }
117443
+ console.log(`Building with the following dependencies marked as external:
117444
+ ${externalDependencies.map((dep) => {
117445
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117446
+ }).join("\n")}`);
117444
117447
  const prettierOptions = {
117445
117448
  plugins: ["prettier-plugin-packagejson"],
117446
117449
  trailingComma: "none",
@@ -117722,6 +117725,7 @@ var applyDefaultOptions = (options) => {
117722
117725
  options.apiReport ??= true;
117723
117726
  options.docModel ??= true;
117724
117727
  options.tsdocMetadata ??= true;
117728
+ options.packageAll ??= true;
117725
117729
  options.define ??= {};
117726
117730
  options.env ??= {};
117727
117731
  options.verbose ??= !!process.env.CI;
@@ -117247,22 +117247,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
117247
117247
  platform,
117248
117248
  ...rest
117249
117249
  }) {
117250
- const entry = globSync(
117251
- [
117252
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
117253
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
117254
- "**/*.{ts,tsx}"
117255
- ),
117256
- ...additionalEntryPoints ?? []
117257
- ],
117258
- {
117259
- withFileTypes: true
117260
- }
117261
- ).reduce((ret, filePath) => {
117250
+ const entryPoints = [];
117251
+ if (rest.entry) {
117252
+ entryPoints.push(rest.entry);
117253
+ }
117254
+ if (rest.packageAll !== false) {
117255
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
117256
+ }
117257
+ if (additionalEntryPoints) {
117258
+ entryPoints.push(...additionalEntryPoints);
117259
+ }
117260
+ const entry = globSync(entryPoints, {
117261
+ withFileTypes: true
117262
+ }).reduce((ret, filePath) => {
117262
117263
  let propertyKey = (0, import_devkit.joinPathFragments)(
117263
117264
  filePath.path,
117264
117265
  removeExtension(filePath.name)
117265
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117266
117267
  if (propertyKey) {
117267
117268
  while (propertyKey.startsWith("/")) {
117268
117269
  propertyKey = propertyKey.substring(1);
@@ -117405,7 +117406,7 @@ ${Object.keys(options).map(
117405
117406
  options.external
117406
117407
  );
117407
117408
  }
117408
- const externalDependencies = options.external.reduce((acc, name) => {
117409
+ let externalDependencies = options.external.reduce((acc, name) => {
117409
117410
  const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
117410
117411
  if (externalNode) {
117411
117412
  acc.push({
@@ -117413,22 +117414,20 @@ ${Object.keys(options).map(
117413
117414
  outputs: [],
117414
117415
  node: externalNode
117415
117416
  });
117416
- } else {
117417
- const workspaceNode = context.projectGraph.nodes[name];
117418
- if (workspaceNode) {
117419
- acc.push({
117420
- name,
117421
- outputs: [],
117422
- node: workspaceNode
117423
- });
117424
- }
117425
117417
  }
117426
117418
  return acc;
117427
117419
  }, []);
117428
- options.verbose && console.log(`Added the following external dependencies:
117429
- ${externalDependencies.map((dep) => {
117430
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117431
- }).join("\n")}`);
117420
+ externalDependencies = implicitDependencies.reduce((acc, name) => {
117421
+ const internalNode = context.projectGraph.nodes[name];
117422
+ if (internalNode) {
117423
+ acc.push({
117424
+ name,
117425
+ outputs: [],
117426
+ node: internalNode
117427
+ });
117428
+ }
117429
+ return acc;
117430
+ }, externalDependencies);
117432
117431
  if (options.bundle === false) {
117433
117432
  for (const thirdPartyDependency of (0, import_get_extra_dependencies.getExtraDependencies)(
117434
117433
  context.projectName,
@@ -117441,6 +117440,10 @@ ${externalDependencies.map((dep) => {
117441
117440
  }
117442
117441
  }
117443
117442
  }
117443
+ console.log(`Building with the following dependencies marked as external:
117444
+ ${externalDependencies.map((dep) => {
117445
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117446
+ }).join("\n")}`);
117444
117447
  const prettierOptions = {
117445
117448
  plugins: ["prettier-plugin-packagejson"],
117446
117449
  trailingComma: "none",
@@ -117722,6 +117725,7 @@ var applyDefaultOptions = (options) => {
117722
117725
  options.apiReport ??= true;
117723
117726
  options.docModel ??= true;
117724
117727
  options.tsdocMetadata ??= true;
117728
+ options.packageAll ??= true;
117725
117729
  options.define ??= {};
117726
117730
  options.env ??= {};
117727
117731
  options.verbose ??= !!process.env.CI;