@zebrash/core 1.0.0 → 1.0.2

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 ADDED
@@ -0,0 +1,26 @@
1
+ # @zebrash/core
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@zebrash/core?color=cb3837&logo=npm)](https://www.npmjs.com/package/@zebrash/core)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Internal engine for the `@zebrash` family — the
7
+ [ZPL II](https://en.wikipedia.org/wiki/Zebra_Programming_Language) parser,
8
+ drawer, and barcode encoders, plus a platform abstraction selected at bundle
9
+ time via the `"browser"` field in `package.json`.
10
+
11
+ > **End users should not import `@zebrash/core` directly.** It has no built-in
12
+ > rasterization backend. Pick the runtime-appropriate wrapper instead:
13
+ >
14
+ > - **Node / Bun:** [`@zebrash/node`](https://www.npmjs.com/package/@zebrash/node)
15
+ > - **Browser:** [`@zebrash/browser`](https://www.npmjs.com/package/@zebrash/browser)
16
+ >
17
+ > Both expose the same `Parser` / `Drawer` / `LabelInfo` / `DrawerOptions` API.
18
+
19
+ ## Documentation
20
+
21
+ See the [main README](https://github.com/Fountain-Bio/zebrash-ts#readme) for
22
+ usage, supported ZPL commands, and the SVG-output reference.
23
+
24
+ ## License
25
+
26
+ MIT.
@@ -5,9 +5,11 @@
5
5
  * the bytes, and returns them as `Uint8Array`. Called via the `package.json`
6
6
  * `"browser"` field swap when bundling for the browser.
7
7
  *
8
- * Default base URL serves the fonts directly from the public GitHub repo via
9
- * jsdelivr. Override via `setFontBaseUrl(...)` to self-host (CSP, offline,
10
- * version-pinning).
8
+ * Default base URL serves the fonts from the published `@zebrash/core`
9
+ * tarball via jsdelivr. The `files` field in core's package.json includes
10
+ * `src/assets/fonts`, so this path is stable across repo restructures and
11
+ * doesn't depend on branch state. Override via `setFontBaseUrl(...)` to
12
+ * self-host (CSP, offline, version-pinning).
11
13
  */
12
14
  export type FontKey = "HelveticaBold" | "DejavuSansMono" | "DejavuSansMonoBold" | "ZplGS";
13
15
  export declare function setFontBaseUrl(url: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"fonts-browser.d.ts","sourceRoot":"","sources":["../../src/assets/fonts-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,OAAO,CAAC;AAW1F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD;AAKD,wBAAsB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBvE"}
1
+ {"version":3,"file":"fonts-browser.d.ts","sourceRoot":"","sources":["../../src/assets/fonts-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,OAAO,CAAC;AAW1F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD;AAKD,wBAAsB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBvE"}
@@ -5,9 +5,11 @@
5
5
  * the bytes, and returns them as `Uint8Array`. Called via the `package.json`
6
6
  * `"browser"` field swap when bundling for the browser.
7
7
  *
8
- * Default base URL serves the fonts directly from the public GitHub repo via
9
- * jsdelivr. Override via `setFontBaseUrl(...)` to self-host (CSP, offline,
10
- * version-pinning).
8
+ * Default base URL serves the fonts from the published `@zebrash/core`
9
+ * tarball via jsdelivr. The `files` field in core's package.json includes
10
+ * `src/assets/fonts`, so this path is stable across repo restructures and
11
+ * doesn't depend on branch state. Override via `setFontBaseUrl(...)` to
12
+ * self-host (CSP, offline, version-pinning).
11
13
  */
12
14
  const filenames = {
13
15
  HelveticaBold: "HelveticaBoldCondensedCustom.ttf",
@@ -15,7 +17,7 @@ const filenames = {
15
17
  DejavuSansMonoBold: "DejaVuSansMonoBold.ttf",
16
18
  ZplGS: "ZplGSCustom.ttf",
17
19
  };
18
- let baseUrl = "https://cdn.jsdelivr.net/gh/Fountain-Bio/zebrash-ts@main/src/assets/fonts/";
20
+ let baseUrl = "https://cdn.jsdelivr.net/npm/@zebrash/core/src/assets/fonts/";
19
21
  export function setFontBaseUrl(url) {
20
22
  baseUrl = url.endsWith("/") ? url : `${url}/`;
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zebrash/core",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Engine for the @zebrash family — pure-TS ZPL parser + renderer. Internal package; consume @zebrash/node or @zebrash/browser.",
5
5
  "keywords": [
6
6
  "barcode",