@moneko/solid 1.10.5 → 1.11.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/env.d.ts +28 -36
- package/lib/entry.js +1 -1
- package/lib/entry.js.map +1 -1
- package/lib/get-pathname.js +1 -1
- package/lib/get-pathname.js.map +1 -1
- package/package.json +3 -3
package/env.d.ts
CHANGED
|
@@ -63,39 +63,34 @@ declare module '@app/docs' {
|
|
|
63
63
|
export default entry;
|
|
64
64
|
}
|
|
65
65
|
declare module '@app/info' {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
/** 应用名称 */
|
|
67
|
+
export const name: string;
|
|
68
|
+
/** 应用描述 */
|
|
69
|
+
export const description: string;
|
|
70
|
+
/** 应用版本 */
|
|
71
|
+
export const version: string;
|
|
72
|
+
/** 应用类型 */
|
|
73
|
+
export const type: 'mobile' | 'site' | 'backstage' | 'micro' | 'library';
|
|
74
|
+
/** 开发者 */
|
|
75
|
+
export const author: {
|
|
68
76
|
name: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
type
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
/** 路由模式 */
|
|
88
|
-
routerMode: 'hash' | 'browser';
|
|
89
|
-
/** 根路由 */
|
|
90
|
-
base: string;
|
|
91
|
-
prefixCls?: string;
|
|
92
|
-
theme?: string;
|
|
93
|
-
projectName: string;
|
|
94
|
-
ssr: boolean;
|
|
95
|
-
}
|
|
96
|
-
const app: App;
|
|
97
|
-
|
|
98
|
-
export default app;
|
|
77
|
+
url?: string;
|
|
78
|
+
email?: string;
|
|
79
|
+
};
|
|
80
|
+
/** 存储库 */
|
|
81
|
+
export const repository: {
|
|
82
|
+
type?: string;
|
|
83
|
+
url?: string;
|
|
84
|
+
directory?: string;
|
|
85
|
+
};
|
|
86
|
+
/** 路由模式 */
|
|
87
|
+
export const routerMode: 'hash' | 'browser';
|
|
88
|
+
/** 根路由 */
|
|
89
|
+
export const base: string;
|
|
90
|
+
export const prefixCls: string;
|
|
91
|
+
export const theme: string;
|
|
92
|
+
export const projectName: string;
|
|
93
|
+
export const ssr: boolean;
|
|
99
94
|
}
|
|
100
95
|
declare module '@app/routes' {
|
|
101
96
|
import { RouteDefinition } from '@solidjs/router';
|
|
@@ -220,10 +215,7 @@ declare module '@app/locales' {
|
|
|
220
215
|
* @param {Argument} values 用于替换占位符的值,按照占位符出现的顺序排列
|
|
221
216
|
* @returns {string} 替换后的字符串
|
|
222
217
|
*/
|
|
223
|
-
export function
|
|
224
|
-
str: string,
|
|
225
|
-
values: InterpolationType<T>,
|
|
226
|
-
): string;
|
|
218
|
+
export function template<T extends string>(str: string, values: InterpolationType<T>): string;
|
|
227
219
|
/** 设置语言
|
|
228
220
|
* @param {string} localeName 语言名称
|
|
229
221
|
* @returns {void}
|
package/lib/entry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createComponent as o}from"solid-js/web";import{createRoot as e,getOwner as r}from"solid-js";import{render as t,hydrate as n}from"solid-js/web";import p from"@app/info";import{Router as
|
|
1
|
+
import{createComponent as o}from"solid-js/web";import{createRoot as e,getOwner as r}from"solid-js";import{render as t,hydrate as n}from"solid-js/web";import{routerMode as i,ssr as m,base as p,type as a}from"@app/info";import{Router as s,HashRouter as l}from"@solidjs/router";import u from"@app/routes";let f="hash"===i?l:s,d=m?n:t;export function App(e){return o(f,{get base(){return e.basename},children:u})}export default function(t={}){let{container:n,basename:i=p,fallback:m,language:s,...l}=t,u=n?.querySelector("#root")||document.getElementById("root");return"micro"===a&&window&&(window.mainApp={...l,container:u}),e(()=>d(()=>o(App,{basename:i,fallback:m,language:s}),u),r())}
|
|
2
2
|
//# sourceMappingURL=entry.js.map
|
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
|
|
1
|
+
{"version":3,"sources":["../src/entry.tsx"],"sourcesContent":["import { createRoot, getOwner } from 'solid-js';\nimport { render, hydrate } from 'solid-js/web';\nimport { routerMode, ssr, base, type } 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 = routerMode === 'hash';\nconst Router = isHashRouter ? HashRouter : BrowserRouter;\nconst root = 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 = base, fallback, language, ...args } = props;\n const _container = (container?.querySelector('#root') ||\n document.getElementById('root')) as HTMLElement;\n\n if (type === 'micro' && window) {\n window.mainApp = {\n ...args,\n container: _container as HTMLElement,\n };\n }\n return createRoot(\n () =>\n root(() => <App basename={basename} fallback={fallback} language={language} />, _container),\n getOwner()\n );\n}\n\nexport default renderApp;\n"],"names":["createRoot","getOwner","render","hydrate","routerMode","ssr","base","type","Router","BrowserRouter","HashRouter","routeDefinition","isHashRouter","root","App","props","basename","container","fallback","language","args","_container","querySelector","document","getElementById","window","mainApp"],"mappings":"8CAAA,QAASA,cAAAA,CAAU,CAAEC,YAAAA,CAAQ,KAAQ,UAAW,AAChD,QAASC,UAAAA,CAAM,CAAEC,WAAAA,CAAO,KAAQ,cAAe,AAC/C,QAASC,cAAAA,CAAU,CAAEC,OAAAA,CAAG,CAAEC,QAAAA,CAAI,CAAEC,QAAAA,CAAI,KAAQ,WAAY,AACxD,QAASC,UAAUC,CAAa,CAAEC,cAAAA,CAAU,KAAQ,iBAAkB,AACtE,QAAOC,MAAqB,aAAc,CAI1C,IAAMH,EAASI,AADMR,AAAe,SAAfA,EACSM,EAAaD,EACrCI,EAAOR,EAAMF,EAAUD,CAE7B,QAAO,SAASY,IAAIC,CAAqB,EACvC,SAAQP,qBAAaO,EAAMC,QAAQ,WAAGL,GACxC,CAoBA,eAlBA,SAAmBI,EAAwB,CAAC,CAAC,EAC3C,GAAM,CAAEE,UAAAA,CAAS,CAAED,SAAAA,EAAWV,CAAI,CAAEY,SAAAA,CAAQ,CAAEC,SAAAA,CAAQ,CAAE,GAAGC,EAAM,CAAGL,EAC9DM,EAAcJ,GAAWK,cAAc,UAC3CC,SAASC,cAAc,CAAC,QAQ1B,MANa,UAATjB,GAAoBkB,QACtBA,CAAAA,OAAOC,OAAO,CAAG,CACf,GAAGN,CAAI,CACPH,UAAWI,CACb,CAAA,EAEKrB,EACL,IACEa,EAAK,MAAOC,cAAcE,WAAoBE,WAAoBC,IAAcE,GAClFpB,IAEJ"}
|
package/lib/get-pathname.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t
|
|
1
|
+
import{base as t}from"@app/info";let n=t.length,e=n>1&&!function(t,n){let e=t.length;return!(1>e)&&t.lastIndexOf("/")===e-1}(t,0)?n+1:n;export default function(t){return t.pathname.substring(e)}
|
|
2
2
|
//# sourceMappingURL=get-pathname.js.map
|
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
|
|
1
|
+
{"version":3,"sources":["../src/get-pathname.ts"],"sourcesContent":["import type { Location } from '@solidjs/router';\nimport { base } from '@app/info';\n\nfunction endsWith(str: string, suffix: string): boolean {\n const strLen = str.length;\n const suffixLen = suffix.length;\n\n if (suffixLen > strLen) {\n return false;\n }\n return str.lastIndexOf(suffix) === strLen - suffixLen;\n}\nconst len = base.length;\nconst prefix = len > 1 ? (endsWith(base, '/') ? len : len + 1) : len;\n\nfunction getPathName(location: Location) {\n return location.pathname.substring(prefix);\n}\n\nexport default getPathName;\n"],"names":["base","len","length","prefix","endsWith","str","suffix","strLen","suffixLen","lastIndexOf","location","pathname","substring"],"mappings":"AACA,OAASA,QAAAA,CAAI,KAAQ,WAAY,CAWjC,IAAMC,EAAMD,EAAKE,MAAM,CACjBC,EAASF,EAAM,IAAKG,AAV1B,SAAkBC,CAAW,CAAEC,CAAc,EAC3C,IAAMC,EAASF,EAAIH,MAAM,OAGzB,CAAIM,CAAAA,AAMmC,EANvBD,CAAK,GAGdF,EAAII,WAAW,CAGiB,OAHJF,EAGI,CAFzC,EAEmCP,EAAM,GAAaC,EAAM,EAAZA,CAMhD,gBAJA,SAAqBS,CAAkB,EACrC,OAAOA,EAASC,QAAQ,CAACC,SAAS,CAACT,EACrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/solid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Solid js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@moneko/transform-imports": "0.6.1",
|
|
22
22
|
"@swc/cli": "0.4.0",
|
|
23
23
|
"@swc/core": "1.6.13",
|
|
24
|
-
"solid-js": "1.
|
|
25
|
-
"typescript": "5.
|
|
24
|
+
"solid-js": "1.8.23",
|
|
25
|
+
"typescript": "5.5.4"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"lib",
|