@moneko/core 3.51.5 → 3.51.6-beta.1
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/bin/pure-lint.d.mts +1 -1
- package/lib/bin/pure-lint.mjs +1 -1
- package/lib/config.d.mts +0 -1
- package/lib/config.mjs +1 -1
- package/lib/options/swcrc.mjs +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +4 -0
package/lib/bin/pure-lint.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ declare const cwd: string;
|
|
|
20
20
|
declare const cachePath: string;
|
|
21
21
|
declare const cmd: {
|
|
22
22
|
readonly ci: readonly ['diff', '--name-only', 'HEAD^', 'HEAD'];
|
|
23
|
-
readonly commit: readonly ['diff', '--cached', '--name-only', '--diff-filter=
|
|
23
|
+
readonly commit: readonly ['diff', '--cached', '--name-only', '--diff-filter=ACM'];
|
|
24
24
|
};
|
|
25
25
|
declare const scriptRegExp: RegExp;
|
|
26
26
|
declare const vueRegExp: RegExp;
|
package/lib/bin/pure-lint.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawnSync as t}from"node:child_process";import{join as e}from"node:path";import{argv as i,cwd as o,exit as r,stdout as n}from"node:process";import{ESLint as l}from"@moneko/eslint";import{stylelint as a}from"@moneko/stylelint";import{ink as m,loadFile as c,println as s}from"@moneko/utils";import f from"../commom/log.mjs";import d from"../commom/parse-args.mjs";import p from"../commom/timer.mjs";let y=d(i.slice(2)),h=y.fix,u=y.cache||!0,w=e(o(),"node_modules/.cache"),g={ci:["diff","--name-only","HEAD^","HEAD"],commit:["diff","--cached","--name-only","--diff-filter=
|
|
2
|
+
import{spawnSync as t}from"node:child_process";import{join as e}from"node:path";import{argv as i,cwd as o,exit as r,stdout as n}from"node:process";import{ESLint as l}from"@moneko/eslint";import{stylelint as a}from"@moneko/stylelint";import{ink as m,loadFile as c,println as s}from"@moneko/utils";import f from"../commom/log.mjs";import d from"../commom/parse-args.mjs";import p from"../commom/timer.mjs";let y=d(i.slice(2)),h=y.fix,u=y.cache||!0,w=e(o(),"node_modules/.cache"),g={ci:["diff","--name-only","HEAD^","HEAD"],commit:["diff","--cached","--name-only","--diff-filter=ACM"]},S=/.*(?<!\.d)\.(j|t|mj|mt|cj|ct)sx?$/,$=/.*(?<!\.d)\.vue$/,E=/.*(?<!\.d)\.(c|sc|sa|le)ss$/,j=t("git",g[y.mode||"ci"]||g.ci).stdout.toString().trim().split("\n");async function L(){let t=m("ESLint","cyan");s(`${t}: ${m("runing...","yellow")}`,!0);try{p.start("ESLint");let t=j.filter(t=>S.test(t)||$.test(t));if(0===t.length){p.end("ESLint");return}let e=new l({cache:u,cacheLocation:`${w}/.eslintcache`,fix:h}),i=await e.lintFiles(t),o=await e.loadFormatter("stylish"),a=await o.format(i);h&&await l.outputFixes(i),a&&n.write(a);let m=i.some(t=>t.errorCount>0);p.end("ESLint"),m&&r(1)}catch(t){f(t)}}let k=j.filter(t=>E.test(t)||$.test(t));async function x(){let t=m("Stylelint","cyan");if(s(`${t}: ${m("runing...","yellow")}`,!0),p.start("Stylelint"),0===k.length){p.end("Stylelint");return}let e=await Promise.all(k.map(async t=>{let e=await c(t);return await a.lint({codeFilename:t,code:e,cache:u,cacheLocation:`${w}/.stylelintcache`,fix:h,formatter:"string"}).catch(f)})),i=!1;e.forEach(t=>{t&&(t.report&&n.write(t.report),t.errored&&(i=!!t.errored))}),p.end("Stylelint"),i&&r(1)}await Promise.all([L(),x()]);
|
package/lib/config.d.mts
CHANGED
|
@@ -24,6 +24,5 @@ declare const normalConf: ConfigType;
|
|
|
24
24
|
declare const envConf: ConfigType;
|
|
25
25
|
declare const defaultConfig: ConfigType;
|
|
26
26
|
declare let customConf: ConfigType;
|
|
27
|
-
declare const DEV_PUBLICPATH: string;
|
|
28
27
|
export declare const CONFIG: ConfigType;
|
|
29
28
|
export declare const PUBLICPATH: string;
|
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,relative as o}from"node:path";import t from"node:process";import{fileExists as r}from"@moneko/utils";import{merge as n}from"webpack-merge";import s from"./commom/paths.mjs";import a from"./commom/require.mjs";import i from"./commom/setup-env.mjs";import l from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{APPTYPE as d,FRAMEWORK as f,frameworkVersion as h,isCI as g,isDev as v,isLibrary as
|
|
1
|
+
import{join as e,relative as o}from"node:path";import t from"node:process";import{fileExists as r}from"@moneko/utils";import{merge as n}from"webpack-merge";import s from"./commom/paths.mjs";import a from"./commom/require.mjs";import i from"./commom/setup-env.mjs";import l from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{APPTYPE as d,FRAMEWORK as f,frameworkVersion as h,isCI as g,isDev as v,isLibrary as x,isMobile as j,isReact as C,jsxImportSource as P,mainDirectory as k,NODE_ENV as b,PACKAGENAME as w}from"./process-env.mjs";let O=["@app","@moneko","neko-ui",".cache/http/data","@element-plus","ant-design-vue","element-plus","element-ui","ng-zorro-antd","@mui","@du","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design","monaco-editor"];export function getConfig(e){return delete a.cache[e],new Promise(o=>{if(r(e)){let r=a(e).default;return o(p(r)?r(t):r)}return o({})})}let y=await Promise.all([i(b,d,f,[]),getConfig(s.configPath),getConfig(s.customConfigPath)]),S=y[0],M=y[1],I=y[2],z={strict:!1,devtool:v?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,mode:"csr",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:"",namespace:w,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:S,basename:"/",publicPath:"/",rem:{designSize:j?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(k)},C&&h<18?{"react/package.json":c("react/package.json"),"react/jsx-runtime":c("react/jsx-runtime.js"),"react/jsx-dev-runtime":c("react/jsx-dev-runtime.js")}:{}),moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3,open:!0},htmlPluginOption:{title:w.toLocaleUpperCase(),favicon:o(s.programPath,`${s.corePath}/options/favicon.ico`)},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:m,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:O,js:O,media:O,font:O,wasm:[]},mdx:{jsx:!1,development:v,jsxImportSource:P,providerImportSource:`@moneko/${f}/mdx`},jsxDomExpressions:l,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:g},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:"solid"!==f,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:v,manifest:{filename:"manifest.json"},corepack:!0};x&&(z.alias=Object.assign(z.alias,{"@pkg":s.componentsPath,[w]:s.componentsPath}));let F=z;(!1===(F=n(F,M,I)).devtool||!1===F.sourceMap)&&(F.sourceMap=!1,F.devtool=!1),"true"===t.env.CODESPACES&&(F.devServer.https=!1),!1===F.devServer.https&&"darwin"===t.platform&&(F.devServer.open=!1),F.htmlPluginOption&&(F.htmlPluginOption.tags||(F.htmlPluginOption.tags=[]),F.fixBrowserRouter&&F.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}),F.manifest&&F.htmlPluginOption.tags.push({href:e(F.basename,F.manifest.filename).replaceAll(/\\/g,"/"),tag:"link",rel:"manifest"}));export const CONFIG=F;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;
|
package/lib/options/swcrc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import r from"../commom/paths.mjs";import{CONFIG as o}from"../config.mjs";import t,{coreJsVersion as s}from"../polyfills/polyfills.mjs";import{isDev as m,isReact as a,isSolid as l,jsxImportSource as p}from"../process-env.mjs";import i from"./reslove.mjs";let c=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}(o.importOnDemand||{}),n={include:t(),mode:"entry",coreJs:s};export default((t,s={})=>e({module:{type:"es6",resolveFully:!0},sync:!0,jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:o.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:a&&m,development:m,importSource:p},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath,plugins:[[i.transformImports,c],l&&[i.jsxDomExpressions,{...o.jsxDomExpressions,generate:t?"ssr":"dom",hydratable:t}]].filter(Boolean)}},env:o.polyfill?n:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof o.swcrc?o.swcrc(m):o.swcrc||{},s));
|
|
1
|
+
import{merge as e}from"webpack-merge";import r from"../commom/paths.mjs";import{CONFIG as o}from"../config.mjs";import t,{coreJsVersion as s}from"../polyfills/polyfills.mjs";import{isDev as m,isReact as a,isSolid as l,jsxImportSource as p}from"../process-env.mjs";import i from"./reslove.mjs";let c=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}(o.importOnDemand||{}),n={include:t(),mode:"entry",coreJs:s};export default((t,s={})=>e({module:{type:"es6",resolveFully:!0},sync:!0,jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:o.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:o.reactJsxRuntime||"automatic",throwIfNamespace:!0,refresh:a&&m,development:m,importSource:p},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath,plugins:[[i.transformImports,c],l&&[i.jsxDomExpressions,{...o.jsxDomExpressions,generate:t?"ssr":"dom",hydratable:t}]].filter(Boolean)}},env:o.polyfill?n:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof o.swcrc?o.swcrc(m):o.swcrc||{},s));
|
package/package.json
CHANGED
package/typings/global.d.ts
CHANGED