@jakubmazanec/carson-templates 1.0.0 → 2.0.0-next.2fa8a2c
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/LICENSE.md +0 -2
- package/README.md +1 -1
- package/build/constants.d.ts +60 -0
- package/build/constants.js +89 -0
- package/build/constants.js.map +7 -0
- package/build/dependency-versions.d.ts +1 -0
- package/build/dependency-versions.js +58 -0
- package/build/dependency-versions.js.map +7 -0
- package/build/getDependencies.d.ts +2 -0
- package/build/getDependencies.js +44 -0
- package/build/getDependencies.js.map +7 -0
- package/build/getDevelopmentBranch.d.ts +2 -0
- package/build/getDevelopmentBranch.js +11 -0
- package/build/getDevelopmentBranch.js.map +7 -0
- package/build/getMainBranch.d.ts +2 -0
- package/build/getMainBranch.js +11 -0
- package/build/getMainBranch.js.map +7 -0
- package/build/getReferences.d.ts +4 -0
- package/build/getReferences.js +20 -0
- package/build/getReferences.js.map +7 -0
- package/build/getWorkspaceName.d.ts +2 -0
- package/build/getWorkspaceName.js +16 -0
- package/build/getWorkspaceName.js.map +7 -0
- package/build/main.d.ts +8 -0
- package/build/main.js +10 -0
- package/build/main.js.map +7 -0
- package/package.json +31 -20
- package/source/constants.ts +94 -0
- package/source/dependency-versions.ts +69 -0
- package/source/getDependencies.ts +58 -0
- package/source/getDevelopmentBranch.ts +13 -0
- package/source/getMainBranch.ts +13 -0
- package/source/getReferences.ts +29 -0
- package/source/getWorkspaceName.ts +20 -0
- package/source/main.ts +8 -0
- package/templates/projects/carson-templates/.eslintrc.cjs.ejs +21 -0
- package/templates/projects/carson-templates/.prettierignore.ejs +3 -0
- package/templates/projects/carson-templates/CONTRIBUTING.md.ejs +3 -0
- package/templates/projects/carson-templates/package.json.ejs +26 -12
- package/templates/projects/carson-templates/prettier.config.cjs.ejs +3 -0
- package/templates/projects/carson-templates/source/main.ts.check.ejs +4 -0
- package/templates/projects/carson-templates/source/main.ts.create.ejs +6 -0
- package/templates/projects/carson-templates/tests/tsconfig.json.ejs +19 -12
- package/templates/projects/carson-templates/tsconfig.json.ejs +23 -9
- package/templates/projects/carson-templates/tsconfig.typecheck.json.ejs +1 -12
- package/templates/projects/carson-templates/typedoc.config.cjs.ejs +1 -10
- package/templates/projects/changesets-changelog/.eslintrc.cjs.ejs +21 -0
- package/templates/projects/changesets-changelog/.prettierignore.ejs +3 -0
- package/templates/projects/changesets-changelog/CONTRIBUTING.md.ejs +3 -0
- package/templates/projects/changesets-changelog/package.json.ejs +38 -20
- package/templates/projects/changesets-changelog/prettier.config.cjs.ejs +3 -0
- package/templates/projects/changesets-changelog/source/main.ts.check.ejs +4 -0
- package/templates/projects/changesets-changelog/source/main.ts.create.ejs +6 -0
- package/templates/projects/changesets-changelog/tests/tsconfig.json.ejs +19 -12
- package/templates/projects/changesets-changelog/tsconfig.json.ejs +23 -9
- package/templates/projects/changesets-changelog/tsconfig.typecheck.json.ejs +21 -10
- package/templates/projects/eslint-config/.eslintrc.cjs.ejs +21 -0
- package/templates/projects/eslint-config/.prettierignore.ejs +3 -0
- package/templates/projects/eslint-config/CONTRIBUTING.md.ejs +3 -0
- package/templates/projects/eslint-config/package.json.ejs +39 -25
- package/templates/projects/eslint-config/prettier.config.cjs.ejs +3 -0
- package/templates/projects/eslint-config/source/main.ts.check.ejs +4 -0
- package/templates/projects/eslint-config/source/main.ts.create.ejs +6 -0
- package/templates/projects/eslint-config/tsconfig.json.ejs +23 -9
- package/templates/projects/eslint-config/tsconfig.typecheck.json.ejs +20 -9
- package/templates/projects/library/.eslintrc.cjs.ejs +21 -0
- package/templates/projects/library/.prettierignore.ejs +3 -0
- package/templates/projects/library/CONTRIBUTING.md.ejs +18 -0
- package/templates/projects/library/README.md.create.ejs +36 -0
- package/templates/projects/library/package.json.create.ejs +1 -1
- package/templates/projects/library/package.json.ejs +35 -13
- package/templates/projects/library/prettier.config.cjs.ejs +3 -0
- package/templates/projects/library/source/main.ts.check.ejs +4 -0
- package/templates/projects/library/source/main.ts.create.ejs +5 -0
- package/templates/projects/library/tests/tsconfig.json.ejs +19 -12
- package/templates/projects/library/tsconfig.json.ejs +23 -9
- package/templates/projects/library/tsconfig.typecheck.json.ejs +20 -9
- package/templates/projects/library/typedoc.config.cjs.ejs +13 -7
- package/templates/projects/remix-app/.eslintrc.cjs.ejs +21 -0
- package/templates/projects/remix-app/.prettierignore.ejs +3 -0
- package/templates/projects/remix-app/CONTRIBUTING.md.ejs +3 -0
- package/templates/projects/remix-app/Dockerfile.ejs +47 -0
- package/templates/projects/remix-app/README.md.create.ejs +26 -0
- package/templates/projects/remix-app/app/entry.client.tsx.create.ejs +16 -0
- package/templates/projects/remix-app/app/root.tsx.create.ejs +26 -0
- package/templates/projects/remix-app/app/routes/_index.tsx.create.ejs +18 -0
- package/templates/projects/remix-app/app/tailwind.css.create.ejs +7 -0
- package/templates/projects/remix-app/config.json +4 -0
- package/templates/projects/remix-app/env.d.ts.ejs +14 -0
- package/templates/projects/remix-app/fly.toml.ejs +18 -0
- package/templates/projects/remix-app/package.json.create.ejs +14 -0
- package/templates/projects/remix-app/package.json.ejs +67 -0
- package/templates/projects/remix-app/postcss.config.cjs.ejs +18 -0
- package/templates/projects/remix-app/prettier.config.cjs.ejs +19 -0
- package/templates/projects/remix-app/tailwind.config.ts.ejs +21 -0
- package/templates/projects/remix-app/tests/setup.ts.ejs +13 -0
- package/templates/projects/remix-app/tests/tsconfig.json.ejs +24 -0
- package/templates/projects/remix-app/tsconfig.json.ejs +30 -0
- package/templates/projects/remix-app/tsconfig.typecheck.json.ejs +19 -0
- package/templates/projects/remix-app/vite.config.ts.ejs +40 -0
- package/templates/workspace/.eslintrc.cjs.ejs +9 -13
- package/templates/workspace/.github/workflows/{pull-request.yaml.ejs → check-pull-request.yaml.ejs} +30 -7
- package/templates/workspace/.github/workflows/merge-to-main-branch.yaml.ejs +12 -4
- package/templates/workspace/.github/workflows/release-pull-request.yaml.ejs +105 -0
- package/templates/workspace/.github/workflows/release.yaml.ejs +65 -105
- package/templates/workspace/.github/workflows/update-pull-request.yaml.ejs +139 -0
- package/templates/workspace/.gitignore.ejs +9 -1
- package/templates/workspace/.prettierignore.ejs +9 -10
- package/templates/workspace/CONTRIBUTING.md.ejs +18 -0
- package/templates/workspace/README.md.create.ejs +16 -0
- package/templates/workspace/README.md.insert.ejs +1 -0
- package/templates/workspace/package.json.ejs +6 -16
- package/templates/workspace/prettier.config.cjs.ejs +19 -0
- package/templates/workspace/tsconfig.json.ejs +23 -0
- package/templates/workspace/tsconfig.typecheck.json.ejs +10 -4
- package/templates/workspace/turbo.json.ejs +1 -1
- package/dist/main.d.ts +0 -10
- package/dist/main.js +0 -128
- package/dist/main.js.map +0 -1
- package/src/main.ts +0 -166
- package/templates/projects/carson-templates/.swcrc.ejs +0 -23
- package/templates/projects/carson-templates/jest.config.ts.ejs +0 -30
- package/templates/projects/carson-templates/src/main.ts.check.ejs +0 -5
- package/templates/projects/carson-templates/src/main.ts.create.ejs +0 -4
- package/templates/projects/changesets-changelog/.swcrc.ejs +0 -25
- package/templates/projects/changesets-changelog/jest.config.ts.ejs +0 -24
- package/templates/projects/changesets-changelog/src/main.ts.check.ejs +0 -5
- package/templates/projects/changesets-changelog/src/main.ts.create.ejs +0 -4
- package/templates/projects/eslint-config/.swcrc.ejs +0 -25
- package/templates/projects/eslint-config/jest.config.ts.ejs +0 -24
- package/templates/projects/eslint-config/src/main.ts.check.ejs +0 -5
- package/templates/projects/eslint-config/src/main.ts.create.ejs +0 -4
- package/templates/projects/eslint-config/tests/tsconfig.json.ejs +0 -17
- package/templates/projects/library/.swcrc.ejs +0 -23
- package/templates/projects/library/jest.config.ts.ejs +0 -30
- package/templates/projects/library/src/main.ts.check.ejs +0 -5
- package/templates/projects/library/src/main.ts.create.ejs +0 -4
- package/templates/workspace/prettier.config.js.ejs +0 -19
- package/templates/workspace/tsconfig.options.json.ejs +0 -24
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: '.github/workflows/release-pull-request.yaml'
|
|
3
|
+
strategy: overwrite
|
|
4
|
+
---
|
|
5
|
+
#
|
|
6
|
+
# DO NOT EDIT!
|
|
7
|
+
# This file was autogenerated by Carson.
|
|
8
|
+
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
9
|
+
#
|
|
10
|
+
# Run `npx carson update workspace` to regenerate.
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
name: Release pull request
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
pull_request:
|
|
17
|
+
branches:
|
|
18
|
+
- development
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
22
|
+
cancel-in-progress: true
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
release_pull_request:
|
|
26
|
+
name: Release pull request
|
|
27
|
+
if: ${{ github.actor != 'renovate[bot]' }}
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
timeout-minutes: 15
|
|
30
|
+
permissions:
|
|
31
|
+
contents: read
|
|
32
|
+
id-token: write
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
|
|
39
|
+
- name: Configure git
|
|
40
|
+
run: |
|
|
41
|
+
git config user.email "bot@mazanec.dev"
|
|
42
|
+
git config user.name "Bot"
|
|
43
|
+
|
|
44
|
+
- uses: actions/setup-node@v4
|
|
45
|
+
with:
|
|
46
|
+
node-version: 20
|
|
47
|
+
registry-url: 'https://registry.npmjs.org'
|
|
48
|
+
|
|
49
|
+
- name: Install packages
|
|
50
|
+
run: npm ci
|
|
51
|
+
|
|
52
|
+
- name: Check for changes
|
|
53
|
+
run: |
|
|
54
|
+
git config core.filemode false
|
|
55
|
+
git_status=$(git status --porcelain)
|
|
56
|
+
|
|
57
|
+
if [[ -n $git_status ]]; then
|
|
58
|
+
echo "You have uncommitted changes!"
|
|
59
|
+
git diff
|
|
60
|
+
git config --unset core.filemode
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
git config --unset core.filemode
|
|
65
|
+
|
|
66
|
+
- name: Run tests
|
|
67
|
+
run: npm test
|
|
68
|
+
|
|
69
|
+
- name: Check for changes
|
|
70
|
+
run: |
|
|
71
|
+
git config core.filemode false
|
|
72
|
+
git_status=$(git status --porcelain)
|
|
73
|
+
|
|
74
|
+
if [[ -n $git_status ]]; then
|
|
75
|
+
echo "You have uncommitted changes!"
|
|
76
|
+
git diff
|
|
77
|
+
git config --unset core.filemode
|
|
78
|
+
exit 1
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
git config --unset core.filemode
|
|
82
|
+
|
|
83
|
+
- name: Build packages
|
|
84
|
+
run: npm run build
|
|
85
|
+
|
|
86
|
+
- name: Authenticate to npm registry
|
|
87
|
+
run: |
|
|
88
|
+
echo "//registry.npmjs.com/:_authToken=NPM_TOKEN" > .npmrc
|
|
89
|
+
env:
|
|
90
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
91
|
+
|
|
92
|
+
- name: Version packages
|
|
93
|
+
run: |
|
|
94
|
+
npx changeset version --snapshot unstable.$(git rev-parse --short HEAD) --snapshot-prerelease-template "{tag}"
|
|
95
|
+
git status
|
|
96
|
+
env:
|
|
97
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
98
|
+
|
|
99
|
+
- name: Publish packages
|
|
100
|
+
run: |
|
|
101
|
+
npx changeset publish --tag unstable --no-git-tag
|
|
102
|
+
env:
|
|
103
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
104
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
105
|
+
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
|
|
@@ -2,25 +2,35 @@
|
|
|
2
2
|
to: '.github/workflows/release.yaml'
|
|
3
3
|
strategy: overwrite
|
|
4
4
|
---
|
|
5
|
+
#
|
|
6
|
+
# DO NOT EDIT!
|
|
7
|
+
# This file was autogenerated by Carson.
|
|
8
|
+
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
9
|
+
#
|
|
10
|
+
# Run `npx carson update workspace` to regenerate.
|
|
11
|
+
#
|
|
12
|
+
|
|
5
13
|
name: Release
|
|
6
14
|
|
|
7
15
|
on: [push, workflow_dispatch]
|
|
8
16
|
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
|
|
9
21
|
jobs:
|
|
10
|
-
|
|
11
|
-
name:
|
|
22
|
+
release_main_branch:
|
|
23
|
+
name: Release
|
|
24
|
+
if: ${{ github.ref_name == '<%- getMainBranch(workspace) %>' }}
|
|
12
25
|
runs-on: ubuntu-latest
|
|
13
26
|
timeout-minutes: 15
|
|
14
|
-
|
|
27
|
+
permissions:
|
|
28
|
+
contents: read
|
|
29
|
+
id-token: write
|
|
15
30
|
steps:
|
|
16
|
-
-
|
|
17
|
-
uses: styfle/cancel-workflow-action@0.11.0
|
|
31
|
+
- uses: actions/checkout@v4
|
|
18
32
|
with:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- uses: actions/checkout@v3
|
|
22
|
-
with:
|
|
23
|
-
token: ${{secrets.PAT}}
|
|
33
|
+
token: ${{ secrets.PAT }}
|
|
24
34
|
fetch-depth: 0
|
|
25
35
|
|
|
26
36
|
- name: Configure git
|
|
@@ -28,9 +38,9 @@ jobs:
|
|
|
28
38
|
git config user.email "bot@mazanec.dev"
|
|
29
39
|
git config user.name "Bot"
|
|
30
40
|
|
|
31
|
-
- uses: actions/setup-node@
|
|
41
|
+
- uses: actions/setup-node@v4
|
|
32
42
|
with:
|
|
33
|
-
node-version:
|
|
43
|
+
node-version: 20
|
|
34
44
|
registry-url: 'https://registry.npmjs.org'
|
|
35
45
|
|
|
36
46
|
- name: Install packages
|
|
@@ -43,7 +53,7 @@ jobs:
|
|
|
43
53
|
|
|
44
54
|
if [[ -n $git_status ]]; then
|
|
45
55
|
echo "You have uncommitted changes!"
|
|
46
|
-
git
|
|
56
|
+
git diff
|
|
47
57
|
git config --unset core.filemode
|
|
48
58
|
exit 1
|
|
49
59
|
fi
|
|
@@ -60,7 +70,7 @@ jobs:
|
|
|
60
70
|
|
|
61
71
|
if [[ -n $git_status ]]; then
|
|
62
72
|
echo "You have uncommitted changes!"
|
|
63
|
-
git
|
|
73
|
+
git diff
|
|
64
74
|
git config --unset core.filemode
|
|
65
75
|
exit 1
|
|
66
76
|
fi
|
|
@@ -96,6 +106,7 @@ jobs:
|
|
|
96
106
|
env:
|
|
97
107
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
98
108
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
109
|
+
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
|
|
99
110
|
|
|
100
111
|
- name: Update lockfile
|
|
101
112
|
run: |
|
|
@@ -112,6 +123,20 @@ jobs:
|
|
|
112
123
|
run: |
|
|
113
124
|
git push --follow-tags
|
|
114
125
|
|
|
126
|
+
<%
|
|
127
|
+
for (let project of workspace.projects) {
|
|
128
|
+
if (project.config.deployment?.appName) {
|
|
129
|
+
-%>
|
|
130
|
+
- name: Deploy
|
|
131
|
+
run:
|
|
132
|
+
npm run deploy --workspace <%- project.name %>
|
|
133
|
+
env:
|
|
134
|
+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
135
|
+
<%
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
%>
|
|
139
|
+
|
|
115
140
|
- name: Checkout main branch
|
|
116
141
|
run: |
|
|
117
142
|
git fetch -p origin
|
|
@@ -131,18 +156,21 @@ jobs:
|
|
|
131
156
|
git merge <%- getMainBranch(workspace) %> --no-verify
|
|
132
157
|
git push -u origin <%- getDevelopmentBranch(workspace) %> --no-verify
|
|
133
158
|
|
|
134
|
-
|
|
135
|
-
name:
|
|
159
|
+
release_development_branch:
|
|
160
|
+
name: Release preview
|
|
161
|
+
if: ${{ github.ref_name == '<%- getDevelopmentBranch(workspace) %>' }}
|
|
136
162
|
runs-on: ubuntu-latest
|
|
137
163
|
timeout-minutes: 15
|
|
138
|
-
|
|
164
|
+
permissions:
|
|
165
|
+
contents: read
|
|
166
|
+
id-token: write
|
|
139
167
|
steps:
|
|
140
168
|
- name: Cancel previous runs
|
|
141
169
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
142
170
|
with:
|
|
143
171
|
access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
144
172
|
|
|
145
|
-
- uses: actions/checkout@
|
|
173
|
+
- uses: actions/checkout@v4
|
|
146
174
|
with:
|
|
147
175
|
token: ${{ secrets.PAT }}
|
|
148
176
|
fetch-depth: 0
|
|
@@ -152,9 +180,9 @@ jobs:
|
|
|
152
180
|
git config user.email "bot@mazanec.dev"
|
|
153
181
|
git config user.name "Bot"
|
|
154
182
|
|
|
155
|
-
- uses: actions/setup-node@
|
|
183
|
+
- uses: actions/setup-node@v4
|
|
156
184
|
with:
|
|
157
|
-
node-version:
|
|
185
|
+
node-version: 20
|
|
158
186
|
registry-url: 'https://registry.npmjs.org'
|
|
159
187
|
|
|
160
188
|
- name: Install packages
|
|
@@ -167,7 +195,7 @@ jobs:
|
|
|
167
195
|
|
|
168
196
|
if [[ -n $git_status ]]; then
|
|
169
197
|
echo "You have uncommitted changes!"
|
|
170
|
-
git
|
|
198
|
+
git diff
|
|
171
199
|
git config --unset core.filemode
|
|
172
200
|
exit 1
|
|
173
201
|
fi
|
|
@@ -184,7 +212,7 @@ jobs:
|
|
|
184
212
|
|
|
185
213
|
if [[ -n $git_status ]]; then
|
|
186
214
|
echo "You have uncommitted changes!"
|
|
187
|
-
git
|
|
215
|
+
git diff
|
|
188
216
|
git config --unset core.filemode
|
|
189
217
|
exit 1
|
|
190
218
|
fi
|
|
@@ -212,7 +240,7 @@ jobs:
|
|
|
212
240
|
|
|
213
241
|
- name: Version packages
|
|
214
242
|
run: |
|
|
215
|
-
npx changeset version --snapshot next --snapshot-prerelease-template "{tag}
|
|
243
|
+
npx changeset version --snapshot next.$(git rev-parse --short HEAD) --snapshot-prerelease-template "{tag}"
|
|
216
244
|
git status
|
|
217
245
|
env:
|
|
218
246
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -223,86 +251,18 @@ jobs:
|
|
|
223
251
|
env:
|
|
224
252
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
225
253
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
with:
|
|
236
|
-
access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
237
|
-
|
|
238
|
-
- uses: actions/checkout@v3
|
|
239
|
-
with:
|
|
240
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
241
|
-
fetch-depth: 0
|
|
242
|
-
|
|
243
|
-
- name: Configure git
|
|
244
|
-
run: |
|
|
245
|
-
git config user.email "bot@mazanec.dev"
|
|
246
|
-
git config user.name "Bot"
|
|
247
|
-
|
|
248
|
-
- uses: actions/setup-node@v3
|
|
249
|
-
with:
|
|
250
|
-
node-version: 16
|
|
251
|
-
registry-url: 'https://registry.npmjs.org'
|
|
252
|
-
|
|
253
|
-
- name: Install packages
|
|
254
|
-
run: npm ci
|
|
255
|
-
|
|
256
|
-
- name: Check for changes
|
|
257
|
-
run: |
|
|
258
|
-
git config core.filemode false
|
|
259
|
-
git_status=$(git status --porcelain)
|
|
260
|
-
|
|
261
|
-
if [[ -n $git_status ]]; then
|
|
262
|
-
echo "You have uncommitted changes!"
|
|
263
|
-
git status --porcelain
|
|
264
|
-
git config --unset core.filemode
|
|
265
|
-
exit 1
|
|
266
|
-
fi
|
|
267
|
-
|
|
268
|
-
git config --unset core.filemode
|
|
269
|
-
|
|
270
|
-
- name: Run tests
|
|
271
|
-
run: npm test
|
|
272
|
-
|
|
273
|
-
- name: Check for changes
|
|
274
|
-
run: |
|
|
275
|
-
git config core.filemode false
|
|
276
|
-
git_status=$(git status --porcelain)
|
|
277
|
-
|
|
278
|
-
if [[ -n $git_status ]]; then
|
|
279
|
-
echo "You have uncommitted changes!"
|
|
280
|
-
git status --porcelain
|
|
281
|
-
git config --unset core.filemode
|
|
282
|
-
exit 1
|
|
283
|
-
fi
|
|
284
|
-
|
|
285
|
-
git config --unset core.filemode
|
|
286
|
-
|
|
287
|
-
- name: Build packages
|
|
288
|
-
run: npm run build
|
|
289
|
-
|
|
290
|
-
- name: Authenticate to npm registry
|
|
291
|
-
run: |
|
|
292
|
-
echo "//registry.npmjs.com/:_authToken=NPM_TOKEN" > .npmrc
|
|
293
|
-
env:
|
|
294
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
295
|
-
|
|
296
|
-
- name: Version packages
|
|
297
|
-
run: |
|
|
298
|
-
npx changeset version --snapshot unstable --snapshot-prerelease-template "{tag}.{commit}"
|
|
299
|
-
git status
|
|
300
|
-
env:
|
|
301
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
302
|
-
|
|
303
|
-
- name: Publish packages
|
|
304
|
-
run: |
|
|
305
|
-
npx changeset publish --tag unstable --no-git-tag
|
|
254
|
+
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
|
|
255
|
+
|
|
256
|
+
<%
|
|
257
|
+
for (let project of workspace.projects) {
|
|
258
|
+
if (project.config.deployment?.appName) {
|
|
259
|
+
-%>
|
|
260
|
+
- name: Deploy
|
|
261
|
+
run:
|
|
262
|
+
npm run deploy --workspace <%- project.name %> -- --app <%- project.config.deployment?.appName %>-staging
|
|
306
263
|
env:
|
|
307
|
-
|
|
308
|
-
|
|
264
|
+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
265
|
+
<%
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
%>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: '.github/workflows/update-pull-request.yaml'
|
|
3
|
+
strategy: overwrite
|
|
4
|
+
---
|
|
5
|
+
#
|
|
6
|
+
# DO NOT EDIT!
|
|
7
|
+
# This file was autogenerated by Carson.
|
|
8
|
+
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
9
|
+
#
|
|
10
|
+
# Run `npx carson update workspace` to regenerate.
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
name: Update pull request
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
pull_request_target:
|
|
17
|
+
branches: [development]
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
update_pull_request:
|
|
21
|
+
name: Update pull request
|
|
22
|
+
if: ${{ github.actor == 'renovate[bot]' && contains(github.head_ref, 'renovate/') }}
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
timeout-minutes: 15
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
ref: ${{ github.head_ref }}
|
|
29
|
+
token: ${{ secrets.PAT }}
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Configure git
|
|
33
|
+
run: |
|
|
34
|
+
git config user.email "bot@mazanec.dev"
|
|
35
|
+
git config user.name "Bot"
|
|
36
|
+
|
|
37
|
+
- uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
node-version: 20
|
|
40
|
+
|
|
41
|
+
- name: Install packages
|
|
42
|
+
run: npm ci
|
|
43
|
+
|
|
44
|
+
- name: Generate changeset
|
|
45
|
+
uses: actions/github-script@v6
|
|
46
|
+
with:
|
|
47
|
+
script: |
|
|
48
|
+
let { promises: fs } = require('fs');
|
|
49
|
+
|
|
50
|
+
async function getPackagesNames(files) {
|
|
51
|
+
let names = [];
|
|
52
|
+
|
|
53
|
+
for (let file of files) {
|
|
54
|
+
let data = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
55
|
+
|
|
56
|
+
if (!data.private) {
|
|
57
|
+
names.push(data.name);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return names;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function createChangeset(fileName, packageBumps, packages) {
|
|
65
|
+
let message = '';
|
|
66
|
+
|
|
67
|
+
for (let [packageName, bump] of packageBumps) {
|
|
68
|
+
message =
|
|
69
|
+
message + `Dependency \`${packageName}\` updated to version \`${bump}\`.\n`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message = message.replace('\n', ' ');
|
|
73
|
+
|
|
74
|
+
let header = packages
|
|
75
|
+
.map((packageName) => `'${packageName}': patch`)
|
|
76
|
+
.join('\n');
|
|
77
|
+
|
|
78
|
+
await fs.writeFile(fileName, `---\n${header}\n---\n${message.trim()}\n`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function getBumps(files) {
|
|
82
|
+
let bumps = new Map();
|
|
83
|
+
|
|
84
|
+
for (let file of files) {
|
|
85
|
+
let { stdout: changes } = await exec.getExecOutput('git', ['show', file]);
|
|
86
|
+
|
|
87
|
+
for (let change of changes.split('\n')) {
|
|
88
|
+
if (!change.startsWith('+ ')) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let match = change.match(/"(.*?)"/g);
|
|
93
|
+
|
|
94
|
+
bumps.set(match[0].replace(/"/g, ''), match[1].replace(/"/g, ''));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return bumps;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let diffOutput = await exec.getExecOutput('git diff --name-only HEAD~1');
|
|
102
|
+
let diffFiles = diffOutput.stdout.split('\n');
|
|
103
|
+
|
|
104
|
+
if (diffFiles.find((diffFile) => diffFile.startsWith('.changeset'))) {
|
|
105
|
+
console.log('Changeset already exists, skipping...');
|
|
106
|
+
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let files = diffFiles
|
|
111
|
+
.filter((file) => file !== 'package.json') // skip root package.json
|
|
112
|
+
.filter((file) => file.includes('package.json'));
|
|
113
|
+
let packageNames = await getPackagesNames(files);
|
|
114
|
+
|
|
115
|
+
if (!packageNames.length) {
|
|
116
|
+
console.log('No package.json changes to published packages, skipping...');
|
|
117
|
+
|
|
118
|
+
await exec.exec('npx', ['changeset', '--empty']);
|
|
119
|
+
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let { stdout: shortHash } = await exec.getExecOutput(
|
|
124
|
+
'git rev-parse --short HEAD',
|
|
125
|
+
);
|
|
126
|
+
let fileName = `.changeset/renovate-${shortHash.trim()}.md`;
|
|
127
|
+
let packageBumps = await getBumps(files);
|
|
128
|
+
|
|
129
|
+
await createChangeset(fileName, packageBumps, packageNames);
|
|
130
|
+
|
|
131
|
+
- name: Update Carson
|
|
132
|
+
run: |
|
|
133
|
+
npm install
|
|
134
|
+
|
|
135
|
+
- name: Commit and push changes
|
|
136
|
+
run: |
|
|
137
|
+
git add . --all
|
|
138
|
+
git commit -m"Update"
|
|
139
|
+
git push --force
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
to: '.gitignore'
|
|
3
3
|
strategy: overwrite
|
|
4
4
|
---
|
|
5
|
+
#
|
|
6
|
+
# DO NOT EDIT!
|
|
7
|
+
# This file was autogenerated by Carson.
|
|
8
|
+
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
9
|
+
#
|
|
10
|
+
# Run `npx carson update workspace` to regenerate.
|
|
11
|
+
#
|
|
12
|
+
|
|
5
13
|
# File extensions
|
|
6
14
|
|
|
7
15
|
## Logs
|
|
@@ -246,4 +254,4 @@ web_modules/
|
|
|
246
254
|
# Project specific files
|
|
247
255
|
|
|
248
256
|
## Build folders
|
|
249
|
-
packages
|
|
257
|
+
packages/**/<%- BUILD_DIRECTORY %>
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
to: '.prettierignore'
|
|
3
3
|
strategy: overwrite
|
|
4
4
|
---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
LICENSE.md
|
|
5
|
+
#
|
|
6
|
+
# DO NOT EDIT!
|
|
7
|
+
# This file was autogenerated by Carson.
|
|
8
|
+
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
9
|
+
#
|
|
10
|
+
# Run `npx carson update workspace` to regenerate.
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
<%- FORMAT_IGNORE_PATTERNS.join('\n') %>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: 'CONTRIBUTING.md'
|
|
3
|
+
strategy: overwrite
|
|
4
|
+
---
|
|
5
|
+
# Contributing
|
|
6
|
+
|
|
7
|
+
Thank you for your interest in contributing to any of these projects! Your help is greatly
|
|
8
|
+
appreciated.
|
|
9
|
+
|
|
10
|
+
## Reporting Bugs
|
|
11
|
+
|
|
12
|
+
If you encounter a bug, please let me know by opening an issue with a detailed description. You can
|
|
13
|
+
also create a repository with a minimal reproducible example to help me fix it more quickly.
|
|
14
|
+
|
|
15
|
+
## Pull Requests
|
|
16
|
+
|
|
17
|
+
At this time, I am not accepting pull requests from external contributors. However, if you have a
|
|
18
|
+
feature request, please feel free to open an issue to discuss it.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: 'README.md'
|
|
3
|
+
strategy: create
|
|
4
|
+
---
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
# <%- getWorkspaceName(workspace) %>
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<!-- projects --><!-- projects -->
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
Each project is licensed separately. Unless otherwise noted, the rest of the code in this repository
|
|
16
|
+
is licensed under the MIT license. See [LICENSE](./LICENSE.md) for details.
|
|
@@ -2,35 +2,25 @@
|
|
|
2
2
|
to: 'package.json'
|
|
3
3
|
strategy: merge
|
|
4
4
|
---
|
|
5
|
-
<%
|
|
5
|
+
<%
|
|
6
|
+
let dependencies = [
|
|
6
7
|
'@changesets/cli',
|
|
7
8
|
'@jakubmazanec/carson',
|
|
8
9
|
'@jakubmazanec/carson-templates',
|
|
9
|
-
'@swc/cli',
|
|
10
|
-
'@swc/core',
|
|
11
|
-
'@testing-library/jest-dom',
|
|
12
10
|
'@types/node',
|
|
13
|
-
'chokidar',
|
|
14
|
-
'cross-env',
|
|
15
11
|
'del-cli',
|
|
16
|
-
'eslint',
|
|
17
|
-
'jest',
|
|
18
12
|
'patch-package',
|
|
19
13
|
'prettier',
|
|
20
14
|
'prettier-plugin-packagejson',
|
|
21
|
-
'ts-jest',
|
|
22
|
-
'ts-node',
|
|
23
15
|
'turbo',
|
|
24
|
-
'typedoc',
|
|
25
|
-
'typedoc-plugin-markdown',
|
|
26
16
|
'typescript',
|
|
27
17
|
].filter((dependency) => {
|
|
28
|
-
return !workspace.projects.find((project) => project.name === dependency);
|
|
18
|
+
return !workspace.projects.find((project) => project.name === dependency); // if a workspace package.json contains dependency that is also part of it, weird stuff happens
|
|
29
19
|
});
|
|
30
|
-
|
|
31
20
|
let developmentDependencies = getDependencies(dependencies, workspace);
|
|
32
21
|
let packageJson = lodash.merge(
|
|
33
22
|
{
|
|
23
|
+
name: getWorkspaceName(workspace),
|
|
34
24
|
private: true,
|
|
35
25
|
scripts: {
|
|
36
26
|
build: 'turbo run build --no-daemon',
|
|
@@ -46,9 +36,9 @@ let packageJson = lodash.merge(
|
|
|
46
36
|
uninstall: 'del-cli ./**/node_modules ./package-lock.json',
|
|
47
37
|
},
|
|
48
38
|
devDependencies: developmentDependencies,
|
|
49
|
-
packageManager: 'npm@
|
|
39
|
+
packageManager: 'npm@10.1.0',
|
|
50
40
|
engines: {
|
|
51
|
-
node: '
|
|
41
|
+
node: '^20.8.0',
|
|
52
42
|
},
|
|
53
43
|
},
|
|
54
44
|
workspace.config.overrides?.packageJson ?? {},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: 'prettier.config.cjs'
|
|
3
|
+
strategy: overwrite
|
|
4
|
+
---
|
|
5
|
+
<%
|
|
6
|
+
let prettierConfig = {
|
|
7
|
+
...PRETTIER_OPTIONS,
|
|
8
|
+
plugins: ['prettier-plugin-packagejson'],
|
|
9
|
+
};
|
|
10
|
+
-%>
|
|
11
|
+
/**
|
|
12
|
+
* DO NOT EDIT!
|
|
13
|
+
* This file was autogenerated by Carson.
|
|
14
|
+
* Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
15
|
+
*
|
|
16
|
+
* Run `npx carson update workspace` to regenerate.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
module.exports = <%- JSON.stringify(prettierConfig, null, 2) %>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: 'tsconfig.json'
|
|
3
|
+
strategy: overwrite
|
|
4
|
+
---
|
|
5
|
+
<%
|
|
6
|
+
let tsconfig = {
|
|
7
|
+
compilerOptions: {
|
|
8
|
+
...TSCONFIG_COMPILER_OPTIONS,
|
|
9
|
+
noEmit: true,
|
|
10
|
+
rootDir: '.',
|
|
11
|
+
},
|
|
12
|
+
include: ['./*.ts'],
|
|
13
|
+
};
|
|
14
|
+
-%>
|
|
15
|
+
//
|
|
16
|
+
// DO NOT EDIT!
|
|
17
|
+
// This file was autogenerated by Carson.
|
|
18
|
+
// Changes may cause incorrect behavior and will be lost when the file is regenerated.
|
|
19
|
+
//
|
|
20
|
+
// Run `npx carson update workspace` to regenerate.
|
|
21
|
+
//
|
|
22
|
+
|
|
23
|
+
<%- JSON.stringify(tsconfig, null, 2) %>
|