@tscircuit/cli 0.1.752 → 0.1.754

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +15 -3
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -74126,7 +74126,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74126
74126
  import { execSync as execSync2 } from "node:child_process";
74127
74127
  var import_semver2 = __toESM2(require_semver2(), 1);
74128
74128
  // package.json
74129
- var version = "0.1.751";
74129
+ var version = "0.1.753";
74130
74130
  var package_default = {
74131
74131
  name: "@tscircuit/cli",
74132
74132
  version,
@@ -80290,7 +80290,7 @@ var registerClone = (program3) => {
80290
80290
  }
80291
80291
  fs25.mkdirSync(dirPath, { recursive: true });
80292
80292
  for (const fileInfo of packageFileList.package_files) {
80293
- const filePath = fileInfo.file_path.replace(/^\/|dist\//g, "");
80293
+ const filePath = fileInfo.file_path.replace(/^\/+/, "");
80294
80294
  if (!filePath)
80295
80295
  continue;
80296
80296
  const fullPath = path27.join(dirPath, filePath);
@@ -80303,7 +80303,19 @@ var registerClone = (program3) => {
80303
80303
  file_path: fileInfo.file_path
80304
80304
  }
80305
80305
  }).json();
80306
- fs25.writeFileSync(fullPath, fileContent.package_file.content_text);
80306
+ const { is_text: isText, content_text: contentText } = fileContent.package_file;
80307
+ if (isText && typeof contentText === "string") {
80308
+ fs25.writeFileSync(fullPath, contentText);
80309
+ } else if (!isText) {
80310
+ const fileBuffer = await ky2.get("package_files/download", {
80311
+ searchParams: {
80312
+ package_file_id: fileContent.package_file.package_file_id
80313
+ }
80314
+ }).arrayBuffer();
80315
+ fs25.writeFileSync(fullPath, Buffer.from(fileBuffer));
80316
+ } else {
80317
+ console.warn(`Skipping ${filePath} due to empty content.`);
80318
+ }
80307
80319
  } catch (error) {
80308
80320
  console.warn(`Skipping ${filePath} due to error:`, error instanceof Error ? error.message : error);
80309
80321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.752",
3
+ "version": "0.1.754",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",