Skip to content

Commit 5b33d7a

Browse files
authored
remove packaging script (#50)
* remove packaging script * match site-kit * fix a bunch of type errors that were somehow hidden until now????
1 parent 75b3336 commit 5b33d7a

23 files changed

+78
-108
lines changed

apps/svelte.dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"shiki": "^1.6.4",
8080
"shiki-twoslash": "^3.1.2",
8181
"svelte": "5.0.0-next.160",
82-
"svelte-check": "^3.8.0",
82+
"svelte-check": "^3.8.2",
8383
"svelte-preprocess": "^5.1.4",
8484
"tiny-glob": "^0.2.9",
8585
"typescript": "^5.4.5",

apps/svelte.dev/src/routes/(authed)/repl/[id]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { browser } from '$app/environment';
33
import { afterNavigate, goto, replaceState } from '$app/navigation';
4-
import Repl from '@sveltejs/repl';
4+
import { Repl } from '@sveltejs/repl';
55
import { theme } from '@sveltejs/site-kit/stores';
66
import { onMount } from 'svelte';
77
import { mapbox_setup } from '../../../../config.js';

apps/svelte.dev/src/routes/(authed)/repl/[id]/AppControls.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
import downloadBlob from './downloadBlob.js';
77
import { enter } from '$lib/utils/events';
88
import { isMac } from '$lib/utils/compat.js';
9-
import Repl from '@sveltejs/repl';
9+
import { Repl } from '@sveltejs/repl';
1010
import { get_app_context } from '../../app-context';
1111
import type { Gist, User } from '$lib/db/types';
12+
import type { File } from '@sveltejs/repl';
1213
1314
interface Props {
1415
user: User | null;
@@ -52,7 +53,7 @@
5253
async function fork(intentWasSave: boolean) {
5354
saving = true;
5455
55-
const { files } = repl.toJSON();
56+
const { files } = repl.toJSON() as { files: File[] };
5657
5758
try {
5859
const r = await fetch(`/repl/create.json`, {
@@ -118,7 +119,7 @@
118119
try {
119120
// Send all files back to API
120121
// ~> Any missing files are considered deleted!
121-
const { files } = repl.toJSON();
122+
const { files } = repl.toJSON() as { files: File[] };
122123
123124
const r = await fetch(`/repl/save/${gist.id}.json`, {
124125
method: 'PUT',
@@ -159,7 +160,10 @@
159160
async function download() {
160161
downloading = true;
161162
162-
const { files: components, imports } = repl.toJSON();
163+
const { files: components, imports } = repl.toJSON() as {
164+
files: any[];
165+
imports: string[];
166+
};
163167
164168
const files = (await (await fetch('/svelte-app.json')).json()) as Array<{
165169
path: string;

apps/svelte.dev/src/routes/(authed)/repl/[id]/embed/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { browser } from '$app/environment';
33
import { afterNavigate } from '$app/navigation';
44
import { theme } from '@sveltejs/site-kit/stores';
5-
import Repl from '@sveltejs/repl';
5+
import { Repl } from '@sveltejs/repl';
66
import { mapbox_setup } from '../../../../../config.js';
77
import { onMount } from 'svelte';
88

apps/svelte.dev/src/routes/_components/Example.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
22
import IntersectionObserver from '$lib/components/IntersectionObserver.svelte';
33
import { process_example } from '$lib/utils/examples';
4-
import Repl from '@sveltejs/repl';
4+
import { Repl } from '@sveltejs/repl';
55
import { theme } from '@sveltejs/site-kit/stores';
66
77
export let id;
88
9-
/** @type {import('@sveltejs/repl').default} */
9+
/** @type {Repl} */
1010
let repl;
1111
1212
$: {

packages/repl/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"dev": "vite dev",
66
"build": "vite build && npm run package",
77
"preview": "vite preview",
8-
"package": "svelte-kit sync && svelte-package && publint",
9-
"package:watch": "svelte-kit sync && svelte-package --watch",
8+
"package": "svelte-kit sync",
109
"prepublishOnly": "npm run package",
1110
"check": "svelte-kit sync && svelte-check",
1211
"lint": "prettier --check .",
@@ -24,13 +23,12 @@
2423
"homepage": "https://github.com/sveltejs/svelte.dev/tree/main/packages/repl/#readme",
2524
"exports": {
2625
".": {
27-
"types": "./dist/Repl.svelte.d.ts",
28-
"svelte": "./dist/Repl.svelte"
26+
"svelte": "./src/lib/index.ts",
27+
"default": "./src/lib/index.ts"
2928
},
3029
"./theme": {
31-
"types": "./dist/theme.d.ts",
32-
"svelte": "./dist/theme.js",
33-
"default": "./dist/theme.js"
30+
"svelte": "./src/lib/theme.ts",
31+
"default": "./src/lib/theme.ts"
3432
}
3533
},
3634
"files": [
@@ -50,7 +48,7 @@
5048
"prettier": "^3.3.2",
5149
"prettier-plugin-svelte": "^3.2.4",
5250
"publint": "^0.1.9",
53-
"svelte-check": "^3.8.0",
51+
"svelte-check": "^3.8.2",
5452
"tslib": "^2.4.1",
5553
"typescript": "^5.0.0",
5654
"vite": "^5.0.11"

packages/repl/src/lib/CodeMirror.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import { javascriptLanguage } from '@codemirror/lang-javascript';
1212
import { createEventDispatcher, tick } from 'svelte';
1313
import { writable } from 'svelte/store';
14-
import { get_repl_context } from '$lib/context.js';
14+
import { get_repl_context } from './context';
1515
import Message from './Message.svelte';
16-
import { svelteTheme } from './theme.js';
17-
import { autocomplete } from './autocomplete.js';
16+
import { svelteTheme } from './theme';
17+
import { autocomplete } from './autocomplete';
1818
import type { LintSource } from '@codemirror/lint';
1919
import type { Extension } from '@codemirror/state';
2020
import { CompletionContext } from '@codemirror/autocomplete';
@@ -207,11 +207,11 @@
207207
const { files, selected } = get_repl_context();
208208
209209
const svelte_rune_completions = svelteLanguage.data.of({
210-
autocomplete: (context: CompletionContext) => autocomplete(context, $selected, $files)
210+
autocomplete: (context: CompletionContext) => autocomplete(context, $selected!, $files)
211211
});
212212
213213
const js_rune_completions = javascriptLanguage.data.of({
214-
autocomplete: (context: CompletionContext) => autocomplete(context, $selected, $files)
214+
autocomplete: (context: CompletionContext) => autocomplete(context, $selected!, $files)
215215
});
216216
</script>
217217

packages/repl/src/lib/Input/ComponentSelector.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
3-
import { get_full_filename } from '$lib/utils.js';
2+
import { get_repl_context } from '../context';
3+
import { get_full_filename } from '../utils';
44
import { createEventDispatcher, tick } from 'svelte';
55
import RunesInfo from './RunesInfo.svelte';
66
import Migrate from './Migrate.svelte';
7-
import type { File } from '$lib/types';
7+
import type { File } from '../types';
88
99
export let show_modified: boolean;
1010
export let runes: boolean;
1111
1212
const dispatch: ReturnType<
1313
typeof createEventDispatcher<{
14-
remove: { files: import('$lib/types').File[]; diff: import('$lib/types').File };
15-
add: { files: import('$lib/types').File[]; diff: import('$lib/types').File };
14+
remove: { files: File[]; diff: File };
15+
add: { files: File[]; diff: File };
1616
}>
1717
> = createEventDispatcher();
1818

packages/repl/src/lib/Input/Migrate.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
44
const { migrate } = get_repl_context();
55
</script>

packages/repl/src/lib/Input/ModuleEditor.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
import CodeMirror from '../CodeMirror.svelte';
44
import type { CompileError, Warning } from 'svelte/compiler';
55
6-
export let error: CompileError;
6+
export let error: CompileError | undefined;
77
export let warnings: Warning[];
88
export let vim: boolean;
99
@@ -23,8 +23,8 @@
2323
return [
2424
{
2525
severity: 'error',
26-
from: error.position[0],
27-
to: error.position[1],
26+
from: error.position![0],
27+
to: error.position![1],
2828
message: error.message,
2929
renderMessage: () => {
3030
// TODO expose error codes, so we can link to docs in future
@@ -42,8 +42,8 @@
4242
if (warnings) {
4343
return warnings.map((warning) => ({
4444
severity: 'warning',
45-
from: warning.start.character,
46-
to: warning.end.character,
45+
from: warning.start!.character,
46+
to: warning.end!.character,
4747
message: warning.message,
4848
renderMessage: () => {
4949
const span = document.createElement('span');

packages/repl/src/lib/Input/RunesInfo.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
44
let { runes }: { runes: boolean } = $props();
55

packages/repl/src/lib/Message.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { MessageDetails } from './types.js';
55
66
export let kind: 'info' | 'warning' | 'error' = 'info';
7-
export let details: MessageDetails | undefined = undefined;
7+
export let details: any | undefined = undefined;
88
export let filename: string | undefined = undefined;
99
export let truncate = false;
1010

packages/repl/src/lib/Output/AstNode.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
import { tick } from 'svelte';
44
import type { CompileResult } from 'svelte/compiler';
55

packages/repl/src/lib/Output/Compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { File } from '$lib/types';
1+
import type { File } from '../types';
22
import type { CompileOptions } from 'svelte/compiler';
33
import Worker from '../workers/compiler/index.js?worker';
4-
import type { CompilerOutput, MigrateOutput } from '$lib/workers/workers';
4+
import type { CompilerOutput, MigrateOutput } from '../workers/workers';
55

66
const workers = new Map();
77

packages/repl/src/lib/Output/CompilerOptions.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
import Checkbox from '../Checkbox.svelte';
44
55
const { compile_options } = get_repl_context();
@@ -20,7 +20,7 @@
2020
<!-- svelte-ignore a11y_label_has_associated_control (TODO this warning should probably be disabled if there's a component)-->
2121
<label class="option">
2222
<span class="key">dev:</span>
23-
<Checkbox bind:checked={$compile_options.dev} />
23+
<Checkbox bind:checked={$compile_options.dev!} />
2424
<span class="boolean">{$compile_options.dev}</span>,
2525
</label>
2626
});

packages/repl/src/lib/Output/Output.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
import { marked } from 'marked';
44
import CodeMirror from '../CodeMirror.svelte';
55
import AstView from './AstView.svelte';
66
import CompilerOptions from './CompilerOptions.svelte';
77
import PaneWithPanel from './PaneWithPanel.svelte';
88
import Viewer from './Viewer.svelte';
9-
import type { File, MessageDetails } from '$lib/types';
10-
import type { CompilerOutput } from '$lib/workers/workers';
9+
import type { File, MessageDetails } from '../types';
10+
import type { CompilerOutput } from '../workers/workers';
1111
1212
export let status: string | null;
13-
export let runtimeError: MessageDetails | null = null;
13+
export let runtimeError: Error | null = null;
1414
export let embedded = false;
1515
export let relaxed = false;
1616
export let injectedJS: string;

packages/repl/src/lib/Output/Viewer.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { get_repl_context } from '$lib/context.js';
2+
import { get_repl_context } from '../context';
33
import { BROWSER } from 'esm-env';
44
import { onMount } from 'svelte';
55
import Message from '../Message.svelte';
@@ -10,10 +10,10 @@
1010
import srcdoc from './srcdoc/index.html?raw';
1111
import ErrorOverlay from './ErrorOverlay.svelte';
1212
import type { CompileError } from 'svelte/compiler';
13-
import type { Bundle, MessageDetails } from '$lib/types';
13+
import type { Bundle } from '../types';
1414
import type { Log } from './console/console';
1515
16-
export let error: MessageDetails | null;
16+
export let error: Error | null;
1717
export let status: string | null;
1818
export let relaxed = false;
1919
export let injectedJS = '';

packages/repl/src/lib/Output/get-location-from-stack.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import type { StartOrEnd } from '$lib/types';
2-
import { decode, type SourceMapMappings } from '@jridgewell/sourcemap-codec';
1+
import { decode } from '@jridgewell/sourcemap-codec';
2+
import type { StartOrEnd } from '../types';
3+
import type { SourceMap } from '@rollup/browser';
34

4-
export default function getLocationFromStack(stack: string, map: SourceMapMappings) {
5+
export default function getLocationFromStack(stack: string, map: SourceMap) {
56
if (!stack) return;
67
const last = stack.split('\n')[1];
78
const match = /<anonymous>:(\d+):(\d+)\)$/.exec(last);
@@ -14,7 +15,7 @@ export default function getLocationFromStack(stack: string, map: SourceMapMappin
1415
return trace({ line, column }, map);
1516
}
1617

17-
function trace(loc: Omit<StartOrEnd, 'character'>, map) {
18+
function trace(loc: Omit<StartOrEnd, 'character'>, map: SourceMap) {
1819
const mappings = decode(map.mappings);
1920
const segments = mappings[loc.line - 1];
2021

packages/repl/src/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as Repl } from './Repl.svelte';
2+
export type { File } from './types';

packages/repl/src/lib/workers/bundler/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import '../patch_window.js';
2-
import { sleep } from '$lib/utils';
1+
import '../patch_window';
2+
import { sleep } from '../../utils';
33
import { rollup } from '@rollup/browser';
44
import { DEV } from 'esm-env';
55
import * as resolve from 'resolve.exports';
6-
import commonjs from './plugins/commonjs.js';
7-
import glsl from './plugins/glsl.js';
8-
import json from './plugins/json.js';
9-
import replace from './plugins/replace.js';
10-
import loop_protect from './plugins/loop-protect.js';
6+
import commonjs from './plugins/commonjs';
7+
import glsl from './plugins/glsl';
8+
import json from './plugins/json';
9+
import replace from './plugins/replace';
10+
import loop_protect from './plugins/loop-protect';
1111
import type { Plugin, TransformResult } from '@rollup/browser';
12-
import type { BundleMessageData } from '../workers.js';
13-
import type { File, Warning } from '$lib/types.js';
12+
import type { BundleMessageData } from '../workers';
13+
import type { File, Warning } from '../../types';
1414
import type { CompileResult } from 'svelte/compiler';
1515

1616
let packages_url: string;
@@ -435,7 +435,7 @@ async function bundle({ uid, files }: { uid: number; files: File[] }) {
435435
console.log(`running Svelte compiler version %c${svelte.VERSION}`, 'font-weight: bold');
436436
}
437437

438-
const lookup: Map<string, import('$lib/types').File> = new Map();
438+
const lookup: Map<string, File> = new Map();
439439

440440
lookup.set('./__entry.js', {
441441
name: '__entry',

packages/repl/svelte.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {
6-
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
7-
// for more information about preprocessors
8-
preprocess: vitePreprocess(),
9-
106
kit: {
117
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
128
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.

packages/site-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"prettier-plugin-svelte": "^3.2.4",
3636
"shiki-twoslash": "^3.1.2",
3737
"svelte": "^5.0.0-next.160",
38-
"svelte-check": "^3.8.0",
38+
"svelte-check": "^3.8.2",
3939
"typescript": "^5.4.5",
4040
"vite": "^5.2.11"
4141
},

0 commit comments

Comments
 (0)