@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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.29.0](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.28.0...workspace-tools-v1.29.0) (2023-12-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * **workspace-tools:** Added compiled child directories to build package ([367ac43](https://github.com/storm-software/storm-ops/commit/367ac4312ed4b81badbce62676d3d9341431018a))
7
+
1
8
  # [1.28.0](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.27.0...workspace-tools-v1.28.0) (2023-12-12)
2
9
 
3
10
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
16
16
 
17
17
  <h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />
18
18
 
19
- [![Version](https://img.shields.io/badge/version-1.24.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
19
+ [![Version](https://img.shields.io/badge/version-1.29.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
20
20
  [![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
21
21
 
22
22
  <h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
@@ -102,13 +102,16 @@ The following executor options are available:
102
102
  | watch | `boolean` | Enable re-building when files change. | |
103
103
  | assets | `array` | List of static assets. | `[]` |
104
104
  | clean | `boolean` | Remove previous output before build. | `true` |
105
- | includeSrc | `boolean` | Should the source files be added to the distribution folder in an \`src\` directory. | `true` |
105
+ | includeSrc | `boolean` | Should the source files be added to the distribution folder in an \`src\` directory. | |
106
+ | packageAll | `boolean` | Should the build run for each file contained in the package individually. | `true` |
107
+ | generatePackageJson | `boolean` | Should a package.json file be generated in the output folder or should the existing one be copied in. | `true` |
106
108
  | splitting | `boolean` | Should the build process preform \*code-splitting\*? | `true` |
107
109
  | treeshake | `boolean` | Should the build process \*tree-shake\* to remove unused code? | `true` |
108
110
  | debug | `boolean` | Should output be unminified with source mappings. | |
109
111
  | **platform \*** | "browser" \| "neutral" \| "node" \| "worker" | Platform target for outputs. | "neutral" |
110
112
  | **banner \*** | `string` | A short heading added to the top of each typescript file added in the output folder's \`src\` directory. | "This code was developed by Storm Software (<https://stormsoftware.org>) and is licensed under the Apache License 2.0." |
111
113
  | verbose | `boolean` | Should write extra log outputs with details from the executor. | |
114
+ | shims | `boolean` | Should the build process add shims for node.js modules that are not available in the browser? | |
112
115
  | define | `object` | Define global constants that can be used in the source code. The value will be converted into a stringified JSON. | |
113
116
  | env | `object` | Define environment variables that can be used in the source code. The value will be converted into a stringified JSON. | |
114
117
  | apiReport | `boolean` | Should API Extractor generate an API Report file. | `true` |
@@ -163,6 +166,22 @@ nx run my-project:tsup-node
163
166
 
164
167
 
165
168
 
169
+ ## Browser TypeScript Builder
170
+
171
+ Runs a browser platform TypeScript build
172
+
173
+ ### Example
174
+
175
+ This executor can be used by executing the following in a command line utility:
176
+
177
+ ```cmd
178
+ nx run my-project:tsup-browser
179
+ ```
180
+
181
+ **Please note:** _The tsup-browser executor should be included in the desired projects's `project.json` file._
182
+
183
+
184
+
166
185
  <!-- markdownlint-restore -->
167
186
  <!-- prettier-ignore-end -->
168
187
 
@@ -326,6 +345,33 @@ The following executor options are available:
326
345
 
327
346
 
328
347
 
348
+ ## Add browser Library
349
+
350
+ Create a new browser TypeScript library package in the Storm workspace
351
+
352
+ ### Options
353
+
354
+ The following executor options are available:
355
+
356
+ | Option | Type | Description | Default |
357
+ | --------- | ------ | ------------- | --------- |
358
+ | **name \*** | `string` | A name for the library. | |
359
+ | description | `string` | The library used by Storm Software for building TypeScript applications. | |
360
+ | **directory \*** | `string` | A directory where the lib is placed. | |
361
+ | **projectNameAndRootFormat \*** | "as-provided" \| "derived" | Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`). | |
362
+ | tags | `string` | Add tags to the library (used for linting). | |
363
+ | strict | `boolean` | Whether to enable tsconfig strict mode or not. | `true` |
364
+ | **publishable \*** | `boolean` | Generate a publishable library. | |
365
+ | **importPath \*** | `string` | The library name used to import it, like @storm-software/my-awesome-lib. Required for publishable library. | |
366
+ | **buildable \*** | `boolean` | Generate a buildable library. | `true` |
367
+ | setParserOptionsProject | `boolean` | Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons. | |
368
+ | rootProject | `boolean` | Is the current project the root project in the workspace. | |
369
+
370
+
371
+ **Please note:** _Option names followed by \* above are required, and must be provided to run the executor._
372
+
373
+
374
+
329
375
  <!-- markdownlint-restore -->
330
376
  <!-- prettier-ignore-end -->
331
377
 
package/index.js CHANGED
@@ -117409,22 +117409,23 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
117409
117409
  platform,
117410
117410
  ...rest
117411
117411
  }) {
117412
- const entry = globSync(
117413
- [
117414
- rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
117415
- sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
117416
- "**/*.{ts,tsx}"
117417
- ),
117418
- ...additionalEntryPoints ?? []
117419
- ],
117420
- {
117421
- withFileTypes: true
117422
- }
117423
- ).reduce((ret, filePath) => {
117412
+ const entryPoints = [];
117413
+ if (rest.entry) {
117414
+ entryPoints.push(rest.entry);
117415
+ }
117416
+ if (rest.packageAll !== false) {
117417
+ entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
117418
+ }
117419
+ if (additionalEntryPoints) {
117420
+ entryPoints.push(...additionalEntryPoints);
117421
+ }
117422
+ const entry = globSync(entryPoints, {
117423
+ withFileTypes: true
117424
+ }).reduce((ret, filePath) => {
117424
117425
  let propertyKey = (0, import_devkit.joinPathFragments)(
117425
117426
  filePath.path,
117426
117427
  removeExtension(filePath.name)
117427
- ).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117428
+ ).replaceAll("/", "\\").replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
117428
117429
  if (propertyKey) {
117429
117430
  while (propertyKey.startsWith("/")) {
117430
117431
  propertyKey = propertyKey.substring(1);
@@ -117567,7 +117568,7 @@ ${Object.keys(options).map(
117567
117568
  options.external
117568
117569
  );
117569
117570
  }
117570
- const externalDependencies = options.external.reduce((acc, name) => {
117571
+ let externalDependencies = options.external.reduce((acc, name) => {
117571
117572
  const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
117572
117573
  if (externalNode) {
117573
117574
  acc.push({
@@ -117575,22 +117576,20 @@ ${Object.keys(options).map(
117575
117576
  outputs: [],
117576
117577
  node: externalNode
117577
117578
  });
117578
- } else {
117579
- const workspaceNode = context.projectGraph.nodes[name];
117580
- if (workspaceNode) {
117581
- acc.push({
117582
- name,
117583
- outputs: [],
117584
- node: workspaceNode
117585
- });
117586
- }
117587
117579
  }
117588
117580
  return acc;
117589
117581
  }, []);
117590
- options.verbose && console.log(`Added the following external dependencies:
117591
- ${externalDependencies.map((dep) => {
117592
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117593
- }).join("\n")}`);
117582
+ externalDependencies = implicitDependencies.reduce((acc, name) => {
117583
+ const internalNode = context.projectGraph.nodes[name];
117584
+ if (internalNode) {
117585
+ acc.push({
117586
+ name,
117587
+ outputs: [],
117588
+ node: internalNode
117589
+ });
117590
+ }
117591
+ return acc;
117592
+ }, externalDependencies);
117594
117593
  if (options.bundle === false) {
117595
117594
  for (const thirdPartyDependency of (0, import_get_extra_dependencies.getExtraDependencies)(
117596
117595
  context.projectName,
@@ -117603,6 +117602,10 @@ ${externalDependencies.map((dep) => {
117603
117602
  }
117604
117603
  }
117605
117604
  }
117605
+ console.log(`Building with the following dependencies marked as external:
117606
+ ${externalDependencies.map((dep) => {
117607
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
117608
+ }).join("\n")}`);
117606
117609
  const prettierOptions = {
117607
117610
  plugins: ["prettier-plugin-packagejson"],
117608
117611
  trailingComma: "none",
@@ -117884,6 +117887,7 @@ var applyDefaultOptions = (options) => {
117884
117887
  options.apiReport ??= true;
117885
117888
  options.docModel ??= true;
117886
117889
  options.tsdocMetadata ??= true;
117890
+ options.packageAll ??= true;
117887
117891
  options.define ??= {};
117888
117892
  options.env ??= {};
117889
117893
  options.verbose ??= !!process.env.CI;