@tscircuit/cli 0.0.66 → 0.0.68

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.
@@ -5,6 +5,7 @@ import { AxiosInstance } from "axios"
5
5
  import { ExportRequest } from "@server/lib/zod/export_request"
6
6
  import { exportPnpCsvToBuffer } from "lib/export-fns/export-pnp-csv"
7
7
  import { exportBomCsvToBuffer } from "lib/export-fns/export-bom-csv"
8
+ import { soupify } from "lib/soupify"
8
9
 
9
10
  export const uploadBufferToExportFile = async ({
10
11
  dev_server_axios,
@@ -59,6 +60,17 @@ export const fulfillExportRequests = async (
59
60
 
60
61
  if (export_request.export_parameters.should_export_gerber_zip) {
61
62
  console.log(kleur.gray(`\n exporting gerbers...`))
63
+ if (typeof Bun !== "undefined") {
64
+ const err_str =
65
+ "Bun currently isn't capable of exporting due to an archiver bug, exports will not work."
66
+ console.log(kleur.red(err_str))
67
+ await dev_server_axios.post("/api/export_requests/update", {
68
+ export_request_id: export_request.export_request_id,
69
+ has_error: true,
70
+ error: err_str,
71
+ })
72
+ return
73
+ }
62
74
  const zip_buffer = await exportGerbersToZipBuffer(
63
75
  {
64
76
  example_file_path: export_request.example_file_path,
@@ -116,5 +128,23 @@ export const fulfillExportRequests = async (
116
128
  export_request_id: export_request.export_request_id,
117
129
  })
118
130
  }
131
+
132
+ if (export_request.export_parameters.should_export_soup_json) {
133
+ console.log(kleur.gray(`\n exporting soup...`))
134
+ const soup = await soupify(
135
+ {
136
+ filePath: export_request.example_file_path,
137
+ exportName: export_request.export_name,
138
+ },
139
+ ctx
140
+ )
141
+
142
+ await uploadBufferToExportFile({
143
+ dev_server_axios,
144
+ file_buffer: Buffer.from(JSON.stringify(soup, null, 2), "utf-8"),
145
+ file_name: export_request.export_parameters.soup_json_file_name!,
146
+ export_request_id: export_request.export_request_id,
147
+ })
148
+ }
119
149
  }
120
150
  }
@@ -13,6 +13,7 @@ import { createOrModifyNpmrc } from "../init/create-or-modify-npmrc"
13
13
  import { checkIfInitialized } from "./check-if-initialized"
14
14
  import { initCmd } from "../init"
15
15
  import { startExportRequestWatcher } from "./start-export-request-watcher"
16
+ import $ from "dax-sh"
16
17
 
17
18
  export const devCmd = async (ctx: AppContext, args: any) => {
18
19
  const params = z
@@ -88,6 +89,10 @@ export const devCmd = async (ctx: AppContext, args: any) => {
88
89
  title: "Open in Browser",
89
90
  value: "open-in-browser",
90
91
  },
92
+ {
93
+ title: "Open Directory in VS Code",
94
+ value: "open-in-vs-code",
95
+ },
91
96
  {
92
97
  title: "Stop Server",
93
98
  value: "stop",
@@ -96,6 +101,8 @@ export const devCmd = async (ctx: AppContext, args: any) => {
96
101
  })
97
102
  if (action === "open-in-browser") {
98
103
  open(serverUrl)
104
+ } else if (action === "open-in-vs-code") {
105
+ await $`code ${cwd}`
99
106
  } else if (!action || action === "stop") {
100
107
  if (server.stop) server.stop()
101
108
  if (server.close) server.close()
@@ -11,17 +11,6 @@ export const startExportRequestWatcher = async (
11
11
  },
12
12
  ctx: AppContext
13
13
  ) => {
14
- if (typeof Bun !== "undefined") {
15
- console.log(
16
- kleur.yellow(
17
- "Bun currently isn't capable of exporting due to an archiver bug, exports will not work."
18
- )
19
- )
20
- return {
21
- stop: () => {},
22
- }
23
- }
24
-
25
14
  let running = true
26
15
 
27
16
  ;(async () => {
package/lib/soupify.ts CHANGED
@@ -80,8 +80,8 @@ console.log(JSON.stringify(elements))
80
80
 
81
81
  debug(`starting process....`)
82
82
  const processResult = await processCmdPart1
83
- .stdout("inheritPiped")
84
- .stderr("inheritPiped")
83
+ .stdout(debug.enabled ? "inheritPiped" : "piped")
84
+ .stderr(debug.enabled ? "inheritPiped" : "piped")
85
85
  .noThrow()
86
86
 
87
87
  const rawSoup = processResult.stdout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",