@tscircuit/cli 0.0.84 → 0.0.86

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/bun.lockb CHANGED
Binary file
@@ -15,6 +15,17 @@ export default withEdgeSpec({
15
15
  completed_edit_events: z.array(z.any()).nullable().default(null),
16
16
  is_loading: z.boolean(),
17
17
  error: z.string().nullable().optional().default(null),
18
+ soup_last_updated_at: z.string().datetime().nullable().default(null),
19
+ edit_events_last_updated_at: z
20
+ .string()
21
+ .datetime()
22
+ .nullable()
23
+ .default(null),
24
+ edit_events_last_applied_at: z
25
+ .string()
26
+ .datetime()
27
+ .nullable()
28
+ .default(null),
18
29
  last_updated_at: z.string().datetime(),
19
30
  }),
20
31
  }),
@@ -11,6 +11,12 @@ export default withEdgeSpec({
11
11
  file_path: z.string(),
12
12
  export_name: z.string(),
13
13
  is_loading: z.coerce.boolean(),
14
+ edit_events_last_updated_at: z
15
+ .string()
16
+ .datetime()
17
+ .nullable()
18
+ .default(null),
19
+ soup_last_updated_at: z.string().datetime().nullable().default(null),
14
20
  last_updated_at: z.string().datetime(),
15
21
  })
16
22
  ),
@@ -24,6 +30,7 @@ export default withEdgeSpec({
24
30
  "file_path",
25
31
  "export_name",
26
32
  "last_updated_at",
33
+ "edit_events_last_updated_at",
27
34
  "soup_last_updated_at",
28
35
  sql`(is_loading = 1)`.$castTo<boolean>().as("is_loading"),
29
36
  ])
@@ -8,6 +8,7 @@ export default withEdgeSpec({
8
8
  dev_package_example_id: z.coerce.number(),
9
9
  tscircuit_soup: z.any().optional(),
10
10
  completed_edit_events: z.array(z.any()).optional(),
11
+ edit_events_last_applied_at: z.string().datetime().optional(),
11
12
  error: z.string().nullable().optional().default(null),
12
13
  }),
13
14
  jsonResponse: z.object({
@@ -36,9 +37,17 @@ export default withEdgeSpec({
36
37
  q.set("error", req.jsonBody.error)
37
38
  )
38
39
  .$if(req.jsonBody.completed_edit_events !== undefined, (q) =>
40
+ q
41
+ .set(
42
+ "completed_edit_events",
43
+ JSON.stringify(req.jsonBody.completed_edit_events)
44
+ )
45
+ .set("edit_events_last_updated_at", new Date().toISOString())
46
+ )
47
+ .$if(req.jsonBody.edit_events_last_applied_at !== undefined, (q) =>
39
48
  q.set(
40
- "completed_edit_events",
41
- JSON.stringify(req.jsonBody.completed_edit_events)
49
+ "edit_events_last_applied_at",
50
+ req.jsonBody.edit_events_last_applied_at!
42
51
  )
43
52
  )
44
53
  .returningAll()
@@ -14,6 +14,8 @@ export const createSchema = async (db: DbClient) => {
14
14
  .addColumn("error", "text")
15
15
  .addColumn("is_loading", "boolean", (cb) => cb.defaultTo(0).notNull())
16
16
  .addColumn("soup_last_updated_at", "text")
17
+ .addColumn("edit_events_last_updated_at", "text")
18
+ .addColumn("edit_events_last_applied_at", "text")
17
19
  .addColumn("last_updated_at", "text")
18
20
  .execute()
19
21
 
@@ -13,6 +13,8 @@ export interface DevPackageExample {
13
13
  is_loading: 1 | 0
14
14
  last_updated_at: string
15
15
  soup_last_updated_at: string
16
+ edit_events_last_updated_at: string
17
+ edit_events_last_applied_at: string
16
18
  }
17
19
 
18
20
  export interface ExportRequest {
@@ -91,6 +93,8 @@ export const getDb = async (): Promise<Kysely<KyselyDatabaseSchema>> => {
91
93
  dialect,
92
94
  })
93
95
 
96
+ await sql`pragma busy_timeout = 5000`.execute(db)
97
+
94
98
  const schemaExistsResult = await sql`
95
99
  SELECT name
96
100
  FROM sqlite_master
Binary file
@@ -30,8 +30,8 @@
30
30
  "@radix-ui/react-toggle": "^1.0.3",
31
31
  "@radix-ui/react-toggle-group": "^1.0.4",
32
32
  "@radix-ui/react-tooltip": "^1.0.7",
33
- "@tscircuit/builder": "^1.5.86",
34
- "@tscircuit/pcb-viewer": "^1.3.7",
33
+ "@tscircuit/builder": "^1.5.87",
34
+ "@tscircuit/pcb-viewer": "1.3.8",
35
35
  "@tscircuit/schematic-viewer": "^1.2.3",
36
36
  "@tscircuit/table-viewer": "0.0.8",
37
37
  "axios": "^1.6.7",
@@ -7,7 +7,7 @@ import { cn } from "./lib/utils"
7
7
  import { ErrorBoundary } from "react-error-boundary"
8
8
  import { SoupTableViewer } from "@tscircuit/table-viewer"
9
9
  import "react-data-grid/lib/styles.css"
10
- import { useRef, useState } from "react"
10
+ import { useEffect, useRef, useState } from "react"
11
11
  import type { EditEvent } from "@tscircuit/pcb-viewer"
12
12
 
13
13
  export const ExampleContentView = () => {
@@ -42,7 +42,12 @@ export const ExampleContentView = () => {
42
42
 
43
43
  const viewMode = useGlobalStore((s) => s.view_mode)
44
44
  const splitMode = useGlobalStore((s) => s.split_mode)
45
- const [editEvents, setEditEvents] = useState<EditEvent[]>([])
45
+ // eslint-disable-next-line prefer-const
46
+ let [editEvents, setEditEvents] = useState<EditEvent[]>([])
47
+
48
+ editEvents = editEvents.filter(
49
+ (ee) => ee.created_at > new Date(pkg?.edit_events_last_applied_at).valueOf()
50
+ )
46
51
 
47
52
  const editorHeight = window.innerHeight - 52
48
53
  const halfHeight = Math.floor(editorHeight / 2)