@moneko/core 3.0.0-beta.137 → 3.0.0-beta.139
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/lib/app-entry.js +1 -1
- package/lib/docs.js +1 -1
- package/package.json +1 -1
package/lib/app-entry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as o}from"fs";import{join as p}from"path";import{CONFIG as n}from"./common.js";import{APPTYPE as t,FRAMEWORK as r,isMicro as e}from"./process-env.js";import i from"./rem.js";import{getExportTokens as m}from"./utils.js";let s=p(n.alias["@"],"./index.ts"),_=o(s),u="",a=`const renderApp = (await import('@moneko/${r}/lib/entry.js')).default;`,l=[];if(_){let o="";e&&(l=m(s).filter(Boolean)).length&&(o=`{${l.map(o=>`${o} as app${o}`).join(",")}} from `),u=`import ${o}"@/index.ts";`}u+=`import "@app/normalize/index.css";${i}`,e?(u+="if (window.__POWERED_BY_QIANKUN__) {__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;}",a+=`if (!window.__POWERED_BY_QIANKUN__) {renderApp();}let unmountApp = void 0;export async function bootstrap() {console.log('app bootstraped');}export async function mount(props) {${l.includes("mount")?"appmount(props);":""}unmountApp = renderApp(props);}export async function unmount(props) {${l.includes("unmount")?"appunmount(props);":""}unmountApp();}`):a+="renderApp();","mobile"===t&&(
|
|
1
|
+
import{existsSync as o}from"fs";import{join as p}from"path";import{CONFIG as n}from"./common.js";import{APPTYPE as t,FRAMEWORK as r,isMicro as e}from"./process-env.js";import i from"./rem.js";import{getExportTokens as m}from"./utils.js";let s=p(n.alias["@"],"./index.ts"),_=o(s),u="",a=`const renderApp = (await import('@moneko/${r}/lib/entry.js')).default;`,l=[];if(_){let o="";e&&(l=m(s).filter(Boolean)).length&&(o=`{${l.map(o=>`${o} as app${o}`).join(",")}} from `),u=`import ${o}"@/index.ts";`}u+=`import "@app/normalize/index.css";${i}`,e?(u+="if (window.__POWERED_BY_QIANKUN__) {__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;}",a+=`if (!window.__POWERED_BY_QIANKUN__) {renderApp();}let unmountApp = void 0;export async function bootstrap() {console.log('app bootstraped');}export async function mount(props) {${l.includes("mount")?"appmount(props);":""}unmountApp = renderApp(props);}export async function unmount(props) {${l.includes("unmount")?"appunmount(props);":""}unmountApp();}`):a+="renderApp();","mobile"===t&&(a+="window.H5RemoteRuntime = {bootstrap: renderApp};");let d=`${u}${a}`;export default d;
|
package/lib/docs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{statSync as e}from"fs";import{dirname as t,join as o}from"path";import{watch as r}from"chokidar";import{CONFIG as
|
|
1
|
+
import{statSync as e}from"fs";import{dirname as t,join as o}from"path";import{watch as r}from"chokidar";import{CONFIG as n}from"./common.js";import i from"./generate-api.js";import s from"./object-listener.js";import{FRAMEWORK as p,FRAMEWORKNAME as l,createElement as a,isLibrary as c,isSolid as d}from"./process-env.js";import{resolveProgramPath as m}from"./utils.js";let f="@app/comment";export const docs=s({});let u={[f]:{}},$=`() => ${a}(SuspenseComp, { comp: $1 })`,g=`import { ${a}${d?",Dynamic":""} } from "${l}${d?"/web":""}";import SuspenseComp from "@app/suspense";`;function b(e,r){let s=e.replace(RegExp(`^${n.alias["@pkg"]}`),""),p=t(s).replace(/^\//,""),l=[f,p].join("/"),c=s.split("/").pop()?.replace(/\.tsx?/,".md");if(!c)return;u[f][p]||(u[f][p]={});let d=o(l,c);if("deleted"===r)u[f][p][c]&&delete u[f][p][c];else{let t=i(e);u[d]=t,t?u[f][p][c]=`rr(() => import(/* webpackChunkName: '${d}' */'${d}?raw').then((res) => ({default: ${a}(Dynamic, {text: res.default, component: 'n-md', css: 'table td a {display:inline-flex;align-items:center;gap:2px;}table td a n-img{display:inline-block;overflow:hidden;border-radius:var(--border-radius);inline-size:18px;block-size:18px;}'})})))rr`:u[f][p][c]&&delete u[f][p][c]}let m={};for(let e in u[f])Object.prototype.hasOwnProperty.call(u[f],e)&&(m[e]=Object.values(u[f][e]));let b={...u};delete b[f],Object.assign(docs.data,{...b,"@app/docs":`${g}export default ${JSON.stringify(m).replace(/"rr\((.+?)\)rr"/g,$)}`})}["react","solid"].includes(p)||($="$1",g=""),c&&function(){let t=[],o=r(m("components"),{ignored:[/(^|[\\/\\])\../,/(^|[\\/\\])__tests__([\\/\\]|$)/],persistent:!0,ignoreInitial:!1});function n(t){return/\.tsx?$/.test(t)&&e(t).isFile()}o.on("add",e=>{n(e)&&(b(e,"added"),t.push(e))}),o.on("change",e=>{n(e)&&b(e,"change")}),o.on("unlink",e=>{n(e)&&(b(e,"deleted"),t.splice(t.indexOf(e),1))}),o.on("ready",()=>{t.forEach(e=>{b(e,"change")})}),process.on("SIGINT",function(){o.close()})}();
|