From 216441d3564e00aabfac7e8acf346e34a5db9598 Mon Sep 17 00:00:00 2001 From: "netop://ウィビ" Date: Fri, 24 Apr 2026 16:50:12 -0700 Subject: Add Vite playground for local development MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm run dev boots a Vite + Svelte 5 server at localhost:5173, importing GraphiQL.svelte directly from source/library. HMR reflects changes without a package rebuild. Points at the public Countries API by default — swap playground/src/App.svelte for your own endpoint. --- .npmignore | 3 +++ package.json | 3 +++ playground/index.html | 16 ++++++++++++++++ playground/src/App.svelte | 23 +++++++++++++++++++++++ playground/src/main.ts | 9 +++++++++ vite.config.ts | 10 ++++++++++ 6 files changed, 64 insertions(+) create mode 100644 playground/index.html create mode 100644 playground/src/App.svelte create mode 100644 playground/src/main.ts create mode 100644 vite.config.ts diff --git a/.npmignore b/.npmignore index 51dd034..f1b7da2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,9 @@ source/ tests/ +playground/ PLAN.md .gitignore svelte.config.js tsconfig.json +vite.config.ts +vitest.config.ts diff --git a/package.json b/package.json index 8621132..fe4a49e 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,12 @@ "access": "public" }, "scripts": { + "build": "vite build", "check": "svelte-check --tsconfig tsconfig.json", + "dev": "vite", "package": "svelte-package -i source/library -o dist", "prepublishOnly": "bun run package", + "preview": "vite preview", "publish": "bun run package && bun publish", "test": "vitest run" }, diff --git a/playground/index.html b/playground/index.html new file mode 100644 index 0000000..7487569 --- /dev/null +++ b/playground/index.html @@ -0,0 +1,16 @@ + + + + + + @eeeooolll/graphiql · playground + + + +
+ + + diff --git a/playground/src/App.svelte b/playground/src/App.svelte new file mode 100644 index 0000000..82a8c9d --- /dev/null +++ b/playground/src/App.svelte @@ -0,0 +1,23 @@ + + + diff --git a/playground/src/main.ts b/playground/src/main.ts new file mode 100644 index 0000000..bf39df9 --- /dev/null +++ b/playground/src/main.ts @@ -0,0 +1,9 @@ +import { mount } from "svelte"; +import App from "./App.svelte"; + +const target = document.getElementById("app"); + +if (!target) + throw new Error("missing #app target"); + +mount(App, { target }); diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..be9ad40 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,10 @@ +import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [svelte()], + root: "playground", + server: { + port: 5173 + } +}); -- cgit v1.2.3