@moneko/core 3.30.0-beta.4 → 3.30.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/lib/dev/config.d.mts +1 -1
- package/lib/dev/config.mjs +3 -3
- 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/plugin/worker/eslint.mjs +1 -1
- package/lib/plugin/worker/stylelint.mjs +1 -1
- package/package.json +1 -1
package/lib/dev/config.d.mts
CHANGED
package/lib/dev/config.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ink as e,
|
|
2
|
-
`,"245");function
|
|
3
|
-
${e(" Network ","231",{bg:"29"})} ${e(
|
|
1
|
+
import{ink as e,println as t,termClear as o}from"@moneko/utils";import{getIPv4 as r,getPort as n}from"../commom/net.mjs";import{CONFIG as i}from"../config.mjs";let m=i.devServer.port||3e3;export const PORT=await n(m);i.devServer.port=PORT;let s="/"===i.basename?"":i.basename,l=m!==PORT&&e(`Port ${e(`${m}`,"yellow")} is in use, trying ${e(`${PORT}`,"green")} instead.
|
|
2
|
+
`,"245");function $(e){return`${i.devServer.https?"https":"http"}://${"local"===e?i.devServer.host:r()}:${PORT}${s}`}let a=e("You application is running here:","245"),p=`${e(" Local ","231",{bg:"blue"})} ${e($("local"),"75")}
|
|
3
|
+
${e(" Network ","231",{bg:"29"})} ${e($("net"),"green")}`;export function devLog(r,n){!r&&n&&(o(3),t([a,"",p,"",e(`Compiled successfully in ${e(`${n.endTime-n.startTime}ms`,"green")}`,"245"),"\n"].join("\n"),!0),l&&t(l))}
|
package/lib/plugin/eslint.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import webpack, { type Compilation, type Compiler } from 'webpack';
|
|
|
4
4
|
import { Worker } from 'worker_threads';
|
|
5
5
|
import type { ESLintWorkerMessage } from './worker/eslint.mjs';
|
|
6
6
|
declare class ESLintError extends webpack.WebpackError {
|
|
7
|
-
constructor(message: string
|
|
7
|
+
constructor(message: string);
|
|
8
8
|
}
|
|
9
9
|
export interface ESLintOption extends ESLint.Options {
|
|
10
10
|
files: string[];
|
package/lib/plugin/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as
|
|
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])))}}
|
|
@@ -4,7 +4,7 @@ import webpack, { type Compilation, type Compiler } from 'webpack';
|
|
|
4
4
|
import { Worker } from 'worker_threads';
|
|
5
5
|
import type { StylelintWorkerMessage } from './worker/stylelint.mjs';
|
|
6
6
|
declare class StylelintError extends webpack.WebpackError {
|
|
7
|
-
constructor(message: string
|
|
7
|
+
constructor(message: string);
|
|
8
8
|
}
|
|
9
9
|
export interface StylelintOption extends LinterOptions {
|
|
10
10
|
files: string[];
|
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
|
|
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])))}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e,a;import{ESLint as t}from"@moneko/eslint";import{parentPort as
|
|
1
|
+
let e,a;import{ESLint as t}from"@moneko/eslint";import{parentPort as r}from"worker_threads";if(!r)throw Error("This file must be run as a worker");let o=null;r.on("message",async({options:i})=>{o&&clearTimeout(o),o=setTimeout(async()=>{o&&(clearTimeout(o),o=null);try{e||(e=new t({cache:i.cache,cacheLocation:i.cacheLocation,cacheStrategy:i.cacheStrategy,fix:i.fix}),a=await e.loadFormatter("stylish"));let o=i.files.map(e=>e.replace(/\\/g,"/")),c=await e.lintFiles(o),s=[],l=[];i.fix&&await t.outputFixes(c),c.forEach(e=>{e.errorCount?l.push(e):e.warningCount&&s.push(e)});let n=await Promise.all([a.format(s),a.format(l)]);r.postMessage(n.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch(e){r.postMessage(e)}},4)}),r.on("close",()=>{o&&clearTimeout(o)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stylelint as e}from"@moneko/stylelint";import{parentPort as r}from"worker_threads";if(!r)throw Error("This file must be run as a worker");let t=null,
|
|
1
|
+
import{stylelint as e}from"@moneko/stylelint";import{parentPort as r}from"worker_threads";if(!r)throw Error("This file must be run as a worker");let t=null,a=await e.formatters.string;r.on("message",async({options:i})=>{t&&clearTimeout(t),t=setTimeout(async()=>{t&&(clearTimeout(t),t=null);try{let t=await e.lint({cache:i.cache,cacheLocation:i.cacheLocation,fix:i.fix,files:i.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:i.quietDeprecationWarnings,quiet:i.quiet});delete t.output;let n=[],s=[];t.results.forEach(e=>{if(!e.ignored&&(e.errored||e.parseErrors.length||e.invalidOptionWarnings.length||e.deprecations.length)){let r=[],t=[];e.warnings.forEach(e=>{"error"===e.severity?r.push(e):"warning"===e.severity&&t.push(e)}),r.length>0&&n.push({...e,warnings:r}),t.length>0&&s.push({...e,warnings:t})}});let o=[a(s,t),a(n,t)];r.postMessage(o.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch(e){r.postMessage(e)}},4)}),r.on("close",()=>{t&&clearTimeout(t)});
|