chore: repo cleanup (#13029)

* chore: cleanup repo configs

- remove prettier from packages, everything runs through the root now (also better aligns with how you work with it in VS Code: no more config duplication needed)
- remove eslint from packages, run it once through the root now (revealed some inconsistencies and missing stuff, config tightened up as a result) (bump eslint while we're at it)

* update vite and related packages (since rollup includes an addition to one estree node we need to adjust code a bit)

* bump more packages

* bump jsdom

* lint
pull/13036/head
Simon H 4 months ago committed by GitHub
parent eebe42789b
commit c4b721584a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2,12 +2,12 @@
# see: https://github.com/sveltejs/svelte/pull/9609
documentation/docs/05-misc/03-typescript.md
# The following are all duplicated with prettierignore configs in the packages,
# which is necessary because of https://github.com/prettier/prettier-vscode/issues/3424
packages/**/dist/*.js
packages/**/build/*.js
packages/**/npm/**/*
packages/**/config/*.js
# packages/svelte
packages/svelte/messages/**/*.md
packages/svelte/src/compiler/errors.js
packages/svelte/src/compiler/warnings.js
@ -17,6 +17,7 @@ packages/svelte/src/internal/shared/errors.js
packages/svelte/src/internal/shared/warnings.js
packages/svelte/src/internal/server/errors.js
packages/svelte/tests/migrate/samples/*/output.svelte
packages/svelte/tests/**/*.svelte
packages/svelte/tests/**/_expected*
packages/svelte/tests/**/_actual*
packages/svelte/tests/**/expected*
@ -29,6 +30,7 @@ packages/svelte/compiler/index.js
playgrounds/sandbox/input/**.svelte
playgrounds/sandbox/output
# sites/svelte.dev
sites/svelte.dev/static/svelte-app.json
sites/svelte.dev/scripts/svelte-app/
sites/svelte.dev/src/routes/_components/Supporters/contributors.jpg

@ -1,7 +1,6 @@
export function busy() {
let a = 0;
for (let i = 0; i < 1_00; i++) {
a++;
}
let a = 0;
for (let i = 0; i < 1_00; i++) {
a++;
}
}

@ -39,7 +39,8 @@ export default [
{
languageOptions: {
parserOptions: {
project: true
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
@ -64,10 +65,14 @@ export default [
}
},
{
files: ['playgrounds/**/*'],
// If you get an error along the lines of "@typescript-eslint/await-thenable needs a project service configured", then that likely means
// that eslint rules that need to be type-aware run through a Svelte file which seems unsupported at the moment. In that case, ensure that
// these are excluded to run on Svelte files.
files: ['**/*.svelte'],
rules: {
'lube/svelte-naming-convention': 'off',
'no-console': 'off'
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/require-await': 'off'
}
},
{
@ -87,6 +92,12 @@ export default [
'packages/svelte/src/internal/client/warnings.js',
'packages/svelte/src/internal/shared/warnings.js',
'packages/svelte/compiler/index.js',
// stuff we don't want to lint
'benchmarking/**',
'coverage/**',
'playgrounds/sandbox/**',
// exclude top level config files
'*.config.js',
// documentation can contain invalid examples
'documentation',
// contains a fork of the REPL which doesn't adhere to eslint rules

@ -18,8 +18,8 @@
"build:sites": "pnpm -r --filter=./sites/* build",
"preview-site": "npm run build --prefix sites/svelte-5-preview",
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"lint": "pnpm -r lint && prettier --check documentation",
"format": "pnpm -r format && prettier --check --write documentation",
"lint": "eslint && prettier --check .",
"format": "prettier --write .",
"test": "vitest run",
"test-output": "vitest run --coverage --reporter=json --outputFile=sites/svelte-5-preview/src/routes/status/results.json",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
@ -33,18 +33,18 @@
"@sveltejs/eslint-config": "^8.0.1",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^20.11.5",
"@vitest/coverage-v8": "^1.2.1",
"eslint": "^9.6.0",
"@vitest/coverage-v8": "^2.0.5",
"eslint": "^9.9.1",
"eslint-plugin-lube": "^0.4.3",
"jsdom": "22.0.0",
"playwright": "^1.41.1",
"jsdom": "25.0.0",
"playwright": "^1.46.1",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "workspace:^",
"typescript": "^5.5.2",
"typescript-eslint": "^8.0.0-alpha.34",
"typescript": "^5.5.4",
"typescript-eslint": "^8.2.0",
"v8-natives": "^1.2.5",
"vitest": "^1.2.1"
"vitest": "^2.0.5"
},
"pnpm": {
"overrides": {

@ -1,22 +0,0 @@
dist/*.js
build/*.js
npm/**/*
config/*.js
messages/**/*.md
src/compiler/errors.js
src/compiler/warnings.js
src/internal/client/errors.js
src/internal/client/warnings.js
src/internal/shared/errors.js
src/internal/shared/warnings.js
src/internal/server/errors.js
tests/**/*.svelte
tests/**/_expected*
tests/**/_actual*
tests/**/expected*
tests/**/_output
tests/**/shards/*.test.js
tests/hydration/samples/*/_expected.html
tests/hydration/samples/*/_override.html
types
compiler/index.js

@ -112,13 +112,11 @@
"generate:version": "node ./scripts/generate-version.js",
"generate:types": "node ./scripts/generate-types.js && tsc -p tsconfig.generated.json",
"prepublishOnly": "pnpm build",
"format": "prettier --check --write .",
"lint": "prettier --check . && eslint",
"knip": "pnpm dlx knip"
},
"devDependencies": {
"@jridgewell/trace-mapping": "^0.3.22",
"@playwright/test": "^1.35.1",
"@jridgewell/trace-mapping": "^0.3.25",
"@playwright/test": "^1.46.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
@ -126,28 +124,26 @@
"@types/aria-query": "^5.0.4",
"@types/node": "^20.11.5",
"dts-buddy": "^0.5.1",
"esbuild": "^0.19.11",
"eslint": "^9.6.0",
"prettier": "^3.2.4",
"rollup": "^4.9.5",
"esbuild": "^0.21.5",
"rollup": "^4.21.0",
"source-map": "^0.7.4",
"tiny-glob": "^0.2.9",
"typescript": "^5.5.2",
"vitest": "^1.2.1"
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
"dependencies": {
"@ampproject/remapping": "^2.2.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
"@ampproject/remapping": "^2.3.0",
"@jridgewell/sourcemap-codec": "^1.5.0",
"@types/estree": "^1.0.5",
"acorn": "^8.11.3",
"acorn": "^8.12.1",
"acorn-typescript": "^1.4.13",
"aria-query": "^5.3.0",
"axobject-query": "^4.0.0",
"axobject-query": "^4.1.0",
"esm-env": "^1.0.0",
"esrap": "^1.2.2",
"is-reference": "^3.0.2",
"locate-character": "^3.0.0",
"magic-string": "^0.30.5",
"magic-string": "^0.30.11",
"zimmerframe": "^1.1.2"
}
}

@ -352,7 +352,7 @@ export function prop(kind, key, value, computed = false) {
* @returns {ESTree.PropertyDefinition}
*/
export function prop_def(key, value, computed = false, is_static = false) {
return { type: 'PropertyDefinition', key, value, computed, static: is_static };
return { type: 'PropertyDefinition', key, value, computed, static: is_static, decorators: [] };
}
/**
@ -541,7 +541,8 @@ export function method(kind, key, params, body, computed = false, is_static = fa
kind,
value: function_builder(null, params, block(body)),
computed,
static: is_static
static: is_static,
decorators: []
};
}

@ -328,7 +328,7 @@ function apply_preprocessor_sourcemap(filename, svelte_map, preprocessor_map_inp
}
}
});
return /** @type {SourceMap} */ (result_map);
return /** @type {any} */ (result_map);
}
const regex_data_uri = /data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(\S*)/;
// parse attached sourcemap in processed.code

@ -30,6 +30,7 @@ const { test, run } = suite<PreprocessTest>(async (config, cwd) => {
expect(result.dependencies).toEqual(config.dependencies || []);
if (fs.existsSync(`${cwd}/expected_map.json`)) {
delete (result.map as any).ignoreList;
const expected_map = JSON.parse(fs.readFileSync(`${cwd}/expected_map.json`, 'utf-8'));
// You can use https://sokra.github.io/source-map-visualization/#custom to visualize the source map
expect(JSON.parse(JSON.stringify(result.map))).toEqual(expected_map);

@ -6,6 +6,6 @@ export default test({
const p = target.querySelector('p');
ok(p);
assert.equal(window.getComputedStyle(p).color, 'red');
assert.equal(window.getComputedStyle(p).color, 'rgb(255, 0, 0)');
}
});

@ -5,9 +5,9 @@ export default test({
const [control, test] = target.querySelectorAll('p');
assert.equal(window.getComputedStyle(control).color, '');
assert.equal(window.getComputedStyle(control).backgroundColor, '');
assert.equal(window.getComputedStyle(control).backgroundColor, 'rgba(0, 0, 0, 0)');
assert.equal(window.getComputedStyle(test).color, 'red');
assert.equal(window.getComputedStyle(test).backgroundColor, 'black');
assert.equal(window.getComputedStyle(test).color, 'rgb(255, 0, 0)');
assert.equal(window.getComputedStyle(test).backgroundColor, 'rgb(0, 0, 0)');
}
});

@ -9,7 +9,7 @@ export default test({
const p = target.querySelector('p');
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
assert.equal(styles.height, '40px');
}
});

@ -10,7 +10,7 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
assert.equal(styles.height, '40px');
}
});

@ -10,7 +10,7 @@ export default test({
ok(p);
let styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
component.myColor = 'pink';
component.width = '100vh';
@ -22,7 +22,7 @@ export default test({
target.innerHTML,
'<p style="color: pink; width: 100vh; font-weight: 100; position: absolute;"></p>'
);
assert.equal(styles.color, 'pink');
assert.equal(styles.color, 'rgb(255, 192, 203)');
assert.equal(styles.width, '100vh');
assert.equal(styles.fontWeight, '100');
assert.equal(styles.position, 'absolute');

@ -11,8 +11,8 @@ export default test({
test({ assert, target, window }) {
const [p1, p2] = target.querySelectorAll('p');
assert.equal(window.getComputedStyle(p1).color, 'red');
assert.equal(window.getComputedStyle(p2).color, 'red');
assert.equal(window.getComputedStyle(p1).color, 'rgb(255, 0, 0)');
assert.equal(window.getComputedStyle(p2).color, 'rgb(255, 0, 0)');
const btn = target.querySelector('button');
btn?.click();
@ -27,7 +27,7 @@ export default test({
`
);
assert.equal(window.getComputedStyle(p1).color, 'green');
assert.equal(window.getComputedStyle(p2).color, 'green');
assert.equal(window.getComputedStyle(p1).color, 'rgb(0, 128, 0)');
assert.equal(window.getComputedStyle(p2).color, 'rgb(0, 128, 0)');
}
});

@ -9,8 +9,8 @@ export default test({
test({ assert, component, target, window }) {
const [p1, p2] = target.querySelectorAll('p');
assert.equal(window.getComputedStyle(p1).color, 'red');
assert.equal(window.getComputedStyle(p2).color, 'red');
assert.equal(window.getComputedStyle(p1).color, 'rgb(255, 0, 0)');
assert.equal(window.getComputedStyle(p2).color, 'rgb(255, 0, 0)');
component.color = 'blue';
assert.htmlEqual(
@ -21,7 +21,7 @@ export default test({
`
);
assert.equal(window.getComputedStyle(p1).color, 'blue');
assert.equal(window.getComputedStyle(p2).color, 'blue');
assert.equal(window.getComputedStyle(p1).color, 'rgb(0, 0, 255)');
assert.equal(window.getComputedStyle(p2).color, 'rgb(0, 0, 255)');
}
});

@ -10,7 +10,7 @@ export default test({
ok(p);
let styles = window.getComputedStyle(p);
assert.equal(styles.color, 'green');
assert.equal(styles.color, 'rgb(0, 128, 0)');
component.color = null;
assert.htmlEqual(target.innerHTML, '<p style=""></p>');
@ -29,12 +29,12 @@ export default test({
assert.htmlEqual(target.innerHTML, '<p style="background-color: green;"></p>');
styles = window.getComputedStyle(p);
assert.equal(styles.color, '');
assert.equal(styles.backgroundColor, 'green');
assert.equal(styles.backgroundColor, 'rgb(0, 128, 0)');
component.color = 'purple';
assert.htmlEqual(target.innerHTML, '<p style="background-color: green; color: purple;"></p>');
styles = window.getComputedStyle(p);
assert.equal(styles.color, 'purple');
assert.equal(styles.backgroundColor, 'green');
assert.equal(styles.color, 'rgb(128, 0, 128)');
assert.equal(styles.backgroundColor, 'rgb(0, 128, 0)');
}
});

@ -10,7 +10,7 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'blue');
assert.equal(styles.color, 'rgb(0, 0, 255)');
assert.equal(styles.width, '65px');
assert.equal(p.id, 'my-id');

@ -10,7 +10,7 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'blue');
assert.equal(styles.color, 'rgb(0, 0, 255)');
assert.equal(styles.width, '65px');
assert.equal(p.id, 'my-id');
}

@ -10,7 +10,7 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'green');
assert.equal(styles.color, 'rgb(0, 128, 0)');
assert.equal(styles.transform, 'translateX(45px)');
assert.equal(styles.border, '100px solid pink');

@ -10,6 +10,6 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
}
});

@ -9,7 +9,7 @@ export default test({
const p = target.querySelector('p');
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.backgroundColor, 'green');
assert.equal(styles.backgroundColor, 'rgb(0, 128, 0)');
assert.equal(styles.fontSize, '12px');
{
@ -17,7 +17,7 @@ export default test({
const p = target.querySelector('p');
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.backgroundColor, 'green');
assert.equal(styles.backgroundColor, 'rgb(0, 128, 0)');
assert.equal(styles.fontSize, '50px');
}
}

@ -12,6 +12,6 @@ export default test({
ok(p);
const styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
}
});

@ -10,12 +10,12 @@ export default test({
ok(p);
let styles = window.getComputedStyle(p);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
assert.equal(styles.fontSize, '20px');
component.color = 'green';
styles = window.getComputedStyle(p);
assert.equal(styles.color, 'green');
assert.equal(styles.color, 'rgb(0, 128, 0)');
}
});

@ -11,7 +11,7 @@ export default test({
let styles = window.getComputedStyle(p);
assert.equal(styles.opacity, '0.5');
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
component.styles = 'font-size: 20px';

@ -10,6 +10,6 @@ export default test({
ok(div);
const styles = window.getComputedStyle(div);
assert.equal(styles.color, 'red');
assert.equal(styles.color, 'rgb(255, 0, 0)');
}
});

@ -14,7 +14,6 @@
"strict": true,
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
"paths": {
"acorn-typescript": ["./src/compiler/phases/1-parse/ambient.d.ts"],
"svelte": ["./src/index.d.ts"],

@ -12,12 +12,12 @@
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.3",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
"nodemon": "^3.0.3",
"polka": "^1.0.0-next.25",
"svelte": "workspace:*",
"tiny-glob": "^0.2.9",
"vite": "^5.0.13",
"vite": "^5.4.2",
"vite-plugin-inspect": "^0.8.4"
}
}

File diff suppressed because it is too large Load Diff

@ -9,18 +9,15 @@
"build": "vite build",
"preview": "vite preview",
"check-disable-tmp": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"format": "prettier --check --write .",
"lint": "prettier --check ."
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
},
"devDependencies": {
"@fontsource/fira-mono": "^5.0.8",
"@lezer/common": "^1.2.1",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/adapter-vercel": "^5.0.0",
"@sveltejs/adapter-vercel": "^5.4.3",
"@sveltejs/kit": "^2.5.24",
"@sveltejs/site-kit": "6.0.0-next.64",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.3",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
"@vercel/speed-insights": "^1.0.0",
"esrap": "^1.2.2",
"marked": "^9.0.0",
@ -28,10 +25,9 @@
"shiki": "^0.14.7",
"shiki-twoslash": "^3.1.2",
"svelte": "workspace:^",
"svelte-check": "^3.6.3",
"tslib": "^2.6.2",
"typescript": "^5.5.2",
"vite": "^5.0.13"
"svelte-check": "^3.8.6",
"typescript": "^5.5.4",
"vite": "^5.4.2"
},
"dependencies": {
"@codemirror/autocomplete": "^6.12.0",
@ -44,18 +40,18 @@
"@codemirror/lint": "^6.5.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.24.0",
"@jridgewell/sourcemap-codec": "^1.4.15",
"@jridgewell/sourcemap-codec": "^1.5.0",
"@lezer/highlight": "^1.1.6",
"@neocodemirror/svelte": "0.0.15",
"@replit/codemirror-lang-svelte": "^6.0.0",
"@rich_harris/svelte-split-pane": "^1.1.3",
"@rollup/browser": "^3.28.0",
"acorn": "^8.10.0",
"acorn": "^8.12.1",
"codemirror": "^6.0.1",
"esm-env": "^1.0.0",
"marked": "^7.0.2",
"resolve.exports": "^2.0.2",
"svelte-json-tree": "^2.2.0",
"zimmerframe": "^1.1.1"
"zimmerframe": "^1.1.2"
}
}

@ -1,7 +0,0 @@
static/svelte-app.json
scripts/svelte-app/
src/routes/_components/Supporters/contributors.jpg
src/routes/_components/Supporters/contributors.js
src/routes/_components/Supporters/donors.jpg
src/routes/_components/Supporters/donors.js
src/lib/generated

@ -12,13 +12,10 @@
"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",
"check:format": "prettier --check .",
"format": "prettier --check --write .",
"lint": "prettier --check ."
"check:watch": "svelte-kit sync && svelte-check --watch"
},
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15",
"@jridgewell/sourcemap-codec": "^1.5.0",
"@supabase/supabase-js": "^2.39.3",
"@sveltejs/repl": "0.6.0",
"cookie": "^0.6.0",
@ -29,7 +26,7 @@
},
"devDependencies": {
"@resvg/resvg-js": "^2.6.0",
"@sveltejs/adapter-vercel": "^4.0.0",
"@sveltejs/adapter-vercel": "^5.4.3",
"@sveltejs/kit": "^2.4.3",
"@sveltejs/site-kit": "6.0.0-next.59",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
@ -40,10 +37,8 @@
"dotenv": "^16.3.2",
"jimp": "^0.22.10",
"lightningcss": "^1.23.0",
"magic-string": "^0.30.5",
"magic-string": "^0.30.11",
"marked": "^11.1.1",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.70.0",
"satori": "^0.10.11",
"satori-html": "^0.3.2",
@ -51,11 +46,11 @@
"shiki": "^0.14.7",
"shiki-twoslash": "^3.1.2",
"svelte": "^4.2.0",
"svelte-check": "^3.6.3",
"svelte-check": "^3.8.6",
"svelte-preprocess": "^5.1.3",
"tiny-glob": "^0.2.9",
"typescript": "^5.5.2",
"vite": "^5.0.13",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-imagetools": "^6.2.9"
}
}

Loading…
Cancel
Save