Skip to content

Commit 89db4b5

Browse files
authored
chore: commit types (#9862)
To ensure that changes to code/types doesn't result in unwanted changes in type generation, or that bumps to dts-buddy don't cause unwanted regressions, we're checking in the generated types. Types should be committed as-is (don't format it with prettier!). CI is enhanced to check that git sees no changed files after generating the types, which would mean types have changed.
1 parent c717a4d commit 89db4b5

File tree

6 files changed

+1833
-13
lines changed

6 files changed

+1833
-13
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,13 @@ jobs:
4949
with:
5050
node-version: 16
5151
cache: pnpm
52-
- run: 'pnpm i && pnpm check && pnpm lint'
52+
- name: install
53+
run: pnpm install --frozen-lockfile
54+
- name: type check
55+
run: pnpm check
56+
- name: lint
57+
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail (avoids multiple runs uncovering different issues at different steps)
58+
run: pnpm lint
59+
- name: build and check generated types
60+
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail
61+
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally and commit the changes after you have reviewed them"; git diff; exit 1); }

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828
node-version: 18.x
2929
cache: pnpm
3030

31-
- run: pnpm install --frozen-lockfile
31+
- name: Install
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Build
35+
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally and commit the changes after you have reviewed them"; git diff; exit 1); }
3236

3337
- name: Create Release Pull Request or Publish to npm
3438
id: changesets

packages/svelte/.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
/test/runtime/shards
77
_actual*.*
88
_output
9-
/types
9+
/types/compiler
1010

11-
action.d.ts
12-
animate.d.ts
13-
compiler.d.ts
14-
easing.d.ts
15-
index.d.ts
16-
motion.d.ts
17-
store.d.ts
18-
transition.d.ts
11+
/action.d.ts
12+
/animate.d.ts
13+
/compiler.d.ts
14+
/easing.d.ts
15+
/index.d.ts
16+
/motion.d.ts
17+
/store.d.ts
18+
/transition.d.ts

packages/svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"@types/estree": "^1.0.1",
128128
"@types/node": "^14.18.51",
129129
"agadoo": "^3.0.0",
130-
"dts-buddy": "^0.4.1",
130+
"dts-buddy": "^0.4.3",
131131
"esbuild": "^0.18.11",
132132
"eslint-plugin-lube": "^0.1.7",
133133
"happy-dom": "^9.20.3",

0 commit comments

Comments
 (0)