Skip to content

Commit

Permalink
breaking: init Svelte 5
Browse files Browse the repository at this point in the history
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Dominic Gannaway <dg@domgan.com>
  • Loading branch information
3 people committed Nov 10, 2023
1 parent 1369aa5 commit fe8a9ce
Show file tree
Hide file tree
Showing 7,233 changed files with 86,262 additions and 86,797 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "svelte-4",
"baseBranch": "svelte-5",
"bumpVersionsWithWorkspaceProtocolOnly": true,
"ignore": ["!(@sveltejs/*|svelte)"]
}
23 changes: 23 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# NOTE: In general this should be kept in sync with .eslintignore

**/dist/**
**/config/**
**/build/**
**/playgrounds/sandbox/**
**/npm/**
**/*.js.flow
**/*.d.ts
**/playwright*/**
**/vite.config.js
**/vite.prod.config.js
**/node_modules

**/tests/**

# documentation can contain invalid examples
documentation/**

# contains a fork of the REPL which doesn't adhere to eslint rules
sites/svelte-5-preview/**
# Wasn't checked previously, reenable at some point
sites/svelte.dev/**
54 changes: 54 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
extends: ['@sveltejs'],

// TODO: add runes to eslint-plugin-svelte
globals: {
$state: true,
$derived: true,
$effect: true,
$props: true
},

overrides: [
{
// scripts and playground should be console logging so don't lint against them
files: ['playgrounds/**/*', 'scripts/**/*'],
rules: {
'no-console': 'off'
}
},
{
// the playgrounds can use public naming conventions since they're examples
files: ['playgrounds/**/*'],
rules: {
'lube/svelte-naming-convention': 'off'
}
},
{
files: ['packages/svelte/src/compiler/**/*'],
rules: {
'no-var': 'error'
}
}
],

plugins: ['lube'],

rules: {
'no-console': 'error',
'lube/svelte-naming-convention': ['error', { fixSameNames: true }],
// eslint isn't that well-versed with JSDoc to know that `foo: /** @type{..} */ (foo)` isn't a violation of this rule, so turn it off
'object-shorthand': 'off',
'no-var': 'off',

// TODO: enable these rules and run `pnpm lint:fix`
// skipping that for now so as to avoid impacting real work
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prefer-const': 'off',
'svelte/valid-compile': 'off',
quotes: 'off'
}
};
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
branches: [svelte-4]
branches: [svelte-5]
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ecosystem-ci-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:
repo: pr.head.repo.full_name
}
- id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0
with:
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
repository: "${{ github.repository_owner }}/svelte-ecosystem-ci"
repository: '${{ github.repository_owner }}/svelte-ecosystem-ci'
- uses: actions/github-script@v6
id: trigger
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
branches:
- svelte-4
- svelte-5

permissions: {}
jobs:
Expand Down
25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# Dependency directories
node_modules/

# IDE related
.idea
.DS_Store
.vscode/*
!.vscode/launch.json
node_modules

# Test coverage
coverage
*.lcov

# Optional eslint cache
.eslintcache

# dotenv environment variables file
.env
.env.test

# build output
dist
.vercel

# OS-specific
.DS_Store

tmp
30 changes: 30 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# NOTE: In general this should be kept in sync with .eslintignore

packages/**/dist/*.js
packages/**/build/*.js
packages/**/npm/**/*
packages/**/config/*.js
packages/svelte/tests/**/*.svelte
packages/svelte/tests/**/_expected*
packages/svelte/tests/**/_actual*
packages/svelte/tests/**/expected*
packages/svelte/tests/**/_output
packages/svelte/tests/**/shards/*.test.js
packages/svelte/tests/hydration/samples/*/_before.html
packages/svelte/tests/hydration/samples/*/_before_head.html
packages/svelte/tests/hydration/samples/*/_after.html
packages/svelte/tests/hydration/samples/*/_after_head.html
packages/svelte/types
packages/svelte/compiler.cjs
playgrounds/demo/src
playgrounds/sandbox/input/**.svelte
playgrounds/sandbox/output
**/*.md
**/node_modules
**/.svelte-kit
flow-typed
.github/CODEOWNERS
.prettierignore
.eslintignore
pnpm-lock.yaml
pnpm-workspace.yaml
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
"tabWidth": 2
}
}
],
"pluginSearchDirs": ["."]
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Playground: Server",
"outputCapture": "std",
"program": "start.js",
"cwd": "${workspaceFolder}/packages/playground",
"cwd": "${workspaceFolder}/playgrounds/demo",
"cascadeTerminateToConfigurations": ["Playground: Browser"]
}
],
Expand Down
38 changes: 22 additions & 16 deletions documentation/examples/06-lifecycle/02-update/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,28 @@
const reply = eliza.transform(text);
setTimeout(() => {
comments = comments.concat({
author: 'eliza',
text: '...',
placeholder: true
});
setTimeout(() => {
comments = comments
.filter((comment) => !comment.placeholder)
.concat({
author: 'eliza',
text: reply
});
}, 500 + Math.random() * 500);
}, 200 + Math.random() * 200);
setTimeout(
() => {
comments = comments.concat({
author: 'eliza',
text: '...',
placeholder: true
});
setTimeout(
() => {
comments = comments
.filter((comment) => !comment.placeholder)
.concat({
author: 'eliza',
text: reply
});
},
500 + Math.random() * 500
);
},
200 + Math.random() * 200
);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
background-size: 1em 1em;
font-weight: bold;
cursor: pointer;
border:none;
font-size:14px;
border: none;
font-size: 14px;
}
.expanded {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

<h2>Immutable</h2>
{#each todos as todo}
<ImmutableTodo {todo} on:click={() => toggle(todo.id)} /><br>
<ImmutableTodo {todo} on:click={() => toggle(todo.id)} /><br />
{/each}

<h2>Mutable</h2>
{#each todos as todo}
<MutableTodo {todo} on:click={() => toggle(todo.id)} /><br>
<MutableTodo {todo} on:click={() => toggle(todo.id)} /><br />
{/each}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<style>
button {
cursor: pointer;
border:none;
background:none;
font-size:14px;
border: none;
background: none;
font-size: 14px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<style>
button {
cursor: pointer;
border:none;
background:none;
font-size:14px;
border: none;
background: none;
font-size: 14px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

<style>
button {
width:200px;
width: 200px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

<style>
button {
width:200px;
width: 200px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
padding: 0.2em 1em 0.3em;
text-align: center;
border-radius: 0.2em;
color:#333333;
color: #333333;
background-color: #ffdfd3;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
padding: 0.2em 1em 0.3em;
text-align: center;
border-radius: 0.2em;
color:#333333;
color: #333333;
background-color: #ffdfd3;
}
</style>
38 changes: 22 additions & 16 deletions documentation/tutorial/07-lifecycle/03-update/app-a/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,28 @@
const reply = eliza.transform(text);
setTimeout(() => {
comments = comments.concat({
author: 'eliza',
text: '...',
placeholder: true
});
setTimeout(() => {
comments = comments
.filter((comment) => !comment.placeholder)
.concat({
author: 'eliza',
text: reply
});
}, 500 + Math.random() * 500);
}, 200 + Math.random() * 200);
setTimeout(
() => {
comments = comments.concat({
author: 'eliza',
text: '...',
placeholder: true
});
setTimeout(
() => {
comments = comments
.filter((comment) => !comment.placeholder)
.concat({
author: 'eliza',
text: reply
});
},
500 + Math.random() * 500
);
},
200 + Math.random() * 200
);
}
}
</script>
Expand Down
Loading

0 comments on commit fe8a9ce

Please sign in to comment.