@tscircuit/cli 0.1.1102 → 0.1.1104
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/README.md +4 -0
- package/dist/cli/build/build.worker.js +160 -69
- package/dist/cli/main.js +230 -19
- package/dist/cli/snapshot/snapshot.worker.js +12 -3
- package/dist/lib/index.js +14 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -74,6 +74,10 @@ The `build` command also accepts the following options:
|
|
|
74
74
|
|
|
75
75
|
- `--ignore-errors` - continue build even if circuit JSON contains errors
|
|
76
76
|
- `--ignore-warnings` - suppress warning output
|
|
77
|
+
- `--ignore-netlist-drc` - suppress netlist DRC diagnostics
|
|
78
|
+
- `--ignore-pin-specification-drc` - suppress pin-specification DRC diagnostics
|
|
79
|
+
- `--ignore-placement-drc` - suppress placement DRC diagnostics
|
|
80
|
+
- `--ignore-routing-drc` - suppress routing DRC diagnostics
|
|
77
81
|
|
|
78
82
|
## Development
|
|
79
83
|
|
|
@@ -7023,6 +7023,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
7023
7023
|
var require_pattern = __commonJS((exports) => {
|
|
7024
7024
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7025
7025
|
var code_1 = require_code2();
|
|
7026
|
+
var util_1 = require_util();
|
|
7026
7027
|
var codegen_1 = require_codegen();
|
|
7027
7028
|
var error = {
|
|
7028
7029
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -7035,10 +7036,18 @@ var require_pattern = __commonJS((exports) => {
|
|
|
7035
7036
|
$data: true,
|
|
7036
7037
|
error,
|
|
7037
7038
|
code(cxt) {
|
|
7038
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
7039
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
7039
7040
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
7040
|
-
|
|
7041
|
-
|
|
7041
|
+
if ($data) {
|
|
7042
|
+
const { regExp } = it.opts.code;
|
|
7043
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
7044
|
+
const valid = gen.let("valid");
|
|
7045
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
7046
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
7047
|
+
} else {
|
|
7048
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
7049
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
7050
|
+
}
|
|
7042
7051
|
}
|
|
7043
7052
|
};
|
|
7044
7053
|
exports.default = def;
|
|
@@ -11777,6 +11786,144 @@ var registerStaticAssetLoaders = () => {
|
|
|
11777
11786
|
}
|
|
11778
11787
|
};
|
|
11779
11788
|
|
|
11789
|
+
// cli/build/drc-diagnostic-filter.ts
|
|
11790
|
+
import {
|
|
11791
|
+
categorizeErrorOrWarning
|
|
11792
|
+
} from "@tscircuit/circuit-json-util";
|
|
11793
|
+
var EMPTY_IGNORE_COUNTS = () => ({
|
|
11794
|
+
netlist: 0,
|
|
11795
|
+
pin_specification: 0,
|
|
11796
|
+
placement: 0,
|
|
11797
|
+
routing: 0,
|
|
11798
|
+
unknown: 0
|
|
11799
|
+
});
|
|
11800
|
+
var normalizeCategory = (category) => category === "netlist" || category === "pin_specification" || category === "placement" || category === "routing" ? category : "unknown";
|
|
11801
|
+
var categorizeIssue = (issue) => normalizeCategory(categorizeErrorOrWarning(issue));
|
|
11802
|
+
var shouldIgnoreCategory = (category, ignoreOptions) => {
|
|
11803
|
+
switch (category) {
|
|
11804
|
+
case "netlist":
|
|
11805
|
+
return Boolean(ignoreOptions?.ignoreNetlistDrc);
|
|
11806
|
+
case "pin_specification":
|
|
11807
|
+
return Boolean(ignoreOptions?.ignorePinSpecificationDrc);
|
|
11808
|
+
case "placement":
|
|
11809
|
+
return Boolean(ignoreOptions?.ignorePlacementDrc);
|
|
11810
|
+
case "routing":
|
|
11811
|
+
return Boolean(ignoreOptions?.ignoreRoutingDrc);
|
|
11812
|
+
default:
|
|
11813
|
+
return false;
|
|
11814
|
+
}
|
|
11815
|
+
};
|
|
11816
|
+
var filterIssues = ({
|
|
11817
|
+
issues,
|
|
11818
|
+
ignoreOptions,
|
|
11819
|
+
ignoredByCategory
|
|
11820
|
+
}) => {
|
|
11821
|
+
const kept = [];
|
|
11822
|
+
for (const issue of issues) {
|
|
11823
|
+
const category = categorizeIssue(issue);
|
|
11824
|
+
if (shouldIgnoreCategory(category, ignoreOptions)) {
|
|
11825
|
+
ignoredByCategory[category] += 1;
|
|
11826
|
+
continue;
|
|
11827
|
+
}
|
|
11828
|
+
kept.push(issue);
|
|
11829
|
+
}
|
|
11830
|
+
return kept;
|
|
11831
|
+
};
|
|
11832
|
+
var filterDiagnosticsByDrcCategory = ({
|
|
11833
|
+
errors,
|
|
11834
|
+
warnings,
|
|
11835
|
+
ignoreOptions
|
|
11836
|
+
}) => {
|
|
11837
|
+
const ignoredByCategory = EMPTY_IGNORE_COUNTS();
|
|
11838
|
+
const filteredErrors = filterIssues({
|
|
11839
|
+
issues: errors,
|
|
11840
|
+
ignoreOptions,
|
|
11841
|
+
ignoredByCategory
|
|
11842
|
+
});
|
|
11843
|
+
const filteredWarnings = filterIssues({
|
|
11844
|
+
issues: warnings,
|
|
11845
|
+
ignoreOptions,
|
|
11846
|
+
ignoredByCategory
|
|
11847
|
+
});
|
|
11848
|
+
const ignoredCount = Object.values(ignoredByCategory).reduce((sum, count) => sum + count, 0);
|
|
11849
|
+
return {
|
|
11850
|
+
errors: filteredErrors,
|
|
11851
|
+
warnings: filteredWarnings,
|
|
11852
|
+
ignoredCount,
|
|
11853
|
+
ignoredByCategory
|
|
11854
|
+
};
|
|
11855
|
+
};
|
|
11856
|
+
var formatIgnoredDrcCounts = (counts) => [
|
|
11857
|
+
["netlist", counts.netlist],
|
|
11858
|
+
["pin_specification", counts.pin_specification],
|
|
11859
|
+
["placement", counts.placement],
|
|
11860
|
+
["routing", counts.routing],
|
|
11861
|
+
["unknown", counts.unknown]
|
|
11862
|
+
].filter(([, count]) => count > 0).map(([category, count]) => `${category}: ${count}`).join(", ");
|
|
11863
|
+
|
|
11864
|
+
// cli/build/image-format-selection.ts
|
|
11865
|
+
var DEFAULT_IMAGE_FORMAT_SELECTION = {
|
|
11866
|
+
threeDPngs: true,
|
|
11867
|
+
pcbSvgs: true,
|
|
11868
|
+
schematicSvgs: true
|
|
11869
|
+
};
|
|
11870
|
+
var EMPTY_IMAGE_FORMAT_SELECTION = {
|
|
11871
|
+
threeDPngs: false,
|
|
11872
|
+
pcbSvgs: false,
|
|
11873
|
+
schematicSvgs: false
|
|
11874
|
+
};
|
|
11875
|
+
var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbSvgs || selection.schematicSvgs;
|
|
11876
|
+
var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.svgs || options?.pcbSvgs || options?.schematicSvgs);
|
|
11877
|
+
var hasEstablishedOutputFlags = (options) => Boolean(options?.["3d"] || options?.pcbOnly || options?.schematicOnly);
|
|
11878
|
+
var resolveImageFormatSelection = (options) => {
|
|
11879
|
+
const hasNewFlags = hasNewOutputFlags(options);
|
|
11880
|
+
const hasEstablishedFlags = hasEstablishedOutputFlags(options);
|
|
11881
|
+
const hasExplicitSelection = hasNewFlags || hasEstablishedFlags;
|
|
11882
|
+
if (!hasExplicitSelection) {
|
|
11883
|
+
return {
|
|
11884
|
+
selection: { ...DEFAULT_IMAGE_FORMAT_SELECTION },
|
|
11885
|
+
hasExplicitSelection: false
|
|
11886
|
+
};
|
|
11887
|
+
}
|
|
11888
|
+
if (!hasNewFlags && hasEstablishedFlags) {
|
|
11889
|
+
const selection2 = {
|
|
11890
|
+
threeDPngs: Boolean(options?.["3d"]),
|
|
11891
|
+
pcbSvgs: true,
|
|
11892
|
+
schematicSvgs: true
|
|
11893
|
+
};
|
|
11894
|
+
if (options?.pcbOnly && !options?.schematicOnly) {
|
|
11895
|
+
selection2.schematicSvgs = false;
|
|
11896
|
+
}
|
|
11897
|
+
if (options?.schematicOnly && !options?.pcbOnly) {
|
|
11898
|
+
selection2.pcbSvgs = false;
|
|
11899
|
+
}
|
|
11900
|
+
return { selection: selection2, hasExplicitSelection: true };
|
|
11901
|
+
}
|
|
11902
|
+
const selection = {
|
|
11903
|
+
...EMPTY_IMAGE_FORMAT_SELECTION
|
|
11904
|
+
};
|
|
11905
|
+
if (options?.svgs) {
|
|
11906
|
+
selection.pcbSvgs = true;
|
|
11907
|
+
selection.schematicSvgs = true;
|
|
11908
|
+
}
|
|
11909
|
+
if (options?.pcbSvgs) {
|
|
11910
|
+
selection.pcbSvgs = true;
|
|
11911
|
+
}
|
|
11912
|
+
if (options?.schematicSvgs) {
|
|
11913
|
+
selection.schematicSvgs = true;
|
|
11914
|
+
}
|
|
11915
|
+
if (options?.pngs || options?.["3d"]) {
|
|
11916
|
+
selection.threeDPngs = true;
|
|
11917
|
+
}
|
|
11918
|
+
if (options?.pcbOnly && !options?.schematicOnly) {
|
|
11919
|
+
selection.schematicSvgs = false;
|
|
11920
|
+
}
|
|
11921
|
+
if (options?.schematicOnly && !options?.pcbOnly) {
|
|
11922
|
+
selection.pcbSvgs = false;
|
|
11923
|
+
}
|
|
11924
|
+
return { selection, hasExplicitSelection: true };
|
|
11925
|
+
};
|
|
11926
|
+
|
|
11780
11927
|
// cli/build/worker-output-generators.ts
|
|
11781
11928
|
import fs9 from "node:fs";
|
|
11782
11929
|
import path12 from "node:path";
|
|
@@ -13369,69 +13516,6 @@ var writeImageAssetsFromCircuitJson = async (circuitJson, options) => {
|
|
|
13369
13516
|
}
|
|
13370
13517
|
};
|
|
13371
13518
|
|
|
13372
|
-
// cli/build/image-format-selection.ts
|
|
13373
|
-
var DEFAULT_IMAGE_FORMAT_SELECTION = {
|
|
13374
|
-
threeDPngs: true,
|
|
13375
|
-
pcbSvgs: true,
|
|
13376
|
-
schematicSvgs: true
|
|
13377
|
-
};
|
|
13378
|
-
var EMPTY_IMAGE_FORMAT_SELECTION = {
|
|
13379
|
-
threeDPngs: false,
|
|
13380
|
-
pcbSvgs: false,
|
|
13381
|
-
schematicSvgs: false
|
|
13382
|
-
};
|
|
13383
|
-
var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbSvgs || selection.schematicSvgs;
|
|
13384
|
-
var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.svgs || options?.pcbSvgs || options?.schematicSvgs);
|
|
13385
|
-
var hasEstablishedOutputFlags = (options) => Boolean(options?.["3d"] || options?.pcbOnly || options?.schematicOnly);
|
|
13386
|
-
var resolveImageFormatSelection = (options) => {
|
|
13387
|
-
const hasNewFlags = hasNewOutputFlags(options);
|
|
13388
|
-
const hasEstablishedFlags = hasEstablishedOutputFlags(options);
|
|
13389
|
-
const hasExplicitSelection = hasNewFlags || hasEstablishedFlags;
|
|
13390
|
-
if (!hasExplicitSelection) {
|
|
13391
|
-
return {
|
|
13392
|
-
selection: { ...DEFAULT_IMAGE_FORMAT_SELECTION },
|
|
13393
|
-
hasExplicitSelection: false
|
|
13394
|
-
};
|
|
13395
|
-
}
|
|
13396
|
-
if (!hasNewFlags && hasEstablishedFlags) {
|
|
13397
|
-
const selection2 = {
|
|
13398
|
-
threeDPngs: Boolean(options?.["3d"]),
|
|
13399
|
-
pcbSvgs: true,
|
|
13400
|
-
schematicSvgs: true
|
|
13401
|
-
};
|
|
13402
|
-
if (options?.pcbOnly && !options?.schematicOnly) {
|
|
13403
|
-
selection2.schematicSvgs = false;
|
|
13404
|
-
}
|
|
13405
|
-
if (options?.schematicOnly && !options?.pcbOnly) {
|
|
13406
|
-
selection2.pcbSvgs = false;
|
|
13407
|
-
}
|
|
13408
|
-
return { selection: selection2, hasExplicitSelection: true };
|
|
13409
|
-
}
|
|
13410
|
-
const selection = {
|
|
13411
|
-
...EMPTY_IMAGE_FORMAT_SELECTION
|
|
13412
|
-
};
|
|
13413
|
-
if (options?.svgs) {
|
|
13414
|
-
selection.pcbSvgs = true;
|
|
13415
|
-
selection.schematicSvgs = true;
|
|
13416
|
-
}
|
|
13417
|
-
if (options?.pcbSvgs) {
|
|
13418
|
-
selection.pcbSvgs = true;
|
|
13419
|
-
}
|
|
13420
|
-
if (options?.schematicSvgs) {
|
|
13421
|
-
selection.schematicSvgs = true;
|
|
13422
|
-
}
|
|
13423
|
-
if (options?.pngs || options?.["3d"]) {
|
|
13424
|
-
selection.threeDPngs = true;
|
|
13425
|
-
}
|
|
13426
|
-
if (options?.pcbOnly && !options?.schematicOnly) {
|
|
13427
|
-
selection.schematicSvgs = false;
|
|
13428
|
-
}
|
|
13429
|
-
if (options?.schematicOnly && !options?.pcbOnly) {
|
|
13430
|
-
selection.pcbSvgs = false;
|
|
13431
|
-
}
|
|
13432
|
-
return { selection, hasExplicitSelection: true };
|
|
13433
|
-
};
|
|
13434
|
-
|
|
13435
13519
|
// cli/build/worker-build-handlers.ts
|
|
13436
13520
|
var loadCircuitJsonFromInputFile = (filePath) => {
|
|
13437
13521
|
const parsed = JSON.parse(fs10.readFileSync(filePath, "utf-8"));
|
|
@@ -13457,21 +13541,26 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
|
|
|
13457
13541
|
fs10.writeFileSync(outputPath, JSON.stringify(circuitJson, null, 2));
|
|
13458
13542
|
workerLog(`Circuit JSON written to ${path13.relative(projectDir, outputPath)}`);
|
|
13459
13543
|
const diagnostics = analyzeCircuitJson(circuitJson);
|
|
13544
|
+
const filteredDiagnostics = filterDiagnosticsByDrcCategory({
|
|
13545
|
+
errors: diagnostics.errors,
|
|
13546
|
+
warnings: diagnostics.warnings,
|
|
13547
|
+
ignoreOptions: options
|
|
13548
|
+
});
|
|
13460
13549
|
if (!options?.ignoreWarnings) {
|
|
13461
|
-
for (const warn of
|
|
13550
|
+
for (const warn of filteredDiagnostics.warnings) {
|
|
13462
13551
|
const msg = warn.message || JSON.stringify(warn);
|
|
13463
13552
|
warnings.push(msg);
|
|
13464
13553
|
workerLog(`Warning: ${msg}`);
|
|
13465
13554
|
}
|
|
13466
13555
|
}
|
|
13467
13556
|
if (!options?.ignoreErrors) {
|
|
13468
|
-
for (const err of
|
|
13557
|
+
for (const err of filteredDiagnostics.errors) {
|
|
13469
13558
|
const msg = err.message || JSON.stringify(err);
|
|
13470
13559
|
errors.push(msg);
|
|
13471
13560
|
workerLog(`Error: ${msg}`);
|
|
13472
13561
|
}
|
|
13473
13562
|
}
|
|
13474
|
-
const hasErrors =
|
|
13563
|
+
const hasErrors = filteredDiagnostics.errors.length > 0 && !options?.ignoreErrors;
|
|
13475
13564
|
let glbOk;
|
|
13476
13565
|
let glbError;
|
|
13477
13566
|
let previewOk;
|
|
@@ -13515,6 +13604,8 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
|
|
|
13515
13604
|
preview_error: previewError,
|
|
13516
13605
|
ok: true,
|
|
13517
13606
|
hasErrors,
|
|
13607
|
+
ignoredDrcCount: filteredDiagnostics.ignoredCount,
|
|
13608
|
+
ignoredDrcByCategory: filteredDiagnostics.ignoredByCategory,
|
|
13518
13609
|
errors,
|
|
13519
13610
|
warnings,
|
|
13520
13611
|
durationMs: options?.profile ? performance.now() - startedAt : undefined
|
package/dist/cli/main.js
CHANGED
|
@@ -19618,6 +19618,7 @@ var require_limitLength = __commonJS((exports2) => {
|
|
|
19618
19618
|
var require_pattern2 = __commonJS((exports2) => {
|
|
19619
19619
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
19620
19620
|
var code_1 = require_code2();
|
|
19621
|
+
var util_1 = require_util3();
|
|
19621
19622
|
var codegen_1 = require_codegen();
|
|
19622
19623
|
var error = {
|
|
19623
19624
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -19630,10 +19631,18 @@ var require_pattern2 = __commonJS((exports2) => {
|
|
|
19630
19631
|
$data: true,
|
|
19631
19632
|
error,
|
|
19632
19633
|
code(cxt) {
|
|
19633
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
19634
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
19634
19635
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
19635
|
-
|
|
19636
|
-
|
|
19636
|
+
if ($data) {
|
|
19637
|
+
const { regExp } = it.opts.code;
|
|
19638
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
19639
|
+
const valid = gen.let("valid");
|
|
19640
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
19641
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
19642
|
+
} else {
|
|
19643
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
19644
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
19645
|
+
}
|
|
19637
19646
|
}
|
|
19638
19647
|
};
|
|
19639
19648
|
exports2.default = def;
|
|
@@ -97670,7 +97679,7 @@ var registerStaticAssetLoaders = () => {
|
|
|
97670
97679
|
// cli/main.ts
|
|
97671
97680
|
var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
97672
97681
|
// package.json
|
|
97673
|
-
var version = "0.1.
|
|
97682
|
+
var version = "0.1.1102";
|
|
97674
97683
|
var package_default = {
|
|
97675
97684
|
name: "@tscircuit/cli",
|
|
97676
97685
|
version,
|
|
@@ -97701,7 +97710,7 @@ var package_default = {
|
|
|
97701
97710
|
chokidar: "4.0.1",
|
|
97702
97711
|
"circuit-json": "^0.0.402",
|
|
97703
97712
|
"circuit-json-to-kicad": "^0.0.84",
|
|
97704
|
-
"circuit-json-to-readable-netlist": "^0.0.
|
|
97713
|
+
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
97705
97714
|
"circuit-json-to-spice": "^0.0.10",
|
|
97706
97715
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
97707
97716
|
commander: "^14.0.0",
|
|
@@ -106644,6 +106653,81 @@ async function generateCircuitJson({
|
|
|
106644
106653
|
};
|
|
106645
106654
|
}
|
|
106646
106655
|
|
|
106656
|
+
// cli/build/drc-diagnostic-filter.ts
|
|
106657
|
+
import {
|
|
106658
|
+
categorizeErrorOrWarning
|
|
106659
|
+
} from "@tscircuit/circuit-json-util";
|
|
106660
|
+
var EMPTY_IGNORE_COUNTS = () => ({
|
|
106661
|
+
netlist: 0,
|
|
106662
|
+
pin_specification: 0,
|
|
106663
|
+
placement: 0,
|
|
106664
|
+
routing: 0,
|
|
106665
|
+
unknown: 0
|
|
106666
|
+
});
|
|
106667
|
+
var normalizeCategory = (category) => category === "netlist" || category === "pin_specification" || category === "placement" || category === "routing" ? category : "unknown";
|
|
106668
|
+
var categorizeIssue = (issue) => normalizeCategory(categorizeErrorOrWarning(issue));
|
|
106669
|
+
var shouldIgnoreCategory = (category, ignoreOptions) => {
|
|
106670
|
+
switch (category) {
|
|
106671
|
+
case "netlist":
|
|
106672
|
+
return Boolean(ignoreOptions?.ignoreNetlistDrc);
|
|
106673
|
+
case "pin_specification":
|
|
106674
|
+
return Boolean(ignoreOptions?.ignorePinSpecificationDrc);
|
|
106675
|
+
case "placement":
|
|
106676
|
+
return Boolean(ignoreOptions?.ignorePlacementDrc);
|
|
106677
|
+
case "routing":
|
|
106678
|
+
return Boolean(ignoreOptions?.ignoreRoutingDrc);
|
|
106679
|
+
default:
|
|
106680
|
+
return false;
|
|
106681
|
+
}
|
|
106682
|
+
};
|
|
106683
|
+
var filterIssues = ({
|
|
106684
|
+
issues,
|
|
106685
|
+
ignoreOptions,
|
|
106686
|
+
ignoredByCategory
|
|
106687
|
+
}) => {
|
|
106688
|
+
const kept = [];
|
|
106689
|
+
for (const issue of issues) {
|
|
106690
|
+
const category = categorizeIssue(issue);
|
|
106691
|
+
if (shouldIgnoreCategory(category, ignoreOptions)) {
|
|
106692
|
+
ignoredByCategory[category] += 1;
|
|
106693
|
+
continue;
|
|
106694
|
+
}
|
|
106695
|
+
kept.push(issue);
|
|
106696
|
+
}
|
|
106697
|
+
return kept;
|
|
106698
|
+
};
|
|
106699
|
+
var filterDiagnosticsByDrcCategory = ({
|
|
106700
|
+
errors,
|
|
106701
|
+
warnings,
|
|
106702
|
+
ignoreOptions
|
|
106703
|
+
}) => {
|
|
106704
|
+
const ignoredByCategory = EMPTY_IGNORE_COUNTS();
|
|
106705
|
+
const filteredErrors = filterIssues({
|
|
106706
|
+
issues: errors,
|
|
106707
|
+
ignoreOptions,
|
|
106708
|
+
ignoredByCategory
|
|
106709
|
+
});
|
|
106710
|
+
const filteredWarnings = filterIssues({
|
|
106711
|
+
issues: warnings,
|
|
106712
|
+
ignoreOptions,
|
|
106713
|
+
ignoredByCategory
|
|
106714
|
+
});
|
|
106715
|
+
const ignoredCount = Object.values(ignoredByCategory).reduce((sum, count) => sum + count, 0);
|
|
106716
|
+
return {
|
|
106717
|
+
errors: filteredErrors,
|
|
106718
|
+
warnings: filteredWarnings,
|
|
106719
|
+
ignoredCount,
|
|
106720
|
+
ignoredByCategory
|
|
106721
|
+
};
|
|
106722
|
+
};
|
|
106723
|
+
var formatIgnoredDrcCounts = (counts) => [
|
|
106724
|
+
["netlist", counts.netlist],
|
|
106725
|
+
["pin_specification", counts.pin_specification],
|
|
106726
|
+
["placement", counts.placement],
|
|
106727
|
+
["routing", counts.routing],
|
|
106728
|
+
["unknown", counts.unknown]
|
|
106729
|
+
].filter(([, count]) => count > 0).map(([category, count]) => `${category}: ${count}`).join(", ");
|
|
106730
|
+
|
|
106647
106731
|
// cli/build/build-file.ts
|
|
106648
106732
|
var buildFile = async (input, output, projectDir, options) => {
|
|
106649
106733
|
try {
|
|
@@ -106667,15 +106751,20 @@ var buildFile = async (input, output, projectDir, options) => {
|
|
|
106667
106751
|
fs25.mkdirSync(path26.dirname(output), { recursive: true });
|
|
106668
106752
|
fs25.writeFileSync(output, JSON.stringify(circuitJson, null, 2));
|
|
106669
106753
|
console.log(`Circuit JSON written to ${path26.relative(projectDir, output)}`);
|
|
106670
|
-
const
|
|
106754
|
+
const diagnostics = analyzeCircuitJson(circuitJson);
|
|
106755
|
+
const filteredDiagnostics = filterDiagnosticsByDrcCategory({
|
|
106756
|
+
errors: diagnostics.errors,
|
|
106757
|
+
warnings: diagnostics.warnings,
|
|
106758
|
+
ignoreOptions: options
|
|
106759
|
+
});
|
|
106671
106760
|
if (!options?.ignoreWarnings) {
|
|
106672
|
-
for (const warn of warnings) {
|
|
106761
|
+
for (const warn of filteredDiagnostics.warnings) {
|
|
106673
106762
|
const msg = warn.message || JSON.stringify(warn);
|
|
106674
106763
|
console.log(kleur_default.yellow(msg));
|
|
106675
106764
|
}
|
|
106676
106765
|
}
|
|
106677
106766
|
if (!options?.ignoreErrors) {
|
|
106678
|
-
for (const err of errors) {
|
|
106767
|
+
for (const err of filteredDiagnostics.errors) {
|
|
106679
106768
|
const msg = err.message || JSON.stringify(err);
|
|
106680
106769
|
console.error(kleur_default.red(msg));
|
|
106681
106770
|
if (err.stack) {
|
|
@@ -106686,7 +106775,9 @@ var buildFile = async (input, output, projectDir, options) => {
|
|
|
106686
106775
|
return {
|
|
106687
106776
|
ok: true,
|
|
106688
106777
|
circuitJson,
|
|
106689
|
-
hasErrors: errors.length > 0 && !options?.ignoreErrors
|
|
106778
|
+
hasErrors: filteredDiagnostics.errors.length > 0 && !options?.ignoreErrors,
|
|
106779
|
+
ignoredDrcCount: filteredDiagnostics.ignoredCount,
|
|
106780
|
+
ignoredDrcByCategory: filteredDiagnostics.ignoredByCategory
|
|
106690
106781
|
};
|
|
106691
106782
|
} catch (err) {
|
|
106692
106783
|
console.error(err);
|
|
@@ -108268,6 +108359,8 @@ async function buildFilesWithWorkerPool(options) {
|
|
|
108268
108359
|
previewError: completedMessage.preview_error,
|
|
108269
108360
|
ok: completedMessage.ok,
|
|
108270
108361
|
hasErrors: completedMessage.hasErrors,
|
|
108362
|
+
ignoredDrcCount: completedMessage.ignoredDrcCount,
|
|
108363
|
+
ignoredDrcByCategory: completedMessage.ignoredDrcByCategory,
|
|
108271
108364
|
isFatalError: completedMessage.isFatalError,
|
|
108272
108365
|
errors: completedMessage.errors,
|
|
108273
108366
|
warnings: completedMessage.warnings,
|
|
@@ -108360,7 +108453,7 @@ var getOutputDirName = (relativePath) => {
|
|
|
108360
108453
|
return relativePath.replace(/(\.board|\.circuit)?\.tsx$/, "").replace(/\.circuit\.json$/, "");
|
|
108361
108454
|
};
|
|
108362
108455
|
var registerBuild = (program2) => {
|
|
108363
|
-
program2.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ci", "Run install and optional prebuild/build commands (or default CI build)").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").option("--ignore-config", "Ignore options from tscircuit.config.json").option("--disable-pcb", "Disable PCB outputs").option("--routing-disabled", "Disable routing during circuit generation").option("--disable-parts-engine", "Disable the parts engine").option("--site", "Generate a static site in the dist directory").option("--transpile", "Transpile the entry file to JavaScript").option("--preview-images", "Generate preview images in the dist directory").option("--all-images", "Generate preview images for every successful build output").option("--pngs", "Generate PNG outputs during build generation").option("--svgs", "Generate SVG outputs during build generation").option("--pcb-svgs", "Generate PCB SVG outputs during build generation").option("--schematic-svgs", "Generate schematic SVG outputs during build generation").option("--3d", "Generate 3D PNG outputs during build generation").option("--pcb-only", "Generate only PCB SVG outputs during build generation").option("--schematic-only", "Generate only schematic SVG outputs during build generation").option("--kicad-project", "Generate KiCad project directories for each successful build output").option("--kicad-library", "Generate KiCad library in dist/kicad-library").option("--kicad-library-name <name>", "Specify the name of the KiCad library").option("--preview-gltf", "Generate a GLTF file from the preview entrypoint").option("--glbs", "Generate GLB 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--kicad-pcm", "Generate KiCad PCM (Plugin and Content Manager) assets in dist/pcm").option("--use-cdn-javascript", "Use CDN-hosted JavaScript instead of bundled standalone file for --site").option("--concurrency <number>", "Number of files to build in parallel (default: 1)", "1").option("--inject-props <json>", "Inject JSON props into the built file's default export").option("--inject-props-file <path>", "Inject JSON props from a file into the built file's default export").action(async (file, options) => {
|
|
108456
|
+
program2.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ci", "Run install and optional prebuild/build commands (or default CI build)").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").option("--ignore-netlist-drc", "Ignore netlist DRC errors/warnings").option("--ignore-pin-specification-drc", "Ignore pin-specification DRC errors/warnings").option("--ignore-placement-drc", "Ignore placement DRC errors/warnings").option("--ignore-routing-drc", "Ignore routing DRC errors/warnings").option("--ignore-config", "Ignore options from tscircuit.config.json").option("--disable-pcb", "Disable PCB outputs").option("--routing-disabled", "Disable routing during circuit generation").option("--disable-parts-engine", "Disable the parts engine").option("--site", "Generate a static site in the dist directory").option("--transpile", "Transpile the entry file to JavaScript").option("--preview-images", "Generate preview images in the dist directory").option("--all-images", "Generate preview images for every successful build output").option("--pngs", "Generate PNG outputs during build generation").option("--svgs", "Generate SVG outputs during build generation").option("--pcb-svgs", "Generate PCB SVG outputs during build generation").option("--schematic-svgs", "Generate schematic SVG outputs during build generation").option("--3d", "Generate 3D PNG outputs during build generation").option("--pcb-only", "Generate only PCB SVG outputs during build generation").option("--schematic-only", "Generate only schematic SVG outputs during build generation").option("--kicad-project", "Generate KiCad project directories for each successful build output").option("--kicad-library", "Generate KiCad library in dist/kicad-library").option("--kicad-library-name <name>", "Specify the name of the KiCad library").option("--preview-gltf", "Generate a GLTF file from the preview entrypoint").option("--glbs", "Generate GLB 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--kicad-pcm", "Generate KiCad PCM (Plugin and Content Manager) assets in dist/pcm").option("--use-cdn-javascript", "Use CDN-hosted JavaScript instead of bundled standalone file for --site").option("--concurrency <number>", "Number of files to build in parallel (default: 1)", "1").option("--inject-props <json>", "Inject JSON props into the built file's default export").option("--inject-props-file <path>", "Inject JSON props from a file into the built file's default export").action(async (file, options) => {
|
|
108364
108457
|
try {
|
|
108365
108458
|
const transpileExplicitlyRequested = options?.transpile === true;
|
|
108366
108459
|
const resolvedRoot = path39.resolve(process.cwd());
|
|
@@ -108432,6 +108525,13 @@ var registerBuild = (program2) => {
|
|
|
108432
108525
|
}
|
|
108433
108526
|
let hasErrors = false;
|
|
108434
108527
|
let hasFatalErrors = false;
|
|
108528
|
+
const ignoredDrcByCategory = {
|
|
108529
|
+
netlist: 0,
|
|
108530
|
+
pin_specification: 0,
|
|
108531
|
+
placement: 0,
|
|
108532
|
+
routing: 0,
|
|
108533
|
+
unknown: 0
|
|
108534
|
+
};
|
|
108435
108535
|
const staticFileReferences = [];
|
|
108436
108536
|
const builtFiles = [];
|
|
108437
108537
|
const kicadProjects = [];
|
|
@@ -108449,6 +108549,10 @@ var registerBuild = (program2) => {
|
|
|
108449
108549
|
const buildOptions = {
|
|
108450
108550
|
ignoreErrors: resolvedOptions?.ignoreErrors,
|
|
108451
108551
|
ignoreWarnings: resolvedOptions?.ignoreWarnings,
|
|
108552
|
+
ignoreNetlistDrc: resolvedOptions?.ignoreNetlistDrc,
|
|
108553
|
+
ignorePinSpecificationDrc: resolvedOptions?.ignorePinSpecificationDrc,
|
|
108554
|
+
ignorePlacementDrc: resolvedOptions?.ignorePlacementDrc,
|
|
108555
|
+
ignoreRoutingDrc: resolvedOptions?.ignoreRoutingDrc,
|
|
108452
108556
|
platformConfig,
|
|
108453
108557
|
profile: resolvedOptions?.profile,
|
|
108454
108558
|
injectedProps,
|
|
@@ -108472,6 +108576,13 @@ var registerBuild = (program2) => {
|
|
|
108472
108576
|
if (buildOutcome.hasErrors) {
|
|
108473
108577
|
hasErrors = true;
|
|
108474
108578
|
}
|
|
108579
|
+
if (buildOutcome.ignoredDrcByCategory) {
|
|
108580
|
+
ignoredDrcByCategory.netlist += buildOutcome.ignoredDrcByCategory.netlist;
|
|
108581
|
+
ignoredDrcByCategory.pin_specification += buildOutcome.ignoredDrcByCategory.pin_specification;
|
|
108582
|
+
ignoredDrcByCategory.placement += buildOutcome.ignoredDrcByCategory.placement;
|
|
108583
|
+
ignoredDrcByCategory.routing += buildOutcome.ignoredDrcByCategory.routing;
|
|
108584
|
+
ignoredDrcByCategory.unknown += buildOutcome.ignoredDrcByCategory.unknown;
|
|
108585
|
+
}
|
|
108475
108586
|
if (!buildOutcome.ok) {
|
|
108476
108587
|
hasErrors = true;
|
|
108477
108588
|
if (buildOutcome.isFatalError) {
|
|
@@ -108589,6 +108700,7 @@ var registerBuild = (program2) => {
|
|
|
108589
108700
|
await processBuildResult(result.filePath, result.outputPath, {
|
|
108590
108701
|
ok: result.ok,
|
|
108591
108702
|
hasErrors: result.hasErrors,
|
|
108703
|
+
ignoredDrcByCategory: result.ignoredDrcByCategory,
|
|
108592
108704
|
isFatalError: result.isFatalError
|
|
108593
108705
|
});
|
|
108594
108706
|
if (resolvedOptions?.glbs && result.ok) {
|
|
@@ -108760,6 +108872,10 @@ var registerBuild = (program2) => {
|
|
|
108760
108872
|
const enabledOpts = [
|
|
108761
108873
|
resolvedOptions?.site && "site",
|
|
108762
108874
|
resolvedOptions?.transpile && "transpile",
|
|
108875
|
+
resolvedOptions?.ignoreNetlistDrc && "ignore-netlist-drc",
|
|
108876
|
+
resolvedOptions?.ignorePinSpecificationDrc && "ignore-pin-specification-drc",
|
|
108877
|
+
resolvedOptions?.ignorePlacementDrc && "ignore-placement-drc",
|
|
108878
|
+
resolvedOptions?.ignoreRoutingDrc && "ignore-routing-drc",
|
|
108763
108879
|
resolvedOptions?.previewImages && "preview-images",
|
|
108764
108880
|
resolvedOptions?.allImages && "all-images",
|
|
108765
108881
|
resolvedOptions?.pngs && "pngs",
|
|
@@ -108794,6 +108910,10 @@ var registerBuild = (program2) => {
|
|
|
108794
108910
|
console.log(` Config ${kleur_default.magenta(configAppliedOpts.join(", "))} ${kleur_default.dim("(from tscircuit.config.json)")}`);
|
|
108795
108911
|
}
|
|
108796
108912
|
console.log(` Output ${kleur_default.dim(path39.relative(process.cwd(), distDir) || "dist")}`);
|
|
108913
|
+
const totalIgnoredDrc = Object.values(ignoredDrcByCategory).reduce((sum, count) => sum + count, 0);
|
|
108914
|
+
if (totalIgnoredDrc > 0) {
|
|
108915
|
+
console.log(` Ignored DRC ${kleur_default.yellow(`${totalIgnoredDrc}`)} ${kleur_default.dim(`(${formatIgnoredDrcCounts(ignoredDrcByCategory)})`)}`);
|
|
108916
|
+
}
|
|
108797
108917
|
console.log(hasErrors ? kleur_default.yellow(`
|
|
108798
108918
|
⚠ Build completed with errors`) : kleur_default.green(`
|
|
108799
108919
|
✓ Done`));
|
|
@@ -219482,19 +219602,87 @@ function stripAnsi(string) {
|
|
|
219482
219602
|
if (typeof string !== "string") {
|
|
219483
219603
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
219484
219604
|
}
|
|
219605
|
+
if (!string.includes("\x1B") && !string.includes("")) {
|
|
219606
|
+
return string;
|
|
219607
|
+
}
|
|
219485
219608
|
return string.replace(regex, "");
|
|
219486
219609
|
}
|
|
219487
219610
|
|
|
219611
|
+
// node_modules/get-east-asian-width/lookup-data.js
|
|
219612
|
+
var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
219613
|
+
var fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
219614
|
+
var halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
|
|
219615
|
+
var narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
|
|
219616
|
+
var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
|
|
219617
|
+
|
|
219618
|
+
// node_modules/get-east-asian-width/utilities.js
|
|
219619
|
+
var isInRange = (ranges, codePoint) => {
|
|
219620
|
+
let low = 0;
|
|
219621
|
+
let high = Math.floor(ranges.length / 2) - 1;
|
|
219622
|
+
while (low <= high) {
|
|
219623
|
+
const mid = Math.floor((low + high) / 2);
|
|
219624
|
+
const i2 = mid * 2;
|
|
219625
|
+
if (codePoint < ranges[i2]) {
|
|
219626
|
+
high = mid - 1;
|
|
219627
|
+
} else if (codePoint > ranges[i2 + 1]) {
|
|
219628
|
+
low = mid + 1;
|
|
219629
|
+
} else {
|
|
219630
|
+
return true;
|
|
219631
|
+
}
|
|
219632
|
+
}
|
|
219633
|
+
return false;
|
|
219634
|
+
};
|
|
219635
|
+
|
|
219488
219636
|
// node_modules/get-east-asian-width/lookup.js
|
|
219489
|
-
|
|
219490
|
-
|
|
219491
|
-
|
|
219492
|
-
|
|
219493
|
-
|
|
219494
|
-
|
|
219495
|
-
|
|
219496
|
-
|
|
219497
|
-
|
|
219637
|
+
var minimumAmbiguousCodePoint = ambiguousRanges[0];
|
|
219638
|
+
var maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
|
|
219639
|
+
var minimumFullWidthCodePoint = fullwidthRanges[0];
|
|
219640
|
+
var maximumFullWidthCodePoint = fullwidthRanges.at(-1);
|
|
219641
|
+
var minimumHalfWidthCodePoint = halfwidthRanges[0];
|
|
219642
|
+
var maximumHalfWidthCodePoint = halfwidthRanges.at(-1);
|
|
219643
|
+
var minimumNarrowCodePoint = narrowRanges[0];
|
|
219644
|
+
var maximumNarrowCodePoint = narrowRanges.at(-1);
|
|
219645
|
+
var minimumWideCodePoint = wideRanges[0];
|
|
219646
|
+
var maximumWideCodePoint = wideRanges.at(-1);
|
|
219647
|
+
var commonCjkCodePoint = 19968;
|
|
219648
|
+
var [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);
|
|
219649
|
+
function findWideFastPathRange(ranges) {
|
|
219650
|
+
let fastPathStart = ranges[0];
|
|
219651
|
+
let fastPathEnd = ranges[1];
|
|
219652
|
+
for (let index = 0;index < ranges.length; index += 2) {
|
|
219653
|
+
const start = ranges[index];
|
|
219654
|
+
const end = ranges[index + 1];
|
|
219655
|
+
if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) {
|
|
219656
|
+
return [start, end];
|
|
219657
|
+
}
|
|
219658
|
+
if (end - start > fastPathEnd - fastPathStart) {
|
|
219659
|
+
fastPathStart = start;
|
|
219660
|
+
fastPathEnd = end;
|
|
219661
|
+
}
|
|
219662
|
+
}
|
|
219663
|
+
return [fastPathStart, fastPathEnd];
|
|
219664
|
+
}
|
|
219665
|
+
var isAmbiguous = (codePoint) => {
|
|
219666
|
+
if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) {
|
|
219667
|
+
return false;
|
|
219668
|
+
}
|
|
219669
|
+
return isInRange(ambiguousRanges, codePoint);
|
|
219670
|
+
};
|
|
219671
|
+
var isFullWidth = (codePoint) => {
|
|
219672
|
+
if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) {
|
|
219673
|
+
return false;
|
|
219674
|
+
}
|
|
219675
|
+
return isInRange(fullwidthRanges, codePoint);
|
|
219676
|
+
};
|
|
219677
|
+
var isWide = (codePoint) => {
|
|
219678
|
+
if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
|
|
219679
|
+
return true;
|
|
219680
|
+
}
|
|
219681
|
+
if (codePoint < minimumWideCodePoint || codePoint > maximumWideCodePoint) {
|
|
219682
|
+
return false;
|
|
219683
|
+
}
|
|
219684
|
+
return isInRange(wideRanges, codePoint);
|
|
219685
|
+
};
|
|
219498
219686
|
|
|
219499
219687
|
// node_modules/get-east-asian-width/index.js
|
|
219500
219688
|
function validate2(codePoint) {
|
|
@@ -222049,6 +222237,7 @@ function applyCameraPreset(preset, cam) {
|
|
|
222049
222237
|
}
|
|
222050
222238
|
|
|
222051
222239
|
// lib/shared/snapshot-project.ts
|
|
222240
|
+
import fs64 from "node:fs";
|
|
222052
222241
|
import path66 from "node:path";
|
|
222053
222242
|
|
|
222054
222243
|
// cli/snapshot/worker-pool.ts
|
|
@@ -222351,6 +222540,11 @@ var processSnapshotFile = async ({
|
|
|
222351
222540
|
};
|
|
222352
222541
|
|
|
222353
222542
|
// lib/shared/snapshot-project.ts
|
|
222543
|
+
var hasConfiguredIncludeBoardFiles = (projectDir) => {
|
|
222544
|
+
const projectConfig2 = loadProjectConfig(projectDir);
|
|
222545
|
+
const hasConfiguredPatterns = Boolean(projectConfig2?.includeBoardFiles?.some((pattern) => pattern.trim()));
|
|
222546
|
+
return hasConfiguredPatterns;
|
|
222547
|
+
};
|
|
222354
222548
|
var snapshotProject = async ({
|
|
222355
222549
|
update = false,
|
|
222356
222550
|
ignored = [],
|
|
@@ -222376,12 +222570,29 @@ var snapshotProject = async ({
|
|
|
222376
222570
|
...ignored.map(normalizeIgnorePattern)
|
|
222377
222571
|
];
|
|
222378
222572
|
const resolvedPaths = filePaths.map((f2) => path66.resolve(projectDir, f2));
|
|
222573
|
+
const explicitDirectoryTarget = resolvedPaths.find((resolvedPath) => {
|
|
222574
|
+
if (!fs64.existsSync(resolvedPath)) {
|
|
222575
|
+
return false;
|
|
222576
|
+
}
|
|
222577
|
+
return fs64.statSync(resolvedPath).isDirectory();
|
|
222578
|
+
});
|
|
222379
222579
|
const boardFiles = findBoardFiles({
|
|
222380
222580
|
projectDir,
|
|
222381
222581
|
ignore,
|
|
222382
222582
|
filePaths: resolvedPaths
|
|
222383
222583
|
});
|
|
222384
222584
|
if (boardFiles.length === 0) {
|
|
222585
|
+
if (explicitDirectoryTarget) {
|
|
222586
|
+
const relativeDirectory = path66.relative(projectDir, explicitDirectoryTarget) || ".";
|
|
222587
|
+
const includeBoardFilePatterns = getBoardFilePatterns(projectDir);
|
|
222588
|
+
const patternSourceMessage = hasConfiguredIncludeBoardFiles(projectDir) ? "Searched using tscircuit.config.json includeBoardFiles" : "Searched using default includeBoardFiles";
|
|
222589
|
+
onError([
|
|
222590
|
+
`No circuit files found to create snapshots in directory: "${relativeDirectory}"`,
|
|
222591
|
+
`${patternSourceMessage}: ${JSON.stringify(includeBoardFilePatterns)}`
|
|
222592
|
+
].join(`
|
|
222593
|
+
`));
|
|
222594
|
+
return onExit2(1);
|
|
222595
|
+
}
|
|
222385
222596
|
console.log("No entrypoint found. Run 'tsci init' to bootstrap a project or specify a file with 'tsci snapshot <file>'");
|
|
222386
222597
|
return onExit2(0);
|
|
222387
222598
|
}
|
|
@@ -7023,6 +7023,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
7023
7023
|
var require_pattern = __commonJS((exports) => {
|
|
7024
7024
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7025
7025
|
var code_1 = require_code2();
|
|
7026
|
+
var util_1 = require_util();
|
|
7026
7027
|
var codegen_1 = require_codegen();
|
|
7027
7028
|
var error = {
|
|
7028
7029
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -7035,10 +7036,18 @@ var require_pattern = __commonJS((exports) => {
|
|
|
7035
7036
|
$data: true,
|
|
7036
7037
|
error,
|
|
7037
7038
|
code(cxt) {
|
|
7038
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
7039
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
7039
7040
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
7040
|
-
|
|
7041
|
-
|
|
7041
|
+
if ($data) {
|
|
7042
|
+
const { regExp } = it.opts.code;
|
|
7043
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
7044
|
+
const valid = gen.let("valid");
|
|
7045
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
7046
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
7047
|
+
} else {
|
|
7048
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
7049
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
7050
|
+
}
|
|
7042
7051
|
}
|
|
7043
7052
|
};
|
|
7044
7053
|
exports.default = def;
|
package/dist/lib/index.js
CHANGED
|
@@ -40662,6 +40662,7 @@ var require_limitLength = __commonJS((exports2) => {
|
|
|
40662
40662
|
var require_pattern = __commonJS((exports2) => {
|
|
40663
40663
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
40664
40664
|
var code_1 = require_code2();
|
|
40665
|
+
var util_1 = require_util();
|
|
40665
40666
|
var codegen_1 = require_codegen();
|
|
40666
40667
|
var error = {
|
|
40667
40668
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -40674,10 +40675,18 @@ var require_pattern = __commonJS((exports2) => {
|
|
|
40674
40675
|
$data: true,
|
|
40675
40676
|
error,
|
|
40676
40677
|
code(cxt) {
|
|
40677
|
-
const { data, $data, schema, schemaCode, it } = cxt;
|
|
40678
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
40678
40679
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
40679
|
-
|
|
40680
|
-
|
|
40680
|
+
if ($data) {
|
|
40681
|
+
const { regExp } = it.opts.code;
|
|
40682
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
40683
|
+
const valid = gen.let("valid");
|
|
40684
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
40685
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
40686
|
+
} else {
|
|
40687
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
40688
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
40689
|
+
}
|
|
40681
40690
|
}
|
|
40682
40691
|
};
|
|
40683
40692
|
exports2.default = def;
|
|
@@ -60436,7 +60445,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
60436
60445
|
}));
|
|
60437
60446
|
};
|
|
60438
60447
|
// package.json
|
|
60439
|
-
var version = "0.1.
|
|
60448
|
+
var version = "0.1.1102";
|
|
60440
60449
|
var package_default = {
|
|
60441
60450
|
name: "@tscircuit/cli",
|
|
60442
60451
|
version,
|
|
@@ -60467,7 +60476,7 @@ var package_default = {
|
|
|
60467
60476
|
chokidar: "4.0.1",
|
|
60468
60477
|
"circuit-json": "^0.0.402",
|
|
60469
60478
|
"circuit-json-to-kicad": "^0.0.84",
|
|
60470
|
-
"circuit-json-to-readable-netlist": "^0.0.
|
|
60479
|
+
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
60471
60480
|
"circuit-json-to-spice": "^0.0.10",
|
|
60472
60481
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
60473
60482
|
commander: "^14.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1104",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"chokidar": "4.0.1",
|
|
29
29
|
"circuit-json": "^0.0.402",
|
|
30
30
|
"circuit-json-to-kicad": "^0.0.84",
|
|
31
|
-
"circuit-json-to-readable-netlist": "^0.0.
|
|
31
|
+
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
32
32
|
"circuit-json-to-spice": "^0.0.10",
|
|
33
33
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
34
34
|
"commander": "^14.0.0",
|