diff --git a/astro.config.mjs b/astro.config.mjs index e721ca8..09af213 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,7 @@ import { defineConfig } from "astro/config"; import { viteStaticCopy } from "vite-plugin-static-copy"; import { createLogger } from "vite"; +import { fileURLToPath } from "node:url"; import mdx from "@astrojs/mdx"; import svelte from "@astrojs/svelte"; @@ -12,7 +13,7 @@ const loggerWarn = logger.warn; logger.warn = (msg, options) => { // Ignore warnings from pyodide distribution - if (msg.includes("/public/pyodide/")) return; + if (msg.includes("pyodide/pyodide")) return; loggerWarn(msg, options); }; @@ -22,19 +23,42 @@ export default defineConfig({ base: "/ppp", integrations: [tailwind(), icon(), mdx(), svelte()], vite: { + resolve: { + alias: { + "@": fileURLToPath(new URL("./src", import.meta.url)), + }, + }, + worker: { + format: "es", + rollupOptions: { + output: { + assetFileNames: "assets/[name].[hash].[ext]", + }, + }, + plugins: [ + { + name: "ignore-wasm-imports", + load(id) { + if (id?.endsWith(".wasm")) { + return { + code: "export default {}", + map: null, + }; + } + }, + }, + ], + }, customLogger: logger, optimizeDeps: { - exclude: ["pyodide"], + exclude: ["pyodide", "@php-wasm/web"], }, - assetsInclude: ["**/*.wasm"], build: { rollupOptions: { external: ["sharp"], - output: { - assetFileNames: "assets/[name].[hash].[ext]", - }, }, }, + assetsInclude: ["**/php_8_3.wasm"], plugins: [ viteStaticCopy({ targets: [ diff --git a/bun.lockb b/bun.lockb index 183f533..029cc93 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index fad4ec2..c3ef5f2 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@php-wasm/web": "^0.7.20", "@xterm/addon-fit": "^0.10.0", "@xterm/xterm": "^5.5.0", - "astro": "^4.10.1", + "astro": "^4.10.2", "astro-icon": "^1.1.0", "fast-deep-equal": "^3.1.3", "monaco-editor": "^0.49.0", diff --git a/src/content/design-patterns/factory/ts/worker.ts b/src/content/design-patterns/factory/ts/worker.ts index 78fddb8..53b5f85 100644 --- a/src/content/design-patterns/factory/ts/worker.ts +++ b/src/content/design-patterns/factory/ts/worker.ts @@ -1,6 +1,6 @@ import { createLogger } from "@/lib/logger"; import type { TestRunnerConfig } from "@/lib/testing"; -import { TsTestRunner } from "@/lib/testing/js"; +import { TsTestRunner } from "@/lib/testing/ts"; import { startTestRunnerActor } from "@/adapters/testing-actor"; import { type Input, type Output } from "../tests-data"; diff --git a/src/lib/testing/js/index.ts b/src/lib/testing/js/index.ts index 217dd13..2d1929b 100644 --- a/src/lib/testing/js/index.ts +++ b/src/lib/testing/js/index.ts @@ -1,3 +1 @@ -export * from "./model"; export * from "./js-test-runner"; -export * from "./ts-test-runner"; diff --git a/src/lib/testing/js/model.ts b/src/lib/testing/js/model.ts deleted file mode 100644 index e897135..0000000 --- a/src/lib/testing/js/model.ts +++ /dev/null @@ -1 +0,0 @@ -export { version as tsVersion } from "typescript"; diff --git a/src/lib/testing/languages.ts b/src/lib/testing/languages.ts index 65f97dc..99485d0 100644 --- a/src/lib/testing/languages.ts +++ b/src/lib/testing/languages.ts @@ -1,6 +1,6 @@ -import { tsVersion } from './js' -import { version as phpVersion } from './php' -import { version as pyVersion } from './python' +import { version as tsVersion } from "./ts/version"; +import { version as phpVersion } from "./php/version"; +import { version as pythonVersion } from "./python/version"; export enum Language { PHP = "php", @@ -12,6 +12,6 @@ export enum Language { export const LANGUAGE_TITLE: Record = { [Language.PHP]: `PHP ${phpVersion}`, [Language.TypeScript]: `TypeScript ${tsVersion}`, - [Language.Python]: `Python ${pyVersion}`, + [Language.Python]: `Python ${pythonVersion}`, [Language.JavaScript]: "JavaScript", }; diff --git a/src/lib/testing/php/index.ts b/src/lib/testing/php/index.ts index 0cdc49e..bbb9466 100644 --- a/src/lib/testing/php/index.ts +++ b/src/lib/testing/php/index.ts @@ -1,4 +1,3 @@ -export * from "./model"; export * from "./php-test-runner"; export * from "./fail-safe-php"; export * from "./php-runtime-factory"; diff --git a/src/lib/testing/php/php-runtime-factory.ts b/src/lib/testing/php/php-runtime-factory.ts index c399488..eaab303 100644 --- a/src/lib/testing/php/php-runtime-factory.ts +++ b/src/lib/testing/php/php-runtime-factory.ts @@ -1,5 +1,5 @@ import { WebPHP } from "@php-wasm/web"; -import { version } from "./model"; +import { version } from "./version"; export const phpRuntimeFactory = () => WebPHP.loadRuntime(version); diff --git a/src/lib/testing/php/model.ts b/src/lib/testing/php/version.ts similarity index 100% rename from src/lib/testing/php/model.ts rename to src/lib/testing/php/version.ts diff --git a/src/lib/testing/python/index.ts b/src/lib/testing/python/index.ts index 496381b..dfa78a0 100644 --- a/src/lib/testing/python/index.ts +++ b/src/lib/testing/python/index.ts @@ -1,3 +1,2 @@ -export * from './model' export * from './py-test-runner' export * from './py-runtime-factory' diff --git a/src/lib/testing/python/model.ts b/src/lib/testing/python/version.ts similarity index 100% rename from src/lib/testing/python/model.ts rename to src/lib/testing/python/version.ts diff --git a/src/lib/testing/ts/index.ts b/src/lib/testing/ts/index.ts new file mode 100644 index 0000000..81671c5 --- /dev/null +++ b/src/lib/testing/ts/index.ts @@ -0,0 +1 @@ +export * from './ts-test-runner' diff --git a/src/lib/testing/js/ts-test-runner.ts b/src/lib/testing/ts/ts-test-runner.ts similarity index 88% rename from src/lib/testing/js/ts-test-runner.ts rename to src/lib/testing/ts/ts-test-runner.ts index 861e9e1..6ee0455 100644 --- a/src/lib/testing/js/ts-test-runner.ts +++ b/src/lib/testing/ts/ts-test-runner.ts @@ -1,6 +1,6 @@ import { transpile, ScriptTarget } from "typescript"; -import { JsTestRunner } from "./js-test-runner"; +import { JsTestRunner } from "@/lib/testing/js"; export abstract class TsTestRunner extends JsTestRunner { protected transformCode(code: string) { diff --git a/src/lib/testing/ts/version.ts b/src/lib/testing/ts/version.ts new file mode 100644 index 0000000..f8ebbb6 --- /dev/null +++ b/src/lib/testing/ts/version.ts @@ -0,0 +1 @@ +export { version } from "typescript"; diff --git a/tailwind.config.mjs b/tailwind.config.mjs index d700713..64b3322 100644 --- a/tailwind.config.mjs +++ b/tailwind.config.mjs @@ -13,7 +13,7 @@ export default { }, plugins: [require("@tailwindcss/typography"), require("daisyui")], daisyui: { - darkTheme: "black", + darkTheme: "business", themes: [ { business: { @@ -22,36 +22,6 @@ export default { }, }, "light", - "dark", - "cupcake", - "bumblebee", - "emerald", - "corporate", - "synthwave", - "retro", - "cyberpunk", - "valentine", - "halloween", - "garden", - "forest", - "aqua", - "lofi", - "pastel", - "fantasy", - "wireframe", - "black", - "luxury", - "dracula", - "cmyk", - "autumn", - "acid", - "lemonade", - "night", - "coffee", - "winter", - "dim", - "nord", - "sunset", ], }, darkMode: ["selector", '[data-theme="business"]'],