@das-fed/cli 6.4.0-hot.25 → 6.4.0-hot.26
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 +1 -1
- package/src/commands/build/index.js +1 -1
- package/src/commands/build/nginx.main.conf +54 -54
- package/src/commands/build/nginx.micro.conf +61 -61
- package/src/commands/extra/auth/index.js +1 -0
- package/src/commands/extra/i18n/index.js +2 -0
- package/src/commands/extra/i18n/vite.config.ts +1 -0
- package/src/commands/extra/index.js +1 -0
- package/src/commands/extra/theme/index.js +1 -0
- package/src/commands/init/template/.prettierignore +21 -21
- package/src/commands/init/template/.prettierrc +8 -8
- package/src/commands/init/template/README.md +28 -28
- package/src/commands/init/template/config.js +3 -3
- package/src/commands/init/template/index.html +12 -12
- package/src/commands/init/template/package.json +12 -12
- package/src/commands/init/template/public/config.js +4 -4
- package/src/commands/init/template/src/das-web-app.ts +9 -9
- package/src/commands/init/template/src/main.ts +9 -9
- package/src/commands/init/template/src/micro-app.ts +8 -8
- package/src/commands/init/template/src/views/demo/app.vue +61 -61
- package/src/commands/init/template/src/views/demo/i18n/index.ts +14 -14
- package/src/commands/init/template/src/views/demo/router.ts +13 -13
- package/src/commands/init/template/src/views/demo/theme/index.ts +7 -7
- package/src/commands/init/template/src/views/hello/api/index.ts +6 -6
- package/src/commands/init/template/src/views/hello/app.vue +157 -157
- package/src/commands/init/template/src/views/hello/i18n/index.ts +16 -16
- package/src/commands/init/template/src/views/hello/router.ts +12 -12
- package/src/commands/init/template/src/views/hello/theme/index.ts +18 -18
- package/src/commands/init/template/src/vite-env.d.ts +1 -1
- package/src/commands/init/template/tsconfig.app.json +28 -28
- package/src/commands/init/template/tsconfig.json +11 -11
- package/src/commands/init/template/tsconfig.node.json +13 -13
- package/src/commands/init/template/vite.config.ts +11 -11
- package/src/vite-plugins/das-fe-resolve/index.js +1 -0
- package/src/vite-plugins/das-fe-ui/index.js +1 -1
- package/src/vite-plugins/das-fe-web/index.js +1 -1
- package/src/vite-plugins/dynamic-entry/index.js +1 -0
- package/src/commands/build/get-window-config.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/config.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/config.local.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/index.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{resolve,extname}from"path";import fs from"fs-extra";import
|
1
|
+
import{resolve,extname}from"path";import fs from"fs-extra";import MagicString from"magic-string";import{parseImportCode}from"../../utils/parse-import-code.js";let cwd=process.cwd(),dasFeWeb=e=>{let a;return{name:"das-fe-web",config:(e,{})=>({resolve:{alias:{"@":resolve(process.cwd(),"src")}}}),configResolved(e){a=e},buildStart:async()=>{a.cwd=resolve(process.cwd())},transformIndexHtml:{order:"post",handler:()=>{var e=a.base||"./";let s="development"===a.mode?e+"config.local.js":e+"config.js";return[{tag:"script",attrs:{src:s}}]}}}},dasFeWebEsmMapPath=resolve(cwd,"node_modules","@das-fed/web/esm-map.json"),dasFeWebEsmMapPathExits=fs.existsSync(dasFeWebEsmMapPath),esmMap=dasFeWebEsmMapPathExits?fs.readJSONSync(dasFeWebEsmMapPath):{},dasFeWebEsm=async e=>({name:"das-fed-web-esm",enforce:"pre",transform(e,a){if(dasFeWebEsmMapPathExits&&!(-1<a.indexOf("?"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(a))){a=parseImportCode(e,"@das-fed/web");if(a){let s=new MagicString(e);return a.map(e=>{let a="";e.members.map(e=>{var s=e.name,s=esmMap[s];s&&(a+=`import { ${e.code} } from '@das-fed/web${s}';`)}),s.overwrite(e.start,e.end,a)}),s.toString()}}}});export default e=>[dasFeWeb(e),dasFeWebEsm(e)];
|
@@ -0,0 +1 @@
|
|
1
|
+
import{resolve}from"path";import fs from"fs-extra";export default(s="/src/main.ts")=>{let a=process.cwd();return{name:"das-fe-dynamic-entry",apply:"serve",transformIndexHtml:{order:"pre",handler:async r=>{var e="/src/main.dev.ts";return await fs.exists(resolve(a,"."+e))?r.replace(s,e):r}}}};
|
@@ -1 +0,0 @@
|
|
1
|
-
import fs from"fs-extra";import prettier from"prettier";import strip from"strip-comments";import json5 from"json5";let getWindowConfig=async r=>{r=(await fs.readFile(r)).toString(),r=(await prettier.format(strip(r),{parser:"typescript"})).split(";").find(r=>r.match("window.config")).replace(/\s/g,"").replace("window.config=","");return json5.parse(r)};export{getWindowConfig};
|
@@ -1 +0,0 @@
|
|
1
|
-
window.config={};
|
@@ -1 +0,0 @@
|
|
1
|
-
window.config={};
|
@@ -1 +0,0 @@
|
|
1
|
-
let m={path:"/demo",component:()=>"virtual:module",meta:{keepAlive:!0}},l=(e,p)=>{var t=(s,e)=>async e=>{let t="string"==typeof e?e:"",a=("object"==typeof e&&(t=e.value),{method:s,url:t,headers:{}});return"get"!==a.method&&(a.params={...a.params,timestamp:(new Date).getTime()}),(a=p?await p(a):a).baseURL&&a.urlPrefix&&(a.baseURL=a.baseURL+a.urlPrefix),a};return{get:t("get"),post:t("post"),put:t("put"),patch:t("patch"),delete:t("delete")}},f=(t,e)=>l(null,async e=>(e.urlPrefix=t,e)),a=f("/test"),h=a.get("/user"),r=a.post("/user"),i=a.put("/user"),c=a.delete("/user"),p=Object.freeze(Object.defineProperty({__proto__:null,addUser:r,deleteUser:c,editUser:i,getUser:h},Symbol.toStringTag,{value:"Module"})),_={name:"示例",code:"demo",path:m.path,apis:p,btns:{add:{name:"新增按钮",apis:[r]},edit:{name:"编辑按钮",apis:[i]},delete:{name:"删除按钮",apis:[c]}}},g={path:"/",component:()=>"virtual:module"},b={name:"公告列表",code:"notice",path:g.path,apis:p,btns:{add:{name:"新增按钮",apis:[r]},edit:{name:"编辑按钮",apis:[i]},delete:{name:"删除按钮",apis:[c]}}},v=Object.assign({"./demo/index.ts":_,"./hello/index.ts":b}),U={code:"cms",name:"内容运营",modules:v};export{U as default};
|