@ikaros-cli/ikaros 1.3.1 → 2.0.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/bin.mjs +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +5 -5
- package/package.json +23 -25
package/bin.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import './dist/index.mjs'
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './dist/index.mjs'
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _rspack_core0 from "@rspack/core";
|
|
2
2
|
import { DefinePluginOptions, LightningcssLoaderOptions, Loader, ModuleFederationPluginOptions, Plugin } from "@rspack/core";
|
|
3
3
|
import * as _rspack_dev_server0 from "@rspack/dev-server";
|
|
4
|
-
import * as
|
|
4
|
+
import * as https0 from "https";
|
|
5
5
|
|
|
6
6
|
//#region src/types/env.d.ts
|
|
7
7
|
interface ImportMetaBaseEnv {
|
|
@@ -42,7 +42,7 @@ type Pages = {
|
|
|
42
42
|
[key: string]: {
|
|
43
43
|
html: string;
|
|
44
44
|
entry: string;
|
|
45
|
-
library?:
|
|
45
|
+
library?: _rspack_core0.LibraryOptions;
|
|
46
46
|
options?: {
|
|
47
47
|
title: string;
|
|
48
48
|
inject: boolean;
|
|
@@ -155,7 +155,7 @@ interface UserConfig {
|
|
|
155
155
|
* @see {@link https://webpack.js.org/configuration/dev-server/#devserverhttps}
|
|
156
156
|
* @default false
|
|
157
157
|
*/
|
|
158
|
-
https?: boolean |
|
|
158
|
+
https?: boolean | https0.ServerOptions;
|
|
159
159
|
};
|
|
160
160
|
/**
|
|
161
161
|
* css loader 配置
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import{Option as t,program as n}from"commander";import r from"chalk";import{rspack as i}from"@rspack/core";import{RsdoctorRspackPlugin as a}from"@rsdoctor/rspack-plugin";import o from"compression-webpack-plugin";import{ModuleFederationPlugin as s}from"@module-federation/enhanced/rspack";import{isArray as c,isEmpty as l,isFunction as u,isObject as d,isString as f}from"radashi";import{RspackDevServer as p}from"@rspack/dev-server";import m,{dirname as h,extname as g,join as _,resolve as v}from"node:path";import{detect as ee}from"detect-port";import y,{join as b}from"path";import te from"node:fs";import x from"node:fs/promises";import S from"fs/promises";import{z as C}from"zod/v4";import w,{pathToFileURL as T}from"node:url";import{parse as ne}from"yaml";import E from"fs-extra";import{transform as re}from"@swc/core";import{config as D}from"dotenv";import ie from"ora";import ae from"node:os";import O from"pretty-bytes";import k from"easy-table";import A from"cli-cursor";import j from"node:process";var oe=`@ikaros-cli/ikaros`,M=`1.3.0`;const N=(e,t)=>{for(let n in t)e[n]=d(t[n])&&n in e?N(e[n],t[n]):t[n];return e};async function P(e){try{let t=b(process.cwd(),`node_modules`,e);return await S.access(t,S.constants.F_OK),!0}catch(e){if(e.code===`ENOENT`)return!1;throw e}}const se=C.object({target:C.enum([`pc`,`mobile`]).optional().default(`pc`),pages:C.custom().optional(),enablePages:C.union([C.array(C.string())]).optional(),moduleFederation:C.union([C.custom(),C.array(C.custom())]).optional(),plugins:C.union([C.custom(),C.array(C.custom())]).optional(),loaders:C.array(C.custom()).optional(),experiments:C.custom().optional(),cdnOptions:C.custom().optional(),server:C.object({port:C.number().int().min(1024).max(65535).optional(),proxy:C.custom().optional(),https:C.union([C.boolean(),C.record(C.string(),C.any())]).optional().default(!1)}).optional(),css:C.object({lightningcssOptions:C.record(C.string(),C.any()).optional(),sourceMap:C.boolean().optional(),lessOptions:C.record(C.string(),C.any()).optional(),sassOptions:C.record(C.string(),C.any()).optional(),stylusOptions:C.record(C.string(),C.any()).optional()}).optional(),build:C.object({base:C.string().optional().default(`/`),assetsDir:C.string().optional(),gzip:C.boolean().optional().default(!1),sourceMap:C.boolean().optional().default(!1),outDirName:C.string().optional().default(`dist`),outReport:C.boolean().optional().default(!1),cache:C.boolean().optional().default(!1),dependencyCycleCheck:C.boolean().optional().default(!1)}).optional(),resolve:C.object({alias:C.record(C.string(),C.string()).optional(),extensions:C.array(C.string()).optional()}).optional()});async function ce(e,t){let{code:n}=await re(e,{filename:e,sourceMaps:`inline`,jsc:{parser:{syntax:t?`typescript`:`ecmascript`,decorators:!0,dynamicImport:!0},target:`es2022`,loose:!0,keepClassNames:!0,externalHelpers:!0},minify:!1});return{code:n}}async function le(e,t){let n=`${e}.timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`,r=`${n}.mjs`,i=`${T(n)}.mjs`;await x.writeFile(r,t);try{let e=await import(i);return e.default}finally{await x.unlink(r)}}async function ue(e,t=!1){let{code:n}=await ce(e,t);return le(e,n)}const F=new Map;F.set(`.mjs`,async e=>{let t=T(e),n=await import(t.href);return n.default}),F.set(`.ts`,async e=>await ue(e,!0)),F.set(`.json`,async e=>await E.readJson(e)),F.set(`.yaml`,async e=>{let t=await x.readFile(e,`utf8`);return ne(t)});async function de({configFile:e}){let t,n=process.cwd(),r=`ikaros.config`,i=[`ts`,`mjs`,`json`,`yaml`].map(e=>`${_(n,r)}.${e}`),a=await Promise.all(i.map(e=>E.pathExists(e))),o=a.findIndex(Boolean);if(!(o<0)){if(t=g(i[o]),n=v(n,`${r}${t}`),e&&(n=h(e),t=g(e)),!F.has(t))throw Error(`No configuration file ! `);return F.get(t)(n)}}const I=[],L=()=>{let e=(e,t)=>{let n={DONE:r.bgGreen.white,ERROR:r.bgRed.white,OKAY:r.bgBlue.white,WARNING:r.bgYellow.white,INFO:r.bgCyan.white};return n[e](` ${e} `)+` ${t}`},t=({text:t,onlyText:n})=>{if(n)return e(`DONE`,t);console.log(e(`DONE`,t))},n=({text:t,onlyText:n})=>{if(n)return e(`ERROR`,t);console.error(e(`ERROR`,t))},i=({text:t,onlyText:n})=>{if(n)return e(`OKAY`,t);console.log(e(`OKAY`,t))},a=({text:t,onlyText:n})=>{if(n)return e(`WARNING`,t);console.warn(e(`WARNING`,t))},o=({text:t,onlyText:n})=>{if(n)return e(`INFO`,t);console.info(e(`INFO`,t))},s=e=>{let t=new Date().toLocaleTimeString(`en-US`,{hour12:!1}).split(` `)[0];I.push(`[${t}] ${e}`)},c=()=>{I.length=0};return{done:t,error:n,okay:i,warning:a,info:o,emitEvent:s,clearEventArray:c,eventArray:I}},R=e=>e?b(z,`env`,`.env.${e}`):b(z,`env`,`.env`),fe=async e=>{let{warning:t,emitEvent:n}=L(),r=await E.pathExists(b(z,`env`));if(!r)return n(t({text:`env folder not found`,onlyText:!0})),!1;if(e){let r=await E.pathExists(R(e));if(!r)return n(t({text:`.env.${e} file not found`,onlyText:!0})),!1}else{let e=await E.pathExists(R());return e?!0:(n(t({text:`.env file not found`,onlyText:!0})),!1)}return!0},z=process.cwd(),B=async e=>{let t=await fe(e);return t?e?D({path:R(e)}).parsed??{}:D({path:R()}).parsed??{}:{}};let V=function(e){return e.SERVER=`server`,e.BUILD=`build`,e}({});var pe=class{command;context;options;contextRequire;_env;configFile;set env(e){this._env=e}get env(){return this._env}_contextPkg;userConfig;set contextPkg(e){this._contextPkg=e}get contextPkg(){return this._contextPkg}constructor(t){let{command:n,options:r,configFile:i}=t;this.command=n,this.options=r,this.configFile=i,this.context=b(process.cwd(),`./`),this.contextRequire=e(this.context),this.initialize()}async initialize(){await this.initContextPkg(),await this.initEnv(),await this.getUserConfig(),this.startCompile()}resolveContext(...e){return b(this.context,...e)}async initContextPkg(){let e=this.resolveContext(`package.json`);try{await x.access(e,te.constants.F_OK)}catch{return}this.contextPkg=JSON.parse(await x.readFile(e,{encoding:`utf8`}))}async initEnv(){let{platform:e,mode:t}=this.options,n={PLATFORM:e,MODE:t},r=await B(t);this.env={...n,...r}}resolveContextModule(e){try{return this.contextRequire.resolve(e)}catch{return}}loadContextModule(e){return this.contextRequire(e)}async getUserConfig(){let{configFile:e}=this,t=await de({configFile:e}),n;if(t){if(u(t)){let e={PLATFORM:this.options.platform},r={mode:this.options.mode??``,env:Object.assign(e,this.env),command:this.command};n=await t(r)}d(t)&&(n=t),this.userConfig=se.parse(n)}}startCompile(){switch(this.command){case V.SERVER:this.dev?.();break;case V.BUILD:this.build?.();break;default:break}}};const H=b(process.cwd(),`./`),me=[`...`,`.mjs`,`.jsx`,`.ts`,`.tsx`],he=b(H,`tsconfig.json`),U=w.fileURLToPath(new w.URL(`../`,import.meta.url)),ge=e(U),_e=(...e)=>b(U,...e),W=(e,t)=>({loader:e.includes(`builtin`)?e:ge.resolve(e),options:t}),ve=(e,t)=>{let{lightningcss:n,sourceMap:r}=t??{},i=W(`builtin:lightningcss-loader`,{...n}),a=(e,n)=>{let a=[i],o=t&&t[`${e}`];return e&&e!==`css`&&a.push(W(`${e}-loader`,Object.assign(o??{},n,{sourceMap:r}))),a};return{less:a(`less`),sass:a(`sass`,{sassOptions:{indentedSyntax:!0,api:`modern-compiler`}}),scss:a(`sass`,{sassOptions:{api:`modern-compiler`}}),stylus:a(`stylus`),styl:a(`stylus`),css:a(`css`)}},ye=(e,t)=>{let n=ve(e,t);return Object.entries(n).map(([e,t])=>({test:RegExp(`\\.${e}$`),use:t,type:`css/auto`}))};var G=class{list=[];env=`development`;mode=``;isDev=!0;constructor({env:e=`development`,mode:t=``}){this.env=e,this.mode=t,this.isDev=e===`development`}add(e){return e&&(c(e)?this.list=this.list.concat(e):this.list.push(e)),this}end(){return this.list}},K=class extends G{constructor({env:e=`development`,mode:t=``}){super({env:e,mode:t})}defaultScriptLoader=e=>({test:/\.m?[j]s$/,loader:`builtin:swc-loader`,options:{isModule:`unknown`,rspackExperiments:e},type:`javascript/auto`});defaultResourceLoader=[{test:/\.(png|jpe?g|gif|svg|ico)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/img/[contenthash][ext]`}},{test:/\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/media/[contenthash][ext]`}},{test:/\.(woff2?|eot|ttf|otf)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/fonts/[contenthash][ext]`}}];useDefaultCssLoader(e){let t=ye(this.env,e);return t.forEach(e=>this.add(e)),this}useDefaultScriptLoader(e){return this.add(this.defaultScriptLoader(e)),this}useDefaultResourceLoader(){return this.defaultResourceLoader.forEach(e=>this.add(e)),this}},be=class extends G{constructor({env:e=`development`,mode:t=``}){super({env:e,mode:t})}useDefaultEnvPlugin(e){let{frameworkEnv:t={},extEnv:n={},env:r={}}=e??{};return this.add(Se({frameworkEnv:t,extEnv:n,env:r})),this}useCopyPlugin(){return this.env===`production`&&this.add(new i.CopyRspackPlugin({patterns:[{context:b(H,`public`),from:`./`,noErrorOnMissing:!0,globOptions:{ignore:[`**/index.html`,`.*`]}}]})),this}useHtmlPlugin(e){return this.add(new i.HtmlRspackPlugin({template:e??b(H,`index.html`)})),this}},xe=class{pages;enablePages;constructor({pages:e,enablePages:t}){this.pages=e,this.enablePages=t,this.getEnablePages()}create(){let e={},t=[];return Object.keys(this.pages).forEach(n=>{e[n]={import:this.pages[n].entry,library:this.pages[n].library},t.push(new i.HtmlRspackPlugin({template:this.pages[n].html,filename:`${n}.html`,chunks:[n],scriptLoading:`blocking`,...this.pages[n].options}))}),{entry:e,plugins:t}}getEnablePages(){let{warning:e,emitEvent:t}=L();if(!l(this.pages)&&c(this.enablePages)){let n={},r=[];if(this.enablePages.forEach(e=>{this.pages[e]?n[e]=this.pages[e]:r.push(e)}),l(r)&&t(e({text:`当前设置页面${r.join()}不存在`,onlyText:!0})),l(n))return;this.pages=n}}};const Se=({frameworkEnv:e={},extEnv:t={},env:n={}})=>{let r=Object.assign({},N(t,n)),a=Object.fromEntries(Object.entries(r).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)])),o=Object.fromEntries(Object.entries({...a,...e}).map(([e,t])=>[e,t]));return new i.DefinePlugin(o)},q={name:oe,version:M},J=`@rspack/ikaros-stats-plugin`,Y=r.hex(`#222222`);var Ce=class{compiler;ora;userConfig;startCompileHrtime=void 0;isDev;lastProgressText;constructor(e){this.userConfig=e,this.ora=ie({color:`cyan`,prefixText:``,hideCursor:!1})}apply(e){this.compiler=e,this.isDev=e.options.mode===`development`,new i.ProgressPlugin(this.progressHandler.bind(this)).apply(e),A.hide(),this.isDev?this.initDevHook():this.initProdHook()}progressHandler(e,t,...n){let i=`${(e*100).toFixed(2)}%`;i+=` ${t} `,i+=r.gray(n?.join(` `)),this.lastProgressText!==i&&(this.lastProgressText=i,this.isDev?this.ora.text=`${i}\n`:console.log(i))}updateStartCompileTime(){this.startCompileHrtime=j.hrtime()}getCurrentEndCompileTime(){let e=j.hrtime(this.startCompileHrtime);return(e[0]*1e9+e[1])/1e6}getError(e){let{errors:t,errorsCount:n=0}=e;if(!(!t||n===0))return t.map(e=>`${Y.bgRed(` ERROR `)} ${e.message.trim()}`).join(`
|
|
1
|
+
import{createRequire as e}from"node:module";import{Option as t,program as n}from"commander";import r from"chalk";import{rspack as i}from"@rspack/core";import{RsdoctorRspackPlugin as a}from"@rsdoctor/rspack-plugin";import o from"compression-webpack-plugin";import{ModuleFederationPlugin as s}from"@module-federation/enhanced/rspack";import{isFunction as c,isString as l}from"es-toolkit";import{isArray as u,isEmpty as d,isObject as f}from"es-toolkit/compat";import{RspackDevServer as p}from"@rspack/dev-server";import m,{dirname as h,extname as g,join as _,resolve as ee}from"node:path";import{detect as te}from"detect-port";import v,{join as y}from"path";import ne from"node:fs";import b,{readFile as x}from"node:fs/promises";import S from"fs/promises";import{z as C}from"zod/v4";import w,{pathToFileURL as T}from"node:url";import{parse as re}from"yaml";import E from"fs-extra";import{transform as ie}from"oxc-transform";import{config as D}from"dotenv";import ae from"ora";import oe from"node:os";import O from"pretty-bytes";import se from"easy-table";import ce from"cli-cursor";import k from"node:process";var le=`@ikaros-cli/ikaros`,A=`2.0.0`;const j=(e,t)=>{for(let n in t)e[n]=f(t[n])&&n in e?j(e[n],t[n]):t[n];return e};async function M(e){try{let t=y(process.cwd(),`node_modules`,e);return await S.access(t,S.constants.F_OK),!0}catch(e){if(e.code===`ENOENT`)return!1;throw e}}const N=C.object({target:C.enum([`pc`,`mobile`]).optional().default(`pc`),pages:C.custom().optional(),enablePages:C.union([C.array(C.string())]).optional(),moduleFederation:C.union([C.custom(),C.array(C.custom())]).optional(),plugins:C.union([C.custom(),C.array(C.custom())]).optional(),loaders:C.array(C.custom()).optional(),experiments:C.custom().optional(),cdnOptions:C.custom().optional(),server:C.object({port:C.number().int().min(1024).max(65535).optional(),proxy:C.custom().optional(),https:C.union([C.boolean(),C.record(C.string(),C.any())]).optional().default(!1)}).optional(),css:C.object({lightningcssOptions:C.record(C.string(),C.any()).optional(),sourceMap:C.boolean().optional(),lessOptions:C.record(C.string(),C.any()).optional(),sassOptions:C.record(C.string(),C.any()).optional(),stylusOptions:C.record(C.string(),C.any()).optional()}).optional(),build:C.object({base:C.string().optional().default(`/`),assetsDir:C.string().optional(),gzip:C.boolean().optional().default(!1),sourceMap:C.boolean().optional().default(!1),outDirName:C.string().optional().default(`dist`),outReport:C.boolean().optional().default(!1),cache:C.boolean().optional().default(!1),dependencyCycleCheck:C.boolean().optional().default(!1)}).optional(),resolve:C.object({alias:C.record(C.string(),C.string()).optional(),extensions:C.array(C.string()).optional()}).optional()});async function ue(e,t){let n=e,r=await x(e,`utf-8`),{code:i,errors:a}=ie(n,r,{lang:t?`ts`:`js`});if(a.length>0)throw Error(`Transformation failed: `+a.map(e=>e.message).join(`, `));return{code:i}}async function de(e,t){let n=`${e}.timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`,r=`${n}.mjs`,i=`${T(n)}.mjs`;await b.writeFile(r,t);try{return(await import(i)).default}finally{await b.unlink(r)}}async function fe(e,t=!1){let{code:n}=await ue(e,t);return de(e,n)}const P=new Map;P.set(`.mjs`,async e=>(await import(T(e).href)).default),P.set(`.ts`,async e=>await fe(e,!0)),P.set(`.json`,async e=>await E.readJson(e)),P.set(`.yaml`,async e=>{let t=await b.readFile(e,`utf8`);return re(t)});async function pe({configFile:e}){let t,n=process.cwd(),r=`ikaros.config`,i=[`ts`,`mjs`,`json`,`yaml`].map(e=>`${_(n,r)}.${e}`),a=(await Promise.all(i.map(e=>E.pathExists(e)))).findIndex(Boolean);if(!(a<0)){if(t=g(i[a]),n=ee(n,`${r}${t}`),e&&(n=h(e),t=g(e)),!P.has(t))throw Error(`No configuration file ! `);return P.get(t)(n)}}const F=[],I=()=>{let e=(e,t)=>({DONE:r.bgGreen.white,ERROR:r.bgRed.white,OKAY:r.bgBlue.white,WARNING:r.bgYellow.white,INFO:r.bgCyan.white})[e](` ${e} `)+` ${t}`;return{done:({text:t,onlyText:n})=>{if(n)return e(`DONE`,t);console.log(e(`DONE`,t))},error:({text:t,onlyText:n})=>{if(n)return e(`ERROR`,t);console.error(e(`ERROR`,t))},okay:({text:t,onlyText:n})=>{if(n)return e(`OKAY`,t);console.log(e(`OKAY`,t))},warning:({text:t,onlyText:n})=>{if(n)return e(`WARNING`,t);console.warn(e(`WARNING`,t))},info:({text:t,onlyText:n})=>{if(n)return e(`INFO`,t);console.info(e(`INFO`,t))},emitEvent:e=>{let t=new Date().toLocaleTimeString(`en-US`,{hour12:!1}).split(` `)[0];F.push(`[${t}] ${e}`)},clearEventArray:()=>{F.length=0},eventArray:F}},L=e=>e?y(z,`env`,`.env.${e}`):y(z,`env`,`.env`),R=async e=>{let{warning:t,emitEvent:n}=I();if(!await E.pathExists(y(z,`env`)))return n(t({text:`env folder not found`,onlyText:!0})),!1;if(e){if(!await E.pathExists(L(e)))return n(t({text:`.env.${e} file not found`,onlyText:!0})),!1}else return await E.pathExists(L())?!0:(n(t({text:`.env file not found`,onlyText:!0})),!1);return!0},z=process.cwd(),B=async e=>await R(e)?e?D({path:L(e)}).parsed??{}:D({path:L()}).parsed??{}:{};let V=function(e){return e.SERVER=`server`,e.BUILD=`build`,e}({});var me=class{set env(e){this._env=e}get env(){return this._env}set contextPkg(e){this._contextPkg=e}get contextPkg(){return this._contextPkg}constructor(t){let{command:n,options:r,configFile:i}=t;this.command=n,this.options=r,this.configFile=i,this.context=y(process.cwd(),`./`),this.contextRequire=e(this.context),this.initialize()}async initialize(){await this.initContextPkg(),await this.initEnv(),this.startCompile()}resolveContext(...e){return y(this.context,...e)}async initContextPkg(){let e=this.resolveContext(`package.json`);try{await b.access(e,ne.constants.F_OK)}catch{return}this.contextPkg=JSON.parse(await b.readFile(e,{encoding:`utf8`}))}async initEnv(){let{platform:e,mode:t}=this.options,n={PLATFORM:e,MODE:t},r=await B(t);this.env={...n,...r}}resolveContextModule(e){try{return this.contextRequire.resolve(e)}catch{return}}loadContextModule(e){return this.contextRequire(e)}async getUserConfig(){let{configFile:e}=this,t=await pe({configFile:e});if(t){if(c(t)){let e={PLATFORM:this.options.platform},n={mode:this.options.mode??``,env:Object.assign(e,this.env),command:this.command};return N.parse(await t(n))}if(f(t))return N.parse(void 0)}}startCompile(){switch(this.command){case V.SERVER:this.dev?.();break;case V.BUILD:this.build?.();break;default:break}}};const H=y(process.cwd(),`./`),he=[`...`,`.mjs`,`.jsx`,`.ts`,`.tsx`];y(H,`tsconfig.json`);const U=w.fileURLToPath(new w.URL(`../`,import.meta.url)),ge=e(U),_e=(...e)=>y(U,...e),W=(e,t)=>({loader:e.includes(`builtin`)?e:ge.resolve(e),options:t}),ve=(e,t)=>{let{lightningcss:n,sourceMap:r}=t??{},i=W(`builtin:lightningcss-loader`,{...n}),a=(e,n)=>{let a=[i],o=t&&t[`${e}`];return e&&e!==`css`&&a.push(W(`${e}-loader`,Object.assign(o??{},n,{sourceMap:r}))),a};return{less:a(`less`),sass:a(`sass`,{sassOptions:{indentedSyntax:!0,api:`modern-compiler`}}),scss:a(`sass`,{sassOptions:{api:`modern-compiler`}}),stylus:a(`stylus`),styl:a(`stylus`),css:a(`css`)}},ye=(e,t)=>{let n=ve(e,t);return Object.entries(n).map(([e,t])=>({test:RegExp(`\\.${e}$`),use:t,type:`css/auto`}))};var G=class{constructor({env:e=`development`,mode:t=``}){this.list=[],this.env=`development`,this.mode=``,this.isDev=!0,this.env=e,this.mode=t,this.isDev=e===`development`}add(e){return e&&(u(e)?this.list=this.list.concat(e):this.list.push(e)),this}end(){return this.list}},be=class extends G{constructor({env:e=`development`,mode:t=``}){super({env:e,mode:t}),this.defaultScriptLoader=e=>[{test:/\.m?ts$/i,loader:`builtin:swc-loader`,options:{jsc:{parser:{syntax:`typescript`}}},type:`javascript/auto`,exclude:[y(H,`node_modules`)]},{test:/\.m?js$/i,loader:`builtin:swc-loader`,options:{isModule:`unknown`,rspackExperiments:e},type:`javascript/auto`,exclude:[y(H,`node_modules`)]}],this.defaultResourceLoader=[{test:/\.(png|jpe?g|gif|svg|ico)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/img/[contenthash][ext]`}},{test:/\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/media/[contenthash][ext]`}},{test:/\.(woff2?|eot|ttf|otf)(\?.*)?$/,type:`asset/resource`,generator:{filename:this.isDev?`[id][ext]`:`assets/fonts/[contenthash][ext]`}}]}useDefaultCssLoader(e){return ye(this.env,e).forEach(e=>this.add(e)),this}useDefaultScriptLoader(e){return this.add(this.defaultScriptLoader(e)),this}useDefaultResourceLoader(){return this.defaultResourceLoader.forEach(e=>this.add(e)),this}},xe=class extends G{constructor({env:e=`development`,mode:t=``}){super({env:e,mode:t})}useDefaultEnvPlugin(e){let{frameworkEnv:t={},extEnv:n={},env:r={}}=e??{};return this.add(Ce({frameworkEnv:t,extEnv:n,env:r})),this}useCopyPlugin(){return this.env===`production`&&this.add(new i.CopyRspackPlugin({patterns:[{context:y(H,`public`),from:`./`,noErrorOnMissing:!0,globOptions:{ignore:[`**/index.html`,`.*`]}}]})),this}useHtmlPlugin(e){return this.add(new i.HtmlRspackPlugin({template:e??y(H,`index.html`)})),this}},Se=class{constructor({pages:e,enablePages:t}){this.pages=e,this.enablePages=t,this.getEnablePages()}create(){let e={},t=[];return Object.keys(this.pages).forEach(n=>{e[n]={import:this.pages[n].entry,library:this.pages[n].library},t.push(new i.HtmlRspackPlugin({template:this.pages[n].html,filename:`${n}.html`,chunks:[n],scriptLoading:`blocking`,...this.pages[n].options}))}),{entry:e,plugins:t}}getEnablePages(){let{warning:e,emitEvent:t}=I();if(!d(this.pages)&&u(this.enablePages)){let n={},r=[];if(this.enablePages.forEach(e=>{this.pages[e]?n[e]=this.pages[e]:r.push(e)}),d(r)&&t(e({text:`当前设置页面${r.join()}不存在`,onlyText:!0})),d(n))return;this.pages=n}}};const Ce=({frameworkEnv:e={},extEnv:t={},env:n={}})=>{let r=Object.assign({},j(t,n)),a=Object.fromEntries(Object.entries(r).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)])),o=Object.fromEntries(Object.entries({...a,...e}).map(([e,t])=>[e,t]));return new i.DefinePlugin(o)},K={name:le,version:A},q=`@rspack/ikaros-stats-plugin`,J=r.hex(`#222222`);var Y=class{constructor(e){this.startCompileHrtime=void 0,this.userConfig=e,this.ora=ae({color:`cyan`,prefixText:``,hideCursor:!1})}apply(e){this.compiler=e,this.isDev=e.options.mode===`development`,new i.ProgressPlugin(this.progressHandler.bind(this)).apply(e),ce.hide(),this.isDev?this.initDevHook():this.initProdHook()}progressHandler(e,t,...n){let i=`${(e*100).toFixed(2)}%`;i+=` ${t} `,i+=r.gray(n?.join(` `)),this.lastProgressText!==i&&(this.lastProgressText=i,this.isDev?this.ora.text=`${i}\n`:console.log(i))}updateStartCompileTime(){this.startCompileHrtime=k.hrtime()}getCurrentEndCompileTime(){let e=k.hrtime(this.startCompileHrtime);return(e[0]*1e9+e[1])/1e6}getError(e){let{errors:t,errorsCount:n=0}=e;if(!(!t||n===0))return t.map(e=>`${J.bgRed(` ERROR `)} ${e.message.trim()}`).join(`
|
|
2
2
|
|
|
3
|
-
`)}getWarn(e){let{warnings:t,warningsCount:n=0}=e;if(!(!t||n===0))return t.map(e=>`${
|
|
3
|
+
`)}getWarn(e){let{warnings:t,warningsCount:n=0}=e;if(!(!t||n===0))return t.map(e=>`${J.bgYellow(` WARN `)} ${e.message.trim()}`).join(`
|
|
4
4
|
|
|
5
|
-
`)}getEndTips(e,t){let{gray:n,cyan:i,red:a,green:o,yellow:s}=r,{errorsCount:c=-1,warningsCount:l=-1}=e,u=(t/1e3).toFixed(2);return n(c>0?`${i(
|
|
6
|
-
`)),console.log());let{name:e,version:t}=
|
|
7
|
-
`,i.toString({chunks:!1,colors:!0}).split(/\r?\n/).forEach(e=>{a+=` ${e}\n`}),n(Error(a))):e(i?.toString({chunks:!1,colors:!0})))})})}};const Q={WEB:`web`},
|
|
5
|
+
`)}getEndTips(e,t){let{gray:n,cyan:i,red:a,green:o,yellow:s}=r,{errorsCount:c=-1,warningsCount:l=-1}=e,u=(t/1e3).toFixed(2);return n(c>0?`${i(K.name)} compiled with${a(` ${c} error`)}`:l>0?`compile ${o(`success`)} and with ${s(`${l} warning`)}, time: ${u}s`:`compile ${o(`success`)}, time: ${u}s.`)}getTableInfo(e){let{assets:t}=e;if(!t||t.length===0)return;let n=new se,i=this.userConfig?.build?.gzip??!1,a=0,o=0,s=!1;for(let e=0;e<t.length;e++){let{name:r,size:c,related:l,info:d}=t[e];if(d.development)continue;let f=i&&u(l)?l.find(e=>e.type===`gzipped`).size:0;if(a+=c,o+=f,t.length>20&&e>=4&&e<t.length-1-4){s||(s=!0,n.cell(`name`,`....`),n.cell(`size`,`....`),i&&n.cell(`gzip`,`....`),n.newRow());continue}n.cell(`name`,r),n.cell(`size`,O(c)),i&&n.cell(`gzip`,O(f)),n.newRow()}return n.pushDelimeter(),n.cell(`name`,`There are ${t.length} files`),n.cell(`size`,O(a)),i&&n.cell(`gzip`,O(o)),n.newRow(),r.cyan.dim(n.toString().trim())}getHostList(){let{userConfig:e,compiler:t}=this,{devServer:n}=t.options,r=n?.server===`https`||typeof n?.server==`object`,i=Number(n?.port),a=[],o=``,s=Object.values(oe.networkInterfaces());if(e){o=e.build?.base??``,(!o||o===`auto`)&&(o=`/`);let t=Object.keys(e?.pages||{})[0];t&&t!==`index`?o=m.join(o,`${t}.html`):o.endsWith(`/`)||(o+=`/`)}for(let e of s){let{address:t}=e?.find(e=>e.family===`IPv4`)||{};if(!t)continue;a.push(t)}a.sort((e,t)=>{let n=e.split(`.`),r=t.split(`.`);for(let[t]of n.entries()){if(e[t]===r[t])continue;return Number(r[t])-Number(e[t])}return 0});let c=a.indexOf(`127.0.0.1`);return c!==-1&&(a.splice(c,1),a.unshift(`localhost`)),a=a.map(e=>(r?(e=`https://${e}`,i!==443&&(e=e+`:`+i)):(e=`http://`+e,i!==80&&(e=e+`:`+i)),new URL(o,e).href)),a}initDevHook(){let{compiler:e,ora:t}=this,n=this.getHostList(),{blue:i,cyan:a,gray:o}=r;e.hooks.environment.intercept({name:q,call(){t.start(`Preparing resource files....`)}}),e.hooks.watchRun.intercept({name:q,call:()=>{t.isSpinning||console.clear(),t.start(),this.updateStartCompileTime()}}),e.hooks.done.intercept({name:q,call:e=>{t.stop(),console.clear();let r=e.toJson({preset:`errors-warnings`,colors:!0}),{eventArray:s}=I(),{errorsCount:c=0,warningsCount:l=0}=r;if(c>0)console.log(this.getError(r)),console.log();else{l>0&&(console.log(this.getWarn(r)),console.log()),s.length>0&&(console.log(s.map(e=>e).join(`
|
|
6
|
+
`)),console.log());let{name:e,version:t}=K,c=`${a(`${e} v${t}`)} entry address:\n\n`;for(let e of n)c+=i(` ${e}\n`);console.log(o(c))}console.log(this.getEndTips(r,this.getCurrentEndCompileTime())),console.log()}})}initProdHook(){let{compiler:e}=this,t;e.hooks.environment.intercept({name:q,call:()=>{console.log(r.gray(`start build...`)),this.updateStartCompileTime()}}),e.hooks.done.intercept({name:q,call:e=>{t=e.toJson({preset:`normal`,colors:!0,assetsSort:`size`})}}),e.cache.hooks.shutdown.intercept({name:q,done:()=>{let{errorsCount:e=0,warningsCount:n=0}=t;console.log(),e>0?(console.log(this.getError(t)),console.log()):(n>0&&(console.log(this.getWarn(t)),console.log()),console.log(this.getTableInfo(t)),console.log()),console.log(this.getEndTips(t,this.getCurrentEndCompileTime()))}})}};const X=`@rspack/ikaros-cdn-plugin`,Z=/:([a-z]+)/gi;var we=class{constructor(e){this.isDev=!1,this.options={prodUrl:`https://unpkg.com/:name@:version/:path`,devUrl:`:name/:path`,crossOrigin:!1,...e}}apply(e){this.compiler=e,this.isDev=e.options.mode===`development`,this.handleExternals(),e.hooks.compilation.tap(X,e=>{i.HtmlRspackPlugin.getCompilationHooks(e).alterAssetTags.tapAsync(X,(e,t)=>{try{this.injectResources(e),t(null,e)}catch(e){t(e)}})})}handleExternals(){let e=this.compiler.options.externals||{};this.options.modules.filter(e=>!e.cssOnly).forEach(t=>{e[t.name]=t.var||t.name}),this.compiler.options.externals=e}injectResources(e){let t=this.options.modules,n=[];t.forEach(e=>{this.getStyles(e).forEach(e=>{n.push({tagName:`link`,voidTag:!0,attributes:{rel:`stylesheet`,href:e,...this.options.crossOrigin&&{crossorigin:this.options.crossOrigin}}})})}),t.filter(e=>!e.cssOnly).forEach(e=>{this.getScripts(e).forEach(e=>{n.push({tagName:`script`,voidTag:!0,attributes:{src:e,...this.options.crossOrigin&&{crossorigin:this.options.crossOrigin}}})})}),e.assetTags&&(e.assetTags.styles.unshift(...n.filter(e=>e.tagName===`link`)),e.assetTags.scripts.unshift(...n.filter(e=>e.tagName===`script`)))}getStyles(e){let t=[...e.styles||[]];return e.style&&t.unshift(e.style),t.map(t=>this.generateUrl(e,t))}getScripts(e){let t=[...e.paths||[]];return e.path&&t.unshift(e.path),t.map(t=>this.generateUrl(e,t))}joinUrl(e,t){return e=e.replace(/\/+$/,``),t=t.replace(/^\/+/,``),`${e}/${t}`}generateUrl(e,t){let n=this.isDev?e.devUrl||this.options.devUrl:e.prodUrl||this.options.prodUrl;return n.match(Z)?n.replace(Z,(n,r)=>{switch(r){case`name`:return e.name;case`version`:return e.version||this.getModuleVersion(e.name);case`path`:return t;default:return n}}):this.joinUrl(n,t)}getModuleVersion(t){try{return e(v.join(process.cwd(),`node_modules`))(v.join(t,`package.json`)).version}catch{return console.warn(r.yellow(`[${X}] 无法获取模块 "${t}" 的版本信息`)),`latest`}}};const{error:Te}=I();var Ee=class extends me{constructor(...e){super(...e),this.isVue=!1,this.isReact=!1}async dev(){await this.initPreConfig(),await this.createRspackBuilder({isLive:!0})}async build(){await this.initPreConfig(),await this.createRspackBuilder()}async initPreConfig(){await Promise.all([this.initUserConfig(),this.initBrowserslist(),this.initOtherConfig()]),await this.createRspackConfig()}async initUserConfig(){let e=this.command===V.SERVER,t=await this.getUserConfig();if(this.userConfig=t,this.base=t?.build?.base??`/`,e&&l(this.base)&&/^https?:/.test(this.base)){let e=r.cyan(`build.base`);Te({text:`本地开发时 ${e} 不应该为外部 Host!`}),process.exit(0)}this.target=t?.target??`pc`,this.pages=t?.pages??{index:{html:this.resolveContext(`index.html`),entry:this.resolveContext(`src/index`)}},this.port=t?.server?.port??await te(`8080`)}async initBrowserslist(){let e=this.target===`mobile`,t=[`defaults`];e?t.push(`IOS >= 10`,`Chrome >= 56`):t.push(`>0.2%`,`Chrome >= 56`,`Safari >= 10`,`last 2 versions`,`not dead`),this.browserslist=t.join(`,`)}async initOtherConfig(){try{let[e,t]=await Promise.all([M(`react`),M(`vue`)]);this.isVue=t,this.isReact=e}catch{}}joinAssetsDir(...e){let t=this.userConfig?.build?.assetsDir??``;return _(t,...e).replaceAll(`\\`,`/`)}getOutDirPath(){let e=this.userConfig?.build?.outDirName;return l(e)?this.resolveContext(e):this.resolveContext(`dist`)}async createRspackConfig(){let e=this.command===V.SERVER,t=e?`development`:`production`,{userConfig:n,context:r,browserslist:i,pages:a,contextPkg:o,port:s,base:c}=this,l=new be({env:t,mode:this.options.mode}),u=new xe({env:t,mode:this.options.mode}),{entry:d,plugins:f}=new Se({pages:a,enablePages:n?.enablePages}).create(),{env:p,noParse:m}=this.createVueOrReactConfig(),h=l.useDefaultResourceLoader().useDefaultScriptLoader(n?.experiments).useDefaultCssLoader(n?.css).add(n?.loaders).end(),g=u.useDefaultEnvPlugin({extEnv:{...n?.define},frameworkEnv:p,env:this.env}).useCopyPlugin().add(f).add(new Y).add(this.createSourceMapPlugin()).add(this.createCssExtractPlugin()).add(this.createDoctorPlugin()).add(this.createGzipPlugin()).add(this.createCdnPlugin()).add(this.createModuleFederationPlugin()).add(this.createDependencyCyclePlugin()).add(n?.plugins).end();this.rspackConfig={mode:t,target:[`web`,`es5`,`browserslist:${i}`],context:r,entry:d,resolve:{alias:{"@":this.resolveContext(`src`),...n?.resolve?.alias},extensions:n?.resolve?.extensions||he,modules:[`node_modules`,this.resolveContext(`node_modules`),_e(`node_modules`)]},output:{clean:!0,path:this.getOutDirPath(),publicPath:c,filename:e?`[id].js`:this.joinAssetsDir(`assets/js/[contenthash].js`),chunkLoadingGlobal:`${o?.name||`ikaros`}_chunk`,pathinfo:!1},optimization:this.createOptimization(),stats:`none`,watchOptions:{aggregateTimeout:500,ignored:/node_modules/},module:{rules:h,noParse:m},plugins:g,devServer:{hot:!0,port:s,server:(()=>{let e=n?.server?.https;return e?e===!0?`https`:{type:`https`,options:e}:`http`})(),allowedHosts:`all`,proxy:n?.server?.proxy,historyApiFallback:{rewrites:[{from:RegExp(`^${c}`),to:_(c,`index.html`)}]},headers:{"Access-Control-Allow-Origin":`*`},static:{directory:this.resolveContext(`public`),publicPath:c},client:{logging:`none`,overlay:{errors:!0,warnings:!1,runtimeErrors:!1},webSocketURL:`auto://0.0.0.0:${s}/ws`}},experiments:{css:!0},...this.createCacheConfig()}}createSourceMapPlugin(){let{userConfig:e,command:t}=this;if(t===V.SERVER)return new i.EvalSourceMapDevToolPlugin({columns:!1,module:!0});if(e?.build?.sourceMap??!1)return new i.SourceMapDevToolPlugin({test:[/.js/,/.mjs/],filename:`[file].map[query]`})}createCssExtractPlugin(){if(this.command!==V.SERVER)return new i.CssExtractRspackPlugin({filename:this.joinAssetsDir(`assets/css/[contenthash].css`),ignoreOrder:!0})}createDoctorPlugin(){if(this.command!==V.SERVER&&this.userConfig?.build?.outReport)return new a}createGzipPlugin(){if(this.command!==V.SERVER&&this.userConfig?.build?.gzip)return new o}createOptimization(){return this.command===V.SERVER?{minimize:!1,removeAvailableModules:!1,removeEmptyChunks:!1,splitChunks:!1}:{minimize:!0,minimizer:[new i.LightningCssMinimizerRspackPlugin,new i.SwcJsMinimizerRspackPlugin],splitChunks:{chunks:`all`,minSize:2e4,minChunks:2,maxAsyncRequests:30,maxInitialRequests:30,cacheGroups:{defaultVendors:{test:/[/\\]node_modules[/\\]/,priority:-10,reuseExistingChunk:!0},default:{minChunks:2,priority:-20,reuseExistingChunk:!0}}}}}createCacheConfig(){if(this.command!==V.SERVER&&this.userConfig?.build?.cache)return{cache:!0,experiments:{cache:{type:`persistent`}}}}createVueOrReactConfig(){return this.isVue?{noParse:/^(vue|vue-router|vuex|vuex-router-sync)$/,env:{__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1}}:this.isReact?{noParse:e=>/(react|react-dom|react-is)\.production\.min\.js$/.test(e),env:{REACT_APP_ENABLE_DEVTOOLS:!1}}:{env:void 0,noParse:void 0}}createCdnPlugin(){let{cdnOptions:e}=this.userConfig??{};if(!(!e||d(e.modules)))return new we(e)}createModuleFederationPlugin(){let e=this.userConfig?.moduleFederation;if(e)return u(e)?e.map(e=>new s(e)):new s(e)}createDependencyCyclePlugin(){if(this.command!==V.SERVER&&this.userConfig?.build?.dependencyCycleCheck)return new i.CircularDependencyRspackPlugin({exclude:/node_modules/,failOnError:!1})}createRspackBuilder(e){let{isLive:t=!1}=e||{};return new Promise((e,n)=>{let r=i(this.rspackConfig);if(t){new p(this.rspackConfig.devServer,r).startCallback(t=>{if(t)return n(t);e(void 0)});return}let a=``;r.run((t,i)=>{r.close(r=>t||r?(console.error(t||r),n(t||r)):i?.hasErrors()?(a+=`Build failed with errors.
|
|
7
|
+
`,i.toString({chunks:!1,colors:!0}).split(/\r?\n/).forEach(e=>{a+=` ${e}\n`}),n(Error(a))):e(i?.toString({chunks:!1,colors:!0})))})})}};const Q={WEB:`web`},De=[new t(`-m, --mode <name>`,`Environment variable`),new t(`-p, --platform <type>`,`build platform type`).default(Q.WEB).choices(Object.values(Q))],$=e=>{switch(e.options.platform){case Q.WEB:new Ee(e);break;default:{let e=Object.values(Q).join(`,`);console.error(`No corresponding compilation service was found, platform: ${e}`),process.exit(1)}}},Oe=e=>{let t=e.command(V.SERVER,{isDefault:!0}).description(`Start local develop serve`).action(e=>{$({command:V.SERVER,options:e})}),n=e.command(V.BUILD).description(`Start build`).action(e=>{$({command:V.BUILD,options:e})});for(let e of De)t.addOption(e),n.addOption(e)},ke=e=>e;if(Number(process.versions.node.split(`.`)[0])<18){let e=r.bgRed.white(` ERROR `);console.error(e+` The Node.js version is greater than v18!`),console.log(),process.exit(1)}n.version(A,`-v, --version`),Oe(n),n.parse();export{ke as defineConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikaros-cli/ikaros",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -14,11 +14,6 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/umbrella22/ikaros/issues"
|
|
16
16
|
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"dev": "tsdown --watch",
|
|
19
|
-
"dts": "tsdown --dts",
|
|
20
|
-
"build": "tsdown"
|
|
21
|
-
},
|
|
22
17
|
"keywords": [
|
|
23
18
|
"vue",
|
|
24
19
|
"rspack"
|
|
@@ -41,36 +36,39 @@
|
|
|
41
36
|
"npm": ">=9.5.0"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
44
|
-
"@module-federation/enhanced": "^0.
|
|
45
|
-
"@rsdoctor/rspack-plugin": "^1.
|
|
46
|
-
"@rspack/core": "^1.
|
|
47
|
-
"@rspack/dev-server": "^1.1.
|
|
48
|
-
"
|
|
49
|
-
"chalk": "^5.4.1",
|
|
39
|
+
"@module-federation/enhanced": "^0.18.4",
|
|
40
|
+
"@rsdoctor/rspack-plugin": "^1.2.3",
|
|
41
|
+
"@rspack/core": "^1.5.2",
|
|
42
|
+
"@rspack/dev-server": "^1.1.4",
|
|
43
|
+
"chalk": "^5.6.2",
|
|
50
44
|
"cli-cursor": "^5.0.0",
|
|
51
|
-
"commander": "^
|
|
45
|
+
"commander": "^14.0.0",
|
|
52
46
|
"compression-webpack-plugin": "^11.1.0",
|
|
53
47
|
"css-loader": "^7.1.2",
|
|
54
48
|
"detect-port": "^2.1.0",
|
|
55
|
-
"dotenv": "^
|
|
49
|
+
"dotenv": "^17.2.2",
|
|
56
50
|
"easy-table": "^1.2.0",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
51
|
+
"es-toolkit": "^1.39.10",
|
|
52
|
+
"fs-extra": "^11.3.1",
|
|
53
|
+
"glob": "^11.0.3",
|
|
59
54
|
"less-loader": "^12.3.0",
|
|
60
|
-
"minimist": "^1.2.8",
|
|
61
55
|
"ora": "^8.2.0",
|
|
56
|
+
"oxc-transform": "^0.86.0",
|
|
62
57
|
"picocolors": "^1.1.1",
|
|
63
|
-
"pretty-bytes": "^
|
|
64
|
-
"radashi": "^12.5.1",
|
|
58
|
+
"pretty-bytes": "^7.0.1",
|
|
65
59
|
"sass-loader": "^16.0.5",
|
|
66
|
-
"stylus-loader": "^8.1.
|
|
60
|
+
"stylus-loader": "^8.1.2",
|
|
67
61
|
"vue-style-loader": "^4.1.3",
|
|
68
|
-
"yaml": "^2.8.
|
|
69
|
-
"zod": "^
|
|
62
|
+
"yaml": "^2.8.1",
|
|
63
|
+
"zod": "^4.1.5"
|
|
70
64
|
},
|
|
71
65
|
"devDependencies": {
|
|
72
66
|
"@types/fs-extra": "^11.0.4",
|
|
73
|
-
"
|
|
74
|
-
|
|
67
|
+
"vitest": "^3.2.4"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"dev": "tsdown --watch",
|
|
71
|
+
"dts": "tsdown --dts",
|
|
72
|
+
"build": "tsdown"
|
|
75
73
|
}
|
|
76
|
-
}
|
|
74
|
+
}
|