@chestnutlabs/gcode-preview-svelte 0.1.0
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 +67 -0
- package/dist/GcodePreview.svelte +113 -0
- package/dist/create-gcode-preview.d.ts +47 -0
- package/dist/create-gcode-preview.d.ts.map +1 -0
- package/dist/create-gcode-preview.js +25 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @chestnutlabs/gcode-preview-svelte
|
|
2
|
+
|
|
3
|
+
Thin Svelte integration for the Chestnut Labs G-code viewer — a reactivity bridge over
|
|
4
|
+
`@chestnutlabs/gcode-preview-core` with **capability parity** to the Vue and React adapters
|
|
5
|
+
(same engine, same state model, same TypeScript contracts; DD-007 D1 amendment).
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @chestnutlabs/gcode-preview-svelte three
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
(`three` is a peerDependency of the renderer, supported range `^0.178.0` — npm ≥ 7 installs
|
|
12
|
+
it automatically; pnpm/yarn users add it explicitly. See the
|
|
13
|
+
[support policy](../../docs/reference/support-policy.md).)
|
|
14
|
+
|
|
15
|
+
## Ready-to-use component
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import GcodePreview from '@chestnutlabs/gcode-preview-svelte/GcodePreview.svelte';
|
|
20
|
+
let file = null;
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div style="height: 70vh">
|
|
24
|
+
<GcodePreview source={file} on:ready={(e) => console.log(`${e.detail.segments} segments`)} />
|
|
25
|
+
</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
That is a complete viewer. The component ships as a **raw `.svelte` file** (standard Svelte
|
|
29
|
+
library packaging — your bundler's svelte plugin compiles it via the `svelte` export condition).
|
|
30
|
+
Full defaulted prop surface: `source`, `parseOptions`, `buildVolume` (consumer-wins bed
|
|
31
|
+
precedence), `quality`, `colorMode`, `layerRange`, `scrub`, `showTravel`, `progress` (DD-006
|
|
32
|
+
observation), `createWorker`. Events: `ready`, `parseerror`, `parsecancelled`, `parseprogress`,
|
|
33
|
+
`buildcomplete`, `qualityfallback`, `machinegeometrymismatch`/`discovered`,
|
|
34
|
+
`progresspresentationchanged`, `disclosure`, `error`. The full handle is exported as `preview`
|
|
35
|
+
(`bind:this` then `.preview`).
|
|
36
|
+
|
|
37
|
+
## Store/action API (build your own controls)
|
|
38
|
+
|
|
39
|
+
```svelte
|
|
40
|
+
<script>
|
|
41
|
+
import { createGcodePreview } from '@chestnutlabs/gcode-preview-svelte';
|
|
42
|
+
import { onDestroy } from 'svelte';
|
|
43
|
+
|
|
44
|
+
const preview = createGcodePreview();
|
|
45
|
+
onDestroy(() => preview.dispose());
|
|
46
|
+
// $state store: const state = preview.state; → {$state.summary?.segments}
|
|
47
|
+
// await preview.parse(bytes); preview.controls.setScrubPosition(n);
|
|
48
|
+
// preview.observeProgress(obs); preview.raw.renderer()
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<canvas use:preview.canvas style="width: 100%; height: 100%" />
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`preview.state` follows the Svelte store contract (immediate emission + every snapshot after),
|
|
55
|
+
so `$`-prefix auto-subscription works. Headless (non-component) users call `dispose()` themselves.
|
|
56
|
+
|
|
57
|
+
## Workers
|
|
58
|
+
|
|
59
|
+
Batteries default (all dialect adapters + `.gcode.3mf`) needs zero setup under Vite; pass
|
|
60
|
+
`createWorker` for the slim build, custom adapters, other bundlers, or strict CSP — options are
|
|
61
|
+
identical across all three framework adapters by design (see the Vue README for the shared worker
|
|
62
|
+
documentation).
|
|
63
|
+
|
|
64
|
+
## Example
|
|
65
|
+
|
|
66
|
+
`tools/example-svelte` in the repository is a complete Vite + Svelte app (corpus load,
|
|
67
|
+
layer/scrub, simulated live progress) compiling the raw component through the export condition.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* <GcodePreview> — the ready-to-use Svelte component (DD-007 D1 amendment, phase 7).
|
|
4
|
+
*
|
|
5
|
+
* Strictly a SHELL over `createGcodePreview` (D1: never a separate implementation):
|
|
6
|
+
* every prop is a reactive statement into the store/action API, every dispatched event
|
|
7
|
+
* re-fires a controller event, and the underlying handle is exported for bind:this
|
|
8
|
+
* access (`preview`). Advanced props are optional with sensible defaults, so
|
|
9
|
+
* `<GcodePreview source={file} />` alone is a working viewer (D4).
|
|
10
|
+
*
|
|
11
|
+
* Svelte-4-style component (compiles under Svelte 5 compat) shipped RAW — the
|
|
12
|
+
* consumer's bundler compiles it via the "svelte" export condition.
|
|
13
|
+
*/
|
|
14
|
+
import { createEventDispatcher, onDestroy } from 'svelte';
|
|
15
|
+
import { createGcodePreview } from './create-gcode-preview.js';
|
|
16
|
+
|
|
17
|
+
/** Bytes/File to parse. Changing it re-parses. */
|
|
18
|
+
export let source = null;
|
|
19
|
+
export let parseOptions = undefined;
|
|
20
|
+
/** Consumer-configured volume — wins over file-discovered geometry (DD-005). */
|
|
21
|
+
export let buildVolume = undefined;
|
|
22
|
+
export let quality = 'auto';
|
|
23
|
+
export let colorMode = undefined;
|
|
24
|
+
export let tube = undefined;
|
|
25
|
+
/** Inclusive [start, end]; null shows every layer. */
|
|
26
|
+
export let layerRange = null;
|
|
27
|
+
/** Scrub cut (IR segment index); null shows everything up to the layer range. */
|
|
28
|
+
export let scrub = null;
|
|
29
|
+
export let showTravel = true;
|
|
30
|
+
/** DD-006 live progress observation; null hides the overlay. */
|
|
31
|
+
export let progress = null;
|
|
32
|
+
/** Worker factory escape hatch (DD-005 slim/custom entries; D2). */
|
|
33
|
+
export let createWorker = undefined;
|
|
34
|
+
/** Advanced/test renderer injectables (pass-throughs of the renderer contract). */
|
|
35
|
+
export let rendererOptions = undefined;
|
|
36
|
+
|
|
37
|
+
const dispatch = createEventDispatcher();
|
|
38
|
+
const isMachine = buildVolume !== undefined && 'bed' in buildVolume;
|
|
39
|
+
|
|
40
|
+
/** The full store/action handle — reachable via `bind:this={c}` then `c.preview`. */
|
|
41
|
+
export const preview = createGcodePreview({
|
|
42
|
+
createWorker,
|
|
43
|
+
renderer: {
|
|
44
|
+
buildVolume: isMachine ? undefined : buildVolume,
|
|
45
|
+
quality,
|
|
46
|
+
colorMode,
|
|
47
|
+
tube,
|
|
48
|
+
...rendererOptions
|
|
49
|
+
},
|
|
50
|
+
parseDefaults: parseOptions
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
if (isMachine) preview.controls.setBuildVolume(buildVolume);
|
|
54
|
+
|
|
55
|
+
preview.onEvent((e) => {
|
|
56
|
+
switch (e.type) {
|
|
57
|
+
case 'parse-complete':
|
|
58
|
+
dispatch('ready', { segments: e.segments, layers: e.layers, complete: e.complete });
|
|
59
|
+
break;
|
|
60
|
+
case 'parse-error':
|
|
61
|
+
dispatch('parseerror', { code: e.code, message: e.message });
|
|
62
|
+
break;
|
|
63
|
+
case 'parse-cancelled':
|
|
64
|
+
dispatch('parsecancelled');
|
|
65
|
+
break;
|
|
66
|
+
case 'parse-progress':
|
|
67
|
+
dispatch('parseprogress', { bytesProcessed: e.progress.bytesProcessed, totalBytes: e.progress.totalBytes });
|
|
68
|
+
break;
|
|
69
|
+
case 'buildComplete': {
|
|
70
|
+
dispatch('buildcomplete', { segments: e.segments, quality: e.quality });
|
|
71
|
+
let disclosure = '';
|
|
72
|
+
const off = preview.state.subscribe((s) => (disclosure = s.disclosure));
|
|
73
|
+
off();
|
|
74
|
+
dispatch('disclosure', disclosure);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case 'qualityFallback':
|
|
78
|
+
dispatch('qualityfallback', { from: e.from, to: e.to, reason: e.reason });
|
|
79
|
+
break;
|
|
80
|
+
case 'progress-presentation-changed':
|
|
81
|
+
dispatch('progresspresentationchanged', e.reason === undefined ? { mode: e.mode } : { mode: e.mode, reason: e.reason });
|
|
82
|
+
break;
|
|
83
|
+
case 'machine-geometry-discovered':
|
|
84
|
+
dispatch('machinegeometrydiscovered', e.machine);
|
|
85
|
+
break;
|
|
86
|
+
case 'error':
|
|
87
|
+
if (e.code === 'machine-geometry-mismatch') dispatch('machinegeometrymismatch', e.message);
|
|
88
|
+
else dispatch('error', { code: e.code, message: e.message });
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// ---- prop wiring: each prop is a thin reactive call into the handle (D1 shell rule) ----
|
|
96
|
+
$: if (source !== null && source !== undefined) void preview.parse(source, parseOptions);
|
|
97
|
+
$: if (layerRange === null || layerRange === undefined) preview.controls.setLayerRange(0, Number.POSITIVE_INFINITY);
|
|
98
|
+
else preview.controls.setLayerRange(layerRange[0], layerRange[1]);
|
|
99
|
+
$: preview.controls.setScrubPosition(scrub ?? null);
|
|
100
|
+
$: preview.controls.setKindVisible('travel', showTravel);
|
|
101
|
+
$: if (colorMode !== undefined) preview.controls.setColorMode(colorMode);
|
|
102
|
+
$: preview.controls.setQuality(quality);
|
|
103
|
+
$: if (progress === null || progress === undefined) preview.clearProgress();
|
|
104
|
+
else preview.observeProgress(progress);
|
|
105
|
+
|
|
106
|
+
onDestroy(() => preview.dispose());
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<canvas
|
|
110
|
+
use:preview.canvas
|
|
111
|
+
style="width: 100%; height: 100%; display: block; touch-action: none;"
|
|
112
|
+
aria-label="3D G-code toolpath preview"
|
|
113
|
+
></canvas>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createGcodePreview — the Svelte reactivity bridge over the framework-neutral
|
|
3
|
+
* controller (DD-007 §4.6 D1 amendment, phase 7, issue #114). This file owns ONLY the
|
|
4
|
+
* Svelte-isms: a store-contract `state` (subscribe receiving controller snapshots) and
|
|
5
|
+
* a `use:` action for the canvas. Engine mechanics and contracts live in
|
|
6
|
+
* @chestnutlabs/gcode-preview-core and are RE-EXPORTED, never redeclared.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle: the component wrapper disposes via onDestroy. Headless users (this API
|
|
9
|
+
* outside a component) call `dispose()` themselves — there is no ambient scope to tie to.
|
|
10
|
+
*/
|
|
11
|
+
import type { GcodeParseSession, WireParseOptions } from '@chestnutlabs/gcode-parser';
|
|
12
|
+
import type { ToolpathRenderer } from '@chestnutlabs/gcode-renderer-three';
|
|
13
|
+
import type { MappedProgress, ProgressObservation } from '@chestnutlabs/toolpath-core';
|
|
14
|
+
import { type GcodePreviewControls, type GcodePreviewState, type ParseOutcome, type PreviewControllerOptions, type PreviewEvent } from '@chestnutlabs/gcode-preview-core';
|
|
15
|
+
export type { GcodePreviewControls, GcodePreviewState, ParseOutcome, PreviewEvent } from '@chestnutlabs/gcode-preview-core';
|
|
16
|
+
/** Svelte-facing options — identical to the controller's (the alias is the public name). */
|
|
17
|
+
export type CreateGcodePreviewOptions = PreviewControllerOptions;
|
|
18
|
+
/** Minimal svelte/store Readable contract — declared structurally so the shipped JS
|
|
19
|
+
* never imports 'svelte' (the component and consumers bring their own). */
|
|
20
|
+
export interface ReadableState {
|
|
21
|
+
subscribe(run: (state: GcodePreviewState) => void): () => void;
|
|
22
|
+
}
|
|
23
|
+
/** Svelte `use:` action result for the canvas binding. */
|
|
24
|
+
export interface CanvasActionResult {
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
export interface SvelteGcodePreview {
|
|
28
|
+
/** Store-contract state: subscribers receive the current snapshot immediately,
|
|
29
|
+
* then every replacement — `$preview.state` works in components. */
|
|
30
|
+
state: ReadableState;
|
|
31
|
+
/** Canvas binding as a Svelte action: `<canvas use:preview.canvas />`. */
|
|
32
|
+
canvas(el: HTMLCanvasElement): CanvasActionResult;
|
|
33
|
+
parse(input: Uint8Array | ArrayBuffer | File, opts?: WireParseOptions): Promise<ParseOutcome>;
|
|
34
|
+
cancel(): void;
|
|
35
|
+
observeProgress(obs: ProgressObservation): MappedProgress | null;
|
|
36
|
+
tickProgress(nowMs: number): MappedProgress | null;
|
|
37
|
+
clearProgress(): void;
|
|
38
|
+
controls: GcodePreviewControls;
|
|
39
|
+
raw: {
|
|
40
|
+
session: GcodeParseSession;
|
|
41
|
+
renderer: () => ToolpathRenderer | null;
|
|
42
|
+
};
|
|
43
|
+
onEvent(cb: (e: PreviewEvent) => void): () => void;
|
|
44
|
+
dispose(): void;
|
|
45
|
+
}
|
|
46
|
+
export declare function createGcodePreview(options?: CreateGcodePreviewOptions): SvelteGcodePreview;
|
|
47
|
+
//# sourceMappingURL=create-gcode-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-gcode-preview.d.ts","sourceRoot":"","sources":["../src/create-gcode-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAClB,MAAM,kCAAkC,CAAC;AAG1C,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,kCAAkC,CAAC;AAE1C,4FAA4F;AAC5F,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAEjE;4EAC4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAChE;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC;yEACqE;IACrE,KAAK,EAAE,aAAa,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAClD,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9F,MAAM,IAAI,IAAI,CAAC;IACf,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;IACjE,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACnD,aAAa,IAAI,IAAI,CAAC;IACtB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,GAAG,EAAE;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,QAAQ,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAA;KAAE,CAAC;IAC7E,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,kBAAkB,CAuB9F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createPreviewController } from '@chestnutlabs/gcode-preview-core';
|
|
2
|
+
export function createGcodePreview(options = {}) {
|
|
3
|
+
const controller = createPreviewController(options);
|
|
4
|
+
return {
|
|
5
|
+
state: {
|
|
6
|
+
subscribe(run) {
|
|
7
|
+
run(controller.getState()); // store contract: immediate emission
|
|
8
|
+
return controller.onStateChange(run);
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
canvas: (el) => {
|
|
12
|
+
controller.bindCanvas(el);
|
|
13
|
+
return { destroy: () => controller.bindCanvas(null) };
|
|
14
|
+
},
|
|
15
|
+
parse: controller.parse,
|
|
16
|
+
cancel: controller.cancel,
|
|
17
|
+
observeProgress: controller.observeProgress,
|
|
18
|
+
tickProgress: controller.tickProgress,
|
|
19
|
+
clearProgress: controller.clearProgress,
|
|
20
|
+
controls: controller.controls,
|
|
21
|
+
raw: controller.raw,
|
|
22
|
+
onEvent: controller.onEvent,
|
|
23
|
+
dispose: controller.dispose
|
|
24
|
+
};
|
|
25
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chestnutlabs/gcode-preview-svelte — thin Svelte integration (DD-007 D1 amendment).
|
|
3
|
+
*
|
|
4
|
+
* `createGcodePreview` store/action API + the raw `GcodePreview.svelte` component
|
|
5
|
+
* (import from '@chestnutlabs/gcode-preview-svelte/GcodePreview.svelte' — the consumer's
|
|
6
|
+
* bundler compiles it via the "svelte" export condition). Both are reactivity bridges
|
|
7
|
+
* over @chestnutlabs/gcode-preview-core — never a separate viewer implementation.
|
|
8
|
+
*/
|
|
9
|
+
export * from './create-gcode-preview.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chestnutlabs/gcode-preview-svelte — thin Svelte integration (DD-007 D1 amendment).
|
|
3
|
+
*
|
|
4
|
+
* `createGcodePreview` store/action API + the raw `GcodePreview.svelte` component
|
|
5
|
+
* (import from '@chestnutlabs/gcode-preview-svelte/GcodePreview.svelte' — the consumer's
|
|
6
|
+
* bundler compiles it via the "svelte" export condition). Both are reactivity bridges
|
|
7
|
+
* over @chestnutlabs/gcode-preview-core — never a separate viewer implementation.
|
|
8
|
+
*/
|
|
9
|
+
export * from './create-gcode-preview.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chestnutlabs/gcode-preview-svelte",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Thin Svelte integration for the Chestnut Labs G-code viewer (DD-007 D1 amendment): createGcodePreview store/action API + GcodePreview component as a reactivity bridge over @chestnutlabs/gcode-preview-core.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"gcode",
|
|
7
|
+
"3d-printing",
|
|
8
|
+
"toolpath",
|
|
9
|
+
"cnc",
|
|
10
|
+
"chestnutlabs",
|
|
11
|
+
"svelte",
|
|
12
|
+
"store",
|
|
13
|
+
"component",
|
|
14
|
+
"viewer",
|
|
15
|
+
"preview"
|
|
16
|
+
],
|
|
17
|
+
"author": "Chestnut Labs",
|
|
18
|
+
"homepage": "https://github.com/ChestnutLabs/gcode-preview#readme",
|
|
19
|
+
"bugs": "https://github.com/ChestnutLabs/gcode-preview/issues",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/ChestnutLabs/gcode-preview.git",
|
|
23
|
+
"directory": "packages/gcode-preview-svelte"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"module": "./dist/index.js",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"svelte": "./dist/index.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"svelte": "./dist/index.js",
|
|
39
|
+
"import": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./GcodePreview.svelte": {
|
|
42
|
+
"svelte": "./dist/GcodePreview.svelte",
|
|
43
|
+
"import": "./dist/GcodePreview.svelte"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist"
|
|
48
|
+
],
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -p tsconfig.json && node copy-svelte.mjs",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@chestnutlabs/gcode-parser": "0.1.0",
|
|
59
|
+
"@chestnutlabs/gcode-preview-core": "0.1.0",
|
|
60
|
+
"@chestnutlabs/gcode-renderer-three": "0.1.0",
|
|
61
|
+
"@chestnutlabs/toolpath-core": "0.1.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"svelte": "^4.0.0 || ^5.0.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"svelte": "^4.2.0"
|
|
68
|
+
}
|
|
69
|
+
}
|