@fangzhongya/vue-archive 0.0.2-41 → 0.0.2-42
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/dist/node/index.cjs
CHANGED
|
@@ -66589,13 +66589,9 @@ function gettests(obj, arr, n) {
|
|
|
66589
66589
|
});
|
|
66590
66590
|
} else {
|
|
66591
66591
|
const name = "cs";
|
|
66592
|
-
|
|
66593
|
-
|
|
66594
|
-
|
|
66595
|
-
name,
|
|
66596
|
-
"index.vue"
|
|
66597
|
-
);
|
|
66598
|
-
console.log("key", key);
|
|
66592
|
+
let key = configObj.example.dir + "/" + getLevelUrl(configObj.example.level, obj) + "/";
|
|
66593
|
+
obj.value + "/" + name + "/index.vue";
|
|
66594
|
+
key = key.replace(/\/\//g, "/").replace(/\/\//g, "/");
|
|
66599
66595
|
arr.push(
|
|
66600
66596
|
...setTestUrl(obj, {
|
|
66601
66597
|
key,
|
package/dist/node/index.js
CHANGED
|
@@ -66589,13 +66589,9 @@ function gettests(obj, arr, n) {
|
|
|
66589
66589
|
});
|
|
66590
66590
|
} else {
|
|
66591
66591
|
const name = "cs";
|
|
66592
|
-
|
|
66593
|
-
|
|
66594
|
-
|
|
66595
|
-
name,
|
|
66596
|
-
"index.vue"
|
|
66597
|
-
);
|
|
66598
|
-
console.log("key", key);
|
|
66592
|
+
let key = configObj.example.dir + "/" + getLevelUrl(configObj.example.level, obj) + "/";
|
|
66593
|
+
obj.value + "/" + name + "/index.vue";
|
|
66594
|
+
key = key.replace(/\/\//g, "/").replace(/\/\//g, "/");
|
|
66599
66595
|
arr.push(
|
|
66600
66596
|
...setTestUrl(obj, {
|
|
66601
66597
|
key,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../config.cjs"),m=require("./common.cjs"),w=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs"),L=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),
|
|
2
|
-
`)}async function ee(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=(await C(t.key,e,t.suffix,t.comprops||"")).filter(a=>m.isComprops(a.name,t.comprops||"")||m.isCurprops(a.name,t.curprops||""));s=await
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../config.cjs"),m=require("./common.cjs"),w=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs"),L=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),b=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs"),q=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs"),d=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs"),H=require("./index.cjs"),f={},x={},y=[],A={},S={},O={};function I(){return P.getConfig("example")}function U(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),r=[],a=n.examples;a&&Object.keys(a).forEach(l=>{r.push(l),S[l]=a[l]});const i=n.examplesRaw,o=[];n.urls&&n.urls.length>0?(n.exampless=n.urls,n.urls.forEach(l=>{o.push(l),i&&(O[l]=N(i,l))})):(n.exampless=r,i&&Object.keys(i).forEach(l=>{o.push(l),i&&(O[l]=N(i,l))})),n.examples=void 0,n.examplessRaw=o,n.examplesRaw=void 0,A[e]=n}function N(e,t){return typeof e=="function"?e:e&&(e[t]||e)}async function k(e,t){let s="";if(t=="vue"){let r=new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);r&&(s=r[3])}else(t=="js"||t=="ts"||t=="")&&(s=e);if(s){const n=await H.getTextImport(s);let r=n==null?void 0:n.map(i=>i.n);const a=[];return r&&r.length>0&&r.forEach(i=>{i&&(i.startsWith("./")||i.startsWith("../"))&&a.push(i)}),a}}function V(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw(e).then(s=>{const n=(s||"")+"";e.raw=n,e.getRaw=null,t(n)}):t(""):t("")})}function K(e,t){e=(e||"")+"";let s="";switch(e){case"1":s=t.tdir+"/";break;case"2":s=t.adir+"/";break;case"3":s=t.tdir+"/"+t.adir+"/";break}return s}function W(e,t,s){var o,l;e=(e||"")+"",s=(s||"")+"";let n=w.humpToLine(t.name),r=[];const a=Object.values(t.aliass||{});if(e==="1")t.alias&&r.push(t.alias+"-"+n);else if(e==="2")a&&a.length>0&&a.forEach(c=>{r.push(c+"-"+n)});else if(e==="3"){let c="";t.alias&&(c=t.alias+"-"),a==null||a.forEach(u=>{r.push(c+u+"-"+n)})}else e==="4"?(o=t.aliasNames)==null||o.forEach(c=>{r.push(w.humpToLine(c))}):e=="9"&&(r.push(n),(l=t.aliasNames)==null||l.forEach(c=>{r.push(w.humpToLine(c))}));r.length==0&&r.push(n);let i=[];return s==="1"?r.forEach(c=>{let u=E.lineToLargeHump(c);i.push(u,L.firstLower(u))}):s==="2"?r.forEach(c=>{let u=E.lineToLargeHump(c);i.push(c,u,L.firstLower(u))}):i=[...r],i=[...new Set(i)],i}function B(e,t,s,n){const r=[];return s.examplessRaw.forEach(a=>{for(let i=0;i<t.length;i++){const o=t[i];if(a==e+o+"/"+s.md+".md"){r.push({topurl:e,comkey:n.key,suffix:d.getSuffix(a),name:n.name,value:o,key:a,raw:"",getRaw:m.getRawValue(O,a)});break}}}),r}function T(e){p();const t=f[e];if(t.tests)return t.tests;{const s=A[t.dir],n=s.dir+K(s.level||0,t),r=W(s.aliaslevel||0,t,s.componentName||0);t.mds=B(n,r,s,t);const a={};return s.exampless.forEach(i=>{for(let o=0;o<r.length;o++){const l=r[o];if(i.startsWith(n+l+"/")){const c=new RegExp("^\\"+n+l+"/(.*)/index\\."+m.defaultExtensions.join("|")+"$");let u="",g=i.match(c);g&&g.length>1&&(u=g[1]),a[i]={topurl:n,name:l,value:u,suffix:d.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:S[i],raw:"",getRaw:m.getRawValue(O,i)};break}}}),t.tests=a,a}}function D(e){if(e){const t=T(e);return Object.values(t)}else return[]}function F(e,t,s){p();const n=T(s),r=[];if(t){let a=n[t];if(a)return r.push(a),r}return Object.values(n).forEach(a=>{a.name+"/"+a.value==e&&r.push(a)}),r}function J(e){return T(e),f[e].mds}async function C(e,t,s,n){let r=await k(t,s)||[],a=e.split("/");return r.map(i=>{if(i.startsWith("./")){let o=a.slice(0,a.length-1).join("/"),l=i.substring(2);return{name:i,comprops:n||"",value:l,suffix:d.getSuffix(i),head:o,key:o+"/"+l}}else{let o=i.split("/"),l=0;for(let R=0;R<o.length;R++)if(o[R]!=".."){l=R;break}let c=o.slice(l,o.length),u=a.slice(0,a.length-l-1).join("/"),g=c.join("/");return{name:i,comprops:n||"",value:g,suffix:d.getSuffix(i),head:u,key:u+"/"+g}}})}function X(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>({raw:"",name:n.name,value:n.value,suffix:d.getSuffix(n.key),key:n.key,getRaw:m.getRawValue(O,n.key)}));q.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(o=>{const l=(o||"")+"";a.raw=l,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function Z(){const e=I(),t=P.getConfig("components");t==null||t.forEach(s=>{var r;G(s);let n=s.dir||((r=s==null?void 0:s.resolver)==null?void 0:r.dir)||"";U(n,e,s.example)})}const h="default";function Q(e){let t=w.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{y.push({name:n,value:e.key})})}function $(e,t){const s={};t==null||t.forEach(n=>{f[n.key]=n,Q(n);const r=Object.values(n.aliass||{});r&&r.length?r.forEach(a=>{s[a]=s[a]||[],s[a].push(n.key)}):(s[h]=s[h]||[],s[h].push(n.key))})}function G(e){var n;let t,s;if(e.resolver)t=e.alias||((n=e.resolver)==null?void 0:n.alias)||h,s=m.getComponentsArr(e.resolver.urls||[],e.resolver,e.componentsRaw,e.components,e);else{t=e.alias||h;let r=(e==null?void 0:e.urls)||Object.keys(e.componentsRaw);s=m.getComponentsArr(r,e,e.componentsRaw,e.components,e)}s&&(s!=null&&s.props)&&s.props.forEach(r=>{x[r.key]=r}),$(t,s.components)}function Y(e){return p(),f[e]}function p(){return Object.keys(f).length==0&&Z(),Object.values(f)}function _(){return p(),x}function z(e,t,s){p();const n=[];if(s){let a=f[s];if(a&&a.key)return[a]}let r=w.humpToLine(e);return y.forEach(a=>{t?a.name.includes(r)&&n.push(f[a.value]):a.name==r&&n.push(f[a.value])}),b.duplicateRemoval(n,"key")}async function v(e,t){let s=e;if(e){let n=(await C(t.key,e,t.suffix,t.comprops)).filter(r=>r.key.startsWith(t.head)||m.isComprops(r.name,t.comprops||""));s=await M(n)+s}return s}function j(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>x[n.key]||x[n.key+".js"]||x[n.key+".ts"]);q.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(async o=>{const l=(o||"")+"";let c=await v(l,e[i]);a.raw=c,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}async function M(e){const t=await j(e);return((t==null?void 0:t.map(n=>n.raw))||[]).join(`
|
|
2
|
+
`)}async function ee(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=(await C(t.key,e,t.suffix,t.comprops||"")).filter(a=>m.isComprops(a.name,t.comprops||"")||m.isCurprops(a.name,t.curprops||""));s=await M(n)+s}return s}function te(e){return new Promise(t=>{if(e){p();const s=f[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw(s).then(n=>{const r=(n||"")+"";ee(r,s).then(a=>{s.raw=a,s.getRaw=null,t(a)})}):t(""):t("")}else t("")})}exports.defaultName=h;exports.getCompoName=z;exports.getCompoNameKey=Y;exports.getCompoNameObj=p;exports.getComponentPropsObjs=_;exports.getKeyMds=J;exports.getLevelUrl=K;exports.getLocalTextArr=X;exports.getLocalTextComponents=te;exports.getLocalTextTests=V;exports.getPropsRaws=j;exports.getTestImportUrl=C;exports.getTestName=D;exports.getTestNameObj=F;
|
|
@@ -6,6 +6,13 @@ import type { PropsObj, ComponentsObj, TestsObj, TextObj, MdObj, PropObj } from
|
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
8
|
export declare function getLocalTextTests(obj: TestsObj): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* 0 : url 下面就是组件
|
|
11
|
+
* 1 : dir 名称开始
|
|
12
|
+
* 2 : 二级 aliass 目录
|
|
13
|
+
* 3 : dir 名称开始 加上二级 aliass 目录
|
|
14
|
+
*/
|
|
15
|
+
export declare function getLevelUrl(key: string | number, obj: ComponentsObj): string;
|
|
9
16
|
export declare function getTestName(url?: string): TestsObj[];
|
|
10
17
|
export declare function getTestNameObj(name: string, key: string, comkey: string): TestsObj[];
|
|
11
18
|
export declare function getKeyMds(key: string): MdObj[] | undefined;
|