@tscircuit/cli 0.1.502 → 0.1.503

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 +36 -1
  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.501";
72390
+ var version = "0.1.502";
72391
72391
  var package_default = {
72392
72392
  name: "@tscircuit/cli",
72393
72393
  version,
@@ -197551,6 +197551,40 @@ var registerInstall = (program3) => {
197551
197551
  });
197552
197552
  };
197553
197553
 
197554
+ // cli/transpile/register.ts
197555
+ import path42 from "node:path";
197556
+ var registerTranspile = (program3) => {
197557
+ program3.command("transpile").description("Transpile TypeScript/TSX to JavaScript (ESM, CommonJS, and type declarations)").argument("[file]", "Path to the entry file").action(async (file) => {
197558
+ try {
197559
+ const { projectDir, circuitFiles, mainEntrypoint } = await getBuildEntrypoints({
197560
+ fileOrDir: file
197561
+ });
197562
+ const distDir = path42.join(projectDir, "dist");
197563
+ console.log("Transpiling entry file...");
197564
+ const entryFile = mainEntrypoint || circuitFiles[0];
197565
+ if (!entryFile) {
197566
+ console.error("No entry file found for transpilation");
197567
+ process.exit(1);
197568
+ }
197569
+ const transpileSuccess = await transpileFile({
197570
+ input: entryFile,
197571
+ outputDir: distDir,
197572
+ projectDir
197573
+ });
197574
+ if (!transpileSuccess) {
197575
+ console.error("Transpilation failed");
197576
+ process.exit(1);
197577
+ }
197578
+ console.log("Transpile complete!");
197579
+ process.exit(0);
197580
+ } catch (error) {
197581
+ const message = error instanceof Error ? error.message : String(error);
197582
+ console.error(message);
197583
+ process.exit(1);
197584
+ }
197585
+ });
197586
+ };
197587
+
197554
197588
  // cli/main.ts
197555
197589
  var program2 = new Command;
197556
197590
  program2.name("tsci").description("CLI for developing tscircuit packages");
@@ -197569,6 +197603,7 @@ registerConfigPrint(program2);
197569
197603
  registerConfigSet(program2);
197570
197604
  registerExport(program2);
197571
197605
  registerBuild(program2);
197606
+ registerTranspile(program2);
197572
197607
  registerAdd(program2);
197573
197608
  registerRemove(program2);
197574
197609
  registerSnapshot(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.502",
3
+ "version": "0.1.503",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",