@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.
@@ -1,4 +1,4 @@
1
- import { ink, print, println, termClear } from '@moneko/utils';
1
+ import { ink, println, termClear } from '@moneko/utils';
2
2
  import webpack from 'webpack';
3
3
  import { getIPv4, getPort } from '../commom/net.mjs';
4
4
  import { CONFIG } from '../config.mjs';
@@ -1,3 +1,3 @@
1
- import{ink as e,print as t,println as o,termClear as r}from"@moneko/utils";import{getIPv4 as n,getPort as i}from"../commom/net.mjs";import{CONFIG as m}from"../config.mjs";let s=m.devServer.port||3e3;export const PORT=await i(s);m.devServer.port=PORT;let l="/"===m.basename?"":m.basename,$=s!==PORT&&e(`Port ${e(`${s}`,"yellow")} is in use, trying ${e(`${PORT}`,"green")} instead.
2
- `,"245");function a(e){return`${m.devServer.https?"https":"http"}://${"local"===e?m.devServer.host:n()}:${PORT}${l}`}let p=e("You application is running here:","245"),c=`${e(" Local ","231",{bg:"blue"})} ${e(a("local"),"75")}
3
- ${e(" Network ","231",{bg:"29"})} ${e(a("net"),"green")}`;export function devLog(n,i){!n&&i&&(r(3),t([p,"",c,"",e(`Compiled successfully in ${e(`${i.endTime-i.startTime}ms`,"green")}`,"245")].join("\n"),!0),$&&o($))}
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))}
@@ -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, error: boolean);
7
+ constructor(message: string);
8
8
  }
9
9
  export interface ESLintOption extends ESLint.Options {
10
10
  files: string[];
@@ -1 +1 @@
1
- import{fileURLToPath as r}from"node:url";import t from"webpack";import{Worker as e}from"worker_threads";class s extends t.WebpackError{constructor(r,t){super(`[ESLint] ${r.replace(/[^\r\n]*(\r?\n)*$/,"")}`),this.name=t?"ESLintError":"ESLintWarning",this.stack=""}}export default class{constructor(t={files:[]}){this.name="ESLintPlugin",this.options=t,this.worker=new e(r(new URL("./worker/eslint.mjs",import.meta.url)))}apply(r){r.hooks.thisCompilation.tap(this.name,r=>{this.worker.postMessage({options:this.options}),this.worker.once("message",t=>{this.report(r,t)})}),r.hooks.shutdown.tap(this.name,()=>{this.worker.terminate()})}report(r,t){t?.length&&r&&(t[0].length&&r.warnings.push(new s(t[0],!1)),t[1].length&&r.errors.push(new s(t[1],!0)))}}
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, error: boolean);
7
+ constructor(message: string);
8
8
  }
9
9
  export interface StylelintOption extends LinterOptions {
10
10
  files: string[];
@@ -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,r){super(`[Stylelint] ${t.replace(/[^\r\n]*(\r?\n)*$/,"")}`),this.name=r?"StylelintError":"StylelintWarning",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],!1)),t[1].length&&r.errors.push(new s(t[1],!0)))}}
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 o}from"worker_threads";if(!o)throw Error("This file must be run as a worker");let r=null;o.on("message",async({options:i})=>{r&&clearTimeout(r),r=setTimeout(async()=>{r&&(clearTimeout(r),r=null);try{e||(e=new t({cache:i.cache,cacheLocation:i.cacheLocation,cacheStrategy:i.cacheStrategy,fix:i.fix}),a=await e.loadFormatter("stylish"));let r=i.files.map(e=>e.replace(/\\/g,"/")),s=await e.lintFiles(r),c=[],l=[];i.fix&&await t.outputFixes(s),s.forEach(e=>{e.errorCount?l.push(e):e.warningCount&&c.push(e)});let n=await Promise.all([a.format(c),a.format(l)]);o.postMessage(n)}catch(e){o.postMessage(e)}},4)}),o.on("close",()=>{r&&clearTimeout(r)});
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,i=await e.formatters.string;r.on("message",async({options:a})=>{t&&clearTimeout(t),t=setTimeout(async()=>{t&&(clearTimeout(t),t=null);try{let t=await e.lint({cache:a.cache,cacheLocation:a.cacheLocation,fix:a.fix,files:a.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:a.quietDeprecationWarnings,quiet:a.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=[i(s,t),i(n,t)];r.postMessage(o)}catch(e){r.postMessage(e)}},4)}),r.on("close",()=>{t&&clearTimeout(t)});
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)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.30.0-beta.4",
3
+ "version": "3.30.0",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",