@moneko/core 3.33.1 → 3.33.3
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/commom/require.d.mts +1 -1
- package/lib/options/md-to-html.d.mts +2 -1
- package/lib/options/md-to-html.mjs +1 -1
- package/lib/plugin/copy.d.mts +1 -1
- package/lib/plugin/copy.mjs +1 -1
- package/lib/plugin/eslint.d.mts +1 -1
- package/lib/plugin/eslint.mjs +1 -1
- package/lib/plugin/stylelint.d.mts +1 -1
- package/lib/plugin/stylelint.mjs +1 -1
- package/lib/plugins.config.mjs +1 -1
- package/lib/vm/docs.mjs +1 -1
- package/package.json +1 -1
- /package/lib/{plugin/worker → worker}/eslint.d.mts +0 -0
- /package/lib/{plugin/worker → worker}/eslint.mjs +0 -0
- /package/lib/{plugin/worker → worker}/stylelint.d.mts +0 -0
- /package/lib/{plugin/worker → worker}/stylelint.mjs +0 -0
package/lib/commom/require.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { type Options, transformFileSync } from '@swc/core';
|
|
3
|
-
declare const require:
|
|
3
|
+
declare const require: NodeJS.Require;
|
|
4
4
|
declare const transformOptions: Options;
|
|
5
5
|
declare function requireEsm(module: NodeJS.Module & {
|
|
6
6
|
_compile?: (code: string, filename: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"marked-completed";let r=new e.Renderer;r.code=(e,r)=>"treeview"===r?`<n-tree data="${e}" />`:`<n-code class="n-code" toolbar="${JSON.stringify(["copy"])}" language="${r}" line-number="true">${encodeURIComponent(e)}</n-code>`,r.image=(e,r,t)=>`<n-img lazy="true" role="img" src="${e}" alt="${t}" ${r?`title="${r}"`:""}></n-img>`,e.use({langToolbar:["copy"],headerPrefix:"# ",breaks:!0,pedantic:!1,smartLists:!0,smartypants:!0,xhtml:!0,renderer:r})
|
|
1
|
+
import e from"marked-completed";let r=!0;export default function(t){return r&&(r=!1,function(){let r=new e.Renderer;r.code=(e,r)=>"treeview"===r?`<n-tree data="${e}" />`:`<n-code class="n-code" toolbar="${JSON.stringify(["copy"])}" language="${r}" line-number="true">${encodeURIComponent(e)}</n-code>`,r.image=(e,r,t)=>`<n-img lazy="true" role="img" src="${e}" alt="${t}" ${r?`title="${r}"`:""}></n-img>`,e.use({langToolbar:["copy"],headerPrefix:"# ",breaks:!0,pedantic:!1,smartLists:!0,smartypants:!0,xhtml:!0,renderer:r})}()),e.parse(t)}
|
package/lib/plugin/copy.d.mts
CHANGED
package/lib/plugin/copy.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as e}from"node:path";import{
|
|
1
|
+
import{resolve as e}from"node:path";import{loadFileRaw as s,scanFolderSync as t}from"@moneko/utils";import i from"webpack";let o="CopyPlugin",l=i.sources.RawSource;export class CopyPlugin{constructor(s){this.cacheFiles=[],this.baseFiles=new Set(s.files?.map(s=>e(s))||[]),this.dirs=new Set(s.dirs||[])}getFiles(){let e=new Set(this.baseFiles);for(let s of this.dirs)t(s,["\\.*"]).forEach(s=>e.add(s));let s={deleted:[],files:[...e]};for(let t of new Set(this.cacheFiles))e.has(t)||s.deleted.push(t);return this.cacheFiles=s.files,s}apply(e){e.hooks.thisCompilation.tap({name:o,stage:e.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},e=>{e.hooks.processAssets.tapPromise(o,async()=>{let t=this.getFiles();(await Promise.all(t.files.map(e=>s(e)))).forEach((s,i)=>{null!==s&&e.emitAsset(t.files[i],new l(Buffer.from(s)))}),t.deleted.forEach(s=>{e.deleteAsset(s)})})})}}
|
package/lib/plugin/eslint.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { ESLint } from '@moneko/eslint';
|
|
3
3
|
import webpack, { type Compilation, type Compiler } from 'webpack';
|
|
4
4
|
import { Worker } from 'worker_threads';
|
|
5
|
-
import type { ESLintWorkerMessage } from '
|
|
5
|
+
import type { ESLintWorkerMessage } from '../worker/eslint.mjs';
|
|
6
6
|
declare class ESLintError extends webpack.WebpackError {
|
|
7
7
|
constructor(message: string);
|
|
8
8
|
}
|
package/lib/plugin/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"node:url";import r from"webpack";import{Worker as s}from"worker_threads";class e extends r.WebpackError{constructor(t){super(`[ESLint] ${t}`),this.name="ESLintError",this.stack=""}}export default class{constructor(r={files:[]}){this.name="ESLintPlugin",this.options=r,this.worker=new s(t(new URL("
|
|
1
|
+
import{fileURLToPath as t}from"node:url";import r from"webpack";import{Worker as s}from"worker_threads";class e extends r.WebpackError{constructor(t){super(`[ESLint] ${t}`),this.name="ESLintError",this.stack=""}}export default class{constructor(r={files:[]}){this.name="ESLintPlugin",this.options=r,this.worker=new s(t(new URL("../worker/eslint.mjs",import.meta.url)))}apply(t){t.hooks.thisCompilation.tap(this.name,t=>{this.worker.postMessage({options:this.options}),this.worker.once("message",r=>{this.report(t,r)})}),t.hooks.shutdown.tap(this.name,()=>{this.worker.terminate()})}report(t,r){r?.length&&t&&(r[0]?.length&&t.warnings.push(new e(r[0])),r[1]?.length&&t.errors.push(new e(r[1])))}}
|
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import type { LinterOptions } from '@moneko/stylelint';
|
|
3
3
|
import webpack, { type Compilation, type Compiler } from 'webpack';
|
|
4
4
|
import { Worker } from 'worker_threads';
|
|
5
|
-
import type { StylelintWorkerMessage } from '
|
|
5
|
+
import type { StylelintWorkerMessage } from '../worker/stylelint.mjs';
|
|
6
6
|
declare class StylelintError extends webpack.WebpackError {
|
|
7
7
|
constructor(message: string);
|
|
8
8
|
}
|
package/lib/plugin/stylelint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"node:url";import r from"webpack";import{Worker as e}from"worker_threads";class s extends r.WebpackError{constructor(t){super(`[Stylelint] ${t}`),this.name="StylelintError",this.stack=""}}export default class{constructor(r={files:[]}){this.name="StylelintPlugin",this.options=r,this.worker=new e(t(new URL("
|
|
1
|
+
import{fileURLToPath as t}from"node:url";import r from"webpack";import{Worker as e}from"worker_threads";class s extends r.WebpackError{constructor(t){super(`[Stylelint] ${t}`),this.name="StylelintError",this.stack=""}}export default class{constructor(r={files:[]}){this.name="StylelintPlugin",this.options=r,this.worker=new e(t(new URL("../worker/stylelint.mjs",import.meta.url)))}apply(t){t.hooks.thisCompilation.tap(this.name,t=>{this.worker.postMessage({options:this.options}),this.worker.once("message",r=>{this.report(r,t)})}),t.hooks.shutdown.tap(this.name,()=>{this.worker.terminate()})}report(t,r){t?.length&&r&&(t[0]?.length&&r.warnings.push(new s(t[0])),t[1]?.length&&r.errors.push(new s(t[1])))}}
|
package/lib/plugins.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"compression-webpack-plugin";import t from"webpack";import{CopyPlugin as i}from"./plugin/copy.mjs";import{HtmlPlugin as o}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as l}from"./plugin/virtual-module.mjs";import{CONFIG as n}from"./config.mjs";import{packageJson as p}from"./process-env.mjs";let a=[...r,new l(n.virtualModule),new i(n.copy),new t.DefinePlugin({"process.env":JSON.stringify(n.env)}),new t.IgnorePlugin({resourceRegExp:/\/(__(tests|mocks)__|test|spec|e2e)\//}),...n.plugins,new e({filename:"[path][base].gz",algorithm:"gzip",test
|
|
1
|
+
import e from"compression-webpack-plugin";import t from"webpack";import{CopyPlugin as i}from"./plugin/copy.mjs";import{HtmlPlugin as o}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as l}from"./plugin/virtual-module.mjs";import{CONFIG as n}from"./config.mjs";import{packageJson as p}from"./process-env.mjs";let a=[...r,new l(n.virtualModule),new i(n.copy),new t.DefinePlugin({"process.env":JSON.stringify(n.env)}),new t.IgnorePlugin({resourceRegExp:/\/(__(tests|mocks)__|test|spec|e2e)\//}),...n.plugins,new e({filename:"[path][base].gz",algorithm:"gzip",test:/\.(js|css|html|svg)$/})].filter(Boolean);if(n.htmlPluginOption){let e={charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no","mobile-web-app-capable":"yes",renderer:"webkit",description:p.description,keywords:Array.isArray(p.keywords)?p.keywords.toString():"","http-equiv":"refresh",viewport:"width=device-width, initial-scale=1"};n.seo&&(e.relCanonical={rel:"canonical",href:`https://${n.seo.domain}${n.basename}`}),n.htmlPluginOption.meta&&Object.assign(e,n.htmlPluginOption.meta),a.push(new o({...n.htmlPluginOption,meta:e}))}if(n.fixBrowserRouter){let e=n.basename.split("/").filter(Boolean).length,t=`${Array(e).fill("..").join("/")+(e?"/":"")}404.html`,i=n.fixBrowserRouter.pathSegmentsToKeep??e;a.push(new o({filename:n.fixBrowserRouter.path??t,inject:!1,templateContent:()=>`<html lang="en"><head><title>Redirect</title><script>const pathKeep = ${i};const l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>`}))}n.sourceMap&&a.push(new t.SourceMapDevToolPlugin(n.sourceMap));export default a;
|
package/lib/vm/docs.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as e,sep as t}from"node:path";import{loadFile as o,scanFolderSync as m}from"@moneko/utils";import a from"../commom/parse-module-meta.mjs";import
|
|
1
|
+
import{relative as e,sep as t}from"node:path";import{loadFile as o,scanFolderSync as m}from"@moneko/utils";import a from"../commom/parse-module-meta.mjs";import r from"../commom/paths.mjs";import n from"../commom/reactive-object.mjs";import s from"../commom/rule.mjs";import{CONFIG as l}from"../config.mjs";import{FRAMEWORK as c,framework as p,isLibrary as i,isReact as d,isSolid as f}from"../process-env.mjs";import u from"./generate-doc.mjs";let g={react:"createElement",solid:"createComponent"}[c],$=a("@app/docs");export const docsModuleName=$.file;export const docsModulePkgJson=$.pkg;export const docsModuleMeta=$.meta;export const docs=new n({[docsModuleName]:"export default {}",[docsModulePkgJson]:docsModuleMeta});export const comment=new n({});export const getCommentPath=function(){let e=/\/(.+?)\.tsx?$/,t=l.alias["@pkg"]?.length;return o=>o.substring(t).replace(/\\/g,"/").replace(e,"@app/comment/$1.md")}();if(i&&!1!==l.htmlPluginOption){let n={},c=`import { ${g}${f?",Dynamic":""} } from "${p}${f?"/web":""}";import SuspenseComp from "@app/suspense";function call_then(res) {return {default: ${d?"() =>":""}${g}(${f?"Dynamic":"'div'"}, {${f?"innerHTML: res.default, component: 'div', class: 'n-md-box' ":"dangerouslySetInnerHTML: {__html:res.default}, className: 'n-md-box'"} })};}`,i=(e,o)=>{if(!e.endsWith("package.json")){let m=e.replace(/@app[/\\]comment[/\\]/,"").split(t),a=m.pop(),r=m.join("/");n[r]||(n[r]={}),o?n[r][a]&&delete n[r][a]:n[r][a]=`rr(() => ${g}(SuspenseComp, { comp: () => import(/* webpackChunkName: '${e}' */ '${e}?raw').then(call_then)}))rr`;let l={};for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(l[e]=Object.values(n[e]));docs.setData(docsModuleName,`${c}export default ${JSON.stringify(l).replace(s.extract_func,"$1")}`)}};comment.on("change",(t,o)=>{i(e(r.nodeModules,t),o?.length<0)});let $=m(l.alias["@pkg"],["\\.tsx?$"]).filter(e=>!/(^|\/)\.[^\\/\\.]|\.test\./i.test(e)),h=await Promise.all($.map(async e=>({data:await o(e),file:e})));for(let e=0;e<h.length;e++){let t=h[e];if(t.data){let{file:e,pkg:o,meta:m}=a(getCommentPath(t.file));comment.setData(e,u(t.data,t.file)),comment.setData(o,m)}}}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|