Skip to content

Commit

Permalink
Merge branch 'main' into feat/vitest-addon-use-workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel3108 committed Feb 2, 2025
2 parents 6c283bf + ac5eee7 commit aa90cce
Show file tree
Hide file tree
Showing 38 changed files with 913 additions and 993 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/docs-preview-create-request.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/docs-preview-delete-request.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/sync-request.yml

This file was deleted.

2 changes: 1 addition & 1 deletion community-addon-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@playwright/test": "^1.49.1",
"sv": "workspace:*",
"vitest": "^2.1.8"
"vitest": "^3.0.3"
},
"keywords": [
"svelte-add-on",
Expand Down
5 changes: 5 additions & 0 deletions documentation/docs/20-commands/40-sv-migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Some migrations may annotate your codebase with tasks for completion that you ca

## Usage

```bash
npx sv migrate
```

You can also specify a migration directly via the CLI:
```bash
npx sv migrate [migration]
```
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default [
'**/.test-output/*',
'**/dist/*',
'packages/**/tests/**/{output,input}.ts',
'rollup.config.js',
'rolldown.config.js',
'community-addon-template/tests/*'
]
}
Expand Down
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"pnpm": "^9.0.0"
},
"scripts": {
"build": "rollup -c",
"build": "rolldown --config",
"changeset:publish": "changeset publish",
"check": "pnpm --parallel check",
"dev": "rollup --config --watch",
"dev": "rolldown --watch --config",
"format": "pnpm --parallel format",
"lint": "pnpm --parallel lint && eslint --cache --cache-location node_modules/.eslintcache",
"test": "vitest run --silent",
Expand All @@ -21,29 +21,23 @@
"devDependencies": {
"@changesets/cli": "^2.27.10",
"@playwright/test": "^1.49.1",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-dynamic-import-vars": "^2.1.5",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@sveltejs/create": "workspace:*",
"@sveltejs/eslint-config": "^8.1.0",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"@types/node": "^22.10.2",
"@vitest/ui": "^2.1.8",
"@vitest/ui": "^3.0.3",
"eslint": "^9.17.0",
"magic-string": "^0.30.15",
"prettier": "^3.4.2",
"prettier-plugin-packagejson": "^2.5.6",
"prettier-plugin-svelte": "^3.3.2",
"rollup": "^4.28.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-preserve-shebangs": "^0.2.0",
"rolldown": "1.0.0-beta.1",
"sv": "workspace:*",
"svelte": "^5.12.0",
"typescript": "^5.6.2",
"typescript-eslint": "^8.18.0",
"unplugin-isolated-decl": "^0.8.3",
"vitest": "^2.1.8"
"vitest": "^3.0.3"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion packages/addons/sveltekit-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const adapters: Adapter[] = [
{ id: 'node', package: '@sveltejs/adapter-node', version: '^5.2.11' },
{ id: 'static', package: '@sveltejs/adapter-static', version: '^3.0.8' },
{ id: 'vercel', package: '@sveltejs/adapter-vercel', version: '^5.5.2' },
{ id: 'cloudflare-pages', package: '@sveltejs/adapter-cloudflare', version: '^4.8.0' },
{ id: 'cloudflare-pages', package: '@sveltejs/adapter-cloudflare', version: '^5.0.1' },
{ id: 'cloudflare-workers', package: '@sveltejs/adapter-cloudflare-workers', version: '^2.7.0' },
{ id: 'netlify', package: '@sveltejs/adapter-netlify', version: '^4.4.0' }
];
Expand Down
2 changes: 1 addition & 1 deletion packages/addons/vitest-addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineAddon({
run: ({ sv, typescript, kit }) => {
const ext = typescript ? 'ts' : 'js';

sv.devDependency('vitest', '^2.1.8');
sv.devDependency('vitest', '^3.0.0');
sv.devDependency('@testing-library/svelte', '^5.2.4');
sv.devDependency('@testing-library/jest-dom', '^6.6.3');
sv.devDependency('jsdom', '^25.0.1');
Expand Down
52 changes: 47 additions & 5 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,67 @@
# sv

## 0.6.18
### Patch Changes


- fix: `checkjs` library template ([#428](https://github.com/sveltejs/cli/pull/428))

## 0.6.17
### Patch Changes


- fix: properly pass through arguments to `sv check` ([#420](https://github.com/sveltejs/cli/pull/420))


- chore: use `rolldown` instead of `rollup` ([#371](https://github.com/sveltejs/cli/pull/371))

## 0.6.16
### Patch Changes


- fix: ensure Sverdle keyboard events modify game state without a trip to the server if client-side JavaScript is enabled ([#416](https://github.com/sveltejs/cli/pull/416))

## 0.6.15
### Patch Changes


- chore: add prepare script to run `svelte-kit sync` ([#409](https://github.com/sveltejs/cli/pull/409))

## 0.6.14
### Patch Changes


- chore: update `vite@6` and related packages ([#410](https://github.com/sveltejs/cli/pull/410))


- fix: forward exit code of external package commands ([#412](https://github.com/sveltejs/cli/pull/412))

## 0.6.13
### Patch Changes


- chore: update `adapter-auto` and `adapter-cloudflare` ([#401](https://github.com/sveltejs/cli/pull/401))

## 0.6.12
### Patch Changes


- fix: git detection inside preconditions failed ([#406](https://github.com/sveltejs/cli/pull/406))
- fix: git detection inside preconditions failed ([#394](https://github.com/sveltejs/cli/pull/394))


- chore: update addon dependencies ([#406](https://github.com/sveltejs/cli/pull/406))
- chore: update addon dependencies ([#357](https://github.com/sveltejs/cli/pull/357))


- chore: utilize prepack lifecycle script ([#406](https://github.com/sveltejs/cli/pull/406))
- chore: utilize prepack lifecycle script ([#396](https://github.com/sveltejs/cli/pull/396))


- chore: improve cli help menu ([#294](https://github.com/sveltejs/cli/pull/294))


- fix: use modern `Spring` and `MediaQuery` implementation ([#406](https://github.com/sveltejs/cli/pull/406))
- fix: use modern `Spring` and `MediaQuery` implementation ([#361](https://github.com/sveltejs/cli/pull/361))


- fix: tailwind plugins as dev dependencies ([#406](https://github.com/sveltejs/cli/pull/406))
- fix: tailwind plugins as dev dependencies ([#400](https://github.com/sveltejs/cli/pull/400))

## 0.6.11
### Patch Changes
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/commands/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { Command } from 'commander';
import * as resolve from 'empathic/resolve';
import { resolveCommand } from 'package-manager-detector/commands';
import { getUserAgent } from '../utils/package-manager.ts';
import { forwardExitCode } from '../utils/common.js';

export const check = new Command('check')
.description('a CLI for checking your Svelte code')
// flags that we'll want to pass to `svelte-check`
.allowUnknownOption(true)
.allowExcessArguments(true)
.option('-C, --cwd <path>', 'path to working directory', process.cwd())
.configureHelp({
formatHelp() {
Expand Down Expand Up @@ -42,5 +44,7 @@ function runCheck(cwd: string, args: string[]) {
try {
const cmd = resolveCommand(pm, 'execute-local', ['svelte-check', ...args])!;
execSync(`${cmd.command} ${cmd.args.join(' ')}`, { stdio: 'inherit', cwd });
} catch {}
} catch (error) {
forwardExitCode(error);
}
}
5 changes: 4 additions & 1 deletion packages/cli/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import process from 'node:process';
import { Command } from 'commander';
import { resolveCommand } from 'package-manager-detector';
import { getUserAgent } from '../utils/package-manager.ts';
import { forwardExitCode } from '../utils/common.js';

export const migrate = new Command('migrate')
.description('a CLI for migrating Svelte(Kit) codebases')
Expand Down Expand Up @@ -31,5 +32,7 @@ function runMigrate(cwd: string, args: string[]) {

const cmd = resolveCommand(pm, 'execute', cmdArgs)!;
execSync(`${cmd.command} ${cmd.args.join(' ')}`, { stdio: 'inherit', cwd });
} catch {}
} catch (error) {
forwardExitCode(error);
}
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sv",
"version": "0.6.12",
"version": "0.6.18",
"type": "module",
"description": "A CLI for creating and updating SvelteKit projects",
"license": "MIT",
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pkg from '../package.json' with { type: 'json' };
import * as p from '@sveltejs/clack-prompts';
import type { Argument, HelpConfiguration, Option } from 'commander';
import { UnsupportedError } from './errors.ts';
import process from 'node:process';

const NO_PREFIX = '--no-';
let options: readonly Option[] = [];
Expand Down Expand Up @@ -96,3 +97,11 @@ export function getPadding(lines: string[]) {
const lengths = lines.map((s) => s.length);
return Math.max(...lengths);
}

export function forwardExitCode(error: unknown) {
if (error && typeof error === 'object' && 'status' in error && typeof error.status == 'number') {
process.exit(error.status);
} else {
process.exit(1);
}
}
8 changes: 4 additions & 4 deletions packages/create/templates/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"devDependencies": {
"@fontsource/fira-mono": "^5.0.0",
"@neoconfetti/svelte": "^2.0.0",
"@sveltejs/adapter-auto": "^3",
"@sveltejs/kit": "^2",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"svelte": "^5.0.0",
"typescript": "^5.3.3",
"vite": "^5.4.11"
"vite": "^6.0.0"
}
}
11 changes: 6 additions & 5 deletions packages/create/templates/demo/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''"
},
"devDependencies": {
"@fontsource/fira-mono": "^5.0.0",
"@neoconfetti/svelte": "^2.0.0",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"svelte": "^5.0.0",
"vite": "^5.4.11"
"vite": "^6.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
document
.querySelector(`[data-key="${event.key}" i]`)
?.dispatchEvent(new MouseEvent('click', { cancelable: true }));
?.dispatchEvent(new MouseEvent('click', { cancelable: true, bubbles: true }));
}
</script>

Expand Down
9 changes: 5 additions & 4 deletions packages/create/templates/library/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dev": "vite dev",
"build": "vite build && npm run prepack",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"prepack": "svelte-kit sync && svelte-package && publint"
},
"files": ["dist", "!dist/**/*.test.*", "!dist/**/*.spec.*"],
Expand All @@ -22,13 +23,13 @@
"svelte": "^5.0.0"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/package": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"publint": "^0.3.2",
"svelte": "^5.0.0",
"typescript": "^5.3.2",
"vite": "^5.4.11"
"vite": "^6.0.0"
}
}
Loading

0 comments on commit aa90cce

Please sign in to comment.