@tscircuit/cli 0.1.578 → 0.1.579

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 +21 -7
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -72387,7 +72387,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
72387
72387
  import { execSync as execSync2 } from "node:child_process";
72388
72388
  var import_semver2 = __toESM2(require_semver2(), 1);
72389
72389
  // package.json
72390
- var version = "0.1.577";
72390
+ var version = "0.1.578";
72391
72391
  var package_default = {
72392
72392
  name: "@tscircuit/cli",
72393
72393
  version,
@@ -183305,6 +183305,9 @@ import dts from "rollup-plugin-dts";
183305
183305
  import fs37 from "node:fs";
183306
183306
  import path36 from "node:path";
183307
183307
  import { createHash } from "node:crypto";
183308
+ function normalizePathSeparators(filePath) {
183309
+ return filePath.split(path36.sep).join("/");
183310
+ }
183308
183311
  var STATIC_ASSET_EXTENSIONS = new Set([
183309
183312
  ".glb",
183310
183313
  ".gltf",
@@ -183338,17 +183341,24 @@ var createStaticAssetPlugin = ({
183338
183341
  if (!STATIC_ASSET_EXTENSIONS.has(ext))
183339
183342
  return null;
183340
183343
  if (path36.isAbsolute(source)) {
183341
- return fs37.existsSync(source) ? { id: source, external: true } : null;
183344
+ return fs37.existsSync(source) ? { id: normalizePathSeparators(source), external: true } : null;
183342
183345
  }
183343
183346
  if (importer) {
183344
- const resolvedFromImporter = path36.resolve(path36.dirname(importer), source);
183347
+ const importerNative = importer.split("/").join(path36.sep);
183348
+ const resolvedFromImporter = path36.resolve(path36.dirname(importerNative), source);
183345
183349
  if (fs37.existsSync(resolvedFromImporter)) {
183346
- return { id: resolvedFromImporter, external: true };
183350
+ return {
183351
+ id: normalizePathSeparators(resolvedFromImporter),
183352
+ external: true
183353
+ };
183347
183354
  }
183348
183355
  }
183349
183356
  const resolvedFromProject = path36.resolve(resolvedBaseUrl, source);
183350
183357
  if (fs37.existsSync(resolvedFromProject)) {
183351
- return { id: resolvedFromProject, external: true };
183358
+ return {
183359
+ id: normalizePathSeparators(resolvedFromProject),
183360
+ external: true
183361
+ };
183352
183362
  }
183353
183363
  for (const [pattern, targets] of Object.entries(resolvedPathMappings)) {
183354
183364
  const isWildcard = pattern.endsWith("/*");
@@ -183359,7 +183369,10 @@ var createStaticAssetPlugin = ({
183359
183369
  const targetPath = isWildcard ? target.replace("*", wildcard) : target;
183360
183370
  const resolvedTarget = path36.resolve(resolvedBaseUrl, targetPath);
183361
183371
  if (fs37.existsSync(resolvedTarget)) {
183362
- return { id: resolvedTarget, external: true };
183372
+ return {
183373
+ id: normalizePathSeparators(resolvedTarget),
183374
+ external: true
183375
+ };
183363
183376
  }
183364
183377
  }
183365
183378
  }
@@ -183387,7 +183400,8 @@ var createStaticAssetPlugin = ({
183387
183400
  if (!copiedAssets.has(importedId)) {
183388
183401
  const assetDir = path36.join(outputDir, "assets");
183389
183402
  fs37.mkdirSync(assetDir, { recursive: true });
183390
- const fileBuffer = fs37.readFileSync(importedId);
183403
+ const nativePath = importedId.split("/").join(path36.sep);
183404
+ const fileBuffer = fs37.readFileSync(nativePath);
183391
183405
  const hash = createHash("sha1").update(fileBuffer).digest("hex").slice(0, 8);
183392
183406
  const fileName = `${path36.basename(importedId, ext)}-${hash}${ext}`;
183393
183407
  const outputFilePath = path36.join(assetDir, fileName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.578",
3
+ "version": "0.1.579",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",