Skip to content

Commit 2a27c36

Browse files
returnsvoidjanetJanetclaude
authored
chore(deps): bump knip (fixes SvelteKit config detection) (#342)
* chore(deps): bump knip (fixes SvelteKit config detection) knip 6.17.1 -> 6.29.0 via the dev catalog. The SK3 fix landed in knip 6.19.0 (webpro-nl/knip#1810, "support new optional sveltekit config pattern via vite config"), written against sveltekit@3.0.0-next.4 -- our exact case. The plugin's config list is now ['svelte.config.js', ...viteConfig], so it finds the Kit options that SvelteKit 3 keeps inside vite.config.ts. Removed as a result: - workspaces["apps/grove"].sveltekit.config -- auto-detected now; the workspace key held nothing else and is gone. - workspaces["."].entry ["vite.config.ts"] -- knip 6.21.0 detects vite configs on its own and now reports this as a redundant-entry config hint, which is fatal under treatConfigHintsAsErrors. - console's hand-mapped $app/env + $app/server paths, replaced by one ignoreUnresolved that mirrors what the plugin contributes. apps/console cannot use the auto-detection. resolveFromAST only takes the vite-config branch when it statically sees `sveltekit` imported from @sveltejs/kit/vite, and console configures Kit through svelte-plugin-composer's kit() wrapper. Without help the plugin contributes nothing there -- the bare bump reported 125 unused files, 8 unused deps, 16 unresolved $lib imports and 68 unused exports/types. So console restates the route/hook production entries and the $lib alias explicitly, with a comment. Rewriting console's real build config or adding a decoy svelte.config.js to satisfy the linter were both rejected. Also drops 5 dead type re-exports the newer knip detects: four in data/cost.ts and TerminalTarget in server/api/console-api.ts. Every consumer imports those from the originating module, not the barrel. Verified: lint:knip, lint:knip:prod, check, test (264), manypkg, typesync:check and a frozen-lockfile install all pass. Canary unused files/exports in both console and grove are still reported, confirming the clean run reflects a live graph rather than an empty one. Co-Authored-By: Opus <noreply@anthropic.com> * chore(deps): update knip to 6.31 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jwe5UwSrJX5HQkjSskfWYv * chore: drop decisions file + dedupe lockfile Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jwe5UwSrJX5HQkjSskfWYv * refactor(console): drop svelte-plugin-composer for native SvelteKit wiring Configure the console app’s Vite plugins directly instead of through svelte-plugin-composer: spread effect() (svelte-effect-runtime) and ts(true) (svelte-global-typescript) ahead of a directly-called sveltekit(), which now carries adapter/kit/compilerOptions inline (this SvelteKit build no longer reads svelte.config.js). knip’s SvelteKit plugin can now statically see the sveltekit() call, so the console workspace drops the manual $lib/$app/route-hook stand-ins and mirrors apps/grove. Verified: console build green with identical SER transform output (18 .remote.js server chunks, zero ServerOnlyImportError, effect_remote_ client wrapper), svelte-check at parity (31 pre-existing errors, unchanged), knip + knip --strict green, lockfile deduped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jwe5UwSrJX5HQkjSskfWYv --------- Co-authored-by: Janet <janet@petalcat.dev> Co-authored-by: Opus <noreply@anthropic.com> Co-authored-by: returnsvoidjanet <returnsvoidjanet@users.noreply.github.com>
1 parent 57501b1 commit 2a27c36

7 files changed

Lines changed: 260 additions & 302 deletions

File tree

apps/console/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"fontless": "catalog:prod",
5757
"svelte-check": "catalog:dev",
5858
"svelte-global-typescript": "catalog:",
59-
"svelte-plugin-composer": "catalog:",
6059
"typescript": "catalog:dev",
6160
"vite": "catalog:dev",
6261
"vitest": "catalog:dev"

apps/console/src/lib/data/cost.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ import type {
66
CostDimension,
77
} from "@petalnet/types";
88

9-
export type {
10-
CostComparisonMetric,
11-
CostComparisonMetricKey,
12-
CostComparisonReceipt,
13-
CostComparisonRequest,
14-
CostComparisonResult,
15-
CostComparisonSide,
16-
CostDimension,
17-
} from "@petalnet/types";
9+
export type { CostComparisonMetric, CostComparisonResult, CostDimension } from "@petalnet/types";
1810

1911
export interface DailyCost {
2012
day: string;

apps/console/src/lib/server/api/console-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import {
9898
} from "../domain/terminal/service.ts";
9999
import { readUpdateApprovals } from "../domain/updates/approvals.ts";
100100

101-
export type { TerminalAdapter, TerminalTarget } from "../domain/terminal/service.ts";
101+
export type { TerminalAdapter } from "../domain/terminal/service.ts";
102102

103103
const askRequestSchema = Schema.Struct({
104104
question: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(2_000)),

apps/console/vite.config.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import adapter from "@petalnet/svelte-ws";
22
import { websocket } from "@petalnet/svelte-ws/vite";
33
import { sentrySvelteKit } from "@sentry/sveltekit";
4+
import { sveltekit } from "@sveltejs/kit/vite";
45
import tailwindcss from "@tailwindcss/vite";
56
import { fontless } from "fontless";
67
import { effect } from "svelte-effect-runtime";
78
import { ts } from "svelte-global-typescript";
8-
import { compose, kit } from "svelte-plugin-composer";
99
import { defineConfig } from "vitest/config";
1010

1111
export default defineConfig({
@@ -28,19 +28,19 @@ export default defineConfig({
2828
{ name: "Geist Mono", provider: "fontsource", weights: [400, 500] },
2929
],
3030
}),
31-
...compose([
32-
effect(),
33-
ts(true),
34-
kit({
35-
adapter: adapter(),
36-
compilerOptions: { experimental: { async: true } },
37-
kit: {
38-
tracing: { server: true },
39-
experimental: {
40-
remoteFunctions: true,
41-
},
42-
},
43-
}),
44-
]),
31+
// SER's svelte-transform is a normal-order Vite transform, so it must precede the
32+
// SvelteKit plugin to lower `<script effect>` / yield* syntax before Svelte compiles.
33+
// `ts(true)` (svelte-global-typescript) likewise runs before sveltekit() for the build;
34+
// its matching preprocess is passed to sveltekit() below so editor tooling parses plain
35+
// <script> blocks as TypeScript (this SvelteKit build no longer reads svelte.config.js —
36+
// all config is passed directly to the sveltekit() plugin).
37+
...effect(),
38+
ts(true),
39+
sveltekit({
40+
adapter: adapter(),
41+
compilerOptions: { experimental: { async: true } },
42+
tracing: { server: true },
43+
experimental: { remoteFunctions: true },
44+
}),
4545
],
4646
});

knip.config.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export default {
66
ignoreExportsUsedInFile: { type: true, interface: true },
77
treatConfigHintsAsErrors: true,
88
workspaces: {
9-
".": {
10-
entry: ["vite.config.ts"],
11-
},
129
"apps/collegemap": {
1310
drizzle: {
1411
config: [],
@@ -17,13 +14,6 @@ export default {
1714
},
1815
"apps/console": {
1916
ignoreDependencies: ["crossws!"],
20-
sveltekit: {
21-
config: ["vite.config.ts"],
22-
},
23-
paths: {
24-
"$app/env": ["node_modules/@sveltejs/kit/types/index.d.ts"],
25-
"$app/server": ["node_modules/@sveltejs/kit/types/index.d.ts"],
26-
},
2717
// Scripts are deploy/ops entrypoints (seed, bridge daemon, token mint, capability
2818
// install) — production surface, hence the `!` markers.
2919
entry: [
@@ -36,9 +26,6 @@ export default {
3626
],
3727
},
3828
"apps/grove": {
39-
sveltekit: {
40-
config: ["vite.config.ts"],
41-
},
4229
entry: ["effectdb.config.ts!", "src/env.ts!"],
4330
},
4431
"apps/storybook": {

0 commit comments

Comments
 (0)