@tscircuit/fake-snippets 0.0.167 → 0.0.169
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 +154 -13
- package/dist/index.js +140 -4
- package/dist/schema.d.ts +86 -1
- package/dist/schema.js +6 -0
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -480,6 +480,11 @@ var tscircuitHandleSchema = z.string().min(1).max(40).regex(
|
|
|
480
480
|
/^[0-9A-Za-z]([0-9A-Za-z_-]*[0-9A-Za-z])?$/,
|
|
481
481
|
"tscircuit_handle must start and end with a letter or number, and may only contain letters, numbers, underscores, and hyphens"
|
|
482
482
|
);
|
|
483
|
+
var memberSchema = accountSchema.omit({ shippingInfo: true }).extend({
|
|
484
|
+
joined_at: z.string(),
|
|
485
|
+
org_member_permissions: userPermissionsSchema,
|
|
486
|
+
avatar_url: z.string().nullable().optional()
|
|
487
|
+
});
|
|
483
488
|
|
|
484
489
|
// fake-snippets-api/lib/db/seed.ts
|
|
485
490
|
import { readFileSync } from "fs";
|
|
@@ -1256,8 +1261,8 @@ export default () => (
|
|
|
1256
1261
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1257
1262
|
is_source_from_github: false,
|
|
1258
1263
|
snippet_type: "package",
|
|
1259
|
-
latest_package_release_id:
|
|
1260
|
-
latest_version: "0.0.
|
|
1264
|
+
latest_package_release_id: "0.0.4",
|
|
1265
|
+
latest_version: "0.0.4",
|
|
1261
1266
|
license: "MIT",
|
|
1262
1267
|
website: "https://tscircuit.com",
|
|
1263
1268
|
star_count: 10,
|
|
@@ -1271,8 +1276,8 @@ export default () => (
|
|
|
1271
1276
|
const { package_release_id: test2PackageReleaseId } = db.addPackageRelease({
|
|
1272
1277
|
package_id: test2Package.package_id,
|
|
1273
1278
|
version: "0.0.1",
|
|
1274
|
-
created_at: (
|
|
1275
|
-
is_latest:
|
|
1279
|
+
created_at: new Date(Date.now() - 864e5 * 3).toISOString(),
|
|
1280
|
+
is_latest: false,
|
|
1276
1281
|
is_locked: false,
|
|
1277
1282
|
has_transpiled: true,
|
|
1278
1283
|
transpilation_error: null,
|
|
@@ -1382,6 +1387,129 @@ export const TestComponent = ({ name }: { name: string }) => (
|
|
|
1382
1387
|
build_error_last_updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1383
1388
|
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"
|
|
1384
1389
|
});
|
|
1390
|
+
const { package_release_id: test2PackageReleaseId2 } = db.addPackageRelease({
|
|
1391
|
+
package_id: test2Package.package_id,
|
|
1392
|
+
version: "0.0.2",
|
|
1393
|
+
created_at: new Date(Date.now() - 864e5 * 2).toISOString(),
|
|
1394
|
+
is_latest: false,
|
|
1395
|
+
is_locked: false,
|
|
1396
|
+
has_transpiled: true,
|
|
1397
|
+
transpilation_error: null
|
|
1398
|
+
});
|
|
1399
|
+
db.addPackageFile({
|
|
1400
|
+
package_release_id: test2PackageReleaseId2,
|
|
1401
|
+
file_path: "index.tsx",
|
|
1402
|
+
content_text: `export const TestComponent = ({ name }: { name: string }) => (
|
|
1403
|
+
<resistor name={name} resistance="20k" />
|
|
1404
|
+
)`,
|
|
1405
|
+
created_at: new Date(Date.now() - 864e5 * 2).toISOString(),
|
|
1406
|
+
is_text: true
|
|
1407
|
+
});
|
|
1408
|
+
db.addPackageFile({
|
|
1409
|
+
package_release_id: test2PackageReleaseId2,
|
|
1410
|
+
file_path: "utils.ts",
|
|
1411
|
+
content_text: `export const formatResistance = (value: number) => \`\${value}k\``,
|
|
1412
|
+
created_at: new Date(Date.now() - 864e5 * 2).toISOString(),
|
|
1413
|
+
is_text: true
|
|
1414
|
+
});
|
|
1415
|
+
const { package_release_id: test2PackageReleaseId3 } = db.addPackageRelease({
|
|
1416
|
+
package_id: test2Package.package_id,
|
|
1417
|
+
version: "0.0.3",
|
|
1418
|
+
created_at: new Date(Date.now() - 864e5).toISOString(),
|
|
1419
|
+
is_latest: false,
|
|
1420
|
+
is_locked: false,
|
|
1421
|
+
has_transpiled: true,
|
|
1422
|
+
transpilation_error: null
|
|
1423
|
+
});
|
|
1424
|
+
db.addPackageFile({
|
|
1425
|
+
package_release_id: test2PackageReleaseId3,
|
|
1426
|
+
file_path: "index.tsx",
|
|
1427
|
+
content_text: `import { formatResistance } from "./utils"
|
|
1428
|
+
|
|
1429
|
+
export const TestComponent = ({ name, value = 30 }: { name: string; value?: number }) => (
|
|
1430
|
+
<resistor name={name} resistance={formatResistance(value)} />
|
|
1431
|
+
)`,
|
|
1432
|
+
created_at: new Date(Date.now() - 864e5).toISOString(),
|
|
1433
|
+
is_text: true
|
|
1434
|
+
});
|
|
1435
|
+
db.addPackageFile({
|
|
1436
|
+
package_release_id: test2PackageReleaseId3,
|
|
1437
|
+
file_path: "utils.ts",
|
|
1438
|
+
content_text: `export const formatResistance = (value: number) => \`\${value}k\`
|
|
1439
|
+
export const DEFAULT_RESISTANCE = 30`,
|
|
1440
|
+
created_at: new Date(Date.now() - 864e5).toISOString(),
|
|
1441
|
+
is_text: true
|
|
1442
|
+
});
|
|
1443
|
+
db.addPackageFile({
|
|
1444
|
+
package_release_id: test2PackageReleaseId3,
|
|
1445
|
+
file_path: "README.md",
|
|
1446
|
+
content_text: `# Test2 Package v0.0.3
|
|
1447
|
+
|
|
1448
|
+
Added value prop support.`,
|
|
1449
|
+
created_at: new Date(Date.now() - 864e5).toISOString(),
|
|
1450
|
+
is_text: true
|
|
1451
|
+
});
|
|
1452
|
+
const { package_release_id: test2PackageReleaseId4 } = db.addPackageRelease({
|
|
1453
|
+
package_id: test2Package.package_id,
|
|
1454
|
+
version: "0.0.4",
|
|
1455
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1456
|
+
is_latest: true,
|
|
1457
|
+
is_locked: false,
|
|
1458
|
+
has_transpiled: true,
|
|
1459
|
+
transpilation_error: null,
|
|
1460
|
+
pcb_preview_image_url: `/api/packages/images/testuser/test2-package/pcb.png`,
|
|
1461
|
+
cad_preview_image_url: `/api/packages/images/testuser/test2-package/3d.png`,
|
|
1462
|
+
sch_preview_image_url: `/api/packages/images/testuser/test2-package/schematic.png`
|
|
1463
|
+
});
|
|
1464
|
+
db.addPackageFile({
|
|
1465
|
+
package_release_id: test2PackageReleaseId4,
|
|
1466
|
+
file_path: "index.tsx",
|
|
1467
|
+
content_text: `import { formatResistance, DEFAULT_RESISTANCE } from "./utils"
|
|
1468
|
+
import type { ComponentProps } from "./types"
|
|
1469
|
+
|
|
1470
|
+
export const TestComponent = ({ name, value = DEFAULT_RESISTANCE }: ComponentProps) => (
|
|
1471
|
+
<resistor name={name} resistance={formatResistance(value)} />
|
|
1472
|
+
)`,
|
|
1473
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1474
|
+
is_text: true
|
|
1475
|
+
});
|
|
1476
|
+
db.addPackageFile({
|
|
1477
|
+
package_release_id: test2PackageReleaseId4,
|
|
1478
|
+
file_path: "utils.ts",
|
|
1479
|
+
content_text: `export const formatResistance = (value: number) => \`\${value}k\`
|
|
1480
|
+
export const DEFAULT_RESISTANCE = 40`,
|
|
1481
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1482
|
+
is_text: true
|
|
1483
|
+
});
|
|
1484
|
+
db.addPackageFile({
|
|
1485
|
+
package_release_id: test2PackageReleaseId4,
|
|
1486
|
+
file_path: "types.ts",
|
|
1487
|
+
content_text: `export interface ComponentProps {
|
|
1488
|
+
name: string
|
|
1489
|
+
value?: number
|
|
1490
|
+
}`,
|
|
1491
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1492
|
+
is_text: true
|
|
1493
|
+
});
|
|
1494
|
+
db.addPackageFile({
|
|
1495
|
+
package_release_id: test2PackageReleaseId4,
|
|
1496
|
+
file_path: "README.md",
|
|
1497
|
+
content_text: `# Test2 Package v0.0.4
|
|
1498
|
+
|
|
1499
|
+
Latest version with TypeScript types.
|
|
1500
|
+
|
|
1501
|
+
## Usage
|
|
1502
|
+
\`\`\`tsx
|
|
1503
|
+
import { TestComponent } from "@tsci/testuser.test2-package"
|
|
1504
|
+
|
|
1505
|
+
<TestComponent name="R1" value={40} />
|
|
1506
|
+
\`\`\``,
|
|
1507
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1508
|
+
is_text: true
|
|
1509
|
+
});
|
|
1510
|
+
db.updatePackage(test2Package.package_id, {
|
|
1511
|
+
latest_package_release_id: test2PackageReleaseId4
|
|
1512
|
+
});
|
|
1385
1513
|
db.addSnippet({
|
|
1386
1514
|
name: "seveibar/a555timer",
|
|
1387
1515
|
unscoped_name: "a555timer",
|
|
@@ -2746,6 +2874,14 @@ exports.TestComponent = TestComponent;
|
|
|
2746
2874
|
is_personal_org: true,
|
|
2747
2875
|
org_id: "org-1234"
|
|
2748
2876
|
});
|
|
2877
|
+
db.addOrganization({
|
|
2878
|
+
name: "seveibar",
|
|
2879
|
+
owner_account_id: seveibarAcc.account_id,
|
|
2880
|
+
github_handle: "seveibar",
|
|
2881
|
+
is_personal_org: true,
|
|
2882
|
+
org_id: "org-1235",
|
|
2883
|
+
avatar_url: "https://github.com/seveibar.png"
|
|
2884
|
+
});
|
|
2749
2885
|
db.addOrganizationAccount({
|
|
2750
2886
|
org_id: testOrg.org_id,
|
|
2751
2887
|
account_id: seveibarAcc.account_id
|
package/dist/schema.d.ts
CHANGED
|
@@ -3515,5 +3515,90 @@ declare const databaseSchema: z.ZodObject<{
|
|
|
3515
3515
|
}>;
|
|
3516
3516
|
type DatabaseSchema = z.infer<typeof databaseSchema>;
|
|
3517
3517
|
declare const tscircuitHandleSchema: z.ZodString;
|
|
3518
|
+
declare const memberSchema: z.ZodObject<Omit<{
|
|
3519
|
+
account_id: z.ZodString;
|
|
3520
|
+
github_username: z.ZodString;
|
|
3521
|
+
tscircuit_handle: z.ZodNullable<z.ZodString>;
|
|
3522
|
+
shippingInfo: z.ZodOptional<z.ZodObject<{
|
|
3523
|
+
firstName: z.ZodString;
|
|
3524
|
+
lastName: z.ZodString;
|
|
3525
|
+
companyName: z.ZodOptional<z.ZodString>;
|
|
3526
|
+
address: z.ZodString;
|
|
3527
|
+
apartment: z.ZodOptional<z.ZodString>;
|
|
3528
|
+
city: z.ZodString;
|
|
3529
|
+
state: z.ZodString;
|
|
3530
|
+
zipCode: z.ZodString;
|
|
3531
|
+
country: z.ZodString;
|
|
3532
|
+
phone: z.ZodString;
|
|
3533
|
+
}, "strip", z.ZodTypeAny, {
|
|
3534
|
+
firstName: string;
|
|
3535
|
+
lastName: string;
|
|
3536
|
+
address: string;
|
|
3537
|
+
city: string;
|
|
3538
|
+
state: string;
|
|
3539
|
+
zipCode: string;
|
|
3540
|
+
country: string;
|
|
3541
|
+
phone: string;
|
|
3542
|
+
companyName?: string | undefined;
|
|
3543
|
+
apartment?: string | undefined;
|
|
3544
|
+
}, {
|
|
3545
|
+
firstName: string;
|
|
3546
|
+
lastName: string;
|
|
3547
|
+
address: string;
|
|
3548
|
+
city: string;
|
|
3549
|
+
state: string;
|
|
3550
|
+
zipCode: string;
|
|
3551
|
+
country: string;
|
|
3552
|
+
phone: string;
|
|
3553
|
+
companyName?: string | undefined;
|
|
3554
|
+
apartment?: string | undefined;
|
|
3555
|
+
}>>;
|
|
3556
|
+
personal_org_id: z.ZodNullable<z.ZodString>;
|
|
3557
|
+
is_tscircuit_staff: z.ZodDefault<z.ZodBoolean>;
|
|
3558
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3559
|
+
created_at: z.ZodDate;
|
|
3560
|
+
}, "shippingInfo"> & {
|
|
3561
|
+
joined_at: z.ZodString;
|
|
3562
|
+
org_member_permissions: z.ZodObject<{
|
|
3563
|
+
can_manage_org: z.ZodOptional<z.ZodBoolean>;
|
|
3564
|
+
can_manage_package: z.ZodOptional<z.ZodBoolean>;
|
|
3565
|
+
}, "strip", z.ZodTypeAny, {
|
|
3566
|
+
can_manage_org?: boolean | undefined;
|
|
3567
|
+
can_manage_package?: boolean | undefined;
|
|
3568
|
+
}, {
|
|
3569
|
+
can_manage_org?: boolean | undefined;
|
|
3570
|
+
can_manage_package?: boolean | undefined;
|
|
3571
|
+
}>;
|
|
3572
|
+
avatar_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3573
|
+
}, "strip", z.ZodTypeAny, {
|
|
3574
|
+
created_at: Date;
|
|
3575
|
+
account_id: string;
|
|
3576
|
+
github_username: string;
|
|
3577
|
+
tscircuit_handle: string | null;
|
|
3578
|
+
personal_org_id: string | null;
|
|
3579
|
+
is_tscircuit_staff: boolean;
|
|
3580
|
+
joined_at: string;
|
|
3581
|
+
org_member_permissions: {
|
|
3582
|
+
can_manage_org?: boolean | undefined;
|
|
3583
|
+
can_manage_package?: boolean | undefined;
|
|
3584
|
+
};
|
|
3585
|
+
email?: string | null | undefined;
|
|
3586
|
+
avatar_url?: string | null | undefined;
|
|
3587
|
+
}, {
|
|
3588
|
+
created_at: Date;
|
|
3589
|
+
account_id: string;
|
|
3590
|
+
github_username: string;
|
|
3591
|
+
tscircuit_handle: string | null;
|
|
3592
|
+
personal_org_id: string | null;
|
|
3593
|
+
joined_at: string;
|
|
3594
|
+
org_member_permissions: {
|
|
3595
|
+
can_manage_org?: boolean | undefined;
|
|
3596
|
+
can_manage_package?: boolean | undefined;
|
|
3597
|
+
};
|
|
3598
|
+
is_tscircuit_staff?: boolean | undefined;
|
|
3599
|
+
email?: string | null | undefined;
|
|
3600
|
+
avatar_url?: string | null | undefined;
|
|
3601
|
+
}>;
|
|
3602
|
+
type Member = z.infer<typeof memberSchema>;
|
|
3518
3603
|
|
|
3519
|
-
export { type Account, type AccountPackage, type AccountSnippet, type AiReview, type BugReport, type BugReportFile, type DatabaseSchema, type Datasheet, type GithubInstallation, type JlcpcbOrderState, type JlcpcbOrderStepRun, type LoginPage, type Order, type OrderFile, type OrderQuote, type OrgAccount, type OrgInvitation, type Organization, type Package, type PackageBuild, type PackageFile, type PackageFileLite, type PackageRelease, type PublicAccount, type PublicOrgSchema, type QuotedComponent, type Session, type ShippingOption, type Snippet, type UserPermissions, accountPackageSchema, accountSchema, accountSnippetSchema, aiReviewSchema, bugReportFileResponseSchema, bugReportFileSchema, bugReportSchema, databaseSchema, datasheetPinInformationSchema, datasheetSchema, errorResponseSchema, errorSchema, githubInstallationSchema, jlcpcbOrderStateSchema, jlcpcbOrderStepRunSchema, log, loginPageSchema, orderFileSchema, orderQuoteSchema, orderSchema, orgAccountSchema, orgInvitationSchema, orgSchema, packageBuildSchema, packageFileLiteSchema, packageFileSchema, packageReleaseSchema, packageSchema, publicAccountSchema, publicOrgSchema, quotedComponentSchema, sessionSchema, shippingInfoSchema, snippetSchema, tscircuitHandleSchema, userPermissionsSchema };
|
|
3604
|
+
export { type Account, type AccountPackage, type AccountSnippet, type AiReview, type BugReport, type BugReportFile, type DatabaseSchema, type Datasheet, type GithubInstallation, type JlcpcbOrderState, type JlcpcbOrderStepRun, type LoginPage, type Member, type Order, type OrderFile, type OrderQuote, type OrgAccount, type OrgInvitation, type Organization, type Package, type PackageBuild, type PackageFile, type PackageFileLite, type PackageRelease, type PublicAccount, type PublicOrgSchema, type QuotedComponent, type Session, type ShippingOption, type Snippet, type UserPermissions, accountPackageSchema, accountSchema, accountSnippetSchema, aiReviewSchema, bugReportFileResponseSchema, bugReportFileSchema, bugReportSchema, databaseSchema, datasheetPinInformationSchema, datasheetSchema, errorResponseSchema, errorSchema, githubInstallationSchema, jlcpcbOrderStateSchema, jlcpcbOrderStepRunSchema, log, loginPageSchema, memberSchema, orderFileSchema, orderQuoteSchema, orderSchema, orgAccountSchema, orgInvitationSchema, orgSchema, packageBuildSchema, packageFileLiteSchema, packageFileSchema, packageReleaseSchema, packageSchema, publicAccountSchema, publicOrgSchema, quotedComponentSchema, sessionSchema, shippingInfoSchema, snippetSchema, tscircuitHandleSchema, userPermissionsSchema };
|
package/dist/schema.js
CHANGED
|
@@ -474,6 +474,11 @@ var tscircuitHandleSchema = z.string().min(1).max(40).regex(
|
|
|
474
474
|
/^[0-9A-Za-z]([0-9A-Za-z_-]*[0-9A-Za-z])?$/,
|
|
475
475
|
"tscircuit_handle must start and end with a letter or number, and may only contain letters, numbers, underscores, and hyphens"
|
|
476
476
|
);
|
|
477
|
+
var memberSchema = accountSchema.omit({ shippingInfo: true }).extend({
|
|
478
|
+
joined_at: z.string(),
|
|
479
|
+
org_member_permissions: userPermissionsSchema,
|
|
480
|
+
avatar_url: z.string().nullable().optional()
|
|
481
|
+
});
|
|
477
482
|
export {
|
|
478
483
|
accountPackageSchema,
|
|
479
484
|
accountSchema,
|
|
@@ -492,6 +497,7 @@ export {
|
|
|
492
497
|
jlcpcbOrderStepRunSchema,
|
|
493
498
|
log,
|
|
494
499
|
loginPageSchema,
|
|
500
|
+
memberSchema,
|
|
495
501
|
orderFileSchema,
|
|
496
502
|
orderQuoteSchema,
|
|
497
503
|
orderSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/fake-snippets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.169",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -81,16 +81,17 @@
|
|
|
81
81
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
82
82
|
"@sentry/react": "^10.10.0",
|
|
83
83
|
"@tailwindcss/typography": "^0.5.16",
|
|
84
|
-
"@tscircuit/3d-viewer": "^0.0.
|
|
84
|
+
"@tscircuit/3d-viewer": "^0.0.476",
|
|
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.556",
|
|
88
88
|
"@tscircuit/layout": "^0.0.29",
|
|
89
89
|
"@tscircuit/mm": "^0.0.8",
|
|
90
90
|
"@tscircuit/pcb-viewer": "^1.11.256",
|
|
91
91
|
"@tscircuit/prompt-benchmarks": "^0.0.28",
|
|
92
|
-
"@tscircuit/
|
|
93
|
-
"@tscircuit/
|
|
92
|
+
"@tscircuit/props": "^0.0.433",
|
|
93
|
+
"@tscircuit/runframe": "^0.0.1427",
|
|
94
|
+
"@tscircuit/schematic-viewer": "^2.0.50",
|
|
94
95
|
"@tscircuit/simple-3d-svg": "^0.0.41",
|
|
95
96
|
"@types/babel__standalone": "^7.1.7",
|
|
96
97
|
"@types/bun": "^1.1.10",
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
"circuit-json-to-spice": "^0.0.6",
|
|
122
123
|
"circuit-json-to-step": "^0.0.2",
|
|
123
124
|
"circuit-json-to-tscircuit": "^0.0.11",
|
|
124
|
-
"circuit-to-svg": "^0.0.
|
|
125
|
+
"circuit-to-svg": "^0.0.298",
|
|
125
126
|
"class-variance-authority": "^0.7.1",
|
|
126
127
|
"clsx": "^2.1.1",
|
|
127
128
|
"cmdk": "^1.0.4",
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
"terser": "^5.27.0",
|
|
187
188
|
"three": "0.165.0",
|
|
188
189
|
"three-stdlib": "^2.36.0",
|
|
189
|
-
"tscircuit": "^0.0.
|
|
190
|
+
"tscircuit": "^0.0.1070",
|
|
190
191
|
"tsup": "^8.5.0",
|
|
191
192
|
"typescript": "^5.6.3",
|
|
192
193
|
"use-async-memo": "^1.2.5",
|