@das-fed/cli 7.1.0-dev.31 → 7.1.0-dev.33
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initPublicConfig}from"../dev-helper/init-public-config.js";import{initWatchers}from"../dev-helper/watchers/index.js";import{execSync}from"child_process";import{resolve,relative,dirname}from"path";import{fileURLToPath}from"url";import minimist from"minimist";import fs from"fs-extra";import{getWindowConfig}from"../../utils/get-window-config/index.js";import{getCliConfig}from"../../utils/get-cli-config/index.js";import{generateNginx}from"./generate-nginx.js";import{generateVersion}from"./genereate-version.js";let __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);export default{handle:async
|
|
1
|
+
import{initPublicConfig}from"../dev-helper/init-public-config.js";import{initWatchers}from"../dev-helper/watchers/index.js";import{execSync}from"child_process";import{resolve,relative,dirname}from"path";import{fileURLToPath}from"url";import minimist from"minimist";import fs from"fs-extra";import glob from"fast-glob";import{getWindowConfig}from"../../utils/get-window-config/index.js";import{getCliConfig}from"../../utils/get-cli-config/index.js";import{generateNginx}from"./generate-nginx.js";import{generateVersion}from"./genereate-version.js";let __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),removeSourceMaps=async e=>{let i=resolve(e,"dist");await fs.pathExists(i)&&0!==(e=await glob("**/*.map",{cwd:i,onlyFiles:!0})).length&&(await Promise.all(e.map(e=>fs.remove(resolve(i,e)))),console.log(`[das-cli build] removed ${e.length} sourcemap file(s) from dist`))};export default{handle:async e=>{var[,]=e,e=minimist(e);let i="";e.c&&(i+="-c "+e.c);var o=process.cwd(),r={cwd:o,isDev:!1,isBuild:!0,...await getCliConfig(),...e},t=r.isLib??!1;if(!t){await initPublicConfig(r),await initWatchers(r);let e=await getWindowConfig(resolve(o,"public/config.js"));try{var a,n=resolve(o,"config.js");await fs.exists(n)&&(a=(await import(relative(resolve(__dirname),n))).default,""===e.microAppName&&delete e.microAppName,e={...a,...e}),await generateNginx({cwd:o,...e})}catch(e){console.log("get rootConfig error",e)}}execSync("npx vite build "+i,{cwd:o,stdio:"inherit"}),await removeSourceMaps(o),t||await generateVersion({cwd:o,frameworkVersion:e?.config?.frameworkVersion??""})}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import json5 from"json5";import{resolve}from"path";import{getExportDefaultsByAst}from"../../../../utils/ts-morph/index.js";import{json2type}from"../../../../utils/json2type/index.js";import{json2snippets}from"../../../../utils/json2snippets/index.js";import{getCliConfig}from"../../../../utils/get-cli-config/index.js";let watchGlob=["src/**/theme/*.ts"],handle=async(e={})=>{var t=e.cwd,s=await getCliConfig(),o=s.theme?.watchGlob||[],o=getExportDefaultsByAst([...watchGlob,...o],e);let r={},a=(o.map((e,t)=>{let s=e.defaultText;var o,e=s.match(/getVar\(
|
|
1
|
+
import json5 from"json5";import{resolve}from"path";import{getExportDefaultsByAst}from"../../../../utils/ts-morph/index.js";import{json2type}from"../../../../utils/json2type/index.js";import{json2snippets}from"../../../../utils/json2snippets/index.js";import{getCliConfig}from"../../../../utils/get-cli-config/index.js";let watchGlob=["src/**/theme/*.ts"],handle=async(e={})=>{var t=e.cwd,s=await getCliConfig(),o=s.theme?.watchGlob||[],o=getExportDefaultsByAst([...watchGlob,...o],e);let r={},a=(o.map((e,t)=>{let s=e.defaultText;var o,e=s.match(/getVar\('[^']*'\)/g)||s.match(/getVar\("[^"]*"\)/g);if(!e)return Object.assign(r,json5.parse(s));for(o of e){var a=o.includes("getVar('")?"'":'"',a=o.replace("getVar("+a,"").replace(a+")","");s=s.replace(o,`'var(${a})'`)}Object.assign(r,json5.parse(s))}),{light:""}),l=(Object.values(r).filter(e=>!!e.light).map(e=>Object.assign(a,e)),0===Object.keys(r).length&&(r.any=""),json2type({data:[{title:"ThemeName",type:"string",enum:Object.keys(a)},{title:"ThemeVarKey",type:"string",enum:Object.keys(r)}],outputFilePath:resolve(t,"src/das-fe-local-runtime/theme-runtime/type.d.ts")}),resolve(t,".vscode/das-theme.local.code-snippets"));s.workspaceRoot&&(e=resolve(t,s.workspaceRoot),l=resolve(e,".vscode/das-theme.local.code-snippets")),json2snippets({data:{"das-theme-css变量":{prefix:"dasvar",body:[`var(\${1|${Object.keys(r).join(",")}|})`],scope:"css,scss,less",description:"das-theme-css变量"}},outputFilePath:l})};export default{name:"das-theme",glob:watchGlob,ignoreGlob:[],load:handle,change:handle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default(
|
|
1
|
+
export default(u={})=>({name:"das-fed-pretty",enforce:"pre",apply:"build",config:e=>{var r=!0===u?.allowSourceMap,e=e?.build||{};return{esbuild:{drop:["console","debugger"],minify:!0,...u?.esbuild||{}},build:{...e,sourcemap:r&&(e.sourcemap??!1)}}}});
|