@tscircuit/fake-snippets 0.0.122 → 0.0.123
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 +138 -3
- package/dist/index.js +137 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -613,6 +613,7 @@ var loadAutoloadPackages = async (db) => {
|
|
|
613
613
|
var seed = (db) => {
|
|
614
614
|
const { account_id } = db.addAccount({
|
|
615
615
|
account_id: "account-1234",
|
|
616
|
+
personal_org_id: "org-1234",
|
|
616
617
|
github_username: "testuser",
|
|
617
618
|
shippingInfo: {
|
|
618
619
|
firstName: "Test",
|
|
@@ -1179,6 +1180,138 @@ export default () => (
|
|
|
1179
1180
|
...release1,
|
|
1180
1181
|
latest_package_build_id: firstBuild.package_build_id
|
|
1181
1182
|
});
|
|
1183
|
+
const test2Package = db.addPackage({
|
|
1184
|
+
name: "testuser/test2-package",
|
|
1185
|
+
unscoped_name: "test2-package",
|
|
1186
|
+
creator_account_id: account_id,
|
|
1187
|
+
owner_org_id: "org-1234",
|
|
1188
|
+
owner_github_username: "testuser",
|
|
1189
|
+
description: "A test package for development",
|
|
1190
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1191
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1192
|
+
is_source_from_github: false,
|
|
1193
|
+
snippet_type: "package",
|
|
1194
|
+
latest_package_release_id: null,
|
|
1195
|
+
latest_version: "0.0.1",
|
|
1196
|
+
license: "MIT",
|
|
1197
|
+
website: "https://tscircuit.com",
|
|
1198
|
+
star_count: 10,
|
|
1199
|
+
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.",
|
|
1200
|
+
ai_usage_instructions: "Import the package using `import { TestComponent } from '@tsci/testuser.test2-package'`. Use the TestComponent in your circuit designs by providing the required props. Example: `<TestComponent name='my-test' value={42} />`",
|
|
1201
|
+
default_view: "files",
|
|
1202
|
+
latest_pcb_preview_image_url: `/api/packages/images/testuser/test2-package/pcb.png`,
|
|
1203
|
+
latest_cad_preview_image_url: `/api/packages/images/testuser/test2-package/3d.png`,
|
|
1204
|
+
latest_sch_preview_image_url: `/api/packages/images/testuser/test2-package/schematic.png`
|
|
1205
|
+
});
|
|
1206
|
+
const { package_release_id: test2PackageReleaseId } = db.addPackageRelease({
|
|
1207
|
+
package_id: test2Package.package_id,
|
|
1208
|
+
version: "0.0.1",
|
|
1209
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1210
|
+
is_latest: true,
|
|
1211
|
+
is_locked: false,
|
|
1212
|
+
has_transpiled: true,
|
|
1213
|
+
transpilation_error: null
|
|
1214
|
+
});
|
|
1215
|
+
db.addPackageFile({
|
|
1216
|
+
package_release_id: test2PackageReleaseId,
|
|
1217
|
+
file_path: "index.tsx",
|
|
1218
|
+
content_text: `
|
|
1219
|
+
export const TestComponent = ({ name }: { name: string }) => (
|
|
1220
|
+
<resistor name={name} resistance="10k" />
|
|
1221
|
+
)
|
|
1222
|
+
`.trim(),
|
|
1223
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1224
|
+
});
|
|
1225
|
+
db.addPackageFile({
|
|
1226
|
+
package_release_id: test2PackageReleaseId,
|
|
1227
|
+
file_path: "/dist/circuit.json",
|
|
1228
|
+
content_text: `[
|
|
1229
|
+
{
|
|
1230
|
+
"type": "source_project_metadata",
|
|
1231
|
+
"source_project_metadata_id": "source_project_metadata_0",
|
|
1232
|
+
"software_used_string": "@tscircuit/core@0.0.813"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
"type": "source_group",
|
|
1236
|
+
"source_group_id": "source_group_0",
|
|
1237
|
+
"is_subcircuit": true,
|
|
1238
|
+
"was_automatically_named": true,
|
|
1239
|
+
"subcircuit_id": "subcircuit_source_group_0"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
"type": "source_board",
|
|
1243
|
+
"source_board_id": "source_board_0",
|
|
1244
|
+
"source_group_id": "source_group_0"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"type": "schematic_group",
|
|
1248
|
+
"schematic_group_id": "schematic_group_0",
|
|
1249
|
+
"is_subcircuit": true,
|
|
1250
|
+
"subcircuit_id": "subcircuit_source_group_0",
|
|
1251
|
+
"name": "unnamed_board1",
|
|
1252
|
+
"center": {
|
|
1253
|
+
"x": 0,
|
|
1254
|
+
"y": 0
|
|
1255
|
+
},
|
|
1256
|
+
"width": 0,
|
|
1257
|
+
"height": 0,
|
|
1258
|
+
"schematic_component_ids": [],
|
|
1259
|
+
"source_group_id": "source_group_0"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"type": "pcb_board",
|
|
1263
|
+
"pcb_board_id": "pcb_board_0",
|
|
1264
|
+
"center": {
|
|
1265
|
+
"x": 0,
|
|
1266
|
+
"y": 0
|
|
1267
|
+
},
|
|
1268
|
+
"thickness": 1.4,
|
|
1269
|
+
"num_layers": 2,
|
|
1270
|
+
"width": 10,
|
|
1271
|
+
"height": 10,
|
|
1272
|
+
"material": "fr4"
|
|
1273
|
+
}
|
|
1274
|
+
]`.trim(),
|
|
1275
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1276
|
+
});
|
|
1277
|
+
db.addPackageBuild({
|
|
1278
|
+
package_release_id: test2PackageReleaseId,
|
|
1279
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1280
|
+
transpilation_in_progress: false,
|
|
1281
|
+
transpilation_started_at: new Date(Date.now() - 5e3).toISOString(),
|
|
1282
|
+
// Started 5 seconds ago
|
|
1283
|
+
transpilation_completed_at: new Date(Date.now() - 3e3).toISOString(),
|
|
1284
|
+
// Completed 3 seconds ago
|
|
1285
|
+
transpilation_logs: [
|
|
1286
|
+
"[INFO] Starting transpilation...",
|
|
1287
|
+
"[INFO] Parsing package code",
|
|
1288
|
+
"[INFO] Generating TypeScript definitions",
|
|
1289
|
+
"[INFO] Compiling to JavaScript",
|
|
1290
|
+
"[SUCCESS] Transpilation completed successfully"
|
|
1291
|
+
],
|
|
1292
|
+
transpilation_error: null,
|
|
1293
|
+
circuit_json_build_in_progress: false,
|
|
1294
|
+
circuit_json_build_started_at: new Date(Date.now() - 3e3).toISOString(),
|
|
1295
|
+
// Started after transpilation
|
|
1296
|
+
circuit_json_build_completed_at: new Date(Date.now() - 1e3).toISOString(),
|
|
1297
|
+
// Completed 1 second ago
|
|
1298
|
+
circuit_json_build_logs: [
|
|
1299
|
+
"[INFO] Starting circuit JSON build...",
|
|
1300
|
+
"[INFO] Analyzing component structure",
|
|
1301
|
+
"[INFO] Generating port configurations",
|
|
1302
|
+
"[INFO] Validating circuit connections",
|
|
1303
|
+
"[SUCCESS] Circuit JSON build completed"
|
|
1304
|
+
],
|
|
1305
|
+
circuit_json_build_error: null,
|
|
1306
|
+
build_in_progress: false,
|
|
1307
|
+
build_started_at: new Date(Date.now() - 1e4).toISOString(),
|
|
1308
|
+
// Started 10 seconds ago
|
|
1309
|
+
build_completed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1310
|
+
// Just completed
|
|
1311
|
+
build_error: null,
|
|
1312
|
+
build_error_last_updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1313
|
+
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"
|
|
1314
|
+
});
|
|
1182
1315
|
db.addSnippet({
|
|
1183
1316
|
name: "seveibar/a555timer",
|
|
1184
1317
|
unscoped_name: "a555timer",
|
|
@@ -2402,7 +2535,8 @@ exports.TestComponent = TestComponent;
|
|
|
2402
2535
|
name: "testuser",
|
|
2403
2536
|
owner_account_id: account_id,
|
|
2404
2537
|
github_handle: "tscircuit",
|
|
2405
|
-
is_personal_org: true
|
|
2538
|
+
is_personal_org: true,
|
|
2539
|
+
org_id: "org-1234"
|
|
2406
2540
|
});
|
|
2407
2541
|
db.addOrganizationAccount({
|
|
2408
2542
|
org_id: testOrg.org_id,
|
|
@@ -3479,10 +3613,11 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
|
|
|
3479
3613
|
},
|
|
3480
3614
|
addPackageFile: (packageFile) => {
|
|
3481
3615
|
const newPackageFile = {
|
|
3482
|
-
package_file_id: `package_file_${
|
|
3616
|
+
package_file_id: `package_file_${get().idCounter + 1}`,
|
|
3483
3617
|
...packageFile
|
|
3484
3618
|
};
|
|
3485
3619
|
set((state) => ({
|
|
3620
|
+
idCounter: state.idCounter + 1,
|
|
3486
3621
|
packageFiles: [...state.packageFiles, newPackageFile]
|
|
3487
3622
|
}));
|
|
3488
3623
|
return newPackageFile;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/fake-snippets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.123",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@tscircuit/3d-viewer": "^0.0.407",
|
|
85
85
|
"@tscircuit/assembly-viewer": "^0.0.5",
|
|
86
86
|
"@tscircuit/create-snippet-url": "^0.0.8",
|
|
87
|
-
"@tscircuit/eval": "^0.0.
|
|
87
|
+
"@tscircuit/eval": "^0.0.415",
|
|
88
88
|
"@tscircuit/layout": "^0.0.29",
|
|
89
89
|
"@tscircuit/mm": "^0.0.8",
|
|
90
90
|
"@tscircuit/pcb-viewer": "^1.11.218",
|