[ISSUE-3145] Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname (#3237)

* [ISSUE-3145] Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname

* Add changeset file
This commit is contained in:
David Nanyan authored and GitHub committed 2025-05-01 14:42:35 -07:00
1 parent bdfda6f908
commit 70cc437d71
2 files changed
+8 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---
Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname
+3 -1
View File
@@ -2,6 +2,7 @@
import * as fs from "fs/promises"
import * as path from "path"
import { fileURLToPath } from "url"
import { execSync } from "child_process"
import { globby } from "globby"
import chalk from "chalk"
@@ -12,7 +13,8 @@ const protoc = path.join(require.resolve("grpc-tools"), "../bin/protoc")
const tsProtoPlugin = require.resolve("ts-proto/protoc-gen-ts_proto")
// Get script directory and root directory
const SCRIPT_DIR = path.dirname(new URL(import.meta.url).pathname)
const __filename = fileURLToPath(import.meta.url)
const SCRIPT_DIR = path.dirname(__filename)
const ROOT_DIR = path.resolve(SCRIPT_DIR, "..")
async function main() {