@tscircuit/fake-snippets 0.0.75 → 0.0.76

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.
@@ -2,6 +2,11 @@ import * as ZT from "fake-snippets-api/lib/db/schema"
2
2
 
3
3
  export const publicMapPackageRelease = (
4
4
  internal_package_release: ZT.PackageRelease,
5
+ options: {
6
+ include_logs?: boolean
7
+ } = {
8
+ include_logs: false,
9
+ },
5
10
  ): ZT.PackageRelease => {
6
11
  return {
7
12
  ...internal_package_release,
@@ -9,5 +14,11 @@ export const publicMapPackageRelease = (
9
14
  circuit_json_build_error_last_updated_at:
10
15
  internal_package_release.circuit_json_build_error_last_updated_at,
11
16
  circuit_json_build_error: internal_package_release.circuit_json_build_error,
17
+ transpilation_logs: options.include_logs
18
+ ? internal_package_release.transpilation_logs
19
+ : [],
20
+ circuit_json_build_logs: options.include_logs
21
+ ? internal_package_release.circuit_json_build_logs
22
+ : [],
12
23
  }
13
24
  }
@@ -6,6 +6,9 @@ import { z } from "zod"
6
6
  export default withRouteSpec({
7
7
  methods: ["POST"],
8
8
  auth: "none",
9
+ commonParams: z.object({
10
+ include_logs: z.boolean().optional().default(false),
11
+ }),
9
12
  jsonBody: z.object({
10
13
  package_release_id: z.string().optional(),
11
14
  package_name_with_version: z.string().optional(),
@@ -115,6 +118,8 @@ export default withRouteSpec({
115
118
 
116
119
  return ctx.json({
117
120
  ok: true,
118
- package_release: publicMapPackageRelease(foundRelease),
121
+ package_release: publicMapPackageRelease(foundRelease, {
122
+ include_logs: req.commonParams?.include_logs,
123
+ }),
119
124
  })
120
125
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/fake-snippets",
3
- "version": "0.0.75",
3
+ "version": "0.0.76",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,7 +70,6 @@
70
70
  "@radix-ui/react-toggle": "^1.1.0",
71
71
  "@radix-ui/react-toggle-group": "^1.1.0",
72
72
  "@radix-ui/react-tooltip": "^1.1.2",
73
- "@tscircuit/eval": "^0.0.198",
74
73
  "@tscircuit/footprinter": "^0.0.169",
75
74
  "@tscircuit/layout": "^0.0.29",
76
75
  "@tscircuit/math-utils": "^0.0.10",
@@ -1,10 +0,0 @@
1
- import type { AnyCircuitElement } from "circuit-json"
2
- import { runTscircuitCode } from "@tscircuit/eval"
3
-
4
- export const generateCircuitJson = async ({
5
- code,
6
- }: {
7
- code: string
8
- }): Promise<AnyCircuitElement[]> => {
9
- return (await runTscircuitCode(code)) as any
10
- }