Skip to content

Commit

Permalink
build: use Bun shell
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Oct 22, 2024
1 parent 8fd94c9 commit 5ac5409
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 5ac5409

Please sign in to comment.