Skip to content

Commit

Permalink
chore: commit types (#9862)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dummdidumm authored Jan 4, 2024
1 parent c717a4d commit 89db4b5
Show file tree
Hide file tree
Showing 6 changed files with 1,833 additions and 13 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ jobs:
with:
node-version: 16
cache: pnpm
- run: 'pnpm i && pnpm check && pnpm lint'
- name: install
run: pnpm install --frozen-lockfile
- name: type check
run: pnpm check
- name: lint
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail (avoids multiple runs uncovering different issues at different steps)
run: pnpm lint
- name: build and check generated types
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail
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); }
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
node-version: 18.x
cache: pnpm

- run: pnpm install --frozen-lockfile
- name: Install
run: pnpm install --frozen-lockfile

- name: Build
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); }

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
18 changes: 9 additions & 9 deletions packages/svelte/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/test/runtime/shards
_actual*.*
_output
/types
/types/compiler

action.d.ts
animate.d.ts
compiler.d.ts
easing.d.ts
index.d.ts
motion.d.ts
store.d.ts
transition.d.ts
/action.d.ts
/animate.d.ts
/compiler.d.ts
/easing.d.ts
/index.d.ts
/motion.d.ts
/store.d.ts
/transition.d.ts
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@types/estree": "^1.0.1",
"@types/node": "^14.18.51",
"agadoo": "^3.0.0",
"dts-buddy": "^0.4.1",
"dts-buddy": "^0.4.3",
"esbuild": "^0.18.11",
"eslint-plugin-lube": "^0.1.7",
"happy-dom": "^9.20.3",
Expand Down
Loading

0 comments on commit 89db4b5

Please sign in to comment.