@storm-software/workspace-tools 1.28.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.
@@ -0,0 +1,9 @@
1
+ import { TsupNeutralExecutorSchema } from "../tsup-neutral/schema";
2
+ import { Platform } from "../tsup/schema";
3
+
4
+ export type TsupBrowserExecutorSchema = Omit<
5
+ TsupNeutralExecutorSchema,
6
+ "platform"
7
+ > & {
8
+ platform?: Platform;
9
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "tsup-browser",
4
+ "extends": "../tsup-browser/schema.json",
5
+ "version": 2,
6
+ "title": "Browser TypeScript Builder",
7
+ "description": "Runs a browser platform TypeScript build",
8
+ "type": "object",
9
+ "properties": {},
10
+ "required": []
11
+ }
@@ -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;
@@ -0,0 +1,58 @@
1
+ <!-- START header -->
2
+ <!-- END header -->
3
+
4
+ # <%= name %>
5
+
6
+ <%= description %>
7
+
8
+ <!-- START doctoc -->
9
+ <!-- END doctoc -->
10
+
11
+ ## Installing
12
+
13
+ Using [pnpm](http://pnpm.io):
14
+
15
+ ```bash
16
+ pnpm add -D <%= namespace %>/<%= name %>
17
+ ```
18
+
19
+ <details>
20
+ <summary>Using npm</summary>
21
+
22
+ ```bash
23
+ npm install -D <%= namespace %>/<%= name %>
24
+ ```
25
+
26
+ </details>
27
+
28
+ <details>
29
+ <summary>Using yarn</summary>
30
+
31
+ ```bash
32
+ yarn add -D <%= namespace %>/<%= name %>
33
+ ```
34
+
35
+ </details>
36
+
37
+ ## Reduced Package Size
38
+
39
+ This project uses [tsup](https://tsup.egoist.dev/) to package the source code due to its ability to remove unused code and ship smaller javascript files thanks to code splitting. This helps to greatly reduce the size of the package and to make it easier to use in other projects.
40
+
41
+ ## Development
42
+
43
+ This project is built using [Nx](https://nx.dev). As a result, many of the usual commands are available to assist in development.
44
+
45
+ ### Building
46
+
47
+ Run `nx build <%= name %>` to build the library.
48
+
49
+ ### Running unit tests
50
+
51
+ Run `nx test <%= name %>` to execute the unit tests via [Jest](https://jestjs.io).
52
+
53
+ ### Linting
54
+
55
+ Run `nx lint <%= name %>` to run [ESLint](https://eslint.org/) on the package.
56
+
57
+ <!-- START footer -->
58
+ <!-- END footer -->
@@ -0,0 +1,3 @@
1
+ import { getJestConfig } from "@storm-software/testing-tools";
2
+
3
+ export default getJestConfig("<%= directory %>", true, "<%= name %>");
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The <%= name %> library used by Storm Software for building TypeScript applications.
3
+ *
4
+ * @remarks
5
+ * <%= description %>
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+
10
+ const variable = "<%= name %>";
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "<%= offsetFromRoot %>dist/out-tsc",
5
+ "types": ["jest"]
6
+ },
7
+ "include": [
8
+ "jest.config.ts",
9
+ "src/**/*.test.ts",
10
+ "src/**/*.spec.ts",
11
+ "src/**/*.d.ts"
12
+ ]
13
+ }