diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 92077d06a8a..9d8b6483309 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -193,6 +193,7 @@ "@types/babel__core": "7.20.5", "@types/better-sqlite3": "7.6.13", "@types/bun": "1.4.3", + "@types/css-tree": "3.2.0", "@types/culori": "4.0.1", "@types/express": "5.0.6", "@types/lodash": "4.17.24", @@ -222,6 +223,7 @@ "better-auth": "1.6.22", "clsx": "2.1.1", "cross-env": "10.1.0", + "css-tree": "3.2.1", "culori": "4.0.2", "date-fns": "4.1.0", "default-shell": "2.2.0", diff --git a/apps/desktop/src/renderer/stores/theme/utils/css-variables.ts b/apps/desktop/src/renderer/stores/theme/utils/css-variables.ts index e0ea619b938..40381f207f9 100644 --- a/apps/desktop/src/renderer/stores/theme/utils/css-variables.ts +++ b/apps/desktop/src/renderer/stores/theme/utils/css-variables.ts @@ -1,5 +1,5 @@ -import { sanitizeThemeCss } from "shared/themes"; import type { UIColors } from "shared/themes/types"; +import { sanitizeThemeCss } from "./sanitizeThemeCss"; /** * Maps UI color keys to CSS variable names diff --git a/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/index.ts b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/index.ts new file mode 100644 index 00000000000..062ccffc7dd --- /dev/null +++ b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/index.ts @@ -0,0 +1 @@ +export { sanitizeThemeCss } from "./sanitizeThemeCss"; diff --git a/packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.test.ts b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.test.ts similarity index 84% rename from packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.test.ts rename to apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.test.ts index 9062d0e7f6d..f7bde728df3 100644 --- a/packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.test.ts +++ b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.test.ts @@ -1,8 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { mkdtemp, rm } from "node:fs/promises"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; -import { MAX_THEME_CSS_LENGTH, sanitizeThemeCss } from "./sanitizeThemeCss"; +import { MAX_THEME_CSS_LENGTH } from "shared/themes"; +import { sanitizeThemeCss } from "./sanitizeThemeCss"; describe("sanitizeThemeCss", () => { it("preserves supported colors, gradients and embedded raster images", () => { @@ -93,19 +91,3 @@ it("bounds output expanded by custom property namespacing", () => { expect(output).toBe(""); expect(sanitizeThemeCss(output)).toBe(output); }); - -it("runs from a Bun bundle, as in the compiled CLI", async () => { - const outdir = await mkdtemp(join(tmpdir(), "sanitize-theme-css-")); - try { - const build = await Bun.build({ - entrypoints: [join(import.meta.dir, "sanitizeThemeCss.ts")], - target: "bun", - outdir, - }); - expect(build.success).toBe(true); - const bundled = await import(join(outdir, "sanitizeThemeCss.js")); - expect(bundled.sanitizeThemeCss("a { color: red; }")).toBe("a{color:red}"); - } finally { - await rm(outdir, { recursive: true, force: true }); - } -}); diff --git a/packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.ts b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.ts similarity index 97% rename from packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.ts rename to apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.ts index 9fa79211605..451afd8f311 100644 --- a/packages/shared/src/themes/sanitizeThemeCss/sanitizeThemeCss.ts +++ b/apps/desktop/src/renderer/stores/theme/utils/sanitizeThemeCss/sanitizeThemeCss.ts @@ -1,4 +1,3 @@ -/// import { type CssNode, generate, @@ -7,9 +6,8 @@ import { type ListItem, parse, walk, -} from "css-tree/dist/csstree.esm"; - -export const MAX_THEME_CSS_LENGTH = 64 * 1024; +} from "css-tree"; +import { MAX_THEME_CSS_LENGTH } from "shared/themes"; const atRules = new Set([ "media", diff --git a/bun.lock b/bun.lock index 4f5ec6ee16b..7b7f67f5d94 100644 --- a/bun.lock +++ b/bun.lock @@ -248,6 +248,7 @@ "@types/babel__core": "7.20.5", "@types/better-sqlite3": "7.6.13", "@types/bun": "1.4.3", + "@types/css-tree": "3.2.0", "@types/culori": "4.0.1", "@types/express": "5.0.6", "@types/lodash": "4.17.24", @@ -277,6 +278,7 @@ "better-auth": "1.6.22", "clsx": "2.1.1", "cross-env": "10.1.0", + "css-tree": "3.2.1", "culori": "4.0.2", "date-fns": "4.1.0", "default-shell": "2.2.0", @@ -1236,7 +1238,6 @@ "@date-fns/tz": "1.4.1", "@lingui/core": "6.12.0", "@superset/i18n": "workspace:*", - "css-tree": "3.2.1", "culori": "4.0.2", "drizzle-orm": "0.45.2", "friendly-words": "1.3.1", @@ -1249,7 +1250,6 @@ }, "devDependencies": { "@superset/typescript": "workspace:*", - "@types/css-tree": "3.2.0", "@types/culori": "4.0.1", "@types/friendly-words": "1.2.2", "@types/semver": "7.7.1", @@ -6336,7 +6336,7 @@ "source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], - "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], "source-map-loader": ["source-map-loader@5.0.0", "", { "dependencies": { "iconv-lite": "^0.6.3", "source-map-js": "^1.0.2" }, "peerDependencies": { "webpack": "^5.72.1" } }, "sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA=="], @@ -7214,6 +7214,8 @@ "@tailwindcss/node/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + "@tailwindcss/node/source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], @@ -7338,8 +7340,6 @@ "cross-fetch/node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], - "css-tree/source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], - "cytoscape-fcose/cose-base": ["cose-base@2.2.0", "", { "dependencies": { "layout-base": "^2.0.0" } }, "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g=="], "d3-dsv/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="], @@ -7606,6 +7606,8 @@ "postcss/nanoid": ["nanoid@3.3.19", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug=="], + "postcss/source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "posthog-js/@posthog/core": ["@posthog/core@1.9.0", "", { "dependencies": { "cross-spawn": "^7.0.6" } }, "sha512-j7KSWxJTUtNyKynLt/p0hfip/3I46dWU2dk+pt7dKRoz2l5CYueHuHK4EO7Wlgno5yo1HO4sc4s30MXMTICHJw=="], "posthog-js/preact": ["preact@10.29.8", "", { "peerDependencies": { "preact-render-to-string": ">=5" }, "optionalPeers": ["preact-render-to-string"] }, "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q=="], @@ -7730,6 +7732,8 @@ "socket.io/accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="], + "source-map-loader/source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "stack-utils/escape-string-regexp": ["escape-string-regexp@2.0.0", "", {}, "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="], @@ -8844,6 +8848,8 @@ "next/postcss/nanoid": ["nanoid@3.3.19", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug=="], + "next/postcss/source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "node-gyp/which/isexe": ["isexe@4.0.0", "", {}, "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw=="], "ora/cli-cursor/restore-cursor": ["restore-cursor@5.1.0", "", { "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" } }, "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA=="], @@ -9004,6 +9010,8 @@ "uniwind/@tailwindcss/node/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + "uniwind/@tailwindcss/node/source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "uniwind/@tailwindcss/node/tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="], "uniwind/@tailwindcss/oxide/@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.3", "", { "os": "android", "cpu": "arm64" }, "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw=="], @@ -9078,8 +9086,6 @@ "vite/postcss/nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], - "vite/postcss/source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], - "wrangler/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.1", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ=="], "wrangler/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.28.1", "", { "os": "android", "cpu": "arm" }, "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ=="], diff --git a/packages/cli-framework/src/build.ts b/packages/cli-framework/src/build.ts index 8bdd69844f0..d8082b5730f 100644 --- a/packages/cli-framework/src/build.ts +++ b/packages/cli-framework/src/build.ts @@ -1,22 +1,14 @@ import { mkdirSync, writeFileSync } from "node:fs"; import { resolve } from "node:path"; -import { loadConfig } from "./config"; +import { type LoadedConfig, loadConfig } from "./config"; import { createCommandsPlugin } from "./plugin"; -export async function runBuild(argv: string[]): Promise { - const { config, configPath, root } = await loadConfig(process.cwd()); +export function buildOptions({ + config, + configPath, + root, +}: LoadedConfig): Pick { const commandsDir = resolve(root, config.commandsDir); - - let target: Bun.Build.CompileTarget | undefined; - let outfile = resolve(root, config.outfile ?? `./dist/${config.name}`); - for (const arg of argv) { - if (arg.startsWith("--target=")) { - target = arg.slice("--target=".length) as Bun.Build.CompileTarget; - } else if (arg.startsWith("--outfile=")) { - outfile = resolve(root, arg.slice("--outfile=".length)); - } - } - const cacheDir = resolve(root, "node_modules/.cache/cli-framework"); mkdirSync(cacheDir, { recursive: true }); const entryPath = resolve(cacheDir, "entry.ts"); @@ -38,11 +30,30 @@ await run({ `, ); - const result = await Bun.build({ + return { entrypoints: [entryPath], plugins: [createCommandsPlugin({ commandsDir }), ...(config.plugins ?? [])], - compile: target ? { target, outfile } : { outfile }, define: config.define, + }; +} + +export async function runBuild(argv: string[]): Promise { + const loaded = await loadConfig(process.cwd()); + const { config, root } = loaded; + + let target: Bun.Build.CompileTarget | undefined; + let outfile = resolve(root, config.outfile ?? `./dist/${config.name}`); + for (const arg of argv) { + if (arg.startsWith("--target=")) { + target = arg.slice("--target=".length) as Bun.Build.CompileTarget; + } else if (arg.startsWith("--outfile=")) { + outfile = resolve(root, arg.slice("--outfile=".length)); + } + } + + const result = await Bun.build({ + ...buildOptions(loaded), + compile: target ? { target, outfile } : { outfile }, }); if (!result.success) { diff --git a/packages/cli-framework/src/index.ts b/packages/cli-framework/src/index.ts index 22dce7ccbbe..b65884099b6 100644 --- a/packages/cli-framework/src/index.ts +++ b/packages/cli-framework/src/index.ts @@ -1,3 +1,4 @@ +export { buildOptions } from "./build"; export type { Audience, CommandConfig, CommandResult } from "./command"; export { createCommand } from "./command"; export { @@ -5,7 +6,7 @@ export { generateZshCompletion, } from "./completion"; export type { CliConfig } from "./config"; -export { defineConfig } from "./config"; +export { defineConfig, loadConfig } from "./config"; export { CLIError, suggestSimilar } from "./errors"; export type { CliDescription, CommandNode } from "./help"; export { diff --git a/packages/cli/cli.config.test.ts b/packages/cli/cli.config.test.ts new file mode 100644 index 00000000000..659fbb67d12 --- /dev/null +++ b/packages/cli/cli.config.test.ts @@ -0,0 +1,16 @@ +import { expect, it } from "bun:test"; +import { buildOptions, loadConfig } from "@superset/cli-framework"; + +it("keeps css-tree out of the compiled CLI", async () => { + const build = await Bun.build({ + ...buildOptions(await loadConfig(import.meta.dir)), + target: "bun", + metafile: true, + }); + expect(build.success).toBe(true); + const inputs = Object.keys(build.metafile?.inputs ?? {}); + expect(inputs.length).toBeGreaterThan(0); + expect( + inputs.filter((path) => /node_modules\/(css-tree|mdn-data)\//.test(path)), + ).toEqual([]); +}); diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 0b75b4535c0..416003cc9c3 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -8,6 +8,6 @@ "emitDeclarationOnly": false, "noEmit": true }, - "include": ["src", "scripts", "cli.config.ts"], + "include": ["src", "scripts", "cli.config.ts", "cli.config.test.ts"], "exclude": ["node_modules", "dist"] } diff --git a/packages/shared/package.json b/packages/shared/package.json index 3adcae1096e..c02b16cdc37 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -582,7 +582,6 @@ "@date-fns/tz": "1.4.1", "@lingui/core": "6.12.0", "@superset/i18n": "workspace:*", - "css-tree": "3.2.1", "culori": "4.0.2", "drizzle-orm": "0.45.2", "friendly-words": "1.3.1", @@ -595,7 +594,6 @@ }, "devDependencies": { "@superset/typescript": "workspace:*", - "@types/css-tree": "3.2.0", "@types/culori": "4.0.1", "@types/friendly-words": "1.2.2", "@types/semver": "7.7.1", diff --git a/packages/shared/src/themes/import.test.ts b/packages/shared/src/themes/import.test.ts index 570447434e1..1d63d1b2203 100644 --- a/packages/shared/src/themes/import.test.ts +++ b/packages/shared/src/themes/import.test.ts @@ -127,9 +127,7 @@ describe("parseThemeConfigFile", () => { expect(result.ok).toBe(true); if (!result.ok) return; - expect(result.themes[0]?.css).toBe( - "body{background:url(data:image/png;base64,AA==)}", - ); + expect(result.themes[0]?.css).toBe(css); }); it("returns an error for invalid JSON", () => { @@ -162,16 +160,7 @@ describe("parseThemeConfigFile", () => { }); }); -it("filters unsafe CSS during import and rejects oversized stylesheets", () => { - const result = parseThemeConfigFile( - JSON.stringify({ - name: "Filtered", - css: "body {display:none; background:url(https://example.invalid/track); color:red}", - }), - ); - expect(result.ok).toBe(true); - if (result.ok) - expect(result.themes[0]?.css).toBe("body{display:none;color:red}"); +it("rejects oversized stylesheets", () => { const oversized = parseThemeConfigFile( JSON.stringify({ name: "Too large", css: " ".repeat(65537) }), ); diff --git a/packages/shared/src/themes/import.ts b/packages/shared/src/themes/import.ts index 182115852b9..faddc7e5875 100644 --- a/packages/shared/src/themes/import.ts +++ b/packages/shared/src/themes/import.ts @@ -1,9 +1,10 @@ import { z } from "zod"; import { builtInThemes, darkTheme, lightTheme } from "./built-in"; import { getEditorTheme } from "./editor-theme"; -import { MAX_THEME_CSS_LENGTH, sanitizeThemeCss } from "./sanitizeThemeCss"; import { getDefaultTerminalColors, type Theme } from "./types"; +export const MAX_THEME_CSS_LENGTH = 64 * 1024; + const uiColorsSchema = z .object({ background: z.string().optional(), @@ -233,7 +234,7 @@ function parseThemeEntry( ...terminalOverrides, } : undefined, - css: config.css === undefined ? undefined : sanitizeThemeCss(config.css), + css: config.css, }; const baseEditorTheme = getEditorTheme(resolvedThemeBase); diff --git a/packages/shared/src/themes/index.ts b/packages/shared/src/themes/index.ts index 428eade6e5e..4c6ea9d3f93 100644 --- a/packages/shared/src/themes/index.ts +++ b/packages/shared/src/themes/index.ts @@ -13,8 +13,11 @@ export { vellumTheme, } from "./built-in"; export { getEditorTheme } from "./editor-theme"; -export { parseThemeConfigFile, type ThemeConfigParseResult } from "./import"; -export { MAX_THEME_CSS_LENGTH, sanitizeThemeCss } from "./sanitizeThemeCss"; +export { + MAX_THEME_CSS_LENGTH, + parseThemeConfigFile, + type ThemeConfigParseResult, +} from "./import"; export type { EditorColors, EditorSyntaxColors, diff --git a/packages/shared/src/themes/sanitizeThemeCss/css-tree-esm.d.ts b/packages/shared/src/themes/sanitizeThemeCss/css-tree-esm.d.ts deleted file mode 100644 index 16c17bf8735..00000000000 --- a/packages/shared/src/themes/sanitizeThemeCss/css-tree-esm.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module "css-tree/dist/csstree.esm" { - export * from "css-tree"; -} diff --git a/packages/shared/src/themes/sanitizeThemeCss/index.ts b/packages/shared/src/themes/sanitizeThemeCss/index.ts deleted file mode 100644 index f7a03257cb3..00000000000 --- a/packages/shared/src/themes/sanitizeThemeCss/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { MAX_THEME_CSS_LENGTH, sanitizeThemeCss } from "./sanitizeThemeCss";