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

File tree

23 files changed

+78
-108
lines changed

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');

0 commit comments

Comments
 (0)