@storm-software/workspace-tools 1.0.1 → 1.2.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +15 -10
  3. package/config/nx.json +22 -53
  4. package/generators.json +8 -1
  5. package/index.d.ts +3 -0
  6. package/index.js +7 -0
  7. package/index.js.map +1 -0
  8. package/package.json +14 -5
  9. package/src/executors/tsup/executor.d.ts +5 -0
  10. package/src/executors/tsup/executor.js +114 -0
  11. package/src/executors/tsup/executor.js.map +1 -0
  12. package/src/executors/tsup/get-config.d.ts +7 -0
  13. package/src/executors/tsup/get-config.js +28 -0
  14. package/src/executors/tsup/get-config.js.map +1 -0
  15. package/src/executors/tsup/hasher.js.map +1 -0
  16. package/src/executors/tsup/schema.d.ts +19 -0
  17. package/src/executors/tsup/schema.json +127 -0
  18. package/src/generators/init/init.d.ts +4 -0
  19. package/src/generators/init/init.js +21 -0
  20. package/src/generators/init/init.js.map +1 -0
  21. package/src/generators/init/schema.d.ts +3 -0
  22. package/src/generators/init/schema.json +16 -0
  23. package/src/generators/preset/files/.all-contributorsrc.template +18 -4
  24. package/src/generators/preset/files/.env.template +14 -35
  25. package/src/generators/preset/files/.gitattributes +9 -0
  26. package/src/generators/preset/files/.github/CONTRIBUTING.md.template +1 -1
  27. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/bug-report.yml.template +38 -7
  28. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/documentation.yml.template +12 -12
  29. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/feature-request.yml.template +4 -7
  30. package/src/generators/preset/files/.github/PULL_REQUEST_TEMPLATE.md.template +1 -1
  31. package/src/generators/preset/files/.github/actions/node/action.yaml +11 -12
  32. package/src/generators/preset/files/.github/codecov.yml +1 -1
  33. package/src/generators/preset/files/.github/renovate.json.template +3 -7
  34. package/src/generators/preset/files/.github/workflows/ci.yml.template +91 -0
  35. package/src/generators/preset/files/.github/workflows/codeql.yml +4 -1
  36. package/src/generators/preset/files/.github/workflows/git-guardian.yml +5 -3
  37. package/src/generators/preset/files/.github/workflows/labels.yml +6 -5
  38. package/src/generators/preset/files/.github/workflows/lock.yml +1 -4
  39. package/src/generators/preset/files/.github/workflows/nextjs-bundle-analysis.yml +12 -28
  40. package/src/generators/preset/files/.husky/post-checkout +1 -2
  41. package/src/generators/preset/files/.husky/post-commit +4 -0
  42. package/src/generators/preset/files/.husky/post-merge +1 -2
  43. package/src/generators/preset/files/.husky/pre-commit +1 -2
  44. package/src/generators/preset/files/.husky/pre-push +3 -2
  45. package/src/generators/preset/files/.markdownlint.json +4 -1
  46. package/src/generators/preset/files/.verdaccio/config.yml.template +1 -1
  47. package/src/generators/preset/files/.vscode/extensions.json +1 -1
  48. package/src/generators/preset/files/.vscode/launch.json +3 -3
  49. package/src/generators/preset/files/README.md.template +31 -30
  50. package/src/generators/preset/files/nx.json +98 -0
  51. package/src/generators/preset/files/pnpm-workspace.yaml +2 -0
  52. package/src/generators/preset/files/socket.yaml +20 -0
  53. package/src/generators/preset/files/tsconfig.base.json.template +1 -1
  54. package/src/generators/preset/generator.js +139 -65
  55. package/src/generators/preset/generator.js.map +1 -1
  56. package/src/generators/preset/schema.d.ts +8 -0
  57. package/src/generators/preset/schema.json +86 -2
  58. package/src/utils/apply-workspace-tokens.d.ts +2 -0
  59. package/src/utils/apply-workspace-tokens.js +42 -0
  60. package/src/utils/apply-workspace-tokens.js.map +1 -0
  61. package/src/utils/get-workspace-root.d.ts +1 -0
  62. package/src/utils/get-workspace-root.js +14 -0
  63. package/src/utils/get-workspace-root.js.map +1 -0
  64. package/src/utils/versions.d.ts +20 -0
  65. package/src/executors/build/executor.d.ts +0 -34
  66. package/src/executors/build/executor.js +0 -51
  67. package/src/executors/build/executor.js.map +0 -1
  68. package/src/executors/build/get-config.d.ts +0 -40
  69. package/src/executors/build/get-config.js +0 -45
  70. package/src/executors/build/get-config.js.map +0 -1
  71. package/src/executors/build/hasher.js.map +0 -1
  72. package/src/executors/build/schema.d.ts +0 -1
  73. package/src/executors/build/schema.json +0 -9
  74. package/src/generators/preset/files/.alexignore +0 -4
  75. package/src/generators/preset/files/.alexrc +0 -39
  76. package/src/generators/preset/files/.github/workflows/ci.yml +0 -131
  77. package/src/generators/preset/files/.github/workflows/documentation.yml.template +0 -85
  78. package/src/generators/preset/files/.husky/commit-msg +0 -4
  79. package/src/generators/preset/files/commitlint.config.d.ts +0 -2
  80. package/src/generators/preset/files/commitlint.config.js +0 -3
  81. package/src/generators/preset/files/commitlint.config.js.map +0 -1
  82. package/src/generators/preset/files/src/index.ts.template +0 -1
  83. package/src/index.d.ts +0 -1
  84. package/src/index.js +0 -5
  85. package/src/index.js.map +0 -1
  86. /package/src/executors/{build → tsup}/hasher.d.ts +0 -0
  87. /package/src/executors/{build → tsup}/hasher.js +0 -0
  88. /package/src/generators/preset/files/{.log4brains.yml → .log4brains.yml.template} +0 -0
@@ -1,40 +0,0 @@
1
- /**
2
- * @param {Object} opts - Options for building configurations.
3
- * @param {string[]} opts.entry - The entry array.
4
- * @returns {import('tsup').Options}
5
- */
6
- export declare function modernConfig(opts: any): {
7
- entry: any;
8
- format: string[];
9
- target: string[];
10
- outDir: string;
11
- dts: boolean;
12
- sourcemap: boolean;
13
- clean: boolean;
14
- esbuildPlugins: import("esbuild").Plugin[];
15
- };
16
- /**
17
- * @param {Object} opts - Options for building configurations.
18
- * @param {string[]} opts.entry - The entry array.
19
- * @returns {import('tsup').Options}
20
- */
21
- export declare function legacyConfig(opts: any): {
22
- entry: any;
23
- format: string[];
24
- target: string[];
25
- outDir: string;
26
- dts: boolean;
27
- sourcemap: boolean;
28
- clean: boolean;
29
- esbuildPlugins: import("esbuild").Plugin[];
30
- };
31
- export declare function getConfig(opts: any): {
32
- entry: any;
33
- format: string[];
34
- target: string[];
35
- outDir: string;
36
- dts: boolean;
37
- sourcemap: boolean;
38
- clean: boolean;
39
- esbuildPlugins: import("esbuild").Plugin[];
40
- }[];
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = exports.legacyConfig = exports.modernConfig = void 0;
4
- const esbuild_plugin_file_path_extensions_1 = require("esbuild-plugin-file-path-extensions");
5
- /**
6
- * @param {Object} opts - Options for building configurations.
7
- * @param {string[]} opts.entry - The entry array.
8
- * @returns {import('tsup').Options}
9
- */
10
- function modernConfig(opts) {
11
- return {
12
- entry: opts.entry,
13
- format: ["cjs", "esm"],
14
- target: ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77"],
15
- outDir: "build/modern",
16
- dts: true,
17
- sourcemap: true,
18
- clean: true,
19
- esbuildPlugins: [(0, esbuild_plugin_file_path_extensions_1.esbuildPluginFilePathExtensions)({ esmExtension: "js" })]
20
- };
21
- }
22
- exports.modernConfig = modernConfig;
23
- /**
24
- * @param {Object} opts - Options for building configurations.
25
- * @param {string[]} opts.entry - The entry array.
26
- * @returns {import('tsup').Options}
27
- */
28
- function legacyConfig(opts) {
29
- return {
30
- entry: opts.entry,
31
- format: ["cjs", "esm"],
32
- target: ["es2020", "node16"],
33
- outDir: "build/legacy",
34
- dts: true,
35
- sourcemap: true,
36
- clean: true,
37
- esbuildPlugins: [(0, esbuild_plugin_file_path_extensions_1.esbuildPluginFilePathExtensions)({ esmExtension: "js" })]
38
- };
39
- }
40
- exports.legacyConfig = legacyConfig;
41
- function getConfig(opts) {
42
- return [modernConfig(opts), legacyConfig(opts)];
43
- }
44
- exports.getConfig = getConfig;
45
- //# sourceMappingURL=get-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-config.js","sourceRoot":"","sources":["../../../../../../packages/workspace-tools/src/executors/build/get-config.ts"],"names":[],"mappings":";;;AAAA,6FAAsF;AAEtF;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAI;IAC/B,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,CAAC,KAAK,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AAW,CAAC"}
@@ -1 +0,0 @@
1
- export interface BuildExecutorSchema {} // eslint-disable-line
@@ -1,9 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Build executor",
5
- "description": "",
6
- "type": "object",
7
- "properties": {},
8
- "required": []
9
- }
@@ -1,4 +0,0 @@
1
- # `node_modules` is ignored by default
2
-
3
- **/CODE_OF_CONDUCT.md
4
-
@@ -1,39 +0,0 @@
1
- {
2
- "allow": [
3
- "attacks",
4
- "color",
5
- "dead",
6
- "execute",
7
- "executed",
8
- "executes",
9
- "execution",
10
- "executions",
11
- "failed",
12
- "failure",
13
- "failures",
14
- "fire",
15
- "fires",
16
- "firing",
17
- "hook",
18
- "hooks",
19
- "host-hostess",
20
- "invalid",
21
- "remains",
22
- "special",
23
- "white",
24
- "just",
25
- "easy",
26
- "easily",
27
- "simple",
28
- "colors",
29
- "clearly",
30
- "obvious",
31
- "pros",
32
- "blind",
33
- "xxx",
34
- "tinker",
35
- "reject",
36
- "terror",
37
- "Primitive"
38
- ]
39
- }
@@ -1,131 +0,0 @@
1
- name: "CI/CD"
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- tag:
7
- description: override release tag
8
- required: false
9
- push:
10
- branches:
11
- - "main"
12
- - "alpha"
13
- - "beta"
14
-
15
- env:
16
- CI: true
17
- NX_DAEMON: false
18
- NX_VERBOSE_LOGGING: true
19
- NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
20
- NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
21
- GITHUB_ACTOR: "🤖 Storm Bot"
22
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
-
25
- jobs:
26
- build-and-release:
27
- if: github.repository == 'storm-software/<%= name %>' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
28
- name: "Build & Release"
29
- runs-on: ubuntu-latest
30
- steps:
31
- - uses: actions/checkout@v3
32
- with:
33
- fetch-depth: 0
34
-
35
- - name: configure git
36
- run: |
37
- git config user.name "${GITHUB_ACTOR}"
38
- git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
39
-
40
- - name: Setup pnpm
41
- uses: pnpm/action-setup@v2.2.4
42
- with:
43
- version: 8
44
-
45
- - uses: actions/setup-node@v3
46
- with:
47
- registry-url: https://registry.npmjs.org/
48
- node-version-file: .github/.nvmrc
49
- cache: pnpm
50
- cache-dependency-path: pnpm-lock.yaml
51
-
52
- - name: Install Dependencies
53
- run: pnpm ci
54
-
55
- - name: Get appropriate base and head commits for `nx affected` commands
56
- uses: nrwl/nx-set-shas@v3
57
- with:
58
- main-branch-name: "main"
59
-
60
- - name: Set appropriate base and head commits for `nx affected` commands
61
- run: |
62
- echo "BASE: ${{ env.NX_BASE }}"
63
- echo "HEAD: ${{ env.NX_HEAD }}"
64
-
65
- #- name: Prepare for build
66
- # run: pnpm build
67
-
68
- - name: Build repository packages
69
- run: pnpm build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
70
-
71
- #- name: Run Linters
72
- # run: pnpm nx affected -t lint --parallel=3 --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
73
-
74
- - name: Run Formatters
75
- run: pnpm nx format
76
-
77
- # - run: npx nx affected -t lint --parallel=3
78
- # - run: npx nx affected -t test --parallel=3 --configuration=ci --base=${{ github.event.before }}
79
-
80
- # run: pnpm nx affected -t build --parallel=5 --exclude="core-server-cloudflare,worker-*" --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
81
- # run: pnpm nx affected -t build --parallel=3 --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
82
-
83
- #- name: Run Tests
84
- # uses: nick-fields/retry@v2.8.3
85
- # with:
86
- # command: npx nx affected -t test --parallel=3 --configuration=ci --base=${{ github.event.before }}
87
- # timeout_minutes: 10
88
- # max_attempts: 3
89
-
90
- - name: Upload coverage to Codecov
91
- uses: codecov/codecov-action@v3
92
-
93
- - name: Release Library Version Updates
94
- run: npx nx affected -t semantic-release --parallel=3 --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
95
-
96
- #- name: Release Repository Version Updates
97
- # run: pnpm nx run-many --target=semantic-release --parallel=false
98
-
99
- - name: Create Pull Request
100
- uses: repo-sync/pull-request@v2
101
- with:
102
- destination_branch: main
103
- pr_title: "chore(repo): Github CI/CD automated updates"
104
- pr_body: "This changeset is the result of updates made in the repository's files via the CI/CD pipeline automatically. The changes include linting, formatting, and version updates."
105
- github_token: ${{ secrets.GITHUB_TOKEN }}
106
-
107
- # - name: Publish
108
- # run: |
109
- # git config --global user.name 'Pat Sullivan'
110
- # git config --global user.email 'sullivanpj@users.noreply.github.com'
111
- # npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
112
- # npm run cipublish
113
- # env:
114
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115
- # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116
- # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
117
- # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
118
- # TAG: ${{ inputs.tag }}
119
-
120
- #- name: Release Library Version Updates
121
- # run: npx nx affected -t semantic-release --parallel=3 --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
122
- # env:
123
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124
-
125
- #- name: Release Repository Version Updates
126
- # run: npm run semantic-release
127
- # env:
128
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129
-
130
- # - name: Build Latest Documentation
131
- # run: npx nx run docs:build
@@ -1,85 +0,0 @@
1
- # Simple workflow for deploying documentation to GitHub Pages
2
- name: "Deploy Documentation"
3
-
4
- on:
5
- # Runs on pushes targeting the default branch
6
- push:
7
- branches:
8
- - "main"
9
-
10
- # Allows you to run this workflow manually from the Actions tab
11
- workflow_dispatch:
12
-
13
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
- permissions:
15
- contents: read
16
- pages: write
17
- id-token: write
18
-
19
- # Allow one concurrent deployment
20
- concurrency:
21
- group: "pages"
22
- cancel-in-progress: true
23
-
24
- env:
25
- CI: true
26
- NX_DAEMON: false
27
- NX_VERBOSE_LOGGING: true
28
- GITHUB_ACTOR: "🤖 Storm Bot"
29
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
-
32
- jobs:
33
- deploy-docs:
34
- if: github.repository == 'storm-software/<%= name %>' && github.ref == 'refs/heads/main'
35
- environment:
36
- name: github-pages
37
- url: ${{ steps.deployment.outputs.page_url }}
38
- runs-on: ubuntu-latest
39
- steps:
40
- - name: Checkout
41
- uses: actions/checkout@v3
42
- with:
43
- fetch-depth: 0
44
-
45
- - name: Setup pnpm
46
- uses: pnpm/action-setup@v2.2.4
47
- with:
48
- version: 8
49
-
50
- - uses: actions/setup-node@v3
51
- with:
52
- registry-url: https://registry.npmjs.org/
53
- node-version-file: .github/.nvmrc
54
- cache: pnpm
55
- cache-dependency-path: pnpm-lock.yaml
56
-
57
- - name: Install Dependencies
58
- run: pnpm ci
59
-
60
- - name: Prepare for build
61
- run: pnpm build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
62
-
63
- - name: Generate TSDocs Markdown with API Extractor
64
- run: pnpm nx g @storm-software/workspace-tools:api-extractor --outputPath 'docs/website/docs/api-reference' --clean --no-interactive
65
-
66
- - name: Build website
67
- run: pnpm nx run docs-website:build
68
-
69
- - name: Build event catalog
70
- run: pnpm nx run docs-event-catalog:build
71
-
72
- - name: Copy event catalog into website
73
- run: mkdir ./dist/docs/website/event-catalog && cp -r ./dist/docs/event-catalog/dist/out/* ./dist/docs/website/event-catalog
74
-
75
- - name: Setup Pages
76
- uses: actions/configure-pages@v3
77
-
78
- - name: Upload artifact
79
- uses: actions/upload-pages-artifact@v2
80
- with:
81
- path: "./dist/docs/website"
82
-
83
- - name: Deploy to GitHub Pages
84
- id: deployment
85
- uses: actions/deploy-pages@v2
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx --no-install commitlint --edit "$1"
@@ -1,2 +0,0 @@
1
- declare let _extends: string[];
2
- export { _extends as extends };
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ["@storm-software/linting-tools/commitlint"]
3
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"commitlint.config.js","sourceRoot":"","sources":["../../../../../../../packages/workspace-tools/src/generators/preset/files/commitlint.config.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE,CAAC,0CAA0C,CAAC;CACtD,CAAC"}
@@ -1 +0,0 @@
1
- const variable = "<%= name %>";
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./generators/preset/generator";
package/src/index.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./generators/preset/generator"), exports);
5
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/workspace-tools/src/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C"}
File without changes
File without changes