@signalk/server-admin-ui 2.24.2 → 2.26.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/public/index.html CHANGED
@@ -1,8 +1,6 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
- <script type="module" src="./assets/hostInit-D-eMgRM5.js"></script>
5
-
6
4
  <meta charset="utf-8" />
7
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
6
  <meta
@@ -15,10 +13,8 @@
15
13
 
16
14
  <link rel="shortcut icon" href="img/favicon.ico" />
17
15
  <title>Signal K Server</title>
18
- <script type="module" crossorigin src="./assets/index-DFi_Kklh.js"></script>
19
- <link rel="modulepreload" crossorigin href="./assets/preload-helper-Ct5FWWRu.js">
20
- <link rel="modulepreload" crossorigin href="./remoteEntry.js">
21
- <link rel="stylesheet" crossorigin href="./assets/style-CLVMbhfE.css">
16
+ <script type="module" crossorigin src="./assets/index-BeqlM-hl.js"></script>
17
+ <link rel="stylesheet" crossorigin href="./assets/style-DKgi9hUa.css">
22
18
  </head>
23
19
  <body
24
20
  class="app header-fixed sidebar-fixed aside-menu-fixed aside-menu-hidden"
package/vite.config.ts ADDED
@@ -0,0 +1,154 @@
1
+ /// <reference types="vitest" />
2
+ import { defineConfig } from 'vite'
3
+ import react, { reactCompilerPreset } from '@vitejs/plugin-react'
4
+ import babel from '@rolldown/plugin-babel'
5
+
6
+ import '@signalk/server-admin-ui-dependencies'
7
+
8
+ // %ADDONSCRIPTS% is replaced server-side at request time with actual addon script tags.
9
+ function replaceAddonScripts() {
10
+ return {
11
+ name: 'replace-addon-scripts',
12
+ transformIndexHtml: {
13
+ order: 'pre',
14
+ handler(html) {
15
+ if (process.env.NODE_ENV !== 'production') {
16
+ return html.replace(
17
+ '%ADDONSCRIPTS%',
18
+ '<!-- addon scripts not available in dev mode -->'
19
+ )
20
+ }
21
+ return html
22
+ }
23
+ }
24
+ }
25
+ }
26
+
27
+ // Strip obsolete SVG font references from @font-face declarations (~2.5MB savings)
28
+ function stripSvgFonts() {
29
+ return {
30
+ name: 'strip-svg-fonts',
31
+ enforce: 'post',
32
+ transform(code, id) {
33
+ if (!id.includes('.css') && !id.includes('.scss')) {
34
+ return null
35
+ }
36
+ const svgFontRegex =
37
+ /,?\s*url\(['"]?[^'"()]+\.svg[^'"()]*['"]?\)\s*format\(['"]svg['"]\)/gi
38
+ if (svgFontRegex.test(code)) {
39
+ return {
40
+ code: code.replace(svgFontRegex, ''),
41
+ map: null
42
+ }
43
+ }
44
+ return null
45
+ },
46
+ generateBundle(options, bundle) {
47
+ for (const fileName of Object.keys(bundle)) {
48
+ const chunk = bundle[fileName]
49
+ if (chunk.type === 'asset' && fileName.endsWith('.css')) {
50
+ const svgFontRegex =
51
+ /,?\s*url\(['"]?[^'"()]+\.svg[^'"()]*['"]?\)\s*format\(['"]svg['"]\)/gi
52
+ if (
53
+ typeof chunk.source === 'string' &&
54
+ svgFontRegex.test(chunk.source)
55
+ ) {
56
+ chunk.source = chunk.source.replace(svgFontRegex, '')
57
+ }
58
+ }
59
+ if (
60
+ chunk.type === 'asset' &&
61
+ fileName.endsWith('.svg') &&
62
+ (fileName.includes('fontawesome') ||
63
+ fileName.includes('fa-') ||
64
+ fileName.includes('Simple-Line-Icons'))
65
+ ) {
66
+ delete bundle[fileName]
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ export default defineConfig({
74
+ base: './',
75
+ publicDir: 'public_src',
76
+ plugins: [
77
+ replaceAddonScripts(),
78
+ stripSvgFonts(),
79
+ react(),
80
+ babel({
81
+ presets: [reactCompilerPreset()]
82
+ })
83
+ ],
84
+ css: {
85
+ preprocessorOptions: {
86
+ scss: {
87
+ quietDeps: true,
88
+ // Bootstrap 5 still uses @import internally
89
+ silenceDeprecations: ['import']
90
+ }
91
+ }
92
+ },
93
+ server: {
94
+ port: 5173,
95
+ host: 'localhost',
96
+ proxy: {
97
+ '/signalk': {
98
+ target: 'http://localhost:3000',
99
+ changeOrigin: true,
100
+ ws: true
101
+ },
102
+ '/skServer': {
103
+ target: 'http://localhost:3000',
104
+ changeOrigin: true,
105
+ ws: true
106
+ },
107
+ '/plugins': {
108
+ target: 'http://localhost:3000',
109
+ changeOrigin: true
110
+ },
111
+ // Proxy scoped webapp packages (@signalk/*, etc.) but not Vite internals
112
+ '/@': {
113
+ target: 'http://localhost:3000',
114
+ changeOrigin: true,
115
+ bypass: (req) => {
116
+ if (
117
+ req.url.startsWith('/@vite') ||
118
+ req.url.startsWith('/@react-refresh') ||
119
+ req.url.startsWith('/@fs') ||
120
+ req.url.startsWith('/@id')
121
+ ) {
122
+ return req.url
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ build: {
129
+ outDir: 'public',
130
+ sourcemap: true,
131
+ target: 'es2023',
132
+ assetsInlineLimit: 0, // Prevent inlining assets to allow server-side logo override
133
+ cssCodeSplit: false // Generate single CSS file to ensure it's always loaded
134
+ },
135
+ resolve: {
136
+ alias: {
137
+ path: 'path-browserify',
138
+ events: 'events',
139
+ buffer: 'buffer'
140
+ }
141
+ },
142
+ test: {
143
+ globals: true,
144
+ environment: 'jsdom',
145
+ setupFiles: ['./src/test/setup.ts'],
146
+ include: ['src/**/*.{test,spec}.{ts,tsx}'],
147
+ coverage: {
148
+ provider: 'v8',
149
+ reporter: ['text', 'json', 'html'],
150
+ include: ['src/**/*.{ts,tsx}'],
151
+ exclude: ['src/test/**', 'src/**/*.d.ts']
152
+ }
153
+ }
154
+ })
@@ -1,2 +0,0 @@
1
- function i(e,n){for(var a=0;a<n.length;a++){const _=n[a];if(typeof _!="string"&&!Array.isArray(_)){for(const t in _)if(t!=="default"&&!(t in e)){const f=Object.getOwnPropertyDescriptor(_,t);f&&Object.defineProperty(e,t,f.get?f:{enumerable:!0,get:()=>_[t]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const o="__mf_init____mf__virtual/adminUI__mf_v__runtimeInit__mf_v__.js__";let r=globalThis[o];if(!r){let e,n;const a=new Promise((_,t)=>{e=_,n=t});r=globalThis[o]={initPromise:a,initResolve:e,initReject:n},typeof window>"u"&&e({loadRemote:function(){return Promise.resolve(void 0)},loadShare:function(){return Promise.resolve(void 0)}})}const m=r.initPromise,u=m.then(e=>e.loadShare("react",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"^19.0.0"}}})),s=await u.then(e=>typeof e=="function"?e():e),c=s,l=s.__esModule?s.default:s.default??s,{Activity:d,Children:E,Component:R,Fragment:S,Profiler:p,PureComponent:C,StrictMode:h,Suspense:g,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:P,__COMPILER_RUNTIME:T,cache:v,cacheSignal:y,cloneElement:I,createContext:N,createElement:O,createRef:b,forwardRef:A,isValidElement:M,lazy:x,memo:D,startTransition:U,unstable_useCacheRefresh:w,use:L,useActionState:V,useCallback:j,useContext:k,useDebugValue:z,useDeferredValue:H,useEffect:G,useEffectEvent:q,useId:F,useImperativeHandle:W,useInsertionEffect:Y,useLayoutEffect:K,useMemo:$,useOptimistic:B,useReducer:J,useRef:Q,useState:X,useSyncExternalStore:Z,useTransition:ee,version:_e}=s,te=i({__proto__:null,Activity:d,Children:E,Component:R,Fragment:S,Profiler:p,PureComponent:C,StrictMode:h,Suspense:g,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:P,__COMPILER_RUNTIME:T,cache:v,cacheSignal:y,cloneElement:I,createContext:N,createElement:O,createRef:b,default:l,forwardRef:A,isValidElement:M,lazy:x,memo:D,startTransition:U,unstable_useCacheRefresh:w,use:L,useActionState:V,useCallback:j,useContext:k,useDebugValue:z,useDeferredValue:H,useEffect:G,useEffectEvent:q,useId:F,useImperativeHandle:W,useInsertionEffect:Y,useLayoutEffect:K,useMemo:$,useOptimistic:B,useReducer:J,useRef:Q,useState:X,useSyncExternalStore:Z,useTransition:ee,version:_e},[c]);export{B as A,te as R,k as _,$ as a,O as b,E as c,M as d,S as e,G as f,N as g,Q as h,j as i,K as j,R as k,X as l,A as m,l as n,_e as o,I as p,J as q,W as r,F as s,V as t,g as u,Z as v,D as w,H as x,ee as y,b as z};
2
- //# sourceMappingURL=adminUI__loadShare__react__loadShare__.js-D12K3nc7.js.map
@@ -1,2 +0,0 @@
1
- import{R as u}from"./adminUI__loadShare__react__loadShare__.js-D12K3nc7.js";var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var o=e.default;if(typeof o=="function"){var t=function r(){return this instanceof r?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};t.prototype=o.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}),t}const c=f(u);export{l as a,s as c,f as g,c as r};
2
- //# sourceMappingURL=adminUI__loadShare__react__loadShare__.js_commonjs-proxy-Ddgktan4.js.map
@@ -1,2 +0,0 @@
1
- function f(e,r){for(var n=0;n<r.length;n++){const _=r[n];if(typeof _!="string"&&!Array.isArray(_)){for(const t in _)if(t!=="default"&&!(t in e)){const i=Object.getOwnPropertyDescriptor(_,t);i&&Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>_[t]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const a="__mf_init____mf__virtual/adminUI__mf_v__runtimeInit__mf_v__.js__";let s=globalThis[a];if(!s){let e,r;const n=new Promise((_,t)=>{e=_,r=t});s=globalThis[a]={initPromise:n,initResolve:e,initReject:r},typeof window>"u"&&e({loadRemote:function(){return Promise.resolve(void 0)},loadShare:function(){return Promise.resolve(void 0)}})}const l=s.initPromise,m=l.then(e=>e.loadShare("react-dom",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"^19.0.0"}}})),o=await m.then(e=>typeof e=="function"?e():e),u=o,c=o.__esModule?o.default:o.default??o,{__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:d,createPortal:p,flushSync:S,preconnect:R,prefetchDNS:O,preinit:h,preinitModule:N,preload:P,preloadModule:b,requestFormReset:g,unstable_batchedUpdates:D,useFormState:E,useFormStatus:M,version:T}=o,v=f({__proto__:null,__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:d,createPortal:p,default:c,flushSync:S,preconnect:R,prefetchDNS:O,preinit:h,preinitModule:N,preload:P,preloadModule:b,requestFormReset:g,unstable_batchedUpdates:D,useFormState:E,useFormStatus:M,version:T},[u]);export{v as R,p as _,c as a};
2
- //# sourceMappingURL=adminUI__loadShare__react_mf_2_dom__loadShare__.js-BWXpsqcx.js.map
@@ -1,2 +0,0 @@
1
- import{g as e}from"./adminUI__loadShare__react__loadShare__.js_commonjs-proxy-Ddgktan4.js";import{R as r}from"./adminUI__loadShare__react_mf_2_dom__loadShare__.js-BWXpsqcx.js";const m=e(r);export{m as r};
2
- //# sourceMappingURL=adminUI__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-07sf8i5D.js.map