Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"ignore": [
"src-tauri/**"
],
"ignoreBinaries": [
"reg"
],
"ignoreExportsUsedInFile": true,
"workspaces": {
".": {
"entry": [
"scripts/*.d.mts",
"scripts/catalog-reference-merge.mjs",
"scripts/gen-gs1-catalog.mjs",
"tests/scripts/*.ts"
]
},
"packages/core": {
"includeEntryExports": true
},
"packages/mcp-server": {
"entry": [
"scripts/*.d.mts"
],
"ignoreDependencies": [
"esbuild",
"postject"
]
}
}
}
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"store:listing": "node scripts/build-store-listing.mjs",
"coverage:gen": "node scripts/gen-coverage.mjs",
"coverage:check": "node scripts/gen-coverage.mjs --check",
"knip": "pnpm dlx knip@6.41.0",
"preview": "vite preview",
"tauri": "tauri",
"e2e": "pnpm build && playwright test"
Expand Down Expand Up @@ -54,7 +55,6 @@
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-konva": "^19.3.0",
"zod": "^4.6.5",
"zundo": "^2.3.0",
"zustand": "^5.0.15"
},
Expand All @@ -68,11 +68,8 @@
"@tauri-apps/cli": "^2.12.1",
"@testing-library/dom": "^10.4.2",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/babel__core": "^7.20.5",
"@types/node": "^26.6.4",
"@types/papaparse": "^5.5.2",
"@types/pixelmatch": "^7.1.0",
"@types/pngjs": "^6.0.5",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
"bwip-js": "^4.11.4",
"fflate": "^0.8.3",
"zod": "^4.6.5"
},
"devDependencies": {
"vitest": "^4.1.11"
}
}
2 changes: 1 addition & 1 deletion packages/core/src/catalog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import raw from "./commands.json";
import type { Catalog, CatalogSection, ZplCommandEntry } from "./schema";

// Types only: a value re-export pulls zod into the app bundle.
export type { CatalogSection, CommandParam, CommandReference, CommandSupport, ImportLossCause, SupportLevel, ZplCommandEntry } from "./schema";
export type { CatalogSection, CommandParam, CommandSupport, ImportLossCause, SupportLevel, ZplCommandEntry } from "./schema";

// Cast, not parse: catalog.test.ts validates the JSON.
const catalog = raw as unknown as Catalog;
Expand Down
13 changes: 0 additions & 13 deletions packages/core/src/lib/customFonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ export function isTrueTypeFileName(path: string): boolean {
/** E=flash, R=RAM, A=removable, B=on-board flash. */
export const ZPL_DRIVE_PREFIXES = ["E:", "R:", "A:", "B:"] as const;

/** Firmware built-ins; excluded from nextFreeAlias auto-pick range. */
export const ZPL_BUILTIN_FONT_IDS = [
"0",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
] as const;

/** The printer path for a locally picked file: a real device, up to 8 name chars, and an extension
* ^A@ and ^CW can reference (spec p.63, p.168). .TTE stays, .OTF and the rest become .TTF (p.184). */
export function printerFontFileName(fileName: string): string | undefined {
Expand Down
5 changes: 0 additions & 5 deletions packages/core/src/lib/footprintProber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ export function registerFootprintMeasurer(m: FootprintMeasurer | null): void {
cache = new WeakMap();
}

/** Clears only if `m` is still active (stale cleanup must not null a successor). */
export function unregisterFootprintMeasurer(m: FootprintMeasurer): void {
if (measurer === m) measurer = null;
}

/** Drop the memo. The cache keys on the props reference, not the resolution
* binding, so a caller that re-measures the same props under a new binding
* (withFootprintBinding) must reset it or read a stale width. */
Expand Down
16 changes: 0 additions & 16 deletions packages/core/src/lib/gs1ModeDFns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,3 @@ export function code128PlainExclusiveFns(
): Set<number> {
return fnConsumerBuckets(objects, variables).plainExclusive;
}

/** Mode-D slots shared with another field type. */
export function gs1ModeDSharedFns(
objects: readonly LabelObject[],
variables: readonly Variable[],
): Set<number> {
return fnConsumerBuckets(objects, variables).modeDShared;
}

/** Plain-^BC slots shared with another field type. */
export function code128PlainSharedFns(
objects: readonly LabelObject[],
variables: readonly Variable[],
): Set<number> {
return fnConsumerBuckets(objects, variables).plainShared;
}
1 change: 0 additions & 1 deletion packages/core/src/lib/storagePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { newId } from "./ids";

/** R volatile RAM, E flash, B alt flash, A alias. */
export const STORAGE_DEVICES = ["R", "E", "B", "A"] as const;
export type StorageDevice = (typeof STORAGE_DEVICES)[number];
/** Where a locally picked font goes. */
export const DEFAULT_FONT_DEVICE = "E";

Expand Down
10 changes: 0 additions & 10 deletions packages/core/src/lib/templateObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ export function rewriteTemplateMarkersMap(
return mapLeafContent(objects, (content) => renameTemplateMarkers(content, renames));
}

/** Replace every `«name»` marker with `replacement` across a subtree's leaf
* `content`. Used on variable deletion. */
export function substituteTemplateMarkers(
objects: LabelObject[],
name: string,
replacement: string,
): LabelObject[] {
return substituteTemplateMarkersMap(objects, new Map([[name, replacement]]));
}

/** Substitute many names in ONE pass per leaf. */
export function substituteTemplateMarkersMap(
objects: LabelObject[],
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/lib/zplParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export type {
ImportFindingKind,
ImportFinding,
ImportReport,
ParsedPage,
ParsedZPL,
FontLossReason,
UnbalancedFormat,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/registry/qrcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const qrFdTransform =
qrFdWire(isQrEcLevel(obj.props.errorCorrection) ? obj.props.errorCorrection : QR_EC_DEFAULT, s);

// Re-exported from lib/qrBy (the cycle-free spot) because this is the prop's home.
export { QR_BY_DEFAULT_HEIGHT, isQrByHeight, qrByHeight } from '../lib/qrBy';
export { QR_BY_DEFAULT_HEIGHT, qrByHeight } from '../lib/qrBy';
const DEFAULT_MAGNIFICATION = 4;

/** ^BQ b per spec p.128: only 1 and 2 exist, anything else is the default. */
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types/LabelConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const RFID_RETRIES_RANGE = { min: 1, max: 10 } as const;
/** ^RW r/w numeric power band; some firmware takes H/M/L instead. */
export const RFID_POWER_RANGE = { min: 0, max: 30 } as const;
export const RFID_POWER_LEVELS = ['H', 'M', 'L'] as const;
export type RfidPowerLevel = (typeof RFID_POWER_LEVELS)[number];
export const isRfidPowerLevel = makeEnumGuard(RFID_POWER_LEVELS);
const rfidPowerSchema = z.union([
intInRange(RFID_POWER_RANGE),
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types/PrinterProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const isMaintenanceAlertType = makeEnumGuard(MAINTENANCE_ALERT_TYPES);

/** ^MA print slot: Y=emit warning label, N=skip. */
export const MAINTENANCE_ALERT_PRINT_VALUES = ['Y', 'N'] as const;
export type MaintenanceAlertPrint = (typeof MAINTENANCE_ALERT_PRINT_VALUES)[number];
export const isMaintenanceAlertPrint = makeEnumGuard(MAINTENANCE_ALERT_PRINT_VALUES);

/** ^MA units slot: C=centimeters, I=inches, M=meters. */
Expand Down
3 changes: 2 additions & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"devDependencies": {
"esbuild": "^0.28.2",
"postject": "^1.0.0-alpha.6",
"tsx": "^4.23.15"
"tsx": "^4.23.15",
"vitest": "^4.1.11"
}
}
2 changes: 1 addition & 1 deletion packages/mcp-server/src/appBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const RASTER_TIMEOUT_MS = 20_000;
export const OPEN_DRAFT_TIMEOUT_MS = 20_000;

/** Waits for the canvas to settle like a design read-back. */
export const EDIT_DESIGN_TIMEOUT_MS = DESIGN_RESPONSE_TIMEOUT_MS;
const EDIT_DESIGN_TIMEOUT_MS = DESIGN_RESPONSE_TIMEOUT_MS;

/** The event a pending entry is waiting on. Kept per request because the
* reply schemas are mutually satisfiable: a draft receipt, a raster response
Expand Down
70 changes: 7 additions & 63 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading