@tscircuit/cli 0.0.226 → 0.0.228
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.
- package/.github/workflows/windows-tests.yml +32 -0
- package/api/db/generic-json-level.ts +1 -1
- package/api/db/get-db.ts +1 -1
- package/bun.lockb +0 -0
- package/cli/lib/cmd-fns/dev/check-if-initialized.ts +1 -1
- package/cli/lib/cmd-fns/dev/index.ts +1 -1
- package/cli/lib/cmd-fns/dev/soupify-and-upload-example-file.ts +1 -1
- package/cli/lib/cmd-fns/dev/start-edit-event-watcher.ts +1 -1
- package/cli/lib/cmd-fns/dev/upload-examples-from-directory.ts +1 -1
- package/cli/lib/cmd-fns/init/create-or-modify-npmrc.ts +1 -1
- package/cli/lib/cmd-fns/init/index.ts +1 -1
- package/cli/lib/cmd-fns/open.ts +1 -1
- package/cli/lib/cmd-fns/publish/index.ts +1 -1
- package/cli/lib/cmd-fns/render.ts +1 -1
- package/cli/lib/cmd-fns/soupify.ts +1 -1
- package/cli/lib/export-fns/export-gerbers.ts +1 -2
- package/cli/lib/export-fns/export-pnp-csv.ts +1 -1
- package/cli/lib/soupify/get-tmp-entrpoint-filepath.ts +1 -1
- package/cli/lib/soupify/run-entrypoint-file.ts +2 -3
- package/cli/lib/soupify/soupify-with-core.ts +1 -1
- package/cli/lib/util/create-context-and-run-program.ts +5 -1
- package/cli/lib/util/lint-project.ts +1 -1
- package/cli/tests/export-gerber-keyboard.test.ts +1 -1
- package/cli/tests/export-gerber.test.ts +1 -1
- package/cli/tests/export-kicad-pcb.test.ts +1 -1
- package/dist/cli.js +25 -22
- package/package.json +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Windows Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
tests:
|
|
13
|
+
runs-on: windows-latest
|
|
14
|
+
timeout-minutes: 10
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v2
|
|
19
|
+
|
|
20
|
+
- name: Setup bun
|
|
21
|
+
uses: oven-sh/setup-bun@v1
|
|
22
|
+
with:
|
|
23
|
+
bun-version: latest
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: bun install
|
|
27
|
+
|
|
28
|
+
- name: Build
|
|
29
|
+
run: bun run build
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: bun test --timeout 15000
|
package/api/db/get-db.ts
CHANGED
package/bun.lockb
CHANGED
|
Binary file
|
|
@@ -4,7 +4,7 @@ import fs from "fs"
|
|
|
4
4
|
import kleur from "kleur"
|
|
5
5
|
import posthog from "cli/lib/posthog"
|
|
6
6
|
import open from "open"
|
|
7
|
-
import * as Path from "path"
|
|
7
|
+
import * as Path from "path/posix"
|
|
8
8
|
import prompts from "prompts"
|
|
9
9
|
import { z } from "zod"
|
|
10
10
|
import { AppContext } from "../../util/app-context"
|
|
@@ -5,7 +5,7 @@ import { AppContext } from "cli/lib/util/app-context"
|
|
|
5
5
|
import fg from "fast-glob"
|
|
6
6
|
import fs from "fs"
|
|
7
7
|
import { Project, ts } from "ts-morph"
|
|
8
|
-
import * as Path from "path"
|
|
8
|
+
import * as Path from "path/posix"
|
|
9
9
|
import { deriveSelectorFromPcbComponentId } from "./derive-selector-from-pcb-component-id"
|
|
10
10
|
import type { EditEvent } from "@tscircuit/manual-edit-events"
|
|
11
11
|
import {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
writeFile,
|
|
9
9
|
appendFileSync,
|
|
10
10
|
} from "fs"
|
|
11
|
-
import * as Path from "node:path"
|
|
11
|
+
import * as Path from "node:path/posix"
|
|
12
12
|
import $ from "dax-sh"
|
|
13
13
|
import { getGeneratedReadme } from "./get-generated-readme"
|
|
14
14
|
import { getGeneratedTsconfig } from "./get-generated-tsconfig"
|
package/cli/lib/cmd-fns/open.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs"
|
|
2
2
|
import kleur from "kleur"
|
|
3
3
|
import { AppContext } from "cli/lib/util/app-context"
|
|
4
|
-
import * as Path from "path"
|
|
4
|
+
import * as Path from "path/posix"
|
|
5
5
|
import open from "open"
|
|
6
6
|
|
|
7
7
|
export const openCmd = async (ctx: AppContext, args: any) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import kleur from "kleur"
|
|
2
2
|
import { z } from "zod"
|
|
3
3
|
import { AppContext } from "../../util/app-context"
|
|
4
|
-
import * as Path from "path"
|
|
4
|
+
import * as Path from "path/posix"
|
|
5
5
|
import * as fs from "fs/promises"
|
|
6
6
|
import { existsSync, readFileSync } from "fs"
|
|
7
7
|
import { getAllPackageFiles } from "cli/lib/util/get-all-package-files"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppContext } from "../util/app-context"
|
|
2
2
|
import { z } from "zod"
|
|
3
|
-
import * as Path from "path"
|
|
3
|
+
import * as Path from "path/posix"
|
|
4
4
|
import { unlink } from "node:fs/promises"
|
|
5
5
|
import { soupify } from "cli/lib/soupify"
|
|
6
6
|
import * as fs from "fs"
|
|
@@ -91,7 +91,6 @@ export const exportGerbersToZipBuffer = async (
|
|
|
91
91
|
) => {
|
|
92
92
|
const tempDir = Path.join(".tscircuit", "tmp-gerber-zip")
|
|
93
93
|
fs.mkdirSync(tempDir, { recursive: true })
|
|
94
|
-
|
|
95
94
|
await exportGerbersToFile(
|
|
96
95
|
{
|
|
97
96
|
example_file_path: params.example_file_path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppContext } from "../util/app-context"
|
|
2
2
|
import { z } from "zod"
|
|
3
|
-
import * as Path from "path"
|
|
3
|
+
import * as Path from "path/posix"
|
|
4
4
|
import { unlink } from "node:fs/promises"
|
|
5
5
|
import { soupify } from "cli/lib/soupify"
|
|
6
6
|
import { convertCircuitJsonToPickAndPlaceCsv } from "circuit-json-to-pnp-csv"
|
|
@@ -22,11 +22,11 @@ export const runEntrypointFile = async (
|
|
|
22
22
|
ctx.runtime === "node"
|
|
23
23
|
? $`npx tsx ${tmpEntrypointPath}`
|
|
24
24
|
: $`bun ${tmpEntrypointPath}`
|
|
25
|
-
|
|
26
25
|
debug(`starting process....`)
|
|
26
|
+
|
|
27
27
|
const processResult = await processCmdPart1
|
|
28
|
-
.stdout(debug.enabled ? "inheritPiped" : "piped")
|
|
29
28
|
.stderr(debug.enabled ? "inheritPiped" : "piped")
|
|
29
|
+
.stdout(debug.enabled ? "inheritPiped" : "piped")
|
|
30
30
|
.noThrow()
|
|
31
31
|
|
|
32
32
|
const rawSoup = await readFile(tmpOutputPath, "utf-8")
|
|
@@ -48,7 +48,6 @@ export const runEntrypointFile = async (
|
|
|
48
48
|
console.log(kleur.red(soup.COMPILE_ERROR))
|
|
49
49
|
throw new Error(soup.COMPILE_ERROR)
|
|
50
50
|
}
|
|
51
|
-
|
|
52
51
|
return soup
|
|
53
52
|
} catch (e: any) {
|
|
54
53
|
// console.log(kleur.red(`Failed to parse result of soupify: ${e.toString()}`))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppContext } from "../util/app-context"
|
|
2
2
|
import { z } from "zod"
|
|
3
3
|
import $ from "dax-sh"
|
|
4
|
-
import * as Path from "path"
|
|
4
|
+
import * as Path from "path/posix"
|
|
5
5
|
import { unlink } from "node:fs/promises"
|
|
6
6
|
import kleur from "kleur"
|
|
7
7
|
import { writeFileSync } from "fs"
|
|
@@ -104,6 +104,10 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
104
104
|
},
|
|
105
105
|
)
|
|
106
106
|
|
|
107
|
+
function isBunRuntime() {
|
|
108
|
+
return typeof process !== "undefined" && "isBun" in process
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
const ctx: AppContext = {
|
|
108
112
|
cmd: args._,
|
|
109
113
|
cwd: args.cwd ?? process.cwd(),
|
|
@@ -112,7 +116,7 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
112
116
|
axios,
|
|
113
117
|
global_config,
|
|
114
118
|
profile_config,
|
|
115
|
-
runtime: global_config.get("runtime") ?? "node",
|
|
119
|
+
runtime: isBunRuntime() ? "bun" : (global_config.get("runtime") ?? "node"),
|
|
116
120
|
args: {
|
|
117
121
|
cmd: args._,
|
|
118
122
|
yes: args.y ?? args.yes,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, expect, describe } from "bun:test"
|
|
2
2
|
import { $ } from "bun"
|
|
3
3
|
import { temporaryDirectory } from "tempy"
|
|
4
|
-
import { join } from "path"
|
|
4
|
+
import { join } from "path/posix"
|
|
5
5
|
import { existsSync } from "fs"
|
|
6
6
|
|
|
7
7
|
test("tsci export gerbers --input example-project/examples/macrokeypad.tsx", async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, expect, describe } from "bun:test"
|
|
2
2
|
import { $ } from "bun"
|
|
3
3
|
import { temporaryDirectory } from "tempy"
|
|
4
|
-
import { join } from "path"
|
|
4
|
+
import { join } from "path/posix"
|
|
5
5
|
import { existsSync, readdirSync, readFileSync } from "fs"
|
|
6
6
|
import extract from "extract-zip"
|
|
7
7
|
import pcbStackup from "pcb-stackup"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, expect, describe } from "bun:test"
|
|
2
2
|
import { $ } from "bun"
|
|
3
3
|
import { temporaryDirectory } from "tempy"
|
|
4
|
-
import { join } from "path"
|
|
4
|
+
import { join } from "path/posix"
|
|
5
5
|
import { existsSync, readFileSync } from "fs"
|
|
6
6
|
|
|
7
7
|
test("tsci export kicad_pcb --input example-project/examples/macrokeypad.tsx", async () => {
|