@moneko/core 3.11.1-beta.1 → 3.11.1-beta.11
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/build.mjs +1 -1
- package/lib/cjs/index.cjs +1 -0
- package/lib/cjs/index.d.cts +6 -0
- package/lib/cjs/load-module-meta.cjs +1 -0
- package/lib/cjs/load-module-meta.d.cts +2 -0
- package/lib/dev/mock.d.mts +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/index.d.mts +2 -0
- package/lib/index.mjs +1 -1
- package/lib/options/js-minify.d.mts +1 -1
- package/lib/options/swcrc.mjs +1 -1
- package/lib/paths.d.mts +1 -1
- package/lib/paths.mjs +1 -1
- package/lib/plugin/lightningcss-plugin.mjs +1 -1
- package/lib/plugin/virtual-module.d.mts +3 -2
- package/lib/plugin/virtual-module.mjs +1 -1
- package/lib/polyfills/polyfills.d.mts +0 -1
- package/lib/polyfills/polyfills.mjs +1 -1
- package/lib/utils/has-pkg.mjs +1 -1
- package/lib/utils/index.d.mts +1 -1
- package/lib/vm/example.d.mts +1 -1
- package/lib/vm/example.mjs +1 -1
- package/lib/vm/info.mjs +1 -1
- package/lib/vm/modules.mjs +1 -1
- package/package.json +16 -16
- package/lib/utils/compiler-listener.d.mts +0 -3
- package/lib/utils/compiler-listener.mjs +0 -1
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as o}from"@moneko/mdx";import
|
|
1
|
+
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import e from"./build/common.mjs";import i from"./build/server.mjs";import{CONFIG as t}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as a}from"./process-env.mjs";import p from"./utils/log.mjs";import f from"./utils/seo.mjs";import c from"./utils/progress.mjs";import g from"chalk";let{ProgressPlugin:h}=r,u=[m(e,{module:s(!1),plugins:[t.done&&new l({done:t.done}),t.bar&&new h({handler(o,r,...m){let e=t.bar;c(o,e.name||"Build",m.length?`[${r}] ${m.join(" ")}`:"",e.color)}})].filter(Boolean)})];a&&u.push(m(e,i));let d=r(u);async function j(){await new Promise(o=>{d.run((r,m)=>{if(r)throw r;if(m&&(m.hasErrors()||m.hasWarnings()))for(let o=0,r=m.stats.length;o<r;o++){let r=m.stats[o];for(let o=0,m=r.compilation.warnings.length;o<m;o++)p(g.yellowBright(r.compilation.warnings[o].message));for(let o=0,m=r.compilation.errors.length;o<m;o++)p(g.redBright(r.compilation.errors[o].message))}o(r)})}),t.seo&&f()}await j(),process.on("exit",function(){o(n.cachePath)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return o}});const t=(e=require("./load-module-meta.cjs"))&&e.__esModule?e:{default:e},r=(0,t.default)("core-js/package.json").version,o={coreJsVersion:r.substring(0,r.indexOf(".",2)),loadModuleMeta:t.default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=function(e){return require(e)};
|
package/lib/dev/mock.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ type Any = any;
|
|
|
20
20
|
* @param {T} data data
|
|
21
21
|
* @returns {Promise} mockData
|
|
22
22
|
*/
|
|
23
|
-
export declare const yApiSchemaMock: <T extends unknown>(option: YApiOptionBySchema, data?: T
|
|
23
|
+
export declare const yApiSchemaMock: <T extends unknown>(option: YApiOptionBySchema, data?: T) => Promise<T>;
|
|
24
24
|
export type YApiOption = {
|
|
25
25
|
/** YApi host */
|
|
26
26
|
host: string;
|
package/lib/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import o from"express";import i from"multer";import
|
|
1
|
+
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import o from"express";import i from"multer";import s from"webpack";import l from"webpack-dev-middleware";import r from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import a from"./build/server.mjs";import{commonConfig as n}from"./common.mjs";import{CONFIG as c}from"./config.mjs";import{PORT as p,devLog as d,headers as u}from"./dev/config.mjs";import h from"./dev/mock.mjs";import f from"./dev/proxy.mjs";import w from"./module.config.mjs";import x from"./paths.mjs";import{SSR as j,isLibrary as g,isReact as k}from"./process-env.mjs";import $ from"./utils/has-pkg.mjs";import{empty as b,resolveProgramPath as y}from"./utils/index.mjs";import v from"./utils/progress.mjs";import _ from"./utils/sigint-exit.mjs";let{HotModuleReplacementPlugin:P,ProgressPlugin:S,WatchIgnorePlugin:B}=s,C=$("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,D=$("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,L=k&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,M=["js","jsx","ts","tsx","json","html","vue"],F=M.join(","),O=["css","scss","sass","less","ts","tsx","js","jsx"],R=O.join(","),T=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],q=new URLSearchParams({timeout:2e3,reload:!0,quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),A=n.output.path;j&&(A=y(`${g?"docs":"dist"}/client`));let E=m(n,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${p}/__hmr__&${q}`]},output:{path:A},module:w(!1),plugins:[new P,new B({paths:[/\.d\.ts$/]}),L&&new L,D&&new D({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${F}}`,g&&`${c.alias["@pkg"]}/**/*.{${F}}`].filter(Boolean),extensions:M,exclude:T,cache:!0,cacheLocation:`${x.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),C&&new C({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${R}}`,g&&`${c.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:O,exclude:T,cache:!0,cacheLocation:`${x.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),c.bar&&new S({handler(e,t,...o){let i=c.bar;v(e,i.name||"Build",o.length?`[${t}] ${o.join(" ")}`:"",i.color)}})].filter(Boolean)}),G=[E];j&&G.push(m(n,a));let I=s(G);I.compilers[0].hooks.done.tap("client-log",e=>{d(null,e)});let U=o(),z=i(),H=l(I,{writeToDisk:!1,index:"index.html",headers:()=>u,serverSideRender:j,lastModified:!0});if(U.use(H),U.use(r(I,{log:!1,path:"/__hmr__",heartbeat:2e3})),c.proxy&&f(U,c.proxy),e(x.mockPath)){let e=h(x.mockPath);U.use(e)}let J=`${E.output.path}/index.html`;U.all("/*",z.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=H.context.outputFileSystem,o=e?.readFileSync?.(J);t.end(o)}});let K=U.listen(p,()=>{});process.on("exit",function(){H.close(b),K.close(b),K.closeAllConnections(),t(x.cachePath)}),_(()=>{process.exit(1)});
|
package/lib/index.d.mts
CHANGED
|
@@ -13,4 +13,6 @@ export { default as jsxDomExpressions, type JsxDomExpressions, } from './options
|
|
|
13
13
|
export { default as splitChunk, type OptimizationSplitChunksOptions, } from './options/split-chunk.mjs';
|
|
14
14
|
export { default as Rule } from './rule.mjs';
|
|
15
15
|
export type { VirtualModulePluginOption } from './plugin/virtual-module.mjs';
|
|
16
|
+
export declare const coreJsVersion: any;
|
|
17
|
+
export declare const loadModuleMeta: any;
|
|
16
18
|
export type * from '../typings/global.js';
|
package/lib/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as paths,CUSTOMCONFIG,yarnArgv,routeDir}from"./paths.mjs";export{APPTYPE,FRAMEWORK,PACKAGENAME,PACKAGEVERSION,coreName,isDev,isLibrary,isMicro,mainDirectory}from"./process-env.mjs";export{realResolve,resolveNodeModulesPath,resolveProgramPath}from"./utils/index.mjs";export{default as log}from"./utils/log.mjs";export{default as hasPkg}from"./utils/has-pkg.mjs";export{default as osTmpDir}from"./utils/os-tmp-dir.mjs";export{yApiMock,yApiSchemaMock}from"./dev/mock.mjs";export{getIPv4,getPort}from"./dev/net.mjs";export{default as jsxDomExpressions}from"./options/jsx-dom-expressions.mjs";export{default as splitChunk}from"./options/split-chunk.mjs";export{default as Rule}from"./rule.mjs";
|
|
1
|
+
export{default as paths,CUSTOMCONFIG,yarnArgv,routeDir}from"./paths.mjs";export{APPTYPE,FRAMEWORK,PACKAGENAME,PACKAGEVERSION,coreName,isDev,isLibrary,isMicro,mainDirectory}from"./process-env.mjs";export{realResolve,resolveNodeModulesPath,resolveProgramPath}from"./utils/index.mjs";export{default as log}from"./utils/log.mjs";export{default as hasPkg}from"./utils/has-pkg.mjs";export{default as osTmpDir}from"./utils/os-tmp-dir.mjs";export{yApiMock,yApiSchemaMock}from"./dev/mock.mjs";export{getIPv4,getPort}from"./dev/net.mjs";export{default as jsxDomExpressions}from"./options/jsx-dom-expressions.mjs";export{default as splitChunk}from"./options/split-chunk.mjs";export{default as Rule}from"./rule.mjs";import o from"./cjs/index.cjs";let e=o.default;export const coreJsVersion=e.coreJsVersion;export const loadModuleMeta=e.loadModuleMeta;
|
|
@@ -20,6 +20,6 @@ export declare const getMinifyOption: (type?: MinifierType, options?: SwcMinifyO
|
|
|
20
20
|
minify: typeof TerserPlugin.swcMinify;
|
|
21
21
|
terserOptions?: SwcMinifyOptions | undefined;
|
|
22
22
|
}) & {
|
|
23
|
-
terserOptions:
|
|
23
|
+
terserOptions: any;
|
|
24
24
|
};
|
|
25
25
|
export {};
|
package/lib/options/swcrc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import{CONFIG as r}from"../config.mjs";import o from"../paths.mjs";import
|
|
1
|
+
import{merge as e}from"webpack-merge";import{CONFIG as r}from"../config.mjs";import o from"../paths.mjs";import{coreJsVersion as t}from"../index.mjs";import s from"../polyfills/polyfills.mjs";import{isDev as m,isReact as a,isSolid as p,jsxImportSource as i}from"../process-env.mjs";let l=function(e){for(let r=0,o=Object.keys(e),t=o.length;r<t;r++)e[o[r]].transform=`${o[r]}/${e[o[r]].transform}`,e[o[r]].style&&(e[o[r]].style=`${o[r]}/${e[o[r]].style}`);return e}(r.importOnDemand||{}),n={include:s(),mode:"entry",coreJs:t};export default(t=>e({module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:r.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:a&&m,development:m,importSource:i},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:o.swcCachePath,plugins:[["@moneko/transform-imports",l],p&&["@moneko/jsx-dom-expressions",{...r.jsxDomExpressions,generate:t?"ssr":"dom",hydratable:t}]].filter(Boolean)}},env:r.polyfill?n:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof r.swcrc?r.swcrc(m):r.swcrc||{}));
|
package/lib/paths.d.mts
CHANGED
|
@@ -14,6 +14,7 @@ declare const paths: {
|
|
|
14
14
|
corePath: string;
|
|
15
15
|
programPath: string;
|
|
16
16
|
webpackCachePath: string;
|
|
17
|
+
lineCachePath: string;
|
|
17
18
|
cachePath: string;
|
|
18
19
|
httpCachePath: string;
|
|
19
20
|
swcCachePath: string;
|
|
@@ -23,7 +24,6 @@ declare const paths: {
|
|
|
23
24
|
pagesPath: string;
|
|
24
25
|
componentsPath: string;
|
|
25
26
|
mockPath: string;
|
|
26
|
-
lineCachePath: string;
|
|
27
27
|
};
|
|
28
28
|
export declare const routeDir: string;
|
|
29
29
|
export default paths;
|
package/lib/paths.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"url";let
|
|
1
|
+
import e from"url";import{resolve as o}from"path";let t=JSON.parse(process.env.npm_config_argv||'{"original":[]}').original;export const yarnArgv={};for(let e=0,o=t.length;e<o;e++){let o=t[e].split("=");Object.assign(yarnArgv,{[o[0]]:o[1]||!0})}export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let a=process.cwd(),c=o(a,"./node_modules"),r={nodeModules:c,corePath:e.fileURLToPath(new URL(".",import.meta.url)),programPath:a,webpackCachePath:o(c,"./.temp_cache"),lineCachePath:o(c,"./.cache"),cachePath:o(c,"./.cache/.mo"),httpCachePath:o(c,"./.cache/http"),swcCachePath:o(c,"./.swc"),configPath:o(a,"./config/index.ts"),customConfigPath:o(a,`./config/${CUSTOMCONFIG}.ts`),coveragePath:o(a,"./coverage/clover.xml"),pagesPath:o(a,"./src/pages"),componentsPath:o(a,"./components"),mockPath:o(a,"./mock")};export const routeDir="library"===process.env.APPTYPE?r.componentsPath:r.pagesPath;export default r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Buffer as s}from"buffer";import{
|
|
1
|
+
import{Buffer as s}from"buffer";import{transform as t}from"lightningcss";import i from"webpack";import{loadModuleMeta as n,paths as o}from"../index.mjs";let{sources:{RawSource:e,SourceMapSource:r},ModuleFilenameHelpers:{matchObject:a}}=i,m="lightning-css-minify",p=/\.css(?:\?.*)?$/i,{name:f,version:c}=n(`${o.programPath}/package.json`);export class LightningCssMinifyPlugin{constructor(s={}){let{implementation:i,...n}=s;if(i&&"function"!=typeof i.transform)throw TypeError(`[LightningCssMinifyPlugin]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof i.transform}`);this.transform=i?.transform??t,this.options=n}apply(s){let t=JSON.stringify({name:f,version:c,options:this.options});s.hooks.compilation.tap(m,s=>{s.hooks.chunkHash.tap(m,(s,i)=>i.update(t)),s.hooks.processAssets.tapPromise({name:m,stage:s.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,additionalAssets:!0},async()=>await this.transformAssets(s)),s.hooks.statsPrinter.tap(m,s=>{s.hooks.print.for("asset.info.minimized").tap(m,(s,{green:t,formatFlag:i})=>s&&t&&i?t(i("minimized")):void 0)})})}async transformAssets(t){let{options:{devtool:i}}=t.compiler,{include:n,exclude:o,test:m,sourceMap:f=!!(i&&i.includes("source-map")),...c}=this.options,l=t.getAssets().filter(s=>!s.info.minimized&&(m||p).test(s.name)&&a({include:n,exclude:o},s.name));await Promise.all(l.map(async i=>{let n;let{source:o,map:a}=i.source.sourceAndMap(),m=o.toString(),p="string"==typeof o?s.from(o):o,l=this.transform({filename:i.name,code:p,minify:!0,sourceMap:f,...c}),g=l.code.toString();n=f?new r(g,i.name,JSON.parse(l.map.toString()),m,a,!0):new e(g),t.updateAsset(i.name,n,{...i.info,minimized:!0})}))}}
|
|
@@ -3,8 +3,9 @@ export interface VirtualModulePluginOption {
|
|
|
3
3
|
[key: string]: string | object;
|
|
4
4
|
}
|
|
5
5
|
export declare class VirtualModuleWebpackPlugin {
|
|
6
|
-
private
|
|
7
|
-
private
|
|
6
|
+
private virtualModules;
|
|
7
|
+
private options;
|
|
8
8
|
constructor(options?: VirtualModulePluginOption);
|
|
9
|
+
private modify;
|
|
9
10
|
apply(compiler: Compiler): void;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"webpack-virtual-modules";import{
|
|
1
|
+
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{node_modules as e}from"../utils/index.mjs";import{comment as i,docs as s}from"../vm/docs.mjs";import{examples as r}from"../vm/example.mjs";import{locales as l}from"../vm/locales.mjs";import m from"../vm/modules.mjs";import{route as p}from"../vm/routes.mjs";import n from"../paths.mjs";export class VirtualModuleWebpackPlugin{constructor(t={}){this.virtualModules=new o(m),this.options={};let e={};for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let i=t[o];Object.assign(e,{[o]:"string"==typeof i?i:`export default ${JSON.stringify(i)}`})}this.options=e}modify(o,t,i){let s=i||"",r=t.startsWith(n.nodeModules)?t:e(t),l=o?.inputFileSystem;for(;l&&l._inputFileSystem;)l=l._inputFileSystem;let m=l._virtualFiles?.[r];m&&m.contents===s||this.virtualModules.writeModule(r,s)}apply(o){this.virtualModules.apply(o);let e=(t,e)=>{this.modify(o,t,e)};p.on("change",e),l.on("change",e),t&&(r.on("change",e),s.on("change",e),i.on("change",e)),o.hooks.compilation.tap("VirtualModuleWebpackPlugin",()=>{for(let o in this.options)Object.prototype.hasOwnProperty.call(this.options,o)&&e(o,this.options[o]);for(let o of r)e(o[0],o[1]);for(let o of s)e(o[0],o[1]);for(let o of i)e(o[0],o[1])})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"core-js-compat";import{getBrowsersTargets as t}from"./targets.mjs";import{coreJsVersion as o}from"../index.mjs";export default function(){return r({targets:t(),version:o}).list}
|
package/lib/utils/has-pkg.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{loadModuleMeta as r}from"../index.mjs";export default function(t){try{return r(`${t}/package.json`),!0}catch(r){return!1}}
|
package/lib/utils/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function resolveProgramPath<T extends string>(src: T): ProgramPat
|
|
|
10
10
|
* @param {string} src 路径
|
|
11
11
|
* @returns {string} 位于项目根目录node_modules下的位置
|
|
12
12
|
*/
|
|
13
|
-
export declare const resolveNodeModulesPath: <T extends string>(src: T) =>
|
|
13
|
+
export declare const resolveNodeModulesPath: <T extends string>(src: T) => NodeModulesPath<T>;
|
|
14
14
|
export declare function node_modules<T extends string>(name: T): `node_modules/${T}`;
|
|
15
15
|
/** 获取模块真实入口位置
|
|
16
16
|
* @param {string} url 路径
|
package/lib/vm/example.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import ReactiveObject from '../utils/reactive-object.mjs';
|
|
2
2
|
export declare const exampleModuleName = "@app/example";
|
|
3
3
|
export declare const examples: ReactiveObject<Record<string, string>>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function generatorExample(): void;
|
package/lib/vm/example.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateExample as e}from"@moneko/mdx";import{watchFiles as t}from"./utils.mjs";import
|
|
1
|
+
import{generateExample as e}from"@moneko/mdx";import{watchFiles as t}from"./utils.mjs";import r from"../paths.mjs";import{isDev as o,isLibrary as m}from"../process-env.mjs";import p from"../utils/reactive-object.mjs";import a from"../rule.mjs";export const exampleModuleName="@app/example";function l(){if(!m)return{};let t=JSON.parse(e(r.componentsPath,`${exampleModuleName}/`)),o={};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&Object.assign(o,{[e]:`rr(() => import('${e}'))rr`});return{...t,[`${exampleModuleName}/index.js`]:`export default ${JSON.stringify(o).replace(a.extract_func,"$1")}`}}export const examples=new p(l());export function generatorExample(){let e=l();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&examples.setData(t,e[t])}m&&o&&t(r.componentsPath,/(?<!\/examples\/(.+)\.md)$/,generatorExample);
|
package/lib/vm/info.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CONFIG as r}from"../config.mjs";import{APPTYPE as e,PACKAGENAME as o,PACKAGEVERSION as t,SSR as s}from"../process-env.mjs";import{toUpperCaseString as i}from"../utils/index.mjs";import{loadModuleMeta as p,paths as m}from"../index.mjs";let{description:n,author:a,repository:c,keywords:d}=p(`${m.programPath}/package.json`),f="string"==typeof a,l={name:o,projectName:i(o).replace(/-/g," "),ssr:s,version:t,base:r.basename,type:e,routerMode:r.routerMode,prefixCls:r.prefixCls,theme:r.theme,description:n,author:f?{name:a}:a,repository:f?{url:c}:c};export const description=n;export const keywords=Array.isArray(d)?d.toString():"";export default l;
|
package/lib/vm/modules.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as
|
|
1
|
+
import{join as m}from"path";import{getAppEntry as o,getAppFallback as e,getAppMdxScope as r,getAppMergeRouter as p,getAppNormalizeCss as t,getAppPrefixRouter as a,getAppRem as s,getAppSuspense as i}from"@moneko/mdx";import f from"./coverage.mjs";import{docs as n,docsModuleName as l}from"./docs.mjs";import{exampleModuleName as c,examples as x}from"./example.mjs";import d from"./info.mjs";import{locales as g,localesModuleName as j}from"./locales.mjs";import{route as u,routesModuleName as h}from"./routes.mjs";import{CONFIG as v}from"../config.mjs";import D from"../paths.mjs";import{APPTYPE as k,FRAMEWORK as z}from"../process-env.mjs";import{node_modules as b,resolveProgramPath as y}from"../utils/index.mjs";let C={[b("@app/info")]:`export default ${JSON.stringify(d)}`,[b("@app/entry")]:o(m(v.alias["@"],"./index.ts"),!!v.rem,!!v.normalizeCss,k,z),[b("@app/rem")]:s(v.rem?.designSize||1680),[b("@app/fallback")]:e(v.fallbackCompPath),[b("@app/coverage")]:f(D.coveragePath),[b("@app/merge-router")]:p(),[b("@app/prefix-router")]:a(),[b("@app/normalize/index.css")]:t(),[b("@app/suspense/index.tsx")]:i(k,z),[b("@app/mdx-scope")]:r(y("site/mdx-scope.ts")),[b(c)]:x.getData(c),[b(h)]:u.getData(h),[b(j)]:g.getData(j),[b(l)]:n.getData(l)};export default C;
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.11.1-beta.
|
|
3
|
+
"version": "3.11.1-beta.11",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "rm -rf ./lib && tsc && swc src -d lib --strip-leading-paths -D"
|
|
9
|
-
"postbuild": "npm run cjs && npm run mjs",
|
|
10
|
-
"cjs": "find ./lib/loader/ -type f -name \"*.js\" -execdir bash -c 'mv \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
|
|
11
|
-
"mjs": "find ./lib/ -type f -name \"*.js\" -execdir bash -c 'mv \"$1\" \"${1%.js}.mjs\"' _ {} \\;"
|
|
8
|
+
"build": "rm -rf ./lib && tsc && swc src -d lib --strip-leading-paths -D && node convert"
|
|
12
9
|
},
|
|
13
10
|
"keywords": [],
|
|
14
11
|
"author": "moneko",
|
|
@@ -16,14 +13,15 @@
|
|
|
16
13
|
"dependencies": {
|
|
17
14
|
"@moneko/mdx": "0.1.26",
|
|
18
15
|
"@moneko/transform-imports": "0.4.0",
|
|
19
|
-
"@swc/core": "1.4.
|
|
16
|
+
"@swc/core": "1.4.14",
|
|
20
17
|
"add-asset-html-webpack-plugin": "6.0.0",
|
|
18
|
+
"browserslist": "4.23.0",
|
|
21
19
|
"chalk": "5.3.0",
|
|
22
20
|
"chokidar": "3.6.0",
|
|
23
21
|
"core-js": "3.36.1",
|
|
24
22
|
"core-js-compat": "3.36.1",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
23
|
+
"css-loader": "7.1.1",
|
|
24
|
+
"enhanced-resolve": "5.16.0",
|
|
27
25
|
"express": "4.19.2",
|
|
28
26
|
"html-webpack-plugin": "5.6.0",
|
|
29
27
|
"http-proxy-middleware": "3.0.0",
|
|
@@ -33,13 +31,14 @@
|
|
|
33
31
|
"mini-css-extract-plugin": "2.8.1",
|
|
34
32
|
"mock-json-schema": "1.1.1",
|
|
35
33
|
"multer": "1.4.5-lts.1",
|
|
36
|
-
"style-loader": "
|
|
34
|
+
"style-loader": "4.0.0",
|
|
37
35
|
"swc-loader": "0.2.6",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"webpack
|
|
41
|
-
"webpack-
|
|
42
|
-
"webpack-
|
|
36
|
+
"terser-webpack-plugin": "5.3.10",
|
|
37
|
+
"typescript": "5.4.5",
|
|
38
|
+
"webpack": "5.91.0",
|
|
39
|
+
"webpack-bundle-analyzer": "4.10.2",
|
|
40
|
+
"webpack-dev-middleware": "7.2.1",
|
|
41
|
+
"webpack-hot-middleware": "2.26.1",
|
|
43
42
|
"webpack-merge": "5.10.0",
|
|
44
43
|
"webpack-node-externals": "3.0.0",
|
|
45
44
|
"webpack-virtual-modules": "0.6.1",
|
|
@@ -49,8 +48,9 @@
|
|
|
49
48
|
"@swc/cli": "0.3.12",
|
|
50
49
|
"@types/express": "4.17.21",
|
|
51
50
|
"@types/multer": "1.4.11",
|
|
52
|
-
"
|
|
53
|
-
"sass
|
|
51
|
+
"@types/webpack-hot-middleware": "2.25.9",
|
|
52
|
+
"sass": "1.75.0",
|
|
53
|
+
"sass-loader": "14.2.0"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"lib",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"./log.mjs";export default function(r,e){return new Promise((n,t)=>{e.hooks.failed.tap(r,o=>{t(o)}),e.hooks.done.tap(r,r=>{r.hasErrors()||n(!0);for(let e=0,n=r.compilation.warnings.length;e<n;e++)o(r.compilation.warnings[e].message);for(let e=0,n=r.compilation.errors.length;e<n;e++)o(r.compilation.errors[e].message)})})}
|