Skip to content

Commit 7929cef

Browse files
committed
chore: release v0.0.9
1 parent e2ffea0 commit 7929cef

File tree

4 files changed

+45
-7
lines changed

4 files changed

+45
-7
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { BuildConfig } from "bun";
22
import dts from "bun-plugin-dts";
3+
import transformImportsInCorePlugins from "./plugins/transform-imports-in-corePlugins";
34

45
const defaultBuildConfig: BuildConfig = {
56
entrypoints: ["./src/index.ts"],
@@ -9,19 +10,18 @@ const defaultBuildConfig: BuildConfig = {
910
await Promise.all([
1011
Bun.build({
1112
...defaultBuildConfig,
12-
plugins: [dts()],
13+
plugins: [dts(), transformImportsInCorePlugins()],
1314
format: "esm",
14-
target: "browser",
15+
target: "node",
1516
naming: "[dir]/[name].js",
1617
external: ["tailwindcss"],
17-
minify: true,
1818
}),
1919
Bun.build({
2020
...defaultBuildConfig,
21+
plugins: [transformImportsInCorePlugins()],
2122
format: "cjs",
2223
target: "node",
2324
naming: "[dir]/[name].cjs",
2425
external: ["tailwindcss"],
25-
minify: true,
2626
}),
2727
]);

packages/tailwindcss-utopia/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tailwindcss-utopia",
33
"type": "module",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
77
"types": "./dist/index.d.ts",
@@ -13,7 +13,7 @@
1313
},
1414
"scripts": {
1515
"build": "bun run build.ts",
16-
"prepublishOnly": "bun run build"
16+
"prepublishOnly": "bun run build && bunx @biome/biome lint --only=correctness/noUnusedImports --write dist/index.js"
1717
},
1818
"files": [
1919
"dist"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { BunPlugin } from "bun";
2+
3+
export default function () {
4+
return {
5+
name: "transform-imports-in-corePlugins",
6+
setup(build) {
7+
// Define the modules to stub out
8+
const nodeBuiltins = new Set(["fs", "url", "path", "util"]);
9+
10+
// Add a resolver that intercepts imports
11+
build.onResolve({ filter: /.*/ }, (args) => {
12+
const { path: id, importer: parentId } = args;
13+
14+
// Check if the import is from relevant files
15+
if (
16+
(parentId?.includes("/postcss/") ||
17+
parentId?.endsWith("/src/corePlugins.js") ||
18+
parentId?.includes("/postcss-selector-parser/") ||
19+
parentId?.includes("/util-deprecate/")) &&
20+
(nodeBuiltins.has(id) || id.includes("/util-deprecate/"))
21+
) {
22+
return {
23+
path: "corePlugins:noop",
24+
namespace: "noop-module",
25+
};
26+
}
27+
});
28+
29+
// Provide the content for stubbed modules
30+
build.onLoad({ filter: /.*/, namespace: "noop-module" }, () => {
31+
return {
32+
contents: "export default function() {}",
33+
loader: "js",
34+
};
35+
});
36+
},
37+
} satisfies BunPlugin;
38+
}

packages/utopia-tailwind-merge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "utopia-tailwind-merge",
33
"type": "module",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
77
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)