@moneko/core 3.54.0-beta.4 → 3.54.0-beta.6
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/bin/build.mjs +1 -1
- package/lib/options/swcrc.mjs +1 -1
- package/package.json +2 -2
package/lib/bin/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as o}from"node:path";import{argv as t,exit as e}from"node:process";import{
|
|
1
|
+
import{join as o}from"node:path";import{argv as t,exit as e}from"node:process";import{ink as s,println as i,removeDir as r}from"@moneko/utils";import m from"../commom/setup-env.mjs";import{cwd as n,swcCachePath as l}from"./utils/config.mjs";import{getSwcOption as p}from"./utils/setup-swcrc.mjs";import{lesscCommonjs as c}from"./lessc.mjs";import d from"./tsc.mjs";async function a(){let a=t[3],j=t[4],u=t.slice(5);a||(i(s(`type: 无效值 ${s(a,"245")}`,"red")),e(1));let f=!u.includes("no-docs"),x=!u.includes("no-lib"),y=!u.includes("no-es"),_=!u.includes("no-dts"),g=u.filter(o=>!["no-docs","no-es","no-lib"].includes(o));if(await m("production",a,j,g),"library"===a){let t="solid"===j?await import("@moneko/convert/solid"):await import("@moneko/convert"),{CONFIG:e}=await import("../config.mjs"),s="swc"===e.dts,i=[x&&{type:"commonjs",dir:"lib",msg:"Convert to CommonJS"},y&&{type:"es6",dir:"es",msg:"Convert to ES Module"}].filter(Boolean);for(let m=0,a=i.length;m<a;m++){if(r(o(n,`./${i[m].dir}`)),"react"===j){let o=p();"es6"===i[m].type&&(o.jsc.target="es2015"),o.jsc.experimental.emitIsolatedDts=_&&s,o.jsc.experimental.cacheRoot=l,o.module.type=i[m].type,t.convert({outDir:i[m].dir,inputDir:"components",ignore:[/^.*\/__*__\//,/\.test\.(js|ts)x?$/,/\.DS_Store/,/\.mdx?$/,/^.*\/examples\//,/\.d\.(cj|mj|j|t|ct|mt)sx?$/],options:o})}else if("solid"===j){let o={jsxOptions:e.jsxDomExpressions,presetEnvOption:{modules:"commonjs"}};"es6"===i[m].type&&(o.presetEnvOption.modules=!1),t.convertSolid({outDir:i[m].dir,inputDir:"components",ignore:[/^.*\/__*__\//,/\.test\.(js|ts)x?$/,/\.DS_Store/,/\.mdx?$/,/^.*\/examples\//,/\.d\.(cj|mj|j|t|ct|mt)sx?$/],options:o})}"commonjs"===i[m].type&&c(),_&&!s&&d(i[m].dir)}}if("library"!==a||f&&"library"===a)try{await import("../build.mjs")}catch(o){i(s(Error(o).message,"red")),e(1)}}export default a;
|
package/lib/options/swcrc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import r from"../commom/paths.mjs";import{CONFIG as
|
|
1
|
+
import{merge as e}from"webpack-merge";import r from"../commom/paths.mjs";import{CONFIG as o}from"../config.mjs";import t,{coreJsVersion as s}from"../polyfills/polyfills.mjs";import{isDev as m,isReact as c,jsxImportSource as p}from"../process-env.mjs";let a={include:t(),mode:"entry",coreJs:s};export default((t,s={})=>e({module:{type:"es6",resolveFully:!0},sync:!0,jsc:{parser:{syntax:"typescript",tsx:c,decorators:!0,dynamicImport:!0},loose:!0,target:o.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:o.reactJsxRuntime||"automatic",throwIfNamespace:!0,refresh:c&&m,development:m,importSource:p},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath}},env:o.polyfill?a:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof o.swcrc?o.swcrc(m):o.swcrc||{},s));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.54.0-beta.
|
|
3
|
+
"version": "3.54.0-beta.6",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@moneko/raw-import": "0.0.3",
|
|
114
114
|
"@moneko/request": "1.6.2",
|
|
115
115
|
"@moneko/stylelint": "1.5.0",
|
|
116
|
-
"@moneko/transform-imports": "0.
|
|
116
|
+
"@moneko/transform-imports": "1.0.0",
|
|
117
117
|
"@moneko/utils": "0.3.3",
|
|
118
118
|
"@swc/core": "1.13.5",
|
|
119
119
|
"browserslist": "4.25.4",
|