8000 Merge remote-tracking branch 'origin/main' into chore/svelte-compiler · sveltejs/cli@ede290f · GitHub
[go: up one dir, main page]

Skip to content

Commit ede290f

Browse files
committed
Merge remote-tracking branch 'origin/main' into chore/svelte-compiler
2 parents 4f84d68 + 19e686a commit ede290f

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1163
-2927
lines changed

.changeset/silent-timers-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sveltejs/addons": patch
3+
---
4+
5+
fix: resolve to `task` instead of `run` in addon instructions for `deno`

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Run package specific tests by specifying a project flag to the package and runni
7070
pnpm test --project core # addons / create / migrate / etc.
7171
```
7272

73-
To run a individual test. `cd` into the package. Run the local `test` script to that package, with a path arg to the individual peice you want tested. Eg:
73+
To run a individual test. `cd` into the package. Run the local `test` script to that package, with a path arg to the individual piece you want tested. Eg:
7474
```bash
7575
pnpm test [path-to-test]
7676
```

community-addon-template/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"@sveltejs/cli-core": "workspace:*"
1919
},
2020
"devDependencies": {
21-
"@playwright/test": "^1.51.1",
21+
"@playwright/test": "^1.53.1",
2222
"sv": "workspace:*",
23-
"vitest": "^3.0.9"
23+
"vitest": "3.0.9"
2424
},
2525
"keywords": [
2626
"svelte-add-on",

documentation/docs/20-commands/20-sv-add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ You can select multiple space-separated add-ons from [the list below](#Official-
3838
- [`sveltekit-adapter`](sveltekit-adapter)
3939
- [`tailwindcss`](tailwind)
4040
- [`vitest`](vitest)
41+
- [`devtools-json`](devtools-json)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: devtools-json
3+
---
4+
5+
`devtools-json` is essentially a vite plugin [vite-plugin-devtools-json](https://github.com/ChromeDevTools/vite-plugin-devtools-json/) for generating the Chrome DevTools project settings file on-the-fly in the devserver.
6+
7+
It will prevent this server log:
8+
9+
```sh
10+
Not found: /.well-known/appspecific/com.chrome.devtools.json
11+
```
12+
13+
## Usage
14+
15+
```bash
16+
npx sv add devtools-json
17+
```
18+
19+
## What you get
20+
21+
- the `vite` plugin added to your vite plugin options.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
"update-addon-deps": "node ./scripts/update-addon-dependencies.js"
2020
},
2121
"devDependencies": {
22-
"@changesets/cli": "^2.28.1",
23-
"@playwright/test": "^1.51.1",
22+
"@changesets/cli": "^2.29.4",
23+
"@playwright/test": "^1.53.1",
2424
"@sveltejs/create": "workspace:*",
2525
"@sveltejs/eslint-config": "^8.2.0",
2626
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
27-
"@types/node": "^22.14.0",
28-
"@vitest/ui": "^3.0.9",
29-
"eslint": "^9.24.0",
30-
"eslint-plugin-svelte": "^3.5.1",
27+
"@types/node": "^22.15.32",
28+
"@vitest/ui": "3.0.9",
29+
"eslint": "^9.29.0",
30+
"eslint-plugin-svelte": "^3.9.2",
3131
"magic-string": "^0.30.17",
3232
"prettier": "^3.5.3",
33-
"prettier-plugin-packagejson": "^2.5.10",
34-
"prettier-plugin-svelte": "^3.3.3",
33+
"prettier-plugin-packagejson": "^2.5.15",
34+
"prettier-plugin-svelte": "^3.4.0",
3535
"rolldown": "1.0.0-beta.1",
3636
"sv": "workspace:*",
37-
"svelte": "^5.25.7",
37+
"svelte": "^5.34.6",
3838
"typescript": "^5.8.3",
39-
"typescript-eslint": "^8.29.0",
39+
"typescript-eslint": "^8.34.1",
4040
"unplugin-isolated-decl": "^0.8.3",
41-
"vitest": "^3.0.9"
41+
"vitest": "3.0.9"
4242
},
4343
"packageManager": "pnpm@10.4.1",
4444
"pnpm": {

packages/addons/_config/official.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import type { AddonWithoutExplicitArgs } from '@sveltejs/cli-core';
22

3+
import devtoolsJson from '../devtools-json/index.ts';
34
import drizzle from '../drizzle/index.ts';
45
import eslint from '../eslint/index.ts';
5-
import sveltekitAdapter from '../sveltekit-adapter/index.ts';
66
import lucia from '../lucia/index.ts';
77
import mdsve 97AE x from '../mdsvex/index.ts';
88
import paraglide from '../paraglide/index.ts';
99
import playwright from '../playwright/index.ts';
1010
import prettier from '../prettier/index.ts';
1111
import storybook from '../storybook/index.ts';
12+
import sveltekitAdapter from '../sveltekit-adapter/index.ts';
1213
import tailwindcss from '../tailwindcss/index.ts';
1314
import vitest from '../vitest-addon/index.ts';
1415

@@ -21,6 +22,7 @@ export const officialAddons = [
2122
playwright,
2223
tailwindcss,
2324
sveltekitAdapter,
25+
devtoolsJson,
2426
drizzle,
2527
lucia,
2628
mdsvex,
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { expect } from '@playwright/test';
2+
import { setupTest } from '../_setup/suite.ts';
3+
import devtoolsJson from '../../devtools-json/index.ts';
4+
import fs from 'node:fs';
5+
import path from 'node:path';
6+
7+
const { test, variants, prepareServer } = setupTest({ devtoolsJson } as {
8+
devtoolsJson?: typeof devtoolsJson;
9+
});
10+
11+
test.concurrent.for(variants)('default - %s', async (variant, { page, ...ctx }) => {
12+
const cwd = await ctx.run(variant, { devtoolsJson: {} });
13+
14+
const { close } = await prepareServer({ cwd, page });
15+
// kill server process when we're done
16+
ctx.onTestFinished(async () => await close());
17+
18+
const ext = variant.includes('ts') ? 'ts' : 'js';
19+
const viteFile = path.resolve(cwd, `vite.config.${ext}`);
20+
const viteContent = fs.readFileSync(viteFile, 'utf8');
21+
22+
// Check if we have the import part
23+
expect(viteContent).toContain(`import devtoolsJson from`);
24+
expect(viteContent).toContain(`vite-plugin-devtools-json`);
25+
26+
// Check if it's called
27+
expect(viteContent).toContain(`devtoolsJson()`);
28+
});
29+
30+
test.concurrent.for(variants)(
31+
'without selecting the addon specifically - %s',
32+
async (variant, { page, ...ctx }) => {
33+
const cwd = await ctx.run(variant, {});
34+
35+
const { close } = await prepareServer({ cwd, page });
36+
// kill server process when we're done
37+
ctx.onTestFinished(async () => await close());
38+
39+
const ext = variant.includes('ts') ? 'ts' : 'js';
40+
const viteFile = path.resolve(cwd, `vite.config.${ext}`);
41+
const viteContent = fs.readFileSync(viteFile, 'utf8');
42+
43+
// Check if we have the import part
44+
expect(viteContent).toContain(`import devtoolsJson from`);
45+
expect(viteContent).toContain(`vite-plugin-devtools-json`);
46+
47+
// Check if it's called
48+
expect(viteContent).toContain(`devtoolsJson()`);
49+
}
50+
);

packages/addons/_tests/storybook/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import process from 'node:process';
22
import { expect } from '@playwright/test';
33
import { setupTest } from '../_setup/suite.ts';
44
import storybook from '../../storybook/index.ts';
5+
import eslint from '../../eslint/index.ts';
56

6-
const { test, variants, prepareServer } = setupTest({ storybook });
7+
// we're including the `eslint` add-on to prevent `storybook` from modifying this repo's `eslint.config.js`
8+
const { test, variants, prepareServer } = setupTest({ storybook, eslint });
79

810
let port = 6006;
911

1012
test.for(variants)(
1113
'storybook loaded - %s',
1214
{ concurrent: !process.env.CI },
1315
async (variant, { page, ...ctx }) => {
14-
const cwd = await ctx.run(variant, { storybook: {} });
16+
const cwd = await ctx.run(variant, { storybook: {}, eslint: {} });
1517

1618
const { close } = await prepareServer({
1719
cwd,

packages/addons/_tests/vitest/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test.concurrent.for(variants)('core - %s', async (variant, { page, ...ctx }) =>
1010

1111
const { close } = await prepareServer({ cwd, page });
1212

13+
execSync('pnpm exec playwright install chromium', { cwd, stdio: 'pipe' });
1314
execSync('pnpm test', { cwd, stdio: 'pipe' });
1415

1516
// kill server process when we're done

0 commit comments

Comments
 (0)
0