@storm-software/workspace-tools 1.0.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 (78) hide show
  1. package/README.md +136 -0
  2. package/config/nx.json +165 -0
  3. package/executors.json +10 -0
  4. package/generators.json +10 -0
  5. package/package.json +46 -0
  6. package/src/executors/build/executor.d.ts +34 -0
  7. package/src/executors/build/executor.js +51 -0
  8. package/src/executors/build/executor.js.map +1 -0
  9. package/src/executors/build/get-config.d.ts +40 -0
  10. package/src/executors/build/get-config.js +45 -0
  11. package/src/executors/build/get-config.js.map +1 -0
  12. package/src/executors/build/hasher.d.ts +8 -0
  13. package/src/executors/build/hasher.js +15 -0
  14. package/src/executors/build/hasher.js.map +1 -0
  15. package/src/executors/build/schema.d.ts +1 -0
  16. package/src/executors/build/schema.json +9 -0
  17. package/src/generators/preset/files/.alexignore +4 -0
  18. package/src/generators/preset/files/.alexrc +39 -0
  19. package/src/generators/preset/files/.all-contributorsrc.template +34 -0
  20. package/src/generators/preset/files/.editorconfig +454 -0
  21. package/src/generators/preset/files/.env.template +64 -0
  22. package/src/generators/preset/files/.eslintrc.json +123 -0
  23. package/src/generators/preset/files/.gitattributes +43 -0
  24. package/src/generators/preset/files/.github/.nvmrc +1 -0
  25. package/src/generators/preset/files/.github/CODEOWNERS +1 -0
  26. package/src/generators/preset/files/.github/CODE_OF_CONDUCT.md +125 -0
  27. package/src/generators/preset/files/.github/CONTRIBUTING.md.template +15 -0
  28. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/bug-report.yml.template +71 -0
  29. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/documentation.yml.template +56 -0
  30. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/feature-request.yml.template +63 -0
  31. package/src/generators/preset/files/.github/PULL_REQUEST_TEMPLATE.md.template +39 -0
  32. package/src/generators/preset/files/.github/SECURITY.md +9 -0
  33. package/src/generators/preset/files/.github/actions/node/action.yaml +42 -0
  34. package/src/generators/preset/files/.github/codecov.yml +29 -0
  35. package/src/generators/preset/files/.github/labels.yml +78 -0
  36. package/src/generators/preset/files/.github/renovate.json.template +55 -0
  37. package/src/generators/preset/files/.github/stale.yml +50 -0
  38. package/src/generators/preset/files/.github/workflows/ci.yml +131 -0
  39. package/src/generators/preset/files/.github/workflows/codeql.yml +81 -0
  40. package/src/generators/preset/files/.github/workflows/cr.yml +18 -0
  41. package/src/generators/preset/files/.github/workflows/documentation.yml.template +85 -0
  42. package/src/generators/preset/files/.github/workflows/git-guardian.yml +21 -0
  43. package/src/generators/preset/files/.github/workflows/greetings.yml +24 -0
  44. package/src/generators/preset/files/.github/workflows/labels.yml +30 -0
  45. package/src/generators/preset/files/.github/workflows/lock.yml +29 -0
  46. package/src/generators/preset/files/.github/workflows/nextjs-bundle-analysis.yml +139 -0
  47. package/src/generators/preset/files/.husky/commit-msg +4 -0
  48. package/src/generators/preset/files/.husky/post-checkout +6 -0
  49. package/src/generators/preset/files/.husky/post-merge +6 -0
  50. package/src/generators/preset/files/.husky/pre-commit +5 -0
  51. package/src/generators/preset/files/.husky/pre-push +3 -0
  52. package/src/generators/preset/files/.log4brains.yml +5 -0
  53. package/src/generators/preset/files/.markdownlint.json +25 -0
  54. package/src/generators/preset/files/.verdaccio/config.yml.template +40 -0
  55. package/src/generators/preset/files/.vscode/cspell.json +3 -0
  56. package/src/generators/preset/files/.vscode/extensions.json +14 -0
  57. package/src/generators/preset/files/.vscode/launch.json +39 -0
  58. package/src/generators/preset/files/.vscode/settings.json +300 -0
  59. package/src/generators/preset/files/.vscode/tasks.json +19 -0
  60. package/src/generators/preset/files/LICENSE +201 -0
  61. package/src/generators/preset/files/README.md.template +270 -0
  62. package/src/generators/preset/files/commitlint.config.d.ts +2 -0
  63. package/src/generators/preset/files/commitlint.config.js +3 -0
  64. package/src/generators/preset/files/commitlint.config.js.map +1 -0
  65. package/src/generators/preset/files/jest.config.d.ts +47 -0
  66. package/src/generators/preset/files/jest.config.js +58 -0
  67. package/src/generators/preset/files/jest.config.js.map +1 -0
  68. package/src/generators/preset/files/pnpm-workspace.yaml +4 -0
  69. package/src/generators/preset/files/src/index.ts.template +1 -0
  70. package/src/generators/preset/files/tsconfig.base.json.template +15 -0
  71. package/src/generators/preset/generator.d.ts +3 -0
  72. package/src/generators/preset/generator.js +148 -0
  73. package/src/generators/preset/generator.js.map +1 -0
  74. package/src/generators/preset/schema.d.ts +3 -0
  75. package/src/generators/preset/schema.json +18 -0
  76. package/src/index.d.ts +1 -0
  77. package/src/index.js +5 -0
  78. package/src/index.js.map +1 -0
@@ -0,0 +1,50 @@
1
+ # Configuration for probot-stale - https://github.com/probot/stale
2
+
3
+ # Number of days of inactivity before an Issue or Pull Request becomes stale
4
+ daysUntilStale: 60
5
+
6
+ # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7
+ # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8
+ daysUntilClose: 7
9
+
10
+ # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
11
+ exemptLabels: []
12
+
13
+ # Set to true to ignore issues in a project (defaults to false)
14
+ exemptProjects: false
15
+
16
+ # Set to true to ignore issues in a milestone (defaults to false)
17
+ exemptMilestones: false
18
+
19
+ # Label to use when marking as stale
20
+ staleLabel: wontfix
21
+
22
+ # Comment to post when marking as stale. Set to `false` to disable
23
+ markComment: >
24
+ This issue has been automatically marked as stale because it has not had
25
+ recent activity. It will be closed if no further activity occurs. Thank you
26
+ for your contributions.
27
+ # Comment to post when removing the stale label.
28
+ # unmarkComment: >
29
+ # Your comment here.
30
+
31
+ # Comment to post when closing a stale Issue or Pull Request.
32
+ # closeComment: >
33
+ # Your comment here.
34
+
35
+ # Limit the number of actions per hour, from 1-30. Default is 30
36
+ limitPerRun: 30
37
+ # Limit to only `issues` or `pulls`
38
+ # only: issues
39
+
40
+ # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
41
+ # pulls:
42
+ # daysUntilStale: 30
43
+ # markComment: >
44
+ # This pull request has been automatically marked as stale because it has not had
45
+ # recent activity. It will be closed if no further activity occurs. Thank you
46
+ # for your contributions.
47
+
48
+ # issues:
49
+ # exemptLabels:
50
+ # - confirmed
@@ -0,0 +1,131 @@
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
@@ -0,0 +1,81 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: ["main"]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: ["main"]
20
+ schedule:
21
+ - cron: "37 16 * * 6"
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
27
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
28
+ # - https://gh.io/supported-runners-and-hardware-resources
29
+ # - https://gh.io/using-larger-runners
30
+ # Consider using larger runners for possible analysis time improvements.
31
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
32
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
33
+ permissions:
34
+ actions: read
35
+ contents: read
36
+ security-events: write
37
+
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ language: ["javascript"]
42
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
43
+ # Use only 'java' to analyze code written in Java, Kotlin or both
44
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
45
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
46
+
47
+ steps:
48
+ - name: Checkout repository
49
+ uses: actions/checkout@v3
50
+
51
+ # Initializes the CodeQL tools for scanning.
52
+ - name: Initialize CodeQL
53
+ uses: github/codeql-action/init@v2
54
+ with:
55
+ languages: ${{ matrix.language }}
56
+ # If you wish to specify custom queries, you can do so here or in a config file.
57
+ # By default, queries listed here will override any specified in a config file.
58
+ # Prefix the list here with "+" to use these queries and those in the config file.
59
+
60
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61
+ # queries: security-extended,security-and-quality
62
+
63
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64
+ # If this step fails, then you should remove it and run the build manually (see below)
65
+ - name: Autobuild
66
+ uses: github/codeql-action/autobuild@v2
67
+
68
+ # ℹ️ Command-line programs to run using the OS shell.
69
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
70
+
71
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
72
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
73
+
74
+ # - run: |
75
+ # echo "Run, Build Application using script"
76
+ # ./location_of_script_within_repo/buildscript.sh
77
+
78
+ - name: Perform CodeQL Analysis
79
+ uses: github/codeql-action/analyze@v2
80
+ with:
81
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,18 @@
1
+ name: "Code Review"
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+ on:
6
+ pull_request:
7
+ types:
8
+ - opened
9
+ - reopened
10
+ - synchronize
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: anc95/ChatGPT-CodeReview@main
16
+ env:
17
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18
+ OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
@@ -0,0 +1,85 @@
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
@@ -0,0 +1,21 @@
1
+ name: "GitGuardian Scan"
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ scanning:
7
+ name: GitGuardian scan
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v3
12
+ with:
13
+ fetch-depth: 0 # fetch all history so multiple commits can be scanned
14
+ - name: GitGuardian scan
15
+ uses: GitGuardian/ggshield-action@master
16
+ env:
17
+ GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
18
+ GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
19
+ GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
20
+ GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
21
+ GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
@@ -0,0 +1,24 @@
1
+ name: "Greetings"
2
+
3
+ on: [pull_request_target, issues]
4
+
5
+ env:
6
+ CI: true
7
+ NX_DAEMON: false
8
+ NX_VERBOSE_LOGGING: true
9
+ GITHUB_ACTOR: "🤖 Storm Bot"
10
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12
+
13
+ jobs:
14
+ greeting:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ issues: write
18
+ pull-requests: write
19
+ steps:
20
+ - uses: actions/first-interaction@v1
21
+ with:
22
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
23
+ issue-message: "Thank you for your interest in this project! We will review this issue and reach out to you ASAP"
24
+ pr-message: "We sincerely appreciate your effort/interest in contributing to this project. We will review this change and get back to you ASAP. Please feel free to reach out to the DEV team if you have any questions/comments."
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Sync labels
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ paths:
9
+ - .github/labels.yml
10
+
11
+ env:
12
+ CI: true
13
+ NX_DAEMON: false
14
+ NX_VERBOSE_LOGGING: true
15
+ SKIP_ENV_VALIDATION: true
16
+ GITHUB_ACTOR: "🤖 Storm Bot"
17
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19
+
20
+ jobs:
21
+ labels:
22
+ name: ♻️ Sync labels
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: ⤵️ Check out code from GitHub
26
+ uses: actions/checkout@v3
27
+ - name: 🚀 Run Label Syncer
28
+ uses: micnncim/action-label-syncer@v1.3.0
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Lock
3
+
4
+ on:
5
+ schedule:
6
+ - cron: "0 9 * * *"
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ CI: true
11
+ NX_DAEMON: false
12
+ NX_VERBOSE_LOGGING: true
13
+ SKIP_ENV_VALIDATION: true
14
+ GITHUB_ACTOR: "🤖 Storm Bot"
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17
+
18
+ jobs:
19
+ lock:
20
+ name: 🔒 Lock closed issues and PRs
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: dessant/lock-threads@v4
24
+ with:
25
+ github-token: ${{ github.token }}
26
+ issue-inactive-days: "30"
27
+ issue-lock-reason: ""
28
+ pr-inactive-days: "1"
29
+ pr-lock-reason: ""
@@ -0,0 +1,139 @@
1
+ name: "Web App Bundle Analysis"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ workflow_dispatch:
11
+
12
+ defaults:
13
+ run:
14
+ # change this if your nextjs app does not live at the root of the repo
15
+ working-directory: ./
16
+
17
+ env:
18
+ CI: true
19
+ NX_DAEMON: false
20
+ NX_VERBOSE_LOGGING: true
21
+ SKIP_ENV_VALIDATION: true
22
+ GITHUB_ACTOR: "🤖 Storm Bot"
23
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25
+
26
+ jobs:
27
+ analyze:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v3
31
+
32
+ - name: Setup pnpm
33
+ uses: pnpm/action-setup@v2.2.4
34
+ with:
35
+ version: 8
36
+
37
+ - uses: actions/setup-node@v3
38
+ with:
39
+ registry-url: https://registry.npmjs.org/
40
+ node-version-file: .github/.nvmrc
41
+ cache: pnpm
42
+ cache-dependency-path: pnpm-lock.yaml
43
+
44
+ - name: Install Dependencies
45
+ run: pnpm ci
46
+
47
+ - name: Restore next build
48
+ uses: actions/cache@v3
49
+ id: restore-build-cache
50
+ env:
51
+ cache-name: cache-next-build
52
+ with:
53
+ path: dist/apps/web/shell/.next/cache
54
+ # change this if you prefer a more strict cache
55
+ key: ${{ runner.os }}-build-${{ env.cache-name }}
56
+
57
+ - name: Set appropriate base and head commits for `nx affected` commands
58
+ run: |
59
+ echo "BASE: ${{ env.NX_BASE }}"
60
+ echo "HEAD: ${{ env.NX_HEAD }}"
61
+
62
+ - name: Prepare for build
63
+ run: pnpm build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
64
+
65
+ - name: Build next.js app
66
+ env:
67
+ SKIP_BUILD_PRODUCT_REDIRECTS: 1
68
+ run: pnpm nx run web-shell:build
69
+
70
+ # Here's the first place where next-bundle-analysis' own script is used
71
+ # This step pulls the raw bundle stats for the current bundle
72
+ - name: Analyze bundle
73
+ run: pnpm -p nextjs-bundle-analysis report
74
+
75
+ - name: Upload bundle
76
+ uses: actions/upload-artifact@v3
77
+ with:
78
+ name: bundle
79
+ path: dist/apps/web/shell/.next/analyze/__bundle_analysis.json
80
+
81
+ #- name: Download base branch bundle stats
82
+ # uses: dawidd6/action-download-artifact@v2
83
+ # if: success() && github.event.number
84
+ # with:
85
+ # workflow: nextjs_bundle_analysis.yml
86
+ # branch: ${{ github.event.pull_request.base.ref }}
87
+ # path: dist/apps/web/shell/.next/analyze/base
88
+
89
+ # And here's the second place - this runs after we have both the current and
90
+ # base branch bundle stats, and will compare them to determine what changed.
91
+ # There are two configurable arguments that come from package.json:
92
+ #
93
+ # - budget: optional, set a budget (bytes) against which size changes are measured
94
+ # it's set to 350kb here by default, as informed by the following piece:
95
+ # https://infrequently.org/2021/03/the-performance-inequality-gap/
96
+ #
97
+ # - red-status-percentage: sets the percent size increase where you get a red
98
+ # status indicator, defaults to 20%
99
+ #
100
+ # Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
101
+ # entry in your package.json file.
102
+ #- name: Compare with base branch bundle
103
+ # if: success() && github.event.number
104
+ # run: ls -laR dist/apps/web/shell/.next/analyze/base && npx -p nextjs-bundle-analysis compare
105
+
106
+ #- name: Get comment body
107
+ # id: get-comment-body
108
+ # if: success() && github.event.number
109
+ # uses: actions/github-script@v6
110
+ # with:
111
+ # result-encoding: string
112
+ # script: |
113
+ # const fs = require('fs')
114
+ # const comment = fs.readFileSync('dist/apps/web/shell/.next/analyze/__bundle_analysis_comment.txt', 'utf8')
115
+ # core.setOutput('body', comment)
116
+
117
+ #- name: Find Comment
118
+ # uses: peter-evans/find-comment@v2
119
+ # if: success() && github.event.number
120
+ # id: fc
121
+ # with:
122
+ # issue-number: ${{ github.event.number }}
123
+ # body-includes: "<!-- __NEXTJS_BUNDLE -->"
124
+
125
+ #- name: Create Comment
126
+ # uses: peter-evans/create-or-update-comment@v3
127
+ # if: success() && github.event.number && steps.fc.outputs.comment-id == 0
128
+ # with:
129
+ # issue-number: ${{ github.event.number }}
130
+ # body: ${{ steps.get-comment-body.outputs.body }}
131
+
132
+ #- name: Update Comment
133
+ # uses: peter-evans/create-or-update-comment@v3
134
+ # if: success() && github.event.number && steps.fc.outputs.comment-id != 0
135
+ # with:
136
+ # issue-number: ${{ github.event.number }}
137
+ # body: ${{ steps.get-comment-body.outputs.body }}
138
+ # comment-id: ${{ steps.fc.outputs.comment-id }}
139
+ # edit-mode: replace
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
5
+ node @storm-software/workspace-tools/scripts/package-version-warning.js $changedFiles
6
+
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
5
+ node @storm-software/workspace-tools/scripts/package-version-warning.js $changedFiles
6
+
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ node @storm-software/workspace-tools/scripts/check-lock-file.js
5
+ pnpm pre-commit
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push'.\n"; exit 2; }
3
+ git lfs pre-push "$@"
@@ -0,0 +1,5 @@
1
+ project:
2
+ name: <%= name %>
3
+ tz: America/New_York
4
+ adrFolder: ./docs/decisions
5
+ packages: []
@@ -0,0 +1,25 @@
1
+ {
2
+ "default": true,
3
+ "MD033": {
4
+ "allowed_elements": [
5
+ "h1",
6
+ "h2",
7
+ "h3",
8
+ "HR",
9
+ "p",
10
+ "a",
11
+ "b",
12
+ "div",
13
+ "img",
14
+ "br",
15
+ "details",
16
+ "summary",
17
+ "strong",
18
+ "table",
19
+ "tr",
20
+ "td"
21
+ ]
22
+ },
23
+ "line-length": false,
24
+ "first-line-heading": false
25
+ }