@moneko/solid 1.7.4-beta.0 → 1.7.6
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/env.d.ts +20 -7
- package/lib/entry.js.map +1 -1
- package/lib/get-pathname.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/ssr.js.map +1 -1
- package/package.json +7 -7
package/env.d.ts
CHANGED
|
@@ -132,16 +132,29 @@ declare module '@app/routes' {
|
|
|
132
132
|
|
|
133
133
|
export default routes;
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
interface ExampleModuleBase {
|
|
137
|
+
codes: Record<string, string>;
|
|
138
|
+
title?: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
col?: string;
|
|
141
|
+
order?: number;
|
|
142
|
+
[key: string]: unknown;
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
declare module '@app/example' {
|
|
136
|
-
export interface ExampleModule {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
146
|
+
export interface ExampleModule extends ExampleModuleBase {
|
|
147
|
+
[key: string]: unknown;
|
|
148
|
+
}
|
|
149
|
+
const examples: Record<string, () => Promise<{ default: ExampleModule[] }>>;
|
|
150
|
+
|
|
151
|
+
export default examples;
|
|
152
|
+
}
|
|
153
|
+
declare module '@app/example/*' {
|
|
154
|
+
export interface ExampleModule extends ExampleModuleBase {
|
|
142
155
|
[key: string]: unknown;
|
|
143
156
|
}
|
|
144
|
-
const example:
|
|
157
|
+
const example: ExampleModule[];
|
|
145
158
|
|
|
146
159
|
export default example;
|
|
147
160
|
}
|
package/lib/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entry.tsx"],"sourcesContent":["import { createRoot, getOwner } from 'solid-js';\nimport { render, hydrate } from 'solid-js/web';\nimport info from '@app/info';\nimport { Router as BrowserRouter, HashRouter } from '@solidjs/router';\nimport routeDefinition from '@app/routes';\nimport type { RenderAppProps } from './index.js';\n\nconst isHashRouter = info.routerMode === 'hash';\nconst Router = isHashRouter ? HashRouter : BrowserRouter;\n\nconst root = info.ssr ? hydrate : render;\n\nexport function App(props: RenderAppProps) {\n return <Router base={props.basename}>{routeDefinition}</Router>;\n}\n\nfunction renderApp(props: RenderAppProps = {}) {\n const { container, basename = info.base, fallback, language, ...args } = props;\n const _container = (container?.querySelector('#root') ||\n document.getElementById('root')) as HTMLElement;\n\n if (info.type === 'micro' && window) {\n window.mainApp = {\n ...args,\n container: _container as HTMLElement,\n };\n }\n return createRoot(() => root(() => <App basename={basename} />, _container), getOwner());\n}\n\nexport default renderApp;\n"],"names":["createRoot","getOwner","render","hydrate","info","Router","BrowserRouter","HashRouter","routeDefinition","isHashRouter","routerMode","root","ssr","App","props","basename","container","base","fallback","language","args","_container","querySelector","document","getElementById","type","window","mainApp"],"mappings":"8CAAA,QAASA,cAAAA,CAAU,CAAEC,YAAAA,CAAQ,KAAQ,UAAW,AAChD,QAASC,UAAAA,CAAM,CAAEC,WAAAA,CAAO,KAAQ,cAAe,AAC/C,QAAOC,MAAU,WAAY,AAC7B,QAASC,UAAUC,CAAa,CAAEC,cAAAA,CAAU,KAAQ,iBAAkB,AACtE,QAAOC,MAAqB,aAAc,CAI1C,IAAMH,EAASI,AADML,AAAoB,SAApBA,EAAKM,UAAU,CACNH,EAAaD,EAErCK,EAAOP,EAAKQ,GAAG,CAAGT,EAAUD,CAElC,QAAO,SAASW,IAAIC,CAAqB,EACvC,SAAQT,qBAAaS,EAAMC,QAAQ,WAAGP,GACxC,CAgBA,eAdA,SAAmBM,EAAwB,CAAC,CAAC,EAC3C,GAAM,CAAEE,UAAAA,CAAS,CAAED,SAAAA,EAAWX,EAAKa,IAAI,CAAEC,SAAAA,CAAQ,CAAEC,SAAAA,CAAQ,CAAE,GAAGC,EAAM,CAAGN,EACnEO,EAAcL,GAAWM,cAAc,UAC3CC,SAASC,cAAc,CAAC,QAQ1B,MANkB,UAAdpB,EAAKqB,IAAI,EAAgBC,QAC3BA,CAAAA,OAAOC,OAAO,CAAG,CACf,GAAGP,CAAI,CACPJ,UAAWK,CACb,CAAA,EAEKrB,EAAW,IAAMW,EAAK,MAAOE,cAAcE,IAAcM,GAAapB,IAC/E"}
|
|
1
|
+
{"version":3,"sources":["../src/entry.tsx"],"sourcesContent":["import { createRoot, getOwner } from 'solid-js';\nimport { render, hydrate } from 'solid-js/web';\nimport info from '@app/info';\nimport { Router as BrowserRouter, HashRouter } from '@solidjs/router';\nimport routeDefinition from '@app/routes';\nimport type { RenderAppProps } from './index.js';\n\nconst isHashRouter = info.routerMode === 'hash';\nconst Router = isHashRouter ? HashRouter : BrowserRouter;\n\nconst root = info.ssr ? hydrate : render;\n\nexport function App(props: RenderAppProps) {\n return <Router base={props.basename}>{routeDefinition}</Router>;\n}\n\nfunction renderApp(props: RenderAppProps = {}) {\n const { container, basename = info.base, fallback, language, ...args } = props;\n const _container = (container?.querySelector('#root') ||\n document.getElementById('root')) as HTMLElement;\n\n if (info.type === 'micro' && window) {\n window.mainApp = {\n ...args,\n container: _container as HTMLElement,\n };\n }\n return createRoot(() => root(() => <App basename={basename} />, _container), getOwner());\n}\n\nexport default renderApp;\n"],"names":["createRoot","getOwner","render","hydrate","info","Router","BrowserRouter","HashRouter","routeDefinition","isHashRouter","routerMode","root","ssr","App","props","basename","container","base","fallback","language","args","_container","querySelector","document","getElementById","type","window","mainApp"],"rangeMappings":"","mappings":"8CAAA,QAASA,cAAAA,CAAU,CAAEC,YAAAA,CAAQ,KAAQ,UAAW,AAChD,QAASC,UAAAA,CAAM,CAAEC,WAAAA,CAAO,KAAQ,cAAe,AAC/C,QAAOC,MAAU,WAAY,AAC7B,QAASC,UAAUC,CAAa,CAAEC,cAAAA,CAAU,KAAQ,iBAAkB,AACtE,QAAOC,MAAqB,aAAc,CAI1C,IAAMH,EAASI,AADML,AAAoB,SAApBA,EAAKM,UAAU,CACNH,EAAaD,EAErCK,EAAOP,EAAKQ,GAAG,CAAGT,EAAUD,CAElC,QAAO,SAASW,IAAIC,CAAqB,EACvC,SAAQT,qBAAaS,EAAMC,QAAQ,WAAGP,GACxC,CAgBA,eAdA,SAAmBM,EAAwB,CAAC,CAAC,EAC3C,GAAM,CAAEE,UAAAA,CAAS,CAAED,SAAAA,EAAWX,EAAKa,IAAI,CAAEC,SAAAA,CAAQ,CAAEC,SAAAA,CAAQ,CAAE,GAAGC,EAAM,CAAGN,EACnEO,EAAcL,GAAWM,cAAc,UAC3CC,SAASC,cAAc,CAAC,QAQ1B,MANkB,UAAdpB,EAAKqB,IAAI,EAAgBC,QAC3BA,CAAAA,OAAOC,OAAO,CAAG,CACf,GAAGP,CAAI,CACPJ,UAAWK,CACb,CAAA,EAEKrB,EAAW,IAAMW,EAAK,MAAOE,cAAcE,IAAcM,GAAapB,IAC/E"}
|
package/lib/get-pathname.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/get-pathname.ts"],"sourcesContent":["import { type Location } from '@solidjs/router';\nimport app from '@app/info';\n\nconst len = app.base.length;\nconst prefix = len > 1 ? (app.base.endsWith('/') ? len : len + 1) : len;\n\nfunction getPathName(location: Location) {\n return location.pathname.substring(prefix);\n}\n\nexport default getPathName;\n"],"names":["app","len","base","length","prefix","endsWith","location","pathname","substring"],"mappings":"AACA,OAAOA,MAAS,WAAY,CAE5B,IAAMC,EAAMD,EAAIE,IAAI,CAACC,MAAM,CACrBC,EAASH,EAAM,EAAKD,EAAIE,IAAI,CAACG,QAAQ,CAAC,KAAOJ,EAAMA,EAAM,EAAKA,CAMpE,gBAJA,SAAqBK,CAAkB,EACrC,OAAOA,EAASC,QAAQ,CAACC,SAAS,CAACJ,EACrC"}
|
|
1
|
+
{"version":3,"sources":["../src/get-pathname.ts"],"sourcesContent":["import { type Location } from '@solidjs/router';\nimport app from '@app/info';\n\nconst len = app.base.length;\nconst prefix = len > 1 ? (app.base.endsWith('/') ? len : len + 1) : len;\n\nfunction getPathName(location: Location) {\n return location.pathname.substring(prefix);\n}\n\nexport default getPathName;\n"],"names":["app","len","base","length","prefix","endsWith","location","pathname","substring"],"rangeMappings":"","mappings":"AACA,OAAOA,MAAS,WAAY,CAE5B,IAAMC,EAAMD,EAAIE,IAAI,CAACC,MAAM,CACrBC,EAASH,EAAM,EAAKD,EAAIE,IAAI,CAACG,QAAQ,CAAC,KAAOJ,EAAMA,EAAM,EAAKA,CAMpE,gBAJA,SAAqBK,CAAkB,EACrC,OAAOA,EAASC,QAAQ,CAACC,SAAS,CAACJ,EACrC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { JSXElement } from 'solid-js';\n\nexport * from '@solidjs/router';\nexport { default as getPathName } from './get-pathname.js';\nexport { default as renderApp, App } from './entry.js';\n\nexport type RenderAppProps = {\n container?: HTMLElement;\n basename?: string;\n fallback?: JSXElement;\n language?: string;\n};\n"],"names":["default","getPathName","renderApp","App"],"mappings":"AAEA,WAAc,iBAAkB,AAChC,QAASA,WAAWC,WAAW,KAAQ,mBAAoB,AAC3D,QAASD,WAAWE,SAAS,CAAEC,GAAG,KAAQ,YAAa"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { JSXElement } from 'solid-js';\n\nexport * from '@solidjs/router';\nexport { default as getPathName } from './get-pathname.js';\nexport { default as renderApp, App } from './entry.js';\n\nexport type RenderAppProps = {\n container?: HTMLElement;\n basename?: string;\n fallback?: JSXElement;\n language?: string;\n};\n"],"names":["default","getPathName","renderApp","App"],"rangeMappings":"","mappings":"AAEA,WAAc,iBAAkB,AAChC,QAASA,WAAWC,WAAW,KAAQ,mBAAoB,AAC3D,QAASD,WAAWE,SAAS,CAAEC,GAAG,KAAQ,YAAa"}
|
package/lib/ssr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ssr.tsx"],"sourcesContent":["import { HydrationScript, renderToStream } from 'solid-js/web';\nimport { App } from './entry.js';\n\nconst send = (_: Request, resp: Response & { write(): void }) => {\n renderToStream(() => {\n return (\n <html lang=\"en\">\n <head>\n <title>🔥 Solid SSR 🔥</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <HydrationScript />\n </head>\n <body>\n <div id=\"app\">\n <App />\n </div>\n </body>\n </html>\n );\n }).pipe(resp);\n};\n\nexport default send;\n"],"names":["renderToStream","App","_","resp","pipe"],"mappings":"mTAAA,QAA0BA,kBAAAA,CAAc,KAAQ,cAAe,AAC/D,QAASC,OAAAA,CAAG,KAAQ,YAAa,AAsBjC,eApBa,CAAA,CAACC,EAAYC,KACxBH,EAAe,uDAWJC,cAKRG,IAAI,CAACD,EACV,CAAA,CAEoB"}
|
|
1
|
+
{"version":3,"sources":["../src/ssr.tsx"],"sourcesContent":["import { HydrationScript, renderToStream } from 'solid-js/web';\nimport { App } from './entry.js';\n\nconst send = (_: Request, resp: Response & { write(): void }) => {\n renderToStream(() => {\n return (\n <html lang=\"en\">\n <head>\n <title>🔥 Solid SSR 🔥</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <HydrationScript />\n </head>\n <body>\n <div id=\"app\">\n <App />\n </div>\n </body>\n </html>\n );\n }).pipe(resp);\n};\n\nexport default send;\n"],"names":["renderToStream","App","_","resp","pipe"],"rangeMappings":"","mappings":"mTAAA,QAA0BA,kBAAAA,CAAc,KAAQ,cAAe,AAC/D,QAASC,OAAAA,CAAG,KAAQ,YAAa,AAsBjC,eApBa,CAAA,CAACC,EAAYC,KACxBH,EAAe,uDAWJC,cAKRG,IAAI,CAACD,EACV,CAAA,CAEoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/solid",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "Solid js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@moneko/jsx-dom-expressions": "0.
|
|
16
|
-
"@solidjs/router": "0.
|
|
15
|
+
"@moneko/jsx-dom-expressions": "0.4.0",
|
|
16
|
+
"@solidjs/router": "0.10.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@moneko/transform-imports": "0.
|
|
20
|
-
"@swc/cli": "0.3.
|
|
21
|
-
"@swc/core": "1.
|
|
22
|
-
"solid-js": "1.8.
|
|
19
|
+
"@moneko/transform-imports": "0.4.0",
|
|
20
|
+
"@swc/cli": "0.3.12",
|
|
21
|
+
"@swc/core": "1.4.11",
|
|
22
|
+
"solid-js": "1.8.16",
|
|
23
23
|
"typescript": "5.3.3"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|