From 9edb23cdd109924cbb374bcc0680ad19ca0e9fbf Mon Sep 17 00:00:00 2001 From: Sprite Day Date: Mon, 9 Jun 2025 10:07:58 +0700 Subject: [PATCH 1/3] fix(scripts): replace deletion commands with os-agnostic rimraf --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cab67e3..80f7131 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ "changeset:status": "pnpm exec changeset status", "changeset:version": "pnpm exec changeset version", "clean": "pnpm \"/^clean:.*/\"", - "clean:dist": "rm -rf dist", - "clean:generated": "rm -rf generated", - "clean:node": "rm -rf node_modules", + "clean:dist": "npx rimraf dist", + "clean:generated": "npx rimraf generated", + "clean:node": "npx rimraf node_modules", "format": "npx @biomejs/biome format --write --changed ./src", "format:check": "pnpm exec biome format ./src", "format:unsafe": "pnpm exec biome check --write --unsafe ./src", From 556fe886f057ab64ad9c45ea92dc3255ff966d6d Mon Sep 17 00:00:00 2001 From: Sprite Day Date: Mon, 9 Jun 2025 10:08:20 +0700 Subject: [PATCH 2/3] fix(scripts): replace copy commands with os-agnostic cpy-cli --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 80f7131..77a7a50 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "main": "dist/cli.js", "types": "./dist/cli.d.ts", "scripts": { - "build": "pnpm clean:dist && pnpm transpile && pnpm bundle && cp -r ./src/templates ./dist", + "build": "pnpm clean:dist && pnpm transpile && pnpm bundle && npx cpy-cli ./src/templates ./dist", "build:ci": "pnpm run build", "bundle": "ts-node -r dotenv/config bundle.ts", "changeset:add": "pnpm exec changeset", From 1a589c287b90ec8e24a374f5a8f7ba9bfc28e1d4 Mon Sep 17 00:00:00 2001 From: Sprite Day Date: Mon, 9 Jun 2025 10:39:12 +0700 Subject: [PATCH 3/3] fix(utils): make path handling os-agnostic in json.ts --- src/utils/json.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/json.ts b/src/utils/json.ts index ffa8fff..55c1ae9 100644 --- a/src/utils/json.ts +++ b/src/utils/json.ts @@ -4,12 +4,12 @@ import { readFileSync } from 'node:fs'; import path from 'node:path'; // The build distribution target directory -const BUILD_DIST_PATHNAME = '/dist'; +const BUILD_DIST_PATHNAME = path.join(path.sep, 'dist'); // Fallback path is the `src` used in tests -const TEST_SRC_PATHNAME = '/src'; +const TEST_SRC_PATHNAME = path.join(path.sep, 'src'); -const leadingSlash = (str: string) => (str.startsWith('/') ? str : `/${str}`); +const leadingSlash = (str: string) => (str.startsWith(path.sep) ? str : `${path.sep}${str}`); const resolvePath = (filename: string) => { /* eslint-disable no-process-env */