@tscircuit/fake-snippets 0.0.153 → 0.0.154
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/dist/bundle.js +136 -1
- package/dist/index.js +135 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2508,6 +2508,141 @@ export const SquareWaveModule = () => (
|
|
|
2508
2508
|
account_id,
|
|
2509
2509
|
is_owner: true
|
|
2510
2510
|
});
|
|
2511
|
+
const testOrgPackage = db.addPackage({
|
|
2512
|
+
name: "test-organization/test-org-package",
|
|
2513
|
+
unscoped_name: "test-org-package",
|
|
2514
|
+
creator_account_id: account_id,
|
|
2515
|
+
owner_org_id: testOrg.org_id,
|
|
2516
|
+
owner_github_username: testOrg.github_handle,
|
|
2517
|
+
description: "A test package for development",
|
|
2518
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2519
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2520
|
+
is_source_from_github: false,
|
|
2521
|
+
snippet_type: "package",
|
|
2522
|
+
latest_package_release_id: null,
|
|
2523
|
+
latest_version: "0.0.1",
|
|
2524
|
+
license: "MIT",
|
|
2525
|
+
website: "https://tscircuit.com",
|
|
2526
|
+
star_count: 10,
|
|
2527
|
+
ai_description: "A comprehensive test package designed for development and testing purposes. This package includes various components and utilities commonly used in circuit design and simulation workflows.",
|
|
2528
|
+
ai_usage_instructions: "Import the package using `import { TestComponent } from '@tsci/test-organization.test-org-package'`. Use the TestComponent in your circuit designs by providing the required props. Example: `<TestComponent name='my-test' value={42} />`",
|
|
2529
|
+
default_view: "files",
|
|
2530
|
+
latest_pcb_preview_image_url: `/api/packages/images/test-organization/test-org-package/pcb.png`,
|
|
2531
|
+
latest_cad_preview_image_url: `/api/packages/images/test-organization/test-org-package/3d.png`,
|
|
2532
|
+
latest_sch_preview_image_url: `/api/packages/images/test-organization/test-org-package/schematic.png`
|
|
2533
|
+
});
|
|
2534
|
+
const { package_release_id: testOrgPackageReleaseId } = db.addPackageRelease({
|
|
2535
|
+
package_id: testOrgPackage.package_id,
|
|
2536
|
+
version: "0.0.1",
|
|
2537
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2538
|
+
is_latest: true,
|
|
2539
|
+
is_locked: false,
|
|
2540
|
+
has_transpiled: true,
|
|
2541
|
+
transpilation_error: null,
|
|
2542
|
+
pcb_preview_image_url: `/api/packages/images/test-organization/test-org-package/pcb.png`,
|
|
2543
|
+
cad_preview_image_url: `/api/packages/images/test-organization/test-org-package/3d.png`,
|
|
2544
|
+
sch_preview_image_url: `/api/packages/images/test-organization/test-org-package/schematic.png`
|
|
2545
|
+
});
|
|
2546
|
+
db.addPackageFile({
|
|
2547
|
+
package_release_id: testOrgPackageReleaseId,
|
|
2548
|
+
file_path: "index.tsx",
|
|
2549
|
+
content_text: `
|
|
2550
|
+
export const TestComponent = ({ name }: { name: string }) => (
|
|
2551
|
+
<resistor name={name} resistance="10k" />
|
|
2552
|
+
)
|
|
2553
|
+
`.trim(),
|
|
2554
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2555
|
+
});
|
|
2556
|
+
db.addPackageFile({
|
|
2557
|
+
package_release_id: testOrgPackageReleaseId,
|
|
2558
|
+
file_path: "/dist/circuit.json",
|
|
2559
|
+
content_text: `[
|
|
2560
|
+
{
|
|
2561
|
+
"type": "source_project_metadata",
|
|
2562
|
+
"source_project_metadata_id": "source_project_metadata_0",
|
|
2563
|
+
"software_used_string": "@tscircuit/core@0.0.813"
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
"type": "source_group",
|
|
2567
|
+
"source_group_id": "source_group_0",
|
|
2568
|
+
"is_subcircuit": true,
|
|
2569
|
+
"was_automatically_named": true,
|
|
2570
|
+
"subcircuit_id": "subcircuit_source_group_0"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"type": "source_board",
|
|
2574
|
+
"source_board_id": "source_board_0",
|
|
2575
|
+
"source_group_id": "source_group_0"
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
"type": "schematic_group",
|
|
2579
|
+
"schematic_group_id": "schematic_group_0",
|
|
2580
|
+
"is_subcircuit": true,
|
|
2581
|
+
"subcircuit_id": "subcircuit_source_group_0",
|
|
2582
|
+
"name": "unnamed_board1",
|
|
2583
|
+
"center": {
|
|
2584
|
+
"x": 0,
|
|
2585
|
+
"y": 0
|
|
2586
|
+
},
|
|
2587
|
+
"width": 0,
|
|
2588
|
+
"height": 0,
|
|
2589
|
+
"schematic_component_ids": [],
|
|
2590
|
+
"source_group_id": "source_group_0"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
"type": "pcb_board",
|
|
2594
|
+
"pcb_board_id": "pcb_board_0",
|
|
2595
|
+
"center": {
|
|
2596
|
+
"x": 0,
|
|
2597
|
+
"y": 0
|
|
2598
|
+
},
|
|
2599
|
+
"thickness": 1.4,
|
|
2600
|
+
"num_layers": 2,
|
|
2601
|
+
"width": 10,
|
|
2602
|
+
"height": 10,
|
|
2603
|
+
"material": "fr4"
|
|
2604
|
+
}
|
|
2605
|
+
]`.trim(),
|
|
2606
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2607
|
+
});
|
|
2608
|
+
db.addPackageBuild({
|
|
2609
|
+
package_release_id: testOrgPackageReleaseId,
|
|
2610
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2611
|
+
transpilation_in_progress: false,
|
|
2612
|
+
transpilation_started_at: new Date(Date.now() - 5e3).toISOString(),
|
|
2613
|
+
// Started 5 seconds ago
|
|
2614
|
+
transpilation_completed_at: new Date(Date.now() - 3e3).toISOString(),
|
|
2615
|
+
// Completed 3 seconds ago
|
|
2616
|
+
transpilation_logs: [
|
|
2617
|
+
"[INFO] Starting transpilation...",
|
|
2618
|
+
"[INFO] Parsing package code",
|
|
2619
|
+
"[INFO] Generating TypeScript definitions",
|
|
2620
|
+
"[INFO] Compiling to JavaScript",
|
|
2621
|
+
"[SUCCESS] Transpilation completed successfully"
|
|
2622
|
+
],
|
|
2623
|
+
transpilation_error: null,
|
|
2624
|
+
circuit_json_build_in_progress: false,
|
|
2625
|
+
circuit_json_build_started_at: new Date(Date.now() - 3e3).toISOString(),
|
|
2626
|
+
// Started after transpilation
|
|
2627
|
+
circuit_json_build_completed_at: new Date(Date.now() - 1e3).toISOString(),
|
|
2628
|
+
// Completed 1 second ago
|
|
2629
|
+
circuit_json_build_logs: [
|
|
2630
|
+
"[INFO] Starting circuit JSON build...",
|
|
2631
|
+
"[INFO] Analyzing component structure",
|
|
2632
|
+
"[INFO] Generating port configurations",
|
|
2633
|
+
"[INFO] Validating circuit connections",
|
|
2634
|
+
"[SUCCESS] Circuit JSON build completed"
|
|
2635
|
+
],
|
|
2636
|
+
circuit_json_build_error: null,
|
|
2637
|
+
build_in_progress: false,
|
|
2638
|
+
build_started_at: new Date(Date.now() - 1e4).toISOString(),
|
|
2639
|
+
// Started 10 seconds ago
|
|
2640
|
+
build_completed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2641
|
+
// Just completed
|
|
2642
|
+
build_error: null,
|
|
2643
|
+
build_error_last_updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2644
|
+
build_logs: "Build process:\n1. Environment setup - OK\n2. Dependency resolution - OK\n3. Code compilation - OK\n4. Circuit validation - OK\n5. Package assembly - OK\nBuild completed successfully"
|
|
2645
|
+
});
|
|
2511
2646
|
const { package_release_id: orgPackageReleaseId } = db.addSnippet({
|
|
2512
2647
|
name: "test-organization/test-package",
|
|
2513
2648
|
unscoped_name: "test-package",
|