Skip to content

Commit

Permalink
build: use Bun shell (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym authored Oct 24, 2024
1 parent 8fd94c9 commit cbcb4e1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import buildInfo from "@carbon/pictograms/metadata.json" assert { type: "json" };
import fsp from "fs/promises";
import { $ } from "bun";
import { ComponentParser } from "sveld";
import type { ParsedExports } from "sveld/lib/parse-exports";
import writeTsDefinitions from "sveld/lib/writer/writer-ts-definitions";
Expand All @@ -8,8 +8,8 @@ import { template } from "./template";

export const buildPictograms = async () => {
console.time("Built in");
await fsp.rm("lib", { recursive: true, force: true });
await fsp.mkdir("lib");
await $`rm -rf lib`;
await $`mkdir lib`;

const parser = new ComponentParser();
const components = new Map();
Expand Down Expand Up @@ -42,7 +42,7 @@ export const buildPictograms = async () => {
default: false,
};

await fsp.writeFile(`lib/${moduleName}.svelte`, source);
await Bun.write(`lib/${moduleName}.svelte`, source);
});

const metadata = `${pictograms.length} pictograms from @carbon/pictograms@${devDependencies["@carbon/pictograms"]}`;
Expand All @@ -54,8 +54,8 @@ export const buildPictograms = async () => {
outDir: "lib",
});

await fsp.writeFile("lib/index.js", imports);
await fsp.writeFile(
await Bun.write("lib/index.js", imports);
await Bun.write(
"PICTOGRAM_INDEX.md",
`
# Pictogram Index
Expand Down

0 comments on commit cbcb4e1

Please sign in to comment.