Skip to content

Commit

Permalink
Merge branch 'main' into preprepare
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry authored Jan 22, 2025
2 parents 7301249 + 6d07765 commit c03012f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 14 deletions.
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 }) => {
const ext = typescript ? 'ts' : 'js';

sv.devDependency('vitest', '^2.1.8');
sv.devDependency('vitest', '^3.0.0');

sv.file('package.json', (content) => {
const { data, generateCode } = parseJson(content);
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# sv

## 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

Expand Down
5 changes: 4 additions & 1 deletion packages/cli/commands/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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')
Expand Down Expand Up @@ -42,5 +43,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.13",
"version": "0.6.14",
"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"
}
}
4 changes: 2 additions & 2 deletions packages/create/templates/demo/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@neoconfetti/svelte": "^2.0.0",
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"svelte": "^5.0.0",
"vite": "^5.4.11"
"vite": "^6.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/create/templates/library/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@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"
}
}
4 changes: 2 additions & 2 deletions packages/create/templates/minimal/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"devDependencies": {
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"svelte": "^5.0.0",
"vite": "^5.4.11"
"vite": "^6.0.0"
}
}

0 comments on commit c03012f

Please sign in to comment.