Skip to content

Commit f2ff684

Browse files
benmccanndominikg
andauthored
chore: setup changesets (#8668)
Co-authored-by: dominikg <[email protected]>
1 parent f74dddd commit f2ff684

File tree

13 files changed

+1568
-1486
lines changed

13 files changed

+1568
-1486
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "sveltejs/svelte" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "version-4",
9+
"bumpVersionsWithWorkspaceProtocolOnly": true,
10+
"ignore": ["!(@sveltejs/*|svelte)"]
11+
}

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mode": "pre",
3+
"tag": "next",
4+
"initialVersions": {
5+
"svelte": "4.0.0-next.1"
6+
},
7+
"changesets": []
8+
}

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- version-4
7+
8+
permissions: {}
9+
jobs:
10+
release:
11+
# prevents this action from running on forks
12+
if: github.repository == 'sveltejs/svelte'
13+
permissions:
14+
contents: write # to create release (changesets/action)
15+
pull-requests: write # to create pull request (changesets/action)
16+
name: Release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v3
21+
with:
22+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
23+
fetch-depth: 0
24+
- uses: pnpm/[email protected]
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 18.x
29+
cache: pnpm
30+
31+
- run: pnpm install --frozen-lockfile
32+
33+
- name: Create Release Pull Request or Publish to npm
34+
id: changesets
35+
uses: changesets/action@v1
36+
with:
37+
version: pnpm changeset:version
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"build": "pnpm -r build",
1010
"check": "pnpm -r check",
1111
"lint": "pnpm -r lint",
12-
"format": "pnpm -r format"
12+
"format": "pnpm -r format",
13+
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
14+
"release": "changeset release"
1315
},
1416
"repository": {
1517
"type": "git",

packages/svelte/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*.map
22
/src/compiler/compile/internal_exports.js
3-
/src/shared/version.js
43
/compiler.d.ts
54
/compiler.cjs
65
/index.d.ts

packages/svelte/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ src/shared/version.js
1212
/test/**/_actual*
1313
/test/**/expected*
1414
/test/**/_output
15+
/test/**/shards/*.test.js
1516
/types
1617
!rollup.config.js
1718
!vitest.config.js

packages/svelte/CHANGELOG.md

Lines changed: 1461 additions & 1473 deletions
Large diffs are not rendered by default.

packages/svelte/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,19 @@
7474
"format": "prettier . --cache --plugin-search-dir=. --write",
7575
"check": "prettier . --cache --plugin-search-dir=. --check",
7676
"test": "vitest run && echo \"manually check that there are no type errors in test/types by opening the files in there\"",
77-
"build": "rollup -c && npm run tsd",
78-
"prepare": "npm run build",
77+
"build": "rollup -c && pnpm tsd",
78+
"prepare": "pnpm build",
79+
"generate:version": "node ./scripts/generate-version.js",
7980
"dev": "rollup -cw",
8081
"posttest": "agadoo src/internal/index.js",
81-
"prepublishOnly": "npm run lint && npm run build && npm test",
82+
"prepublishOnly": "pnpm lint && pnpm build && pnpm test",
8283
"tsd": "node ./generate-types.js",
8384
"lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache"
8485
},
8586
"repository": {
8687
"type": "git",
8788
"url": "https://github.com/sveltejs/svelte.git",
88-
"directory":"packages/svelte"
89+
"directory": "packages/svelte"
8990
},
9091
"keywords": [
9192
"UI",

packages/svelte/rollup.config.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ import resolve from '@rollup/plugin-node-resolve';
55
import commonjs from '@rollup/plugin-commonjs';
66
import json from '@rollup/plugin-json';
77

8-
const require = createRequire(import.meta.url);
9-
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
8+
// runs the version generation as a side-effect of importing
9+
import './scripts/generate-version.js';
1010

11-
// Create auto-generated .js files
12-
fs.writeFileSync(
13-
'./src/shared/version.js',
14-
`/** @type {string} */\nexport const VERSION = '${pkg.version}';`
15-
);
11+
const require = createRequire(import.meta.url);
1612

1713
const internal = await import('./src/runtime/internal/index.js');
1814
fs.writeFileSync(

0 commit comments

Comments
 (0)