@moneko/core 3.9.19 → 3.9.20

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,3 +1,3 @@
1
- import t from"chalk";import{getIPv4 as o,getPort as e}from"./net.mjs";import{CONFIG as r}from"../config.mjs";import s from"../utils/log.mjs";let{yellow:i,green:n,grey:l,gray:m,bgBlue:a,bgGreenBright:c,blueBright:p,greenBright:$}=t,u=r.devServer||{},f=u.port||3e3;export const PORT=await e(f,65535,u.host);u.port=PORT;let d="/"===r.basename?"":r.basename,T=u.port!==PORT&&m(`Port ${i(f)} is in use, trying ${n(PORT)} instead.
1
+ import t from"chalk";import{getIPv4 as o,getPort as e}from"./net.mjs";import{CONFIG as r}from"../config.mjs";import s from"../utils/log.mjs";let{yellow:i,green:n,grey:l,gray:m,bgBlue:a,bgGreenBright:c,blueBright:p,greenBright:$}=t,u=r.devServer||{},f=u.port||3e3;export const PORT=await e(f,u.host);u.port=PORT;let d="/"===r.basename?"":r.basename,T=u.port!==PORT&&m(`Port ${i(f)} is in use, trying ${n(PORT)} instead.
2
2
  `);function g(t){return`http://${"local"===t?u.host:o()}:${PORT}${d}`}let h=m("You application is running here:"),x=`${a(" Local ")} ${p(g("local"))}
3
3
  ${c(" Network ")} ${$(g("net"))}`;export function devLog(t,o){!t&&o&&(process.stdout.write("\x1b[2J\x1b[3J\x1b[H"),s([h,"",x,"",l(`Compiled successfully in ${n(`${o.endTime-o.startTime}ms`)}`)]),T&&s(T))}export const headers={"Access-Control-Allow-Origin":"*"};
package/lib/dev/net.d.mts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare function getIPv4(): string | null;
2
- export declare function getPort<T = number>(start: T, end: number, host?: string): Promise<T>;
2
+ export declare function getPort<T = number>(start: T, host?: string): Promise<T>;
package/lib/dev/net.mjs CHANGED
@@ -1 +1 @@
1
- import{createConnection as e}from"net";import{networkInterfaces as t}from"os";export function getIPv4(){let e=t(),r=null,o=Object.keys(e);for(let t=0,n=o.length;t<n;t++){let n=e[o[t]]||[];for(let e=0,t=n.length;e<t;e++){let t=n[e];"IPv4"!==t.family||t.internal||(r=t.address)}}return r}export function getPort(t,r,o="0.0.0.0"){return new Promise(n=>{if("number"!=typeof t)n(t);else{let l=e(t,o);l.on("connect",()=>{l.destroy(),n(getPort(t+1,r,o))}),l.on("error",()=>{n(t)})}})}
1
+ import{createConnection as e}from"net";import{networkInterfaces as t}from"os";export function getIPv4(){let e=t(),r=null,o=Object.keys(e);for(let t=0,n=o.length;t<n;t++){let n=e[o[t]]||[];for(let e=0,t=n.length;e<t;e++){let t=n[e];"IPv4"!==t.family||t.internal||(r=t.address)}}return r}export function getPort(t,r="0.0.0.0"){return new Promise(o=>{if("number"!=typeof t)o(t);else{let n=e(t,r);n.on("connect",()=>{n.destroy(),o(getPort(t+1,r))}),n.on("error",()=>{o(t)})}})}
@@ -1 +1 @@
1
- import{relative as e}from"path";import{fileExists as t}from"@moneko/mdx";import r from"../paths.mjs";let a="OverrideResolverPlugin";export default class{constructor(e){this.options=e}apply(i){let{override:o,original:s}=this.options;if(o&&s){let l=`./${e(r.programPath,s)}`,p=`./${e(r.programPath,o)}`;i.getHook("existing-file").tapAsync(a,(e,r,n)=>{let h=e.request||e.path;if(h&&h.startsWith(s)&&e.relativePath){let m=h.replace(s,o);if(t(m)){let t=e.relativePath.replace(l,p);return Object.assign(e,{path:m,relativePath:t,__innerRequest_relativePath:t,__innerRequest:t}),i.doResolve("resolved",e,`${a} 使用目标模块${o}`,r,n)}}return n()})}}}
1
+ import{relative as e}from"path";import{fileExists as t}from"@moneko/mdx";import r from"../paths.mjs";let o="OverrideResolverPlugin";export default class{constructor(e){this.options=e}apply(a){let i=a.ensureHook("resolved"),{override:s,original:l}=this.options;if(s&&l){let p=`./${e(r.programPath,l)}`,n=`./${e(r.programPath,s)}`;a.getHook("existing-file").tapAsync(o,(e,r,h)=>{let m=e.request||e.path;if(m&&m.startsWith(l)&&e.relativePath){let u=m.replace(l,s);if(t(u)){let t=e.relativePath.replace(p,n);return Object.assign(e,{path:u,relativePath:t,__innerRequest_relativePath:t,__innerRequest:t}),a.doResolve(i,e,`${o} 使用目标模块${s}`,r,h)}}return h()})}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.9.19",
3
+ "version": "3.9.20",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -50,7 +50,7 @@
50
50
  "@swc/cli": "0.1.63",
51
51
  "@types/express": "4.17.21",
52
52
  "@types/multer": "1.4.11",
53
- "oxlint": "0.0.22",
53
+ "oxlint": "0.1.2",
54
54
  "sass": "1.69.7",
55
55
  "sass-loader": "13.3.3"
56
56
  },