Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,754 changes: 718 additions & 1,036 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "2.8.4",
"description": "Light as Notepad, elegant as Markdown.",
"type": "module",
"imports": {
"#lib/*": "./src/lib/*"
},
"scripts": {
"dev": "vite dev",
"dev:installer": "tauri dev -- -- --install",
Expand Down Expand Up @@ -35,21 +38,20 @@
"yaml": "^2.9.0"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.70.2",
"@sveltejs/vite-plugin-svelte": "^5.1.1",
"@sveltejs/adapter-static": "^4.0.0",
"@sveltejs/kit": "^3.1.0",
"@sveltejs/vite-plugin-svelte": "^7.3.1",
"@tauri-apps/cli": "^2.11.4",
"@types/node": "^26.2.0",
"jsdom": "^30.0.1",
"svelte": "^5.56.8",
"svelte": "^5.57.2",
"svelte-check": "^4.7.5",
"tsx": "^4.23.12",
"typescript": "^5.9.3",
"vite": "^6.4.3",
"typescript": "^6.0.3",
"vite": "^8.3.5",
"vitest": "^4.1.12"
},
"overrides": {
"cookie": "0.7.2",
"dompurify": "3.4.17",
"mermaid": {
"katex": "$katex"
Expand Down
6 changes: 4 additions & 2 deletions scripts/editorOptionWiring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ function optionsPassedTo(callee: string, settings: Record<string, unknown> = {})
// the effect race #369 removed.
assert.equal(literals.length, 1, `exactly one ${callee} call site in Editor.svelte`);

const js = ts.transpileModule(`(${literals[0].getText(source)})`, {
// Bound to a name, not returned as an expression: TypeScript 6 prefixes the
// output with "use strict", and `return ${js}` would return that string.
const js = ts.transpileModule(`const options = (${literals[0].getText(source)});`, {
compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ESNext },
}).outputText;

Expand All @@ -387,7 +389,7 @@ function optionsPassedTo(callee: string, settings: Record<string, unknown> = {})
'fontIsMonospace',
'editorOptionsFromSettings',
'readOnly',
`return ${js};`,
`${js}\nreturn options;`,
)(settings, '', 'markdown', () => 'app-theme-dark', {}, 100, false, editorOptionsFromSettings, false) as Record<
string,
unknown
Expand Down
4 changes: 2 additions & 2 deletions scripts/monacoStartupGraph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function staticSpecifiers(source: string): string[] {
function resolveLocal(specifier: string, fromFile: string): string | null {
let target: string;
if (specifier.startsWith('.')) target = resolve(dirname(fromFile), specifier);
else if (specifier.startsWith('$lib/')) target = resolve('src/lib', specifier.slice('$lib/'.length));
else if (specifier.startsWith('#lib/')) target = resolve('src/lib', specifier.slice('#lib/'.length));
else if (specifier.startsWith('$app/') || !specifier.startsWith('/')) return null;
else return null;

Expand Down Expand Up @@ -116,7 +116,7 @@ test('the parser sees the imports it is supposed to see', () => {

assert.ok(files.includes('src/lib/MarkdownViewer.svelte'), 'reached the viewer from the entry');
assert.ok(files.includes('src/lib/components/Editor.svelte'), 'reached Editor.svelte, which is still statically imported');
assert.ok(files.includes('src/lib/stores/settings.svelte.ts'), 'followed a $lib specifier with a .js extension');
assert.ok(files.includes('src/lib/stores/settings.svelte.ts'), 'followed a #lib specifier with a .js extension');
assert.ok(files.length > 30, `walked a real graph, not a stub (got ${files.length} files)`);

// The negative check below is only meaningful if a static Monaco import
Expand Down
4 changes: 2 additions & 2 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { settings } from '$lib/stores/settings.svelte.js';
import { loadLocale } from '$lib/utils/i18n.js';
import { settings } from '#lib/stores/settings.svelte.js';
import { loadLocale } from '#lib/utils/i18n.js';

// Tauri doesn't have a Node.js server to do proper SSR
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import MarkdownViewer from '$lib/MarkdownViewer.svelte';
import MarkdownViewer from '#lib/MarkdownViewer.svelte';
import '../styles.css';
</script>

Expand Down
18 changes: 0 additions & 18 deletions svelte.config.js

This file was deleted.

40 changes: 7 additions & 33 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"extends": "$app/tsconfig",
"compilerOptions": {
// scripts/*.test.ts import their subjects with an explicit `.ts`
// extension, which is what `tsx` (the test runner's loader) resolves.
Expand All @@ -16,37 +16,11 @@
"strict": true,
"moduleResolution": "bundler"
},
// TypeScript does not merge `include` across `extends`, so this list is a
// copy of the one in .svelte-kit/tsconfig.json (rewritten relative to this
// file, which sits one level up) plus `scripts/`.
//
// `scripts/` holds the whole Node test suite. SvelteKit only ever generates
// `test/` and `tests/` entries, so without this override every *.test.ts was
// invisible to `npm run check`: renaming an exported function left the type
// check green and only the test run red.
//
// Keep in sync with .svelte-kit/tsconfig.json when SvelteKit is upgraded.
"include": [
".svelte-kit/ambient.d.ts",
".svelte-kit/env.d.ts",
".svelte-kit/non-ambient.d.ts",
".svelte-kit/types/**/$types.d.ts",
"vite.config.js",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.js",
"src/**/*.ts",
"src/**/*.svelte",
"test/**/*.js",
"test/**/*.ts",
"test/**/*.svelte",
"tests/**/*.js",
"tests/**/*.ts",
"tests/**/*.svelte",
"scripts/**/*.js",
"scripts/**/*.mjs",
"scripts/**/*.ts"
]
// SvelteKit 3's generated `$app/tsconfig` declares no `include`, so the
// project lists its own. `scripts/` holds the whole Node test suite; without
// it every *.test.ts would be invisible to `npm run check`. `*` covers the
// root config files (vite.config.js, vitest.config.ts).
"include": ["src", "scripts", "*"]
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
// except #lib, which is declared in package.json "imports"
}
16 changes: 15 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defineConfig } from "vite";
import { sveltekit } from "@sveltejs/kit/vite";
import adapter from "@sveltejs/adapter-static";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { monacoImePatch } from "./scripts/monacoImePatch.mjs";

const host = process.env.TAURI_DEV_HOST;
Expand All @@ -8,7 +10,19 @@ const host = process.env.TAURI_DEV_HOST;
export default defineConfig(async () => ({
// See scripts/monacoImePatch.mjs: a build-time patch to Monaco, to delete
// once microsoft/vscode#333909 ships in a release.
plugins: [monacoImePatch, sveltekit()],
plugins: [
monacoImePatch,
sveltekit({
preprocess: vitePreprocess(),
// Tauri doesn't have a Node.js server to do proper SSR
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
// See: https://svelte.dev/docs/kit/single-page-apps
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
adapter: adapter({
fallback: "index.html",
}),
}),
],
build: {
chunkSizeWarningLimit: 6000,
},
Expand Down
Loading