Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
x0k committed Jun 12, 2024
1 parent f49c6f3 commit c1e1615
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 50 deletions.
36 changes: 30 additions & 6 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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);
};

Expand All @@ -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: [
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/content/design-patterns/factory/ts/worker.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 0 additions & 2 deletions src/lib/testing/js/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from "./model";
export * from "./js-test-runner";
export * from "./ts-test-runner";
1 change: 0 additions & 1 deletion src/lib/testing/js/model.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/lib/testing/languages.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -12,6 +12,6 @@ export enum Language {
export const LANGUAGE_TITLE: Record<Language, string> = {
[Language.PHP]: `PHP ${phpVersion}`,
[Language.TypeScript]: `TypeScript ${tsVersion}`,
[Language.Python]: `Python ${pyVersion}`,
[Language.Python]: `Python ${pythonVersion}`,
[Language.JavaScript]: "JavaScript",
};
1 change: 0 additions & 1 deletion src/lib/testing/php/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "./model";
export * from "./php-test-runner";
export * from "./fail-safe-php";
export * from "./php-runtime-factory";
2 changes: 1 addition & 1 deletion src/lib/testing/php/php-runtime-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WebPHP } from "@php-wasm/web";

import { version } from "./model";
import { version } from "./version";

export const phpRuntimeFactory = () => WebPHP.loadRuntime(version);
File renamed without changes.
1 change: 0 additions & 1 deletion src/lib/testing/python/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './model'
export * from './py-test-runner'
export * from './py-runtime-factory'
File renamed without changes.
1 change: 1 addition & 0 deletions src/lib/testing/ts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ts-test-runner'
Original file line number Diff line number Diff line change
@@ -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<M, I, O> extends JsTestRunner<M, I, O> {
protected transformCode(code: string) {
Expand Down
1 change: 1 addition & 0 deletions src/lib/testing/ts/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { version } from "typescript";
32 changes: 1 addition & 31 deletions tailwind.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
},
plugins: [require("@tailwindcss/typography"), require("daisyui")],
daisyui: {
darkTheme: "black",
darkTheme: "business",
themes: [
{
business: {
Expand All @@ -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"]'],
Expand Down

0 comments on commit c1e1615

Please sign in to comment.