@itxtech/fdnext-resources 2.3.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 ADDED
@@ -0,0 +1,78 @@
1
+ # @itxtech/fdnext-resources
2
+
3
+ Embedded FDB, MDB, PN suggestion indexes, and language resources for fdnext.
4
+
5
+ ## Overview
6
+
7
+ `@itxtech/fdnext-resources` bundles all the static data resources that the fdnext engine needs at runtime. It provides a single `embeddedResourceBundle` object that can be passed directly to `createEngine()`, eliminating the need for filesystem or network access in browser and serverless environments.
8
+
9
+ ### Bundled Resources
10
+
11
+ | Resource | File | Description |
12
+ | :--- | :--- | :--- |
13
+ | **Flash Database (FDB)** | `resources/fdb.json` | Comprehensive NAND Flash chip database — part numbers, Flash IDs, controllers, and vendor metadata |
14
+ | **Marking Database (MDB)** | `resources/mdb.json` | Micron FBGA and SpecTek marking code reverse-lookup database |
15
+ | **Managed NAND PN Index** | `resources/managed-nand-pn.json` | PN suggestion index for eMMC, UFS, eMCP, uMCP, and other managed NAND products |
16
+ | **DRAM PN Index** | `resources/dram-pn.json` | PN suggestion index for DDR/LPDDR DRAM products |
17
+ | **Controller Groups** | `resources/controller-groups.json` | Controller group definitions for projection views (interface, era) |
18
+ | **Language — English** | `resources/lang/eng.json` | English field labels and translations |
19
+ | **Language — Chinese** | `resources/lang/chs.json` | Simplified Chinese field labels and translations |
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pnpm add @itxtech/fdnext-resources
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ### Node.js / Bundler
30
+
31
+ ```ts
32
+ import { embeddedResourceBundle } from "@itxtech/fdnext-resources";
33
+ import { createEngine } from "@itxtech/fdnext-core";
34
+ import { compileDecodePack, defaultDecodePack } from "@itxtech/fdnext-decodepack";
35
+
36
+ const compiled = compileDecodePack(defaultDecodePack);
37
+ const engine = createEngine({
38
+ resources: embeddedResourceBundle,
39
+ decoders: compiled.partDecoders,
40
+ identifierDecoders: compiled.identifierDecoders
41
+ });
42
+ ```
43
+
44
+ ### Browser (fetch static JSON)
45
+
46
+ For browser environments, serve the `resources/` directory as static files and load them via `fetch()`. See the [Integration Guide](../../docs/INTEGRATION.md) for detailed browser setup.
47
+
48
+ ## Exports
49
+
50
+ | Export | Description |
51
+ | :--- | :--- |
52
+ | `embeddedResourceBundle` | Pre-loaded resource bundle ready for `createEngine()` |
53
+ | `getEmbeddedResourceBundle()` | Function form of the same bundle |
54
+ | `EmbeddedResourceBundle` | TypeScript interface for the resource bundle shape |
55
+
56
+ ## Directory Structure
57
+
58
+ ```
59
+ ├── index.ts # Bundle assembly and exports
60
+ └── resources/
61
+ ├── fdb.json # Flash Database
62
+ ├── mdb.json # Marking Database
63
+ ├── managed-nand-pn.json # Managed NAND PN suggestion index
64
+ ├── dram-pn.json # DRAM PN suggestion index
65
+ ├── controller-groups.json # Controller group definitions
66
+ └── lang/
67
+ ├── eng.json # English translations
68
+ └── chs.json # Chinese translations
69
+ ```
70
+
71
+ ## Documentation
72
+
73
+ - [Integration Guide](https://github.com/iTXTech/fdnext/blob/master/docs/INTEGRATION.md) — Browser resource loading patterns
74
+ - [FDBGen Guide](https://github.com/iTXTech/fdnext/blob/master/docs/FDBGEN.md) — How FDB and MDB are generated
75
+
76
+ ## License
77
+
78
+ AGPL-3.0-or-later — See [LICENSE](https://github.com/iTXTech/fdnext/blob/master/LICENSE) for details.
@@ -0,0 +1,41 @@
1
+ export type ResourcesRecord = Record<string, unknown>;
2
+ export type SearchResourceRecord = Record<string, unknown> | unknown[];
3
+ export type LangRecord = Record<string, string>;
4
+ export type ResourceJson = ResourcesRecord | unknown[];
5
+ export interface EmbeddedResourceBundle {
6
+ partIndex: {
7
+ rawNand: ResourcesRecord;
8
+ managedNand: SearchResourceRecord;
9
+ dram: SearchResourceRecord;
10
+ };
11
+ identifierIndex: {
12
+ nandFlash: ResourcesRecord;
13
+ };
14
+ markingIndex: {
15
+ packageMarkings: ResourcesRecord;
16
+ };
17
+ vendorIndex: Record<string, never>;
18
+ controllerIndex: ResourcesRecord;
19
+ translationIndex: Record<string, LangRecord>;
20
+ }
21
+ export declare const embeddedResourceBundle: {
22
+ partIndex: {
23
+ rawNand: ResourcesRecord;
24
+ managedNand: SearchResourceRecord;
25
+ dram: SearchResourceRecord;
26
+ };
27
+ identifierIndex: {
28
+ nandFlash: ResourcesRecord;
29
+ };
30
+ markingIndex: {
31
+ packageMarkings: ResourcesRecord;
32
+ };
33
+ vendorIndex: {};
34
+ controllerIndex: ResourcesRecord;
35
+ translationIndex: {
36
+ chs: LangRecord;
37
+ eng: LangRecord;
38
+ };
39
+ };
40
+ export declare function getEmbeddedResourceBundle(): EmbeddedResourceBundle;
41
+ //# sourceMappingURL=index.d.ts.map