@tscircuit/fake-snippets 0.0.114 → 0.0.116

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.
@@ -0,0 +1,58 @@
1
+ # =============================================================================
2
+ # Do not change anything in this file.
3
+ # This workflow automatically updates @tscircuit packages when triggered by
4
+ # the source repository's trigger-dependent-repo-update.yml workflow.
5
+ # =============================================================================
6
+
7
+ name: Update @tscircuit Package
8
+
9
+ on:
10
+ workflow_dispatch:
11
+ inputs:
12
+ package_names:
13
+ description: 'Package names to update (comma-separated, e.g., @tscircuit/core,@tscircuit/props)'
14
+ required: true
15
+ type: string
16
+ default: '@tscircuit/eval'
17
+
18
+ env:
19
+ PACKAGE_NAMES: ${{ inputs.package_names }}
20
+
21
+ jobs:
22
+ update-package:
23
+ runs-on: ubuntu-latest
24
+
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ with:
28
+ token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
29
+ - uses: oven-sh/setup-bun@v2
30
+ - name: Update packages
31
+ run: |
32
+ IFS=',' read -ra PACKAGES <<< "${{ env.PACKAGE_NAMES }}"
33
+ for package in "${PACKAGES[@]}"; do
34
+ if [[ -n "$package" ]]; then
35
+ bun update --latest "$package"
36
+ fi
37
+ done
38
+ - name: Close existing PRs
39
+ run: |
40
+ gh pr list --repo ${{ github.repository }} --state open --author "tscircuitbot" --json number,title --jq '.[] | select(.title | startswith("chore:")) | .number' | xargs -I{} gh pr close {} --comment "Closing in favor of a new update PR"
41
+ - name: Create Pull Request
42
+ id: create-pr
43
+ uses: peter-evans/create-pull-request@v5
44
+ with:
45
+ commit-message: "chore: update packages ${{ env.PACKAGE_NAMES }}"
46
+ title: "chore: update packages ${{ env.PACKAGE_NAMES }}"
47
+ body: "Automated package update"
48
+ branch: update-packages-${{ github.run_number }}
49
+ base: main
50
+ token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
51
+ committer: tscircuitbot <githubbot@tscircuit.com>
52
+ author: tscircuitbot <githubbot@tscircuit.com>
53
+ - name: Enable auto-merge with CI checks
54
+ if: steps.create-pr.outputs.pull-request-number != ''
55
+ run: |
56
+ gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} --auto --squash --delete-branch
57
+ env:
58
+ GH_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
@@ -35,20 +35,33 @@ test("create package with private flag", async () => {
35
35
  })
36
36
 
37
37
  test("create package under org", async () => {
38
- const { jane_axios } = await getTestServer()
39
-
40
- const orgResponse = await jane_axios.post("/api/orgs/create", {
41
- name: "testorg",
42
- })
43
- expect(orgResponse.status).toBe(200)
44
- const orgId = orgResponse.data.org.org_id
38
+ const { jane_axios, seed } = await getTestServer()
45
39
 
46
40
  const response = await jane_axios.post("/api/packages/create", {
47
- name: "testorg/TestPackage",
41
+ is_private: true,
42
+ org_id: seed.organization.org_id,
48
43
  description: "Test Description",
49
44
  })
50
45
 
51
46
  expect(response.status).toBe(200)
52
- expect(response.data.package.owner_org_id).toBe(orgId)
53
- expect(response.data.package.owner_github_username).toBe("testorg")
47
+ expect(response.data.package.owner_org_id).toBe(seed.organization.org_id)
48
+ expect(response.data.package.owner_github_username).toBe("jane")
49
+ expect(response.data.package.is_private).toBe(true)
50
+ expect(response.data.package.description).toBe("Test Description")
51
+ })
52
+
53
+ test("create package under non-existent org", async () => {
54
+ const { jane_axios, seed } = await getTestServer()
55
+
56
+ const response = await jane_axios.post(
57
+ "/api/packages/create",
58
+ {
59
+ org_id: "not-existent-org-id",
60
+ },
61
+ {
62
+ validateStatus: () => true,
63
+ },
64
+ )
65
+ expect(response.status).toBe(404)
66
+ expect(response.data.error.error_code).toBe("org_not_found")
54
67
  })
package/bun.lock CHANGED
@@ -51,7 +51,7 @@
51
51
  "@tscircuit/3d-viewer": "^0.0.407",
52
52
  "@tscircuit/assembly-viewer": "^0.0.5",
53
53
  "@tscircuit/create-snippet-url": "^0.0.8",
54
- "@tscircuit/eval": "^0.0.325",
54
+ "@tscircuit/eval": "^0.0.406",
55
55
  "@tscircuit/layout": "^0.0.29",
56
56
  "@tscircuit/mm": "^0.0.8",
57
57
  "@tscircuit/pcb-viewer": "^1.11.218",
@@ -765,7 +765,7 @@
765
765
 
766
766
  "@tscircuit/create-snippet-url": ["@tscircuit/create-snippet-url@0.0.8", "", { "dependencies": { "fflate": "^0.8.2" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-VMixgwQRsOXlQGwVh2RZIFLLtsn8YWl2Bht61T26MHNM71A1Wzo5qGZtqcdbVkFnvlA42KmdVVjvxYDvEyWdJw=="],
767
767
 
768
- "@tscircuit/eval": ["@tscircuit/eval@0.0.325", "", { "peerDependencies": { "@tscircuit/core": "*", "circuit-json": "*", "typescript": "^5.0.0", "zod": "3" } }, "sha512-zW/zEDJR2yYP+woObt0zXpt5Y3iiX4cO577UW4mO7Ut/bw3EHXlh82T9IME+kYkbvvr6WPVt9T+6XDlrRIvRvA=="],
768
+ "@tscircuit/eval": ["@tscircuit/eval@0.0.406", "", { "peerDependencies": { "@tscircuit/core": "*", "circuit-json": "*", "typescript": "^5.0.0", "zod": "3" } }, "sha512-uiR5FRvmnk2/EiMhMB+ssT96JQoZoJq/w5xdlaBRKPkfaksK03TUbbe/ofcGmwxRrqDj+isTKhOLqRxjrcCysQ=="],
769
769
 
770
770
  "@tscircuit/featured-snippets": ["@tscircuit/featured-snippets@0.0.1", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-SNUbCQmyaAaWq7DqqDbYlZkYttbfaObtp5rOheZvlJ2TGYvooECFpB8SzNo06bqKGoIwNjgaAGUTB2DcxdX7ow=="],
771
771
 
@@ -2507,6 +2507,8 @@
2507
2507
 
2508
2508
  "tscircuit/@tscircuit/circuit-json-util": ["@tscircuit/circuit-json-util@0.0.67", "", { "dependencies": { "parsel-js": "^1.1.2" }, "peerDependencies": { "circuit-json": "*", "transformation-matrix": "*", "zod": "3" } }, "sha512-ErTCyrW/zOBq+Ulqan8weUNNgcJNpelJ7gIq2G3OZGcI3xUrZBB+BE7oZeritvDtG1ofKrVMgvHTnENdxXjIug=="],
2509
2509
 
2510
+ "tscircuit/@tscircuit/eval": ["@tscircuit/eval@0.0.325", "", { "peerDependencies": { "@tscircuit/core": "*", "circuit-json": "*", "typescript": "^5.0.0", "zod": "3" } }, "sha512-zW/zEDJR2yYP+woObt0zXpt5Y3iiX4cO577UW4mO7Ut/bw3EHXlh82T9IME+kYkbvvr6WPVt9T+6XDlrRIvRvA=="],
2511
+
2510
2512
  "tscircuit/@tscircuit/footprinter": ["@tscircuit/footprinter@0.0.236", "", { "dependencies": { "@tscircuit/mm": "^0.0.8", "zod": "^3.23.8" }, "peerDependencies": { "circuit-json": "*" } }, "sha512-SE03ZCNp9FxzSa3LdbQOMBHjT16Q86ZwN6iLu+RPsAbFrdE1RwtM7dv5lOb6lkh78mL3e7yyuyay+QrERiLcYQ=="],
2511
2513
 
2512
2514
  "tscircuit/@tscircuit/runframe": ["@tscircuit/runframe@0.0.945", "", {}, "sha512-mDLiR7belMSVbo2pbCrNX9xXtsK58HbjQCc1D+TSK55DeKRyxU3adJEEFobRz6y8MJ9twTcfeoXLWalelyZZZA=="],