Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup CI and changesets #7

Merged
merged 7 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "sveltejs/svelte.dev" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["svelte.dev"]
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: svelte
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "\U0001F41E Bug report"
description: Report an issue with the site or one of the libraries
labels: ["triage: bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: In case of a site bug, please provide concrete steps to reproduce it. In case of a library bug, please provide a link to a repo or REPL that can reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "awaiting submitter" label. If no reproduction is provided within a reasonable time-frame, the issue will be closed.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: "Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text."
render: shell
- type: textarea
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --npmPackages svelte,rollup,webpack --binaries --browsers`
render: shell
placeholder: System, Binaries, Browsers
validations:
required: true
- type: dropdown
id: severity
attributes:
label: Severity
description: Select the severity of this issue
options:
- annoyance
- blocking an upgrade
- blocking all usage
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Discord Chat
url: https://svelte.dev/chat
about: Ask questions and discuss with other Svelte users in real time.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Documentation Request"
description: Request enhanced/new documentation
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to request enhancements to the documentation! Please be concise and clear in your request, vague requests may not be actionable and may be closed.
- type: textarea
id: problem
attributes:
label: Describe the problem
description: Please provide a clear and concise description the problem enhanced documentation would solve / the confusion it would clear up. The more information you can provide here, the better.
placeholder: I'm always frustrated when...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the proposed solution
description: Please provide a clear and concise description of what you would like to happen.
placeholder: I would like to see...
validations:
required: true
- type: dropdown
id: importance
attributes:
label: Importance
description: How important is this documentation to you?
options:
- nice to have
- would make my life easier
- i cannot use svelte without it
validations:
required: true
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Feature Request"
description: Request a new library feature
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to request this feature! If your feature request is complex or substantial enough to warrant in-depth discussion, maintainers may close the issue and ask you to open an [RFC](https://github.com/sveltejs/rfcs).
- type: textarea
id: problem
attributes:
label: Describe the problem
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
placeholder: I'm always frustrated when...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the proposed solution
description: Please provide a clear and concise description of what you would like to happen.
placeholder: I would like to see...
validations:
required: true
- type: dropdown
id: importance
attributes:
label: Importance
description: How important is this feature to you?
options:
- nice to have
- would make my life easier
- i cannot use svelte without it
validations:
required: true
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Before submitting the PR, please make sure you do the following

- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [ ] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`.
- [ ] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.

### Tests and linting

- [ ] Run the tests with `pnpm test` and lint the project with `pnpm lint`
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)

env:
# We only install Chromium manually
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

jobs:
# unskip once we have tutorial here which runs playwright tests
# Tests:
# runs-on: ${{ matrix.os }}
# timeout-minutes: 15
# strategy:
# matrix:
# include:
# - node-version: 18
# os: windows-latest
# - node-version: 18
# os: macOS-latest
# - node-version: 18
# os: ubuntu-latest
# - node-version: 20
# os: ubuntu-latest
# - node-version: 22
# os: ubuntu-latest

# steps:
# - uses: actions/checkout@v3
# - uses: pnpm/action-setup@v4
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# cache: pnpm
# - run: pnpm install --frozen-lockfile
# - run: pnpm playwright install chromium
# - run: pnpm test
# env:
# CI: true
Lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- 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); }
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- main

permissions: {}
jobs:
release:
# prevents this action from running on forks
if: github.repository == 'sveltejs/svelte.dev'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- 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
uses: changesets/action@v1
with:
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# needed in addition to package ignores due to https://github.com/prettier/prettier-vscode/issues/3424
node_modules
.svelte-kit
dist
pnpm-lock.yaml
.vercel
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}
4 changes: 3 additions & 1 deletion apps/svelte.dev/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Ignore files for PNPM, NPM and YARN
node_modules
.svelte-kit
.vercel
pnpm-lock.yaml
package-lock.json
yarn.lock
13 changes: 6 additions & 7 deletions apps/svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
"update": "node scripts/update.js --force=true",
"preview": "vite preview",
"start": "node build",
"check": "node scripts/update.js && pnpm generate && svelte-kit sync && svelte-check",
"check:watch": "svelte-kit sync && svelte-check --watch",
"format": "prettier --check . --write",
"check:format": "prettier --check ."
"check": "node scripts/update.js && svelte-kit sync && svelte-check",
"format": "prettier --write .",
"lint": "prettier --check ."
},
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15",
Expand All @@ -40,15 +39,15 @@
"lightningcss": "^1.24.1",
"magic-string": "^0.30.10",
"marked": "^11.2.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4",
"satori": "^0.10.13",
"satori-html": "^0.3.2",
"shelljs": "^0.8.5",
"shiki": "^0.14.7",
"shiki-twoslash": "^3.1.2",
"svelte": "^5.0.0-next.1",
"svelte-check": "^3.7.1",
"svelte-check": "^3.8.0",
"svelte-preprocess": "^5.1.4",
"tiny-glob": "^0.2.9",
"typescript": "^5.4.5",
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
"url": "git+https://github.com/sveltejs/svelte.dev.git"
},
"scripts": {
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"format": "prettier --write .",
"lint": "prettier --check ."
"check": "pnpm -r check",
"lint": "pnpm -r lint",
"format": "pnpm -r format",
"test": "pnpm -r test",
"build": "cd ./packages/site-kit && pnpm build && cd ../repl && pnpm build && cd ../../apps/svelte.dev && pnpm build",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
"changeset:publish": "changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.27.5"
}
}
4 changes: 3 additions & 1 deletion packages/repl/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Ignore files for PNPM, NPM and YARN
.svelte-kit
/dist
node_modules
pnpm-lock.yaml
package-lock.json
yarn.lock
21 changes: 15 additions & 6 deletions packages/repl/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"name": "@sveltejs/repl",
"version": "0.0.1",
"version": "0.6.0",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "npm run package",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"check": "svelte-kit sync && svelte-check",
"lint": "prettier --check .",
"format": "prettier --write ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/sveltejs/svelte.dev.git"
},
"author": "The Svelte Team",
"license": "MIT",
"bugs": {
"url": "https://github.com/sveltejs/svelte.dev/issues"
},
"homepage": "https://github.com/sveltejs/svelte.dev/tree/main/packages/repl/#readme",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -31,10 +40,10 @@
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/package": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4",
"publint": "^0.1.9",
"svelte-check": "^3.6.0",
"svelte-check": "^3.8.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.11"
Expand Down
Loading
Loading