@fjell/registry 4.4.16 → 4.4.20
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/build.js +4 -0
- package/dist/Coordinate.d.ts +2 -1
- package/dist/Coordinate.d.ts.map +1 -0
- package/dist/Instance.d.ts +3 -2
- package/dist/Instance.d.ts.map +1 -0
- package/dist/Registry.d.ts +1 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/RegistryHub.d.ts +1 -0
- package/dist/RegistryHub.d.ts.map +1 -0
- package/dist/RegistryStats.d.ts +3 -1
- package/dist/RegistryStats.d.ts.map +1 -0
- package/dist/errors/CoordinateError.d.ts +1 -0
- package/dist/errors/CoordinateError.d.ts.map +1 -0
- package/dist/errors/InstanceError.d.ts +1 -0
- package/dist/errors/InstanceError.d.ts.map +1 -0
- package/dist/errors/RegistryError.d.ts +1 -0
- package/dist/errors/RegistryError.d.ts.map +1 -0
- package/dist/errors/RegistryHubError.d.ts +1 -0
- package/dist/errors/RegistryHubError.d.ts.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +685 -10
- package/dist/index.js.map +7 -0
- package/dist/logger.d.ts +2 -1
- package/dist/logger.d.ts.map +1 -0
- package/dist/types.d.ts +6 -4
- package/dist/types.d.ts.map +1 -0
- package/docs/docs.config.ts +1 -32
- package/docs/package-lock.json +5129 -0
- package/docs/package.json +2 -2
- package/docs/src/types.d.ts +13 -5
- package/docs/timing-range.svg +172 -0
- package/examples/multi-level-keys.ts +10 -2
- package/package.json +21 -33
- package/tsconfig.docs.json +28 -0
- package/vitest.config.ts +17 -0
- package/MIGRATION_SUMMARY.md +0 -200
- package/dist/Coordinate.cjs +0 -32
- package/dist/Coordinate.js +0 -28
- package/dist/Instance.cjs +0 -24
- package/dist/Instance.js +0 -19
- package/dist/Registry.cjs +0 -182
- package/dist/Registry.js +0 -178
- package/dist/RegistryHub.cjs +0 -94
- package/dist/RegistryHub.js +0 -90
- package/dist/RegistryStats.cjs +0 -200
- package/dist/RegistryStats.js +0 -196
- package/dist/errors/CoordinateError.cjs +0 -70
- package/dist/errors/CoordinateError.js +0 -63
- package/dist/errors/InstanceError.cjs +0 -101
- package/dist/errors/InstanceError.js +0 -92
- package/dist/errors/RegistryError.cjs +0 -82
- package/dist/errors/RegistryError.js +0 -75
- package/dist/errors/RegistryHubError.cjs +0 -92
- package/dist/errors/RegistryHubError.js +0 -84
- package/dist/index.cjs +0 -823
- package/dist/index.cjs.map +0 -1
- package/dist/logger.cjs +0 -10
- package/dist/logger.js +0 -6
package/docs/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"copy-docs": "
|
|
7
|
+
"copy-docs": "npx copy-docs",
|
|
8
8
|
"dev": "npm run copy-docs && vite",
|
|
9
9
|
"build": "npm run copy-docs && tsc && vite build",
|
|
10
10
|
"preview": "vite preview",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test:watch": "vitest --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fjell/docs-template": "^1.0.
|
|
15
|
+
"@fjell/docs-template": "^1.0.24",
|
|
16
16
|
"react": "^19.1.0",
|
|
17
17
|
"react-dom": "^19.1.0"
|
|
18
18
|
},
|
package/docs/src/types.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ declare module '@fjell/docs-template' {
|
|
|
21
21
|
subtitle: string;
|
|
22
22
|
file: string;
|
|
23
23
|
}>;
|
|
24
|
+
filesToCopy: Array<{
|
|
25
|
+
source: string;
|
|
26
|
+
destination: string;
|
|
27
|
+
}>;
|
|
24
28
|
plugins?: any[];
|
|
25
29
|
version: {
|
|
26
30
|
source: string;
|
|
@@ -34,11 +38,15 @@ declare module '@fjell/docs-template' {
|
|
|
34
38
|
config: DocsConfig;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
export const DocsApp:
|
|
41
|
+
export const DocsApp: any;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
declare module '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
declare module '@fjell/docs-template/config' {
|
|
45
|
+
export function createDocsViteConfig(options?: {
|
|
46
|
+
basePath?: string;
|
|
47
|
+
port?: number;
|
|
48
|
+
plugins?: any[];
|
|
49
|
+
packageJsonPath?: string;
|
|
50
|
+
defineVars?: Record<string, any>;
|
|
51
|
+
}): any;
|
|
44
52
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="1200" height="800" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<style>
|
|
4
|
+
.axis { stroke: #333; stroke-width: 1; }
|
|
5
|
+
.grid { stroke: #ddd; stroke-width: 0.5; }
|
|
6
|
+
.label { font-family: Arial, sans-serif; font-size: 14px; fill: #333; }
|
|
7
|
+
.title { font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; fill: #333; }
|
|
8
|
+
.subtitle { font-family: Arial, sans-serif; font-size: 12px; fill: #666; }
|
|
9
|
+
.register-mean { stroke: #e74c3c; stroke-width: 3; fill: none; }
|
|
10
|
+
.lookup-mean { stroke: #3498db; stroke-width: 3; fill: none; }
|
|
11
|
+
.register-band { fill: rgba(231, 76, 60, 0.2); stroke: #e74c3c; stroke-width: 1; }
|
|
12
|
+
.lookup-band { fill: rgba(52, 152, 219, 0.2); stroke: #3498db; stroke-width: 1; }
|
|
13
|
+
.register-dot { fill: #e74c3c; }
|
|
14
|
+
.lookup-dot { fill: #3498db; }
|
|
15
|
+
.legend { font-family: Arial, sans-serif; font-size: 12px; fill: #333; }
|
|
16
|
+
.axis-title { font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; fill: #333; }
|
|
17
|
+
.metadata-title { font-family: Arial, sans-serif; font-size: 14px; font-weight: bold; fill: #333; }
|
|
18
|
+
.metadata-section { font-family: Arial, sans-serif; font-size: 14px; font-weight: bold; fill: #444; }
|
|
19
|
+
.metadata-label { font-family: Arial, sans-serif; font-size: 10px; fill: #666; }
|
|
20
|
+
.metadata-value { font-family: Arial, sans-serif; font-size: 10px; fill: #333; }
|
|
21
|
+
</style>
|
|
22
|
+
|
|
23
|
+
<!-- Background -->
|
|
24
|
+
<rect width="1200" height="800" fill="white"/>
|
|
25
|
+
|
|
26
|
+
<!-- Title -->
|
|
27
|
+
<text x="600" y="25" text-anchor="middle" class="title">Timing of Common Registry Operations</text>
|
|
28
|
+
<text x="600" y="45" text-anchor="middle" class="subtitle">Performance measurements across varying tree sizes</text>
|
|
29
|
+
|
|
30
|
+
<!-- Plot area -->
|
|
31
|
+
<g transform="translate(110,60)">
|
|
32
|
+
|
|
33
|
+
<!-- Grid lines (logarithmic scale) -->
|
|
34
|
+
<line x1="0" y1="393.22897224509614" x2="1015" y2="393.22897224509614" class="grid"/>
|
|
35
|
+
<text x="-10" y="397.22897224509614" text-anchor="end" class="label">0.20µs</text>
|
|
36
|
+
<line x1="0" y1="285.8524636086765" x2="1015" y2="285.8524636086765" class="grid"/>
|
|
37
|
+
<text x="-10" y="289.8524636086765" text-anchor="end" class="label">0.50µs</text>
|
|
38
|
+
<line x1="0" y1="204.6252705021037" x2="1015" y2="204.6252705021037" class="grid"/>
|
|
39
|
+
<text x="-10" y="208.6252705021037" text-anchor="end" class="label">1.0µs</text>
|
|
40
|
+
<line x1="0" y1="123.39807739553095" x2="1015" y2="123.39807739553095" class="grid"/>
|
|
41
|
+
<text x="-10" y="127.39807739553095" text-anchor="end" class="label">2.0µs</text>
|
|
42
|
+
<line x1="0" y1="16.021568759111233" x2="1015" y2="16.021568759111233" class="grid"/>
|
|
43
|
+
<text x="-10" y="20.021568759111233" text-anchor="end" class="label">5.0µs</text>
|
|
44
|
+
<line x1="0" y1="0" x2="0" y2="460" class="grid"/>
|
|
45
|
+
<text x="0" y="480" text-anchor="middle" class="label">10</text>
|
|
46
|
+
<line x1="76.38636139973525" y1="0" x2="76.38636139973525" y2="460" class="grid"/>
|
|
47
|
+
<text x="76.38636139973525" y="480" text-anchor="middle" class="label">20</text>
|
|
48
|
+
<line x1="177.36363860026475" y1="0" x2="177.36363860026475" y2="460" class="grid"/>
|
|
49
|
+
<text x="177.36363860026475" y="480" text-anchor="middle" class="label">50</text>
|
|
50
|
+
<line x1="253.75" y1="0" x2="253.75" y2="460" class="grid"/>
|
|
51
|
+
<text x="253.75" y="480" text-anchor="middle" class="label">100</text>
|
|
52
|
+
<line x1="330.1363613997352" y1="0" x2="330.1363613997352" y2="460" class="grid"/>
|
|
53
|
+
<text x="330.1363613997352" y="480" text-anchor="middle" class="label">200</text>
|
|
54
|
+
<line x1="431.1136386002648" y1="0" x2="431.1136386002648" y2="460" class="grid"/>
|
|
55
|
+
<text x="431.1136386002648" y="480" text-anchor="middle" class="label">500</text>
|
|
56
|
+
<line x1="507.5" y1="0" x2="507.5" y2="460" class="grid"/>
|
|
57
|
+
<text x="507.5" y="480" text-anchor="middle" class="label">1k</text>
|
|
58
|
+
<line x1="583.8863613997353" y1="0" x2="583.8863613997353" y2="460" class="grid"/>
|
|
59
|
+
<text x="583.8863613997353" y="480" text-anchor="middle" class="label">2k</text>
|
|
60
|
+
<line x1="684.8636386002647" y1="0" x2="684.8636386002647" y2="460" class="grid"/>
|
|
61
|
+
<text x="684.8636386002647" y="480" text-anchor="middle" class="label">5k</text>
|
|
62
|
+
<line x1="761.25" y1="0" x2="761.25" y2="460" class="grid"/>
|
|
63
|
+
<text x="761.25" y="480" text-anchor="middle" class="label">10k</text>
|
|
64
|
+
<line x1="837.6363613997353" y1="0" x2="837.6363613997353" y2="460" class="grid"/>
|
|
65
|
+
<text x="837.6363613997353" y="480" text-anchor="middle" class="label">20k</text>
|
|
66
|
+
<line x1="938.6136386002647" y1="0" x2="938.6136386002647" y2="460" class="grid"/>
|
|
67
|
+
<text x="938.6136386002647" y="480" text-anchor="middle" class="label">50k</text>
|
|
68
|
+
<line x1="1015" y1="0" x2="1015" y2="460" class="grid"/>
|
|
69
|
+
<text x="1015" y="480" text-anchor="middle" class="label">100k</text>
|
|
70
|
+
<!-- Y-axis -->
|
|
71
|
+
<line x1="0" y1="0" x2="0" y2="460" class="axis"/>
|
|
72
|
+
|
|
73
|
+
<!-- X-axis -->
|
|
74
|
+
<line x1="0" y1="460" x2="1015" y2="460" class="axis"/>
|
|
75
|
+
|
|
76
|
+
<!-- Axis labels -->
|
|
77
|
+
<text x="507.5" y="510" text-anchor="middle" class="axis-title">Tree Size (items) - Log Scale</text>
|
|
78
|
+
<text transform="rotate(-90,-70,230)" x="-70" y="230" text-anchor="middle" class="axis-title">Execution Time (µs)</text>
|
|
79
|
+
<path d="M 0 81.22719310657283 L 76.38636139973525 127.37076593632901 L 177.36363860026475 140.36368304266443 L 253.75 131.8407505931923 L 330.1363613997352 153.10100791189012 L 431.1136386002648 157.2027875202291 L 507.5 148.14280012187862 L 583.8863613997353 160.25564146596378 L 684.8636386002647 151.99052603552718 L 761.25 117.87736443311223 L 837.6363613997353 118.7512616667658 L 938.6136386002647 176.3890488072118 L 1015 189.01182654132322" class="register-mean"/>
|
|
80
|
+
<path d="M 0 308.1116006867061 L 76.38636139973525 371.64731920541044 L 177.36363860026475 378.7728068934272 L 253.75 344.65292696631695 L 330.1363613997352 372.9529342358376 L 431.1136386002648 357.41252615666247 L 507.5 358.05264872672586 L 583.8863613997353 359.27110078280924 L 684.8636386002647 238.78218846609843 L 761.25 285.5603316099687 L 837.6363613997353 262.92859355624 L 938.6136386002647 295.3772854109651 L 1015 291.9403211688891" class="lookup-mean"/>
|
|
81
|
+
<circle cx="0" cy="81.22719310657283" r="4" class="register-dot"/>
|
|
82
|
+
<circle cx="76.38636139973525" cy="127.37076593632901" r="4" class="register-dot"/>
|
|
83
|
+
<circle cx="177.36363860026475" cy="140.36368304266443" r="4" class="register-dot"/>
|
|
84
|
+
<circle cx="253.75" cy="131.8407505931923" r="4" class="register-dot"/>
|
|
85
|
+
<circle cx="330.1363613997352" cy="153.10100791189012" r="4" class="register-dot"/>
|
|
86
|
+
<circle cx="431.1136386002648" cy="157.2027875202291" r="4" class="register-dot"/>
|
|
87
|
+
<circle cx="507.5" cy="148.14280012187862" r="4" class="register-dot"/>
|
|
88
|
+
<circle cx="583.8863613997353" cy="160.25564146596378" r="4" class="register-dot"/>
|
|
89
|
+
<circle cx="684.8636386002647" cy="151.99052603552718" r="4" class="register-dot"/>
|
|
90
|
+
<circle cx="761.25" cy="117.87736443311223" r="4" class="register-dot"/>
|
|
91
|
+
<circle cx="837.6363613997353" cy="118.7512616667658" r="4" class="register-dot"/>
|
|
92
|
+
<circle cx="938.6136386002647" cy="176.3890488072118" r="4" class="register-dot"/>
|
|
93
|
+
<circle cx="1015" cy="189.01182654132322" r="4" class="register-dot"/>
|
|
94
|
+
<circle cx="0" cy="308.1116006867061" r="4" class="lookup-dot"/>
|
|
95
|
+
<circle cx="76.38636139973525" cy="371.64731920541044" r="4" class="lookup-dot"/>
|
|
96
|
+
<circle cx="177.36363860026475" cy="378.7728068934272" r="4" class="lookup-dot"/>
|
|
97
|
+
<circle cx="253.75" cy="344.65292696631695" r="4" class="lookup-dot"/>
|
|
98
|
+
<circle cx="330.1363613997352" cy="372.9529342358376" r="4" class="lookup-dot"/>
|
|
99
|
+
<circle cx="431.1136386002648" cy="357.41252615666247" r="4" class="lookup-dot"/>
|
|
100
|
+
<circle cx="507.5" cy="358.05264872672586" r="4" class="lookup-dot"/>
|
|
101
|
+
<circle cx="583.8863613997353" cy="359.27110078280924" r="4" class="lookup-dot"/>
|
|
102
|
+
<circle cx="684.8636386002647" cy="238.78218846609843" r="4" class="lookup-dot"/>
|
|
103
|
+
<circle cx="761.25" cy="285.5603316099687" r="4" class="lookup-dot"/>
|
|
104
|
+
<circle cx="837.6363613997353" cy="262.92859355624" r="4" class="lookup-dot"/>
|
|
105
|
+
<circle cx="938.6136386002647" cy="295.3772854109651" r="4" class="lookup-dot"/>
|
|
106
|
+
<circle cx="1015" cy="291.9403211688891" r="4" class="lookup-dot"/>
|
|
107
|
+
<!-- Legend -->
|
|
108
|
+
<g transform="translate(20, 20)">
|
|
109
|
+
<rect x="0" y="0" width="190" height="80" fill="white" stroke="#ccc" stroke-width="1"/>
|
|
110
|
+
|
|
111
|
+
<!-- Register Instance Legend -->
|
|
112
|
+
<text x="10" y="20" class="legend" font-weight="bold">Register Instance</text>
|
|
113
|
+
<line x1="10" y1="30" x2="40" y2="30" class="register-mean"/>
|
|
114
|
+
<circle cx="25" cy="30" r="3" class="register-dot"/>
|
|
115
|
+
<text x="45" y="34" class="legend">Average Timing</text>
|
|
116
|
+
|
|
117
|
+
<!-- Lookup Instance Legend -->
|
|
118
|
+
<text x="10" y="55" class="legend" font-weight="bold">Lookup Instance</text>
|
|
119
|
+
<line x1="10" y1="65" x2="40" y2="65" class="lookup-mean"/>
|
|
120
|
+
<circle cx="25" cy="65" r="3" class="lookup-dot"/>
|
|
121
|
+
<text x="45" y="69" class="legend">Average Timing</text>
|
|
122
|
+
</g>
|
|
123
|
+
|
|
124
|
+
</g>
|
|
125
|
+
|
|
126
|
+
<!-- Test Metadata Section -->
|
|
127
|
+
<g transform="translate(50, 620)">
|
|
128
|
+
<!-- Left Column: System Information -->
|
|
129
|
+
<g transform="translate(20, 20)">
|
|
130
|
+
<text x="0" y="0" class="metadata-section">System Information</text>
|
|
131
|
+
|
|
132
|
+
<text x="0" y="25" class="metadata-label">Test Date:</text>
|
|
133
|
+
<text x="150" y="25" class="metadata-value">2025-07-25</text>
|
|
134
|
+
|
|
135
|
+
<text x="0" y="45" class="metadata-label">Package Version:</text>
|
|
136
|
+
<text x="150" y="45" class="metadata-value">@fjell/registry v4.4.5</text>
|
|
137
|
+
|
|
138
|
+
<text x="0" y="65" class="metadata-label">Node.js Version:</text>
|
|
139
|
+
<text x="150" y="65" class="metadata-value">v22.17.1 (darwin arm64)</text>
|
|
140
|
+
|
|
141
|
+
<text x="0" y="85" class="metadata-label">Platform:</text>
|
|
142
|
+
<text x="150" y="85" class="metadata-value">darwin arm64</text>
|
|
143
|
+
|
|
144
|
+
<text x="0" y="105" class="metadata-label">Compiler:</text>
|
|
145
|
+
<text x="150" y="105" class="metadata-value">TypeScript + Vite</text>
|
|
146
|
+
</g>
|
|
147
|
+
|
|
148
|
+
<!-- Center Column: Test Configuration -->
|
|
149
|
+
<g transform="translate(330, 20)">
|
|
150
|
+
<text x="0" y="0" class="metadata-section">Test Configuration</text>
|
|
151
|
+
|
|
152
|
+
<text x="0" y="25" class="metadata-label">Test Rounds:</text>
|
|
153
|
+
<text x="120" y="25" class="metadata-value">100 per tree size</text>
|
|
154
|
+
|
|
155
|
+
<text x="0" y="45" class="metadata-label">Iterations per Round:</text>
|
|
156
|
+
<text x="120" y="45" class="metadata-value">200 operations</text>
|
|
157
|
+
|
|
158
|
+
<text x="0" y="65" class="metadata-label">Total Measurements:</text>
|
|
159
|
+
<text x="120" y="65" class="metadata-value">20,000 per data point</text>
|
|
160
|
+
</g>
|
|
161
|
+
|
|
162
|
+
<!-- Right Column: Test Notes -->
|
|
163
|
+
<g transform="translate(600, 20)">
|
|
164
|
+
<text x="0" y="0" class="metadata-section">Test Notes</text>
|
|
165
|
+
<text x="0" y="25" class="metadata-label">• Performance measurements use Node.js performance.now() with microsecond precision</text>
|
|
166
|
+
<text x="0" y="42" class="metadata-label">• Each test includes warm-up iterations to minimize JIT compilation effects</text>
|
|
167
|
+
<text x="0" y="59" class="metadata-label">• Logging is mocked during timing tests to eliminate I/O overhead</text>
|
|
168
|
+
<text x="0" y="76" class="metadata-label">• Tests verify both mean performance and consistency (low standard deviation)</text>
|
|
169
|
+
<text x="0" y="93" class="metadata-label">• Statistical analysis ensures reliable performance measurements across all tree sizes</text>
|
|
170
|
+
</g>
|
|
171
|
+
</g>
|
|
172
|
+
</svg>
|
|
@@ -14,13 +14,21 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// Import the actual registry functionality
|
|
17
|
+
import { AllItemTypeArrays } from '@fjell/core';
|
|
17
18
|
import { createRegistry } from '../src/Registry';
|
|
18
19
|
import { createInstance } from '../src/Instance';
|
|
19
20
|
import type { Registry } from '../src/types';
|
|
20
21
|
|
|
21
22
|
// Helper function to require a service (throw if not found)
|
|
22
|
-
function requireService
|
|
23
|
-
|
|
23
|
+
function requireService<
|
|
24
|
+
S extends string,
|
|
25
|
+
L1 extends string = never,
|
|
26
|
+
L2 extends string = never,
|
|
27
|
+
L3 extends string = never,
|
|
28
|
+
L4 extends string = never,
|
|
29
|
+
L5 extends string = never,
|
|
30
|
+
>(registry: Registry, keyPath: AllItemTypeArrays<S, L1, L2, L3, L4, L5>, options?: { scopes?: string[] }): any {
|
|
31
|
+
const result = registry.get<S, L1, L2, L3, L4, L5>(keyPath, options);
|
|
24
32
|
if (!result) {
|
|
25
33
|
throw new Error(`Required service '${keyPath.join('.')}' not found`);
|
|
26
34
|
}
|
package/package.json
CHANGED
|
@@ -1,69 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjell/registry",
|
|
3
|
-
"
|
|
3
|
+
"description": "Dependency injection and service location system for the Fjell ecosystem",
|
|
4
|
+
"version": "4.4.20",
|
|
4
5
|
"keywords": [
|
|
5
6
|
"registry",
|
|
7
|
+
"dependency-injection",
|
|
8
|
+
"service-locator",
|
|
6
9
|
"fjell"
|
|
7
10
|
],
|
|
8
11
|
"license": "Apache-2.0",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"node": ">=21"
|
|
12
|
-
},
|
|
13
|
-
"main": "dist/index.cjs",
|
|
14
|
-
"module": "dist/index.js",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
15
14
|
"exports": {
|
|
16
15
|
".": {
|
|
17
16
|
"types": "./dist/index.d.ts",
|
|
18
|
-
"require": "./dist/index.cjs",
|
|
19
17
|
"import": "./dist/index.js"
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
20
|
"type": "module",
|
|
23
21
|
"dependencies": {
|
|
24
|
-
"@fjell/core": "^4.4.
|
|
25
|
-
"@fjell/logging": "^4.4.
|
|
26
|
-
"deepmerge": "^4.3.1"
|
|
22
|
+
"@fjell/core": "^4.4.25",
|
|
23
|
+
"@fjell/logging": "^4.4.30"
|
|
27
24
|
},
|
|
28
25
|
"devDependencies": {
|
|
29
26
|
"@eslint/eslintrc": "^3.3.1",
|
|
30
|
-
"@eslint/js": "^9.
|
|
31
|
-
"@fjell/eslint-config": "^1.
|
|
27
|
+
"@eslint/js": "^9.32.0",
|
|
28
|
+
"@fjell/eslint-config": "^1.1.3",
|
|
32
29
|
"@swc/core": "^1.13.2",
|
|
33
30
|
"@tsconfig/recommended": "^1.0.10",
|
|
34
|
-
"@types/multer": "^2.0.0",
|
|
35
|
-
"@types/node": "^24.1.0",
|
|
36
31
|
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
37
32
|
"@typescript-eslint/parser": "^8.38.0",
|
|
38
|
-
"@
|
|
39
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
33
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
40
34
|
"concurrently": "^9.2.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
35
|
+
"esbuild": "^0.25.8",
|
|
36
|
+
"eslint": "^9.32.0",
|
|
43
37
|
"rimraf": "^6.0.1",
|
|
44
|
-
"ts-node": "^10.9.2",
|
|
45
|
-
"tsc-alias": "^1.8.16",
|
|
46
38
|
"typescript": "^5.8.3",
|
|
47
|
-
"
|
|
48
|
-
"vite-plugin-dts": "^4.5.4",
|
|
49
|
-
"vite-plugin-node": "^7.0.0",
|
|
50
|
-
"vitest": "^3.2.4"
|
|
39
|
+
"vitest": "3.2.4"
|
|
51
40
|
},
|
|
52
41
|
"repository": {
|
|
53
42
|
"type": "git",
|
|
54
43
|
"url": "git+https://github.com/getfjell/registry.git"
|
|
55
44
|
},
|
|
56
45
|
"scripts": {
|
|
57
|
-
"build": "tsc --noEmit && vite build",
|
|
58
|
-
"dev": "concurrently \"tsc --watch --noEmit\" \"vite build --watch\"",
|
|
59
46
|
"lint": "eslint . --ext .ts --fix",
|
|
47
|
+
"dev": "concurrently \"tsc --noEmit --watch\" \"node build.js --watch\"",
|
|
48
|
+
"build": "pnpm run lint && tsc --noEmit && node build.js",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
60
50
|
"clean": "rimraf dist",
|
|
61
51
|
"test": "pnpm run lint && vitest run --coverage",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"docs:
|
|
65
|
-
"docs:
|
|
66
|
-
"docs:preview": "cd docs && pnpm run preview",
|
|
67
|
-
"docs:test": "cd docs && pnpm run test"
|
|
52
|
+
"docs:dev": "cd docs && npm run dev",
|
|
53
|
+
"docs:build": "cd docs && npm run build",
|
|
54
|
+
"docs:preview": "cd docs && npm run preview",
|
|
55
|
+
"docs:test": "cd docs && npm run test"
|
|
68
56
|
}
|
|
69
57
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2020",
|
|
7
|
+
"DOM",
|
|
8
|
+
"DOM.Iterable"
|
|
9
|
+
],
|
|
10
|
+
"types": [
|
|
11
|
+
"vitest/globals"
|
|
12
|
+
],
|
|
13
|
+
"module": "ESNext",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
/* Bundler mode */
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
"allowImportingTsExtensions": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"noEmit": true,
|
|
21
|
+
"jsx": "react-jsx",
|
|
22
|
+
/* Linting */
|
|
23
|
+
"strict": true,
|
|
24
|
+
"noUnusedLocals": true,
|
|
25
|
+
"noUnusedParameters": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true
|
|
27
|
+
}
|
|
28
|
+
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { defineConfig } from 'vitest/config'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: {
|
|
8
|
+
'@': resolve(__dirname, './src'),
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
test: {
|
|
12
|
+
environment: 'jsdom',
|
|
13
|
+
setupFiles: ['./tests/setup.ts'],
|
|
14
|
+
globals: true,
|
|
15
|
+
testTimeout: 30000,
|
|
16
|
+
},
|
|
17
|
+
})
|
package/MIGRATION_SUMMARY.md
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
# Fjell Documentation Template Migration Summary
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Successfully migrated fjell-registry, fjell-logging, and fjell-http-api from individual documentation implementations to a shared template system, dramatically reducing code duplication and improving maintainability.
|
|
6
|
-
|
|
7
|
-
## What Was Accomplished
|
|
8
|
-
|
|
9
|
-
### ✅ Created Shared Template Package (`@fjell/docs-template`)
|
|
10
|
-
|
|
11
|
-
**Location**: `/fjell-docs-template/` (root level of getfjell workspace)
|
|
12
|
-
|
|
13
|
-
**Key Components**:
|
|
14
|
-
- **DocsApp**: Main application component with configurable navigation and content rendering
|
|
15
|
-
- **Navigation**: Reusable sidebar with project branding and section navigation
|
|
16
|
-
- **ContentRenderer**: Markdown rendering with syntax highlighting and image handling
|
|
17
|
-
- **Layout**: Overall page structure with responsive design and modals
|
|
18
|
-
- **Theme System**: CSS variables for project-specific branding (registry, logging, http-api, etc.)
|
|
19
|
-
|
|
20
|
-
**Package Structure**:
|
|
21
|
-
```
|
|
22
|
-
fjell-docs-template/
|
|
23
|
-
├── src/
|
|
24
|
-
│ ├── components/ # Reusable React components
|
|
25
|
-
│ ├── styles/ # Base CSS and theme system
|
|
26
|
-
│ ├── utils/ # Content loading utilities
|
|
27
|
-
│ └── types/ # TypeScript type definitions
|
|
28
|
-
├── config/ # Vite configuration templates
|
|
29
|
-
└── dist/ # Built package output
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### ✅ Migrated Three Projects
|
|
33
|
-
|
|
34
|
-
#### 1. **fjell-registry** (Proof of Concept)
|
|
35
|
-
- ✅ Reduced from ~600 lines of duplicated App.tsx to simple config file
|
|
36
|
-
- ✅ Maintained all existing functionality (performance charts, examples, etc.)
|
|
37
|
-
- ✅ Updated GitHub workflow to build template first
|
|
38
|
-
|
|
39
|
-
#### 2. **fjell-logging**
|
|
40
|
-
- ✅ Migrated to template with custom content processors
|
|
41
|
-
- ✅ Theme: Orange/amber branding
|
|
42
|
-
- ✅ Custom sections for logging-specific content
|
|
43
|
-
|
|
44
|
-
#### 3. **fjell-http-api**
|
|
45
|
-
- ✅ Migrated to template with inline content generation
|
|
46
|
-
- ✅ Theme: Green branding
|
|
47
|
-
- ✅ Preserved existing copy-examples plugin functionality
|
|
48
|
-
|
|
49
|
-
### ✅ Eliminated Massive Code Duplication
|
|
50
|
-
|
|
51
|
-
**Before Migration**:
|
|
52
|
-
- **App.tsx**: ~600-750 lines per project × 3 projects = **~2,000 lines**
|
|
53
|
-
- **App.css**: ~1,200 lines per project × 3 projects = **~3,600 lines**
|
|
54
|
-
- **Configuration files**: Duplicated across all projects
|
|
55
|
-
- **Total Duplicated Code**: **~5,600+ lines**
|
|
56
|
-
|
|
57
|
-
**After Migration**:
|
|
58
|
-
- **Template Package**: ~1,500 lines (shared across all projects)
|
|
59
|
-
- **Per-Project Config**: ~100 lines per project × 3 = **~300 lines**
|
|
60
|
-
- **Total Code**: **~1,800 lines**
|
|
61
|
-
|
|
62
|
-
**Result**: **~70% reduction in total code** while improving maintainability
|
|
63
|
-
|
|
64
|
-
### ✅ Enhanced Developer Experience
|
|
65
|
-
|
|
66
|
-
**Simplified Project Structure**:
|
|
67
|
-
```
|
|
68
|
-
project/docs/
|
|
69
|
-
├── docs.config.ts # Project-specific configuration
|
|
70
|
-
├── src/
|
|
71
|
-
│ ├── main.tsx # Simple template import
|
|
72
|
-
│ ├── index.css # Minimal project styles
|
|
73
|
-
│ └── types.d.ts # Type declarations
|
|
74
|
-
├── package.json # Template dependency
|
|
75
|
-
└── vite.config.ts # Basic configuration
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Configuration-Driven Approach**:
|
|
79
|
-
- **Sections**: Define navigation and content sources
|
|
80
|
-
- **Branding**: Project-specific themes and colors
|
|
81
|
-
- **Custom Content**: Override default content with project-specific logic
|
|
82
|
-
- **Plugins**: Extend functionality (e.g., copy-examples for http-api)
|
|
83
|
-
|
|
84
|
-
### ✅ Improved Maintainability
|
|
85
|
-
|
|
86
|
-
**Centralized Updates**:
|
|
87
|
-
- Bug fixes and improvements made once in template
|
|
88
|
-
- New features automatically available to all projects
|
|
89
|
-
- Consistent UI/UX across all Fjell documentation
|
|
90
|
-
|
|
91
|
-
**Version Management**:
|
|
92
|
-
- Template versioned independently
|
|
93
|
-
- Projects can update template dependency as needed
|
|
94
|
-
- Breaking changes managed through semantic versioning
|
|
95
|
-
|
|
96
|
-
### ✅ Preserved Project-Specific Features
|
|
97
|
-
|
|
98
|
-
**fjell-registry**:
|
|
99
|
-
- Performance charts and memory analysis
|
|
100
|
-
- Custom content processing for getting-started sections
|
|
101
|
-
- SVG chart integration
|
|
102
|
-
|
|
103
|
-
**fjell-logging**:
|
|
104
|
-
- Component-based logging examples
|
|
105
|
-
- Time logging and flood control documentation
|
|
106
|
-
- Configuration-specific content extraction
|
|
107
|
-
|
|
108
|
-
**fjell-http-api**:
|
|
109
|
-
- Examples auto-copy functionality via Vite plugin
|
|
110
|
-
- Inline content generation for API documentation
|
|
111
|
-
- Method reference structure
|
|
112
|
-
|
|
113
|
-
### ✅ Updated CI/CD Pipeline
|
|
114
|
-
|
|
115
|
-
**Modified GitHub Workflow**:
|
|
116
|
-
- Template package built first in CI
|
|
117
|
-
- Shared across all documentation builds
|
|
118
|
-
- Maintains existing deployment patterns
|
|
119
|
-
|
|
120
|
-
## Technical Implementation
|
|
121
|
-
|
|
122
|
-
### Theme System
|
|
123
|
-
CSS variables enable easy project-specific branding:
|
|
124
|
-
```css
|
|
125
|
-
.brand-registry { --color-accent: #667EEA; }
|
|
126
|
-
.brand-logging { --color-accent: #ED8936; }
|
|
127
|
-
.brand-http-api { --color-accent: #48BB78; }
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Configuration System
|
|
131
|
-
Type-safe configuration for each project:
|
|
132
|
-
```typescript
|
|
133
|
-
interface DocsConfig {
|
|
134
|
-
projectName: string;
|
|
135
|
-
basePath: string;
|
|
136
|
-
branding: { theme: string; };
|
|
137
|
-
sections: DocumentSection[];
|
|
138
|
-
customContent?: { [key: string]: ContentProcessor };
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Content Processing
|
|
143
|
-
Flexible content transformation:
|
|
144
|
-
```typescript
|
|
145
|
-
customContent: {
|
|
146
|
-
'getting-started': createGettingStartedContent,
|
|
147
|
-
'performance': extractPerformanceSections
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Benefits Achieved
|
|
152
|
-
|
|
153
|
-
### 🚀 **Faster Development**
|
|
154
|
-
- New documentation sites can be created in minutes
|
|
155
|
-
- Focus on content, not infrastructure
|
|
156
|
-
- Consistent patterns reduce learning curve
|
|
157
|
-
|
|
158
|
-
### 🔧 **Easier Maintenance**
|
|
159
|
-
- Single source of truth for documentation UI
|
|
160
|
-
- Bug fixes propagate to all projects automatically
|
|
161
|
-
- Consistent dependency management
|
|
162
|
-
|
|
163
|
-
### 🎨 **Better Consistency**
|
|
164
|
-
- Unified design system across all Fjell projects
|
|
165
|
-
- Consistent navigation and user experience
|
|
166
|
-
- Shared performance optimizations
|
|
167
|
-
|
|
168
|
-
### 📦 **Reduced Bundle Size**
|
|
169
|
-
- Eliminated duplicate dependencies
|
|
170
|
-
- Shared React/CSS reduces overall footprint
|
|
171
|
-
- External dependencies managed centrally
|
|
172
|
-
|
|
173
|
-
## Next Steps
|
|
174
|
-
|
|
175
|
-
### Immediate
|
|
176
|
-
1. **Resolve Module Resolution**: Fix template package dependency issues in fjell-logging and fjell-http-api
|
|
177
|
-
2. **Test Deployments**: Verify GitHub Pages deployment works correctly for all projects
|
|
178
|
-
3. **Documentation**: Create setup guide for future Fjell projects
|
|
179
|
-
|
|
180
|
-
### Future Enhancements
|
|
181
|
-
1. **Publish to NPM**: Make template publicly available
|
|
182
|
-
2. **CLI Tool**: Create `create-fjell-docs` for instant project setup
|
|
183
|
-
3. **More Themes**: Add themes for remaining Fjell projects (core, cache, etc.)
|
|
184
|
-
4. **Plugin System**: Expand plugin architecture for custom functionality
|
|
185
|
-
5. **Search Integration**: Add documentation search capabilities
|
|
186
|
-
|
|
187
|
-
## Success Metrics
|
|
188
|
-
|
|
189
|
-
- ✅ **70% code reduction** across documentation projects
|
|
190
|
-
- ✅ **100% feature preservation** during migration
|
|
191
|
-
- ✅ **3 projects migrated** successfully
|
|
192
|
-
- ✅ **Consistent UI/UX** maintained across all projects
|
|
193
|
-
- ✅ **Build process** successfully updated
|
|
194
|
-
- ✅ **Template package** created and functional
|
|
195
|
-
|
|
196
|
-
## Conclusion
|
|
197
|
-
|
|
198
|
-
The migration successfully demonstrates the power of template-driven development for documentation sites. By extracting common patterns into a shared package, we've dramatically reduced maintenance overhead while preserving all project-specific functionality and improving the overall developer experience.
|
|
199
|
-
|
|
200
|
-
This approach provides a scalable foundation for all future Fjell project documentation and serves as a model for similar consolidation efforts across the ecosystem.
|
package/dist/Coordinate.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const logger$1 = require('./logger.cjs');
|
|
6
|
-
|
|
7
|
-
const logger = logger$1.default.get("Coordinate");
|
|
8
|
-
const createCoordinate = (kta, scopes = [])=>{
|
|
9
|
-
const ktArray = Array.isArray(kta) ? kta : [
|
|
10
|
-
kta
|
|
11
|
-
];
|
|
12
|
-
const toString = ()=>{
|
|
13
|
-
logger.debug("toString", {
|
|
14
|
-
kta,
|
|
15
|
-
scopes
|
|
16
|
-
});
|
|
17
|
-
return `${ktArray.join(', ')} - ${scopes.join(', ')}`;
|
|
18
|
-
};
|
|
19
|
-
logger.debug("createCoordinate", {
|
|
20
|
-
kta: ktArray,
|
|
21
|
-
scopes,
|
|
22
|
-
toString
|
|
23
|
-
});
|
|
24
|
-
return {
|
|
25
|
-
kta: ktArray,
|
|
26
|
-
scopes,
|
|
27
|
-
toString
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.createCoordinate = createCoordinate;
|
|
32
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29vcmRpbmF0ZS5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|
package/dist/Coordinate.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import LibLogger from './logger.js';
|
|
2
|
-
|
|
3
|
-
const logger = LibLogger.get("Coordinate");
|
|
4
|
-
const createCoordinate = (kta, scopes = [])=>{
|
|
5
|
-
const ktArray = Array.isArray(kta) ? kta : [
|
|
6
|
-
kta
|
|
7
|
-
];
|
|
8
|
-
const toString = ()=>{
|
|
9
|
-
logger.debug("toString", {
|
|
10
|
-
kta,
|
|
11
|
-
scopes
|
|
12
|
-
});
|
|
13
|
-
return `${ktArray.join(', ')} - ${scopes.join(', ')}`;
|
|
14
|
-
};
|
|
15
|
-
logger.debug("createCoordinate", {
|
|
16
|
-
kta: ktArray,
|
|
17
|
-
scopes,
|
|
18
|
-
toString
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
kta: ktArray,
|
|
22
|
-
scopes,
|
|
23
|
-
toString
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { createCoordinate };
|
|
28
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29vcmRpbmF0ZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0=
|