frosty 0.0.78 → 0.0.80

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.
Files changed (47) hide show
  1. package/README.md +0 -1
  2. package/dist/_native.d.ts +3 -3
  3. package/dist/_native.mjs +2 -2
  4. package/dist/dom.d.ts +3 -3
  5. package/dist/dom.mjs +3 -3
  6. package/dist/index.d.ts +7 -7
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +6 -6
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +9 -9
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/internals/{common-lfYTb1eV.d.ts → common-C5xm7xDw.d.ts} +3 -3
  13. package/dist/internals/{common-lfYTb1eV.d.ts.map → common-C5xm7xDw.d.ts.map} +1 -1
  14. package/dist/internals/{common-CPQORaXm.mjs → common-IghNU-hG.mjs} +3 -3
  15. package/dist/internals/{common-CPQORaXm.mjs.map → common-IghNU-hG.mjs.map} +1 -1
  16. package/dist/internals/{common-B0Nya-9e.d.ts → common-jmXMOod4.d.ts} +3 -3
  17. package/dist/internals/{common-B0Nya-9e.d.ts.map → common-jmXMOod4.d.ts.map} +1 -1
  18. package/dist/internals/{fragment-CApRh6Hp.d.ts → fragment-BQXp1_iv.d.ts} +2 -2
  19. package/dist/internals/{fragment-CApRh6Hp.d.ts.map → fragment-BQXp1_iv.d.ts.map} +1 -1
  20. package/dist/internals/{renderer-DBPR_8BN.d.ts → renderer-D4aiCZGU.d.ts} +2 -2
  21. package/dist/internals/{renderer-DBPR_8BN.d.ts.map → renderer-D4aiCZGU.d.ts.map} +1 -1
  22. package/dist/internals/{renderer-DnIxEcQv.mjs → renderer-Dn64xymQ.mjs} +2 -2
  23. package/dist/internals/{renderer-DnIxEcQv.mjs.map → renderer-Dn64xymQ.mjs.map} +1 -1
  24. package/dist/internals/{state-BIFtc4bv.mjs → state-BRL-17Kd.mjs} +2 -2
  25. package/dist/internals/{state-BIFtc4bv.mjs.map → state-BRL-17Kd.mjs.map} +1 -1
  26. package/dist/internals/{sync-2I_UkBG9.mjs → sync-BlGknxx_.mjs} +3 -3
  27. package/dist/internals/{sync-2I_UkBG9.mjs.map → sync-BlGknxx_.mjs.map} +1 -1
  28. package/dist/internals/{utils-CyrF9IfR.d.ts → utils-B_4b5vas.d.ts} +2 -2
  29. package/dist/internals/{utils-CyrF9IfR.d.ts.map → utils-B_4b5vas.d.ts.map} +1 -1
  30. package/dist/jsx-dev-runtime.d.ts +7 -3
  31. package/dist/jsx-dev-runtime.d.ts.map +1 -1
  32. package/dist/jsx-dev-runtime.js +28 -2
  33. package/dist/jsx-dev-runtime.js.map +1 -1
  34. package/dist/jsx-dev-runtime.mjs +32 -1
  35. package/dist/jsx-dev-runtime.mjs.map +1 -1
  36. package/dist/jsx-runtime.d.ts +2 -2
  37. package/dist/server-dom.d.ts +3 -3
  38. package/dist/server-dom.mjs +3 -3
  39. package/dist/web.d.ts +3 -3
  40. package/dist/web.mjs +5 -5
  41. package/package.json +1 -1
  42. package/packages/frosty-cli/src/server/{default.js → default.ts} +2 -3
  43. package/packages/frosty-cli/src/server/{env.js → env.ts} +3 -1
  44. package/packages/frosty-cli/src/server/index.js +2 -6
  45. package/packages/frosty-cli/src/server/render.js +11 -11
  46. package/packages/frosty-cli/src/server/route.ts +1 -27
  47. package/packages/frosty-cli/webpack.mjs +0 -1
@@ -1,7 +1,7 @@
1
- import { R as Ref } from './common-lfYTb1eV.js';
1
+ import { a as Ref } from './common-C5xm7xDw.js';
2
2
 
3
3
  declare const mergeRefs: <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => void;
4
4
  declare const uniqueId: () => string;
5
5
 
6
6
  export { mergeRefs as m, uniqueId as u };
7
- //# sourceMappingURL=utils-CyrF9IfR.d.ts.map
7
+ //# sourceMappingURL=utils-B_4b5vas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-CyrF9IfR.d.ts","sources":["../../src/core/utils.ts"],"sourcesContent":["//\n// utils.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n"],"names":[],"mappings":";;AACO,cAAA,SAAA,gBAAA,GAAA;AACA,cAAA,QAAA;;;;"}
1
+ {"version":3,"file":"utils-B_4b5vas.d.ts","sources":["../../src/core/utils.ts"],"sourcesContent":["//\n// utils.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n"],"names":[],"mappings":";;AACO,cAAA,SAAA,gBAAA,GAAA;AACA,cAAA,QAAA;;;;"}
@@ -1,7 +1,11 @@
1
- export { JSX, jsx, jsx as jsxDEV, jsxs } from './jsx-runtime.js';
2
- export { F as Fragment } from './internals/fragment-CApRh6Hp.js';
3
- import './internals/common-lfYTb1eV.js';
1
+ import { _ as _ElementType, c as PropsType, b as ComponentNode } from './internals/common-C5xm7xDw.js';
2
+ export { JSX, jsx, jsxs } from './jsx-runtime.js';
3
+ export { F as Fragment } from './internals/fragment-BQXp1_iv.js';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
6
6
  import 'csstype';
7
+
8
+ declare function jsxDEV(type: _ElementType, props: PropsType, key?: string | number, isStaticChildren?: boolean, source?: any, self?: any): ComponentNode;
9
+
10
+ export { jsxDEV };
7
11
  //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-dev-runtime.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"jsx-dev-runtime.d.ts","sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["//\n// jsx-dev-runtime.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentNode } from './core/types/component';\nimport { _ElementType, PropsType } from './core/types/runtime';\nimport { jsx } from './jsx-runtime';\n\nexport * from './jsx-runtime';\n\nexport function jsxDEV(\n type: _ElementType,\n props: PropsType,\n key?: string | number,\n isStaticChildren?: boolean,\n source?: any,\n self?: any\n): ComponentNode {\n return jsx(type, props, key);\n}\n"],"names":[],"mappings":";;;;;;;AAGO,iBAAA,MAAA,OAAA,YAAA,SAAA,SAAA,gFAAA,aAAA;;;;"}
@@ -4,11 +4,37 @@ var jsxRuntime = require('./jsx-runtime.js');
4
4
  require('./internals/component-BiP3XIPe.js');
5
5
  require('./internals/runtime-DCKT7fd6.js');
6
6
 
7
-
7
+ //
8
+ // jsx-dev-runtime.ts
9
+ //
10
+ // The MIT License
11
+ // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
12
+ //
13
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ // of this software and associated documentation files (the "Software"), to deal
15
+ // in the Software without restriction, including without limitation the rights
16
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ // copies of the Software, and to permit persons to whom the Software is
18
+ // furnished to do so, subject to the following conditions:
19
+ //
20
+ // The above copyright notice and this permission notice shall be included in
21
+ // all copies or substantial portions of the Software.
22
+ //
23
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ // THE SOFTWARE.
30
+ //
31
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
32
+ return jsxRuntime.jsx(type, props, key);
33
+ }
8
34
 
9
35
  exports.Fragment = jsxRuntime.Fragment;
10
36
  exports.JSX = jsxRuntime.JSX;
11
37
  exports.jsx = jsxRuntime.jsx;
12
- exports.jsxDEV = jsxRuntime.jsx;
13
38
  exports.jsxs = jsxRuntime.jsxs;
39
+ exports.jsxDEV = jsxDEV;
14
40
  //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-dev-runtime.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"jsx-dev-runtime.js","sources":["../../src/jsx-dev-runtime.ts"],"sourcesContent":["//\n// jsx-dev-runtime.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentNode } from './core/types/component';\nimport { _ElementType, PropsType } from './core/types/runtime';\nimport { jsx } from './jsx-runtime';\n\nexport * from './jsx-runtime';\n\nexport function jsxDEV(\n type: _ElementType,\n props: PropsType,\n key?: string | number,\n isStaticChildren?: boolean,\n source?: any,\n self?: any\n): ComponentNode {\n return jsx(type, props, key);\n}\n"],"names":["jsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQM,SAAU,MAAM,CACpB,IAAkB,EAClB,KAAgB,EAChB,GAAqB,EACrB,gBAA0B,EAC1B,MAAY,EACZ,IAAU,EAAA;IAEV,OAAOA,cAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC;AAC9B;;;;;;;;"}
@@ -1,4 +1,35 @@
1
- export { Fragment, JSX, jsx, jsx as jsxDEV, jsxs } from './jsx-runtime.mjs';
1
+ import { jsx } from './jsx-runtime.mjs';
2
+ export { Fragment, JSX, jsxs } from './jsx-runtime.mjs';
2
3
  import './internals/component-BzurKp_J.mjs';
3
4
  import './internals/runtime-DK28Kyy2.mjs';
5
+
6
+ //
7
+ // jsx-dev-runtime.ts
8
+ //
9
+ // The MIT License
10
+ // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
11
+ //
12
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ // of this software and associated documentation files (the "Software"), to deal
14
+ // in the Software without restriction, including without limitation the rights
15
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ // copies of the Software, and to permit persons to whom the Software is
17
+ // furnished to do so, subject to the following conditions:
18
+ //
19
+ // The above copyright notice and this permission notice shall be included in
20
+ // all copies or substantial portions of the Software.
21
+ //
22
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ // THE SOFTWARE.
29
+ //
30
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
31
+ return jsx(type, props, key);
32
+ }
33
+
34
+ export { jsx, jsxDEV };
4
35
  //# sourceMappingURL=jsx-dev-runtime.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-dev-runtime.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"jsx-dev-runtime.mjs","sources":["../../src/jsx-dev-runtime.ts"],"sourcesContent":["//\n// jsx-dev-runtime.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentNode } from './core/types/component';\nimport { _ElementType, PropsType } from './core/types/runtime';\nimport { jsx } from './jsx-runtime';\n\nexport * from './jsx-runtime';\n\nexport function jsxDEV(\n type: _ElementType,\n props: PropsType,\n key?: string | number,\n isStaticChildren?: boolean,\n source?: any,\n self?: any\n): ComponentNode {\n return jsx(type, props, key);\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQM,SAAU,MAAM,CACpB,IAAkB,EAClB,KAAgB,EAChB,GAAqB,EACrB,gBAA0B,EAC1B,MAAY,EACZ,IAAU,EAAA;IAEV,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC;AAC9B;;;;"}
@@ -1,5 +1,5 @@
1
- import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, a as ComponentNode, b as PropsType } from './internals/common-lfYTb1eV.js';
2
- export { F as Fragment } from './internals/fragment-CApRh6Hp.js';
1
+ import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, b as ComponentNode, c as PropsType } from './internals/common-C5xm7xDw.js';
2
+ export { F as Fragment } from './internals/fragment-BQXp1_iv.js';
3
3
  import '@o2ter/utils-js';
4
4
  import 'lodash';
5
5
  import 'csstype';
@@ -1,11 +1,11 @@
1
1
  import { JSDOM } from 'jsdom';
2
2
  export * from 'jsdom';
3
- import { _ as _DOMRenderer } from './internals/common-B0Nya-9e.js';
4
- import './internals/common-lfYTb1eV.js';
3
+ import { _ as _DOMRenderer } from './internals/common-jmXMOod4.js';
4
+ import './internals/common-C5xm7xDw.js';
5
5
  import '@o2ter/utils-js';
6
6
  import 'lodash';
7
7
  import 'csstype';
8
- import './internals/renderer-DBPR_8BN.js';
8
+ import './internals/renderer-D4aiCZGU.js';
9
9
 
10
10
  declare class ServerDOMRenderer extends _DOMRenderer {
11
11
  constructor(dom?: JSDOM);
@@ -1,11 +1,11 @@
1
1
  import { JSDOM } from 'jsdom';
2
2
  export * from 'jsdom';
3
- import { _ as _DOMRenderer } from './internals/common-CPQORaXm.mjs';
3
+ import { _ as _DOMRenderer } from './internals/common-IghNU-hG.mjs';
4
4
  import 'lodash';
5
5
  import 'myers.js';
6
6
  import './internals/component-BzurKp_J.mjs';
7
- import './internals/renderer-DnIxEcQv.mjs';
8
- import './internals/state-BIFtc4bv.mjs';
7
+ import './internals/renderer-Dn64xymQ.mjs';
8
+ import './internals/state-BRL-17Kd.mjs';
9
9
  import 'nextick';
10
10
  import 'postcss';
11
11
  import 'postcss-js';
package/dist/web.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { S as SetStateAction, c as RefObject } from './internals/common-lfYTb1eV.js';
1
+ import { S as SetStateAction, R as RefObject } from './internals/common-C5xm7xDw.js';
2
2
  import * as jsdom from 'jsdom';
3
- export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/common-B0Nya-9e.js';
3
+ export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/common-jmXMOod4.js';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
6
6
  import 'csstype';
7
- import './internals/renderer-DBPR_8BN.js';
7
+ import './internals/renderer-D4aiCZGU.js';
8
8
 
9
9
  declare const useDocument: () => Document;
10
10
 
package/dist/web.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { r as reconciler, u as uniqueId, E as EventEmitter } from './internals/state-BIFtc4bv.mjs';
2
- import { _ as _DOMRenderer } from './internals/common-CPQORaXm.mjs';
3
- export { D as DOMNativeNode } from './internals/common-CPQORaXm.mjs';
1
+ import { r as reconciler, a as uniqueId, b as EventEmitter } from './internals/state-BRL-17Kd.mjs';
2
+ import { _ as _DOMRenderer } from './internals/common-IghNU-hG.mjs';
3
+ export { D as DOMNativeNode } from './internals/common-IghNU-hG.mjs';
4
4
  import _ from 'lodash';
5
- import { u as useSyncExternalStore, a as useMemo, b as useCallback, c as useEffect } from './internals/sync-2I_UkBG9.mjs';
5
+ import { d as useSyncExternalStore, b as useMemo, u as useCallback, c as useEffect } from './internals/sync-BlGknxx_.mjs';
6
6
  import './internals/component-BzurKp_J.mjs';
7
7
  import 'myers.js';
8
- import './internals/renderer-DnIxEcQv.mjs';
8
+ import './internals/renderer-Dn64xymQ.mjs';
9
9
  import 'nextick';
10
10
  import 'postcss';
11
11
  import 'postcss-js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frosty",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "main": "dist/index",
5
5
  "module": "dist/index",
6
6
  "types": "dist/index",
@@ -1,5 +1,5 @@
1
1
  //
2
- // default.js
2
+ // default.ts
3
3
  //
4
4
  // The MIT License
5
5
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -25,8 +25,7 @@
25
25
 
26
26
  import { Server } from '@o2ter/server-js';
27
27
 
28
- /** @type {Server.Options} */
29
- export const serverOptions = {
28
+ export const serverOptions: Server.Options = {
30
29
  http: 'v1',
31
30
  express: {
32
31
  cors: {
@@ -23,4 +23,6 @@
23
23
  // THE SOFTWARE.
24
24
  //
25
25
 
26
- export const PORT = !_.isEmpty(process.env.PORT) ? parseInt(process.env.PORT) : 8080;
26
+ import _ from 'lodash';
27
+
28
+ export const PORT = process.env.PORT ? parseInt(process.env.PORT) : 8080;
@@ -34,9 +34,7 @@ import { PORT } from './env';
34
34
  let __SERVER__ = {};
35
35
  try {
36
36
  __SERVER__ = await import('__SERVER__');
37
- } catch(e) {
38
- console.error(e);
39
- };
37
+ } catch {};
40
38
 
41
39
  const app = 'serverOptions' in __SERVER__ ? new Server(__SERVER__.serverOptions) : new Server;
42
40
 
@@ -45,7 +43,7 @@ app.use(Server.static(path.join(__dirname, 'public'), { cacheControl: true }));
45
43
  const server_env = {};
46
44
  if ('default' in __SERVER__) await __SERVER__.default(app, server_env);
47
45
 
48
- for (const [name, { path: pathname, basename }] of _.toPairs(__applications__)) {
46
+ for (const [name, { path: pathname }] of _.toPairs(__applications__)) {
49
47
  const { default: App } = __APPLICATIONS__[name];
50
48
  if (!_.isFunction(App)) {
51
49
  throw new Error(
@@ -57,8 +55,6 @@ for (const [name, { path: pathname, basename }] of _.toPairs(__applications__))
57
55
  const route = ReactRoute(App, {
58
56
  jsSrc: `/${name}_bundle.js`,
59
57
  cssSrc: cssExists ? `/css/${name}_bundle.css` : undefined,
60
- basename: basename ?? '/',
61
- preferredLocale: 'preferredLocale' in __SERVER__ ? (req) => __SERVER__.preferredLocale(app, name, req) : undefined,
62
58
  });
63
59
  if (_.isEmpty(pathname) || pathname === '/') {
64
60
  app.use(route);
@@ -25,17 +25,23 @@
25
25
 
26
26
  import _ from 'lodash';
27
27
  import { ServerDOMRenderer } from 'frosty/server-dom';
28
- import { JSDOM } from 'frosty/server-dom';
28
+ import { JSDOM, CookieJar } from 'jsdom';
29
29
 
30
30
  export const renderToHTML = async (App, {
31
31
  request: req,
32
32
  response: res,
33
33
  jsSrc,
34
34
  cssSrc,
35
- basename,
36
- preferredLocale,
37
35
  }) => {
38
- const component = (
36
+ const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
37
+ const cookieJar = new CookieJar();
38
+ for (const cookie of _.split(req.get('cookie'), ';')) {
39
+ cookieJar.setCookieSync(cookie, url);
40
+ }
41
+ const dom = new JSDOM(undefined, { url, referrer: req.get('Referrer'), cookieJar });
42
+ const renderer = new ServerDOMRenderer(dom);
43
+ res.setHeader('Content-Type', 'text/html');
44
+ res.send(await renderer.renderToString(
39
45
  <html>
40
46
  <head>
41
47
  <script src={jsSrc} defer />
@@ -45,11 +51,5 @@ export const renderToHTML = async (App, {
45
51
  <div id="root"><App /></div>
46
52
  </body>
47
53
  </html>
48
- );
49
- const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
50
- const referrer = req.get('Referrer');
51
- const dom = new JSDOM(undefined, { url, referrer });
52
- const renderer = new ServerDOMRenderer(dom);
53
- res.setHeader('Content-Type', 'text/html');
54
- res.send(await renderer.renderToString(component));
54
+ ));
55
55
  }
@@ -24,52 +24,26 @@
24
24
  //
25
25
 
26
26
  import _ from 'lodash';
27
- import { Server, Request } from '@o2ter/server-js';
28
- import cookieParser from 'cookie-parser';
27
+ import { Server } from '@o2ter/server-js';
29
28
  import { renderToHTML } from './render';
30
- import { Awaitable } from '@o2ter/utils-js';
31
29
 
32
30
  type ReactRouteOptions = {
33
31
  jsSrc: string;
34
32
  cssSrc: string | undefined;
35
- basename: string;
36
- preferredLocale?: (req: Request) => Awaitable<string | undefined>;
37
- }
38
-
39
- const defaultPreferredLocale = (req: Request) => {
40
- if (_.isString(req.cookies['PREFERRED_LOCALE'])) {
41
- return req.cookies['PREFERRED_LOCALE'];
42
- }
43
- if (_.isString(req.headers['accept-language'])) {
44
- const acceptLanguage = req.headers['accept-language'].split(',');
45
- for (const language of acceptLanguage) {
46
- return language.split(';')[0].trim();
47
- }
48
- }
49
33
  }
50
34
 
51
35
  export const ReactRoute = (App: any, {
52
36
  jsSrc,
53
37
  cssSrc,
54
- basename,
55
- preferredLocale = defaultPreferredLocale,
56
38
  }: ReactRouteOptions) => {
57
-
58
39
  const router = Server.Router();
59
- router.use(cookieParser() as any);
60
-
61
40
  router.get('*path', async (req, res) => {
62
- const _preferredLocale = await preferredLocale(req);
63
- res.cookie('PREFERRED_LOCALE', _preferredLocale, { maxAge: 31536000 });
64
41
  await renderToHTML(App, {
65
42
  request: req,
66
43
  response: res,
67
44
  jsSrc,
68
45
  cssSrc,
69
- basename,
70
- preferredLocale: _preferredLocale,
71
46
  });
72
47
  });
73
-
74
48
  return router;
75
49
  }
@@ -261,7 +261,6 @@ export default async (env, argv) => {
261
261
  new webpack.DefinePlugin({
262
262
  __applications__: JSON.stringify(_.mapValues(inputs, x => ({
263
263
  path: x.uri,
264
- basename: x.basename,
265
264
  }))),
266
265
  }),
267
266
  ...config.options?.server?.plugins ?? [],