agile-core 3.0.7 → 3.0.8

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/plugin.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { UserConfig } from 'vite';
2
2
  export type AuiOptions = {
3
3
  tagPrefix?: string;
4
+ coreAlias?: string;
4
5
  };
5
6
  export type AuiVuePlugin = {
6
7
  userConfig: UserConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,MAAM,CAAA;AA2G9C,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3C,CAAC;AAGF,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,YAAY,CA0B/D"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,MAAM,CAAA;AA2G9C,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3C,CAAC;AAGF,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,YAAY,CA0B/D"}
package/dist/plugin.es.js CHANGED
@@ -1,59 +1,62 @@
1
1
  import { fileURLToPath as e } from "url";
2
- import n, { dirname as t } from "path";
3
- import { glob as r } from "glob";
4
- import { merge as o } from "ts-deepmerge";
5
- const i = "auicore", u = t(e(import.meta.url));
2
+ import n, { dirname as r } from "path";
3
+ import { glob as o } from "glob";
4
+ import { merge as t } from "ts-deepmerge";
5
+ const i = r(e(import.meta.url));
6
+ function u(e2) {
7
+ return { name: "aui-vue-plugin", enforce: "post", transform(r2, o2) {
8
+ if (o2.endsWith(".aui.vue")) {
9
+ const t2 = n.basename(o2).replace(".aui.vue", ""), i2 = r2.split("export default"), u2 = `
10
+ const __aui_comp_define__ = ${i2.pop()};
11
+ import __aui_como_core__ from '${e2.coreAlias ? e2.coreAlias : "agile-core"}';
12
+ if(!__aui_comp_define__.name) {
13
+ __aui_comp_define__.name = '${t2}';
14
+ }
15
+ export const componentStructure = __aui_comp_define__;
16
+ export default __aui_como_core__.define(__aui_comp_define__);
17
+ `;
18
+ return { code: i2.join("export default") + u2 };
19
+ }
20
+ return null;
21
+ } };
22
+ }
6
23
  const a = "Comp";
7
24
  const s = "// insert";
8
- function _() {
9
- return { name: "aui-export-plugin", enforce: "pre", transform(e2, t2) {
10
- if (t2.endsWith(".export.aui.ts")) {
25
+ function c() {
26
+ return { name: "aui-export-plugin", enforce: "pre", transform(e2, r2) {
27
+ if (r2.endsWith(".export.aui.ts")) {
11
28
  if (-1 === e2.indexOf(s)) throw new Error(`.export.aui.ts文件必须包含[ ${s} ]标记`);
12
- const o2 = n.dirname(t2), i2 = r.sync("**/*.aui.vue", { cwd: o2 });
29
+ const t2 = n.dirname(r2), i2 = o.sync("**/*.aui.vue", { cwd: t2 });
13
30
  if (0 === i2.length) return null;
14
31
  const u2 = [];
15
- return i2.forEach((e3, t3) => {
16
- const r2 = n.join(o2, e3).replace(/\\/g, "/");
17
- u2.push(`import ${a}${t3} from '${r2}';`), u2.push(`import {componentStructure as ${a}${t3}_${t3} } from '${r2}';`);
32
+ return i2.forEach((e3, r3) => {
33
+ const o2 = n.join(t2, e3).replace(/\\/g, "/");
34
+ u2.push(`import ${a}${r3} from '${o2}';`), u2.push(`import {componentStructure as ${a}${r3}_${r3} } from '${o2}';`);
18
35
  }), u2.push(e2.replace(s, function(e3) {
19
36
  const n2 = [];
20
- return e3.forEach((e4, t3) => {
21
- n2.push(`[${a}${t3}_${t3}.name]: ${a}${t3}`);
37
+ return e3.forEach((e4, r3) => {
38
+ n2.push(`[${a}${r3}_${r3}.name]: ${a}${r3}`);
22
39
  }), n2.join(", ");
23
40
  }(i2))), { code: u2.join("\n") };
24
41
  }
25
42
  return null;
26
43
  } };
27
44
  }
28
- function c(e2) {
29
- const n2 = "virtual:aui-config", t2 = "\0" + n2;
45
+ function _(e2) {
46
+ const n2 = "virtual:aui-config", r2 = "\0" + n2;
30
47
  return { name: "aui-config-plugin", resolveId(e3) {
31
- if (e3 === n2) return t2;
48
+ if (e3 === n2) return r2;
32
49
  }, load(n3) {
33
- if (n3 === t2) {
34
- const n4 = o({ tagPrefix: "aui", buildTime: (/* @__PURE__ */ new Date()).toISOString() }, e2 || {});
50
+ if (n3 === r2) {
51
+ const n4 = t({ tagPrefix: "aui", buildTime: (/* @__PURE__ */ new Date()).toISOString() }, e2 || {});
35
52
  return `export default ${JSON.stringify(n4)}`;
36
53
  }
37
54
  } };
38
55
  }
39
56
  function getAuiConfig(e2) {
40
- e2 = o({ tagPrefix: "aui" }, e2 || {});
41
- const t2 = (e2 == null ? void 0 : e2.tagPrefix) || "aui";
42
- return { userConfig: { plugins: [_(), { name: "aui-vue-plugin", enforce: "post", transform(e3, t3) {
43
- if (t3.endsWith(".aui.vue")) {
44
- const r2 = n.basename(t3).replace(".aui.vue", ""), o2 = e3.split("export default"), u2 = `
45
- const __aui_comp_define__ = ${o2.pop()};
46
- import __aui_como_core__ from '@${i}';
47
- if(!__aui_comp_define__.name) {
48
- __aui_comp_define__.name = '${r2}';
49
- }
50
- export const componentStructure = __aui_comp_define__;
51
- export default __aui_como_core__.define(__aui_comp_define__);
52
- `;
53
- return { code: o2.join("export default") + u2 };
54
- }
55
- return null;
56
- } }, c(e2)], resolve: { alias: { [`@${i}`]: n.resolve(u, "./core") }, extensions: [".js", ".ts", ".jsx", ".tsx", ".json", ".cjs.js", ".es.js"] }, define: { __AUI_CONFIG__: JSON.stringify(o({ tagPrefix: "aui", buildTime: (/* @__PURE__ */ new Date()).toISOString() }, e2 || {})) } }, isCustomElement: (e3) => e3.startsWith(`${t2}-`) };
57
+ e2 = t({ tagPrefix: "aui" }, e2 || {});
58
+ const r2 = (e2 == null ? void 0 : e2.tagPrefix) || "aui";
59
+ return { userConfig: { plugins: [c(), u(e2), _(e2)], resolve: { alias: { "@auicore": n.resolve(i, "./core") }, extensions: [".js", ".ts", ".jsx", ".tsx", ".json", ".cjs.js", ".es.js"] }, define: { __AUI_CONFIG__: JSON.stringify(t({ tagPrefix: "aui", buildTime: (/* @__PURE__ */ new Date()).toISOString() }, e2 || {})) } }, isCustomElement: (e3) => e3.startsWith(`${r2}-`) };
57
60
  }
58
61
  export {
59
62
  getAuiConfig
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.es.js","sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite'\nimport { fileURLToPath } from 'url'\nimport { default as path, dirname } from 'path'\nimport { glob } from 'glob'\nimport { merge } from 'ts-deepmerge'\n\nconst coreAlias = 'auicore'\n// 避免使用 import.meta.url,在构建时会被转换为 data URL\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\n// 自定义AUI.vue文件处理插件\nfunction auiVuePlugin(): Plugin {\n return {\n name: 'aui-vue-plugin',\n enforce: 'post', // 在Vue插件之后执行\n transform(code, id) {\n if (id.endsWith(`.aui.vue`)) {\n const fileName = path.basename(id).replace('.aui.vue', '');\n const sp = code.split('export default');\n const last = `\nconst __aui_comp_define__ = ${sp.pop()};\nimport __aui_como_core__ from '@${coreAlias}';\nif(!__aui_comp_define__.name) {\n __aui_comp_define__.name = '${fileName}';\n}\nexport const componentStructure = __aui_comp_define__;\nexport default __aui_como_core__.define(__aui_comp_define__);\n`;\n const first = sp.join('export default');\n return {\n code: first + last,\n }\n }\n return null\n },\n }\n}\n\n\nconst IMPORT_PREFIX = 'Comp';\n\nfunction joinExport(files: string[]): string {\n const codes: string[] = [];\n files.forEach((_, index: number) => {\n codes.push(`[${IMPORT_PREFIX}${index}_${index}.name]: ${IMPORT_PREFIX}${index}`);\n });\n return codes.join(', ');\n}\n\nconst INSERT_FLAG = '// insert';\n\nfunction auiExportPlugin(): Plugin {\n return {\n name: 'aui-export-plugin',\n enforce: 'pre',\n transform(code, id) {\n if (id.endsWith(`.export.aui.ts`)) {\n\n if (code.indexOf(INSERT_FLAG) === -1) {\n throw new Error(`.export.aui.ts文件必须包含[ ${INSERT_FLAG} ]标记`);\n }\n const cwd = path.dirname(id);\n const files: string[] = glob.sync('**/*.aui.vue', {\n cwd,\n });\n\n if (files.length === 0) return null;\n\n const codes: string[] = [];\n files.forEach((file, index) => {\n const filePath = path.join(cwd, file).replace(/\\\\/g, '/');\n codes.push(`import ${IMPORT_PREFIX}${index} from '${filePath}';`);\n codes.push(`import {componentStructure as ${IMPORT_PREFIX}${index}_${index} } from '${filePath}';`);\n });\n codes.push(code.replace(INSERT_FLAG, joinExport(files)));\n return { code: codes.join(`\\n`) };\n }\n return null\n },\n }\n}\n\n\nfunction auiConfigPlugin(options?: AuiOptions) {\n const virtualModuleId = 'virtual:aui-config'\n const resolvedVirtualModuleId = '\\0' + virtualModuleId\n\n return {\n name: 'aui-config-plugin',\n resolveId(id: string) {\n if (id === virtualModuleId) {\n return resolvedVirtualModuleId\n }\n },\n load(id: string) {\n if (id === resolvedVirtualModuleId) {\n const auiConfig = merge({\n tagPrefix: 'aui',\n buildTime: new Date().toISOString()\n }, options || {})\n return `export default ${JSON.stringify(auiConfig)}`\n }\n }\n }\n}\n\nexport type AuiOptions = {\n tagPrefix?: string,\n};\n\nexport type AuiVuePlugin = {\n userConfig: UserConfig,\n isCustomElement: (tag: string) => boolean,\n};\n\n// 导出AUI配置函数\nexport function getAuiConfig(options?: AuiOptions): AuiVuePlugin {\n\n options = merge({\n tagPrefix: 'aui'\n }, options || {});\n\n const tagPrefix = options?.tagPrefix || 'aui';\n\n return {\n userConfig: {\n plugins: [auiExportPlugin(), auiVuePlugin(), auiConfigPlugin(options)],\n resolve: {\n alias: {\n [`@${coreAlias}`]: path.resolve(__dirname, './core')\n },\n extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.cjs.js', '.es.js'],\n },\n define: {\n __AUI_CONFIG__: JSON.stringify(merge({\n tagPrefix: 'aui',\n buildTime: new Date().toISOString()\n }, options || {}))\n },\n },\n isCustomElement: (tag: string) => tag.startsWith(`${tagPrefix}-`),\n }\n}"],"names":["coreAlias","__dirname","dirname","fileURLToPath","url","IMPORT_PREFIX","INSERT_FLAG","auiExportPlugin","name","enforce","code","id","endsWith","indexOf","Error","cwd","path","files","glob","sync","length","codes","forEach","file","index","filePath","join","replace","push","_","auiConfigPlugin","options","virtualModuleId","resolvedVirtualModuleId","auiConfig","merge","tagPrefix","buildTime","Date","toISOString","JSON","stringify","getAuiConfig","userConfig","plugins","fileName","basename","sp","split","last","pop","resolve","alias","extensions","define","__AUI_CONFIG__","isCustomElement","tag","startsWith"],"mappings":";;;;AAMA,MAAMA,IAAY,WAGZC,IAAYC,EADCC,cAA0BC,GAAAA,CAAAA;AAgC7C,MAAMC,IAAgB;AAUtB,MAAMC,IAAc;AAEpB,SAASC;AACP,SAAO,EACLC,MAAM,qBACNC,SAAS,OACT,UAAUC,IAAMC;AACd,QAAIA,GAAGC,SAAS,gBAAA,GAAmB;AAEjC,UAAA,OAAIF,GAAKG,QAAQP,CAAAA,EACf,OAAM,IAAIQ,MAAM,yBAAyBR,CAAAA,MAAAA;AAE3C,YAAMS,KAAMC,EAAKd,QAAQS,EAAAA,GACnBM,KAAkBC,EAAKC,KAAK,gBAAgB,EAChDJ,KAAAA,GAAAA,CAAAA;AAGF,UAAqB,MAAjBE,GAAMG,OAAc,QAA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Ed,QAAMK,MAAYL,MAAAA,gBAAAA,GAASK,cAAa;AAExC,SAAO,EACLO,YAAY,EACVC,SAAS,CAACrC,EAAAA,GAlHP,EACLC,MAAM,kBACNC,SAAS,QACT,UAAUC,IAAMC,IAAAA;AACd,QAAIA,GAAGC,SAAS,UAAA,GAAa;AAC3B,YAAMiC,KAAW7B,EAAK8B,SAASnC,EAAAA,EAAIgB,QAAQ,YAAY,EAAA,GACjDoB,KAAKrC,GAAKsC,MAAM,gBAAA,GAChBC,KAAO;AAAA,8BACSF,GAAGG;kCACClD,CAAAA;AAAAA;AAAAA,gCAEF6C,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAMxB,aAAO,EACLnC,MAFYqC,GAAGrB,KAAK,gBAAA,IAENuB;IAElB;AACA,WAAO;AAAA,EACT,EAAA,GA4F+CnB,EAAgBC,EAAAA,CAAAA,GAC7DoB,SAAS,EACPC,OAAO,EACL,CAAC,IAAIpD,CAAAA,EAAAA,GAAcgB,EAAKmC,QAAQlD,GAAW,QAAA,EAAA,GAE7CoD,YAAY,CAAC,OAAO,OAAO,QAAQ,QAAQ,SAAS,WAAW,QAAA,EAAA,GAEjEC,QAAQ,EACNC,gBAAgBf,KAAKC,UAAUN,EAAM,EACnCC,WAAW,OACXC,YAAA,oBAAeC,QAAOC,YAAAA,EAAAA,GACrBR,MAAW,CAAA,CAAA,CAAA,EAAA,EAAA,GAGlByB,iBAAkBC,CAAAA,OAAgBA,GAAIC,WAAW,GAAGtB;AAExD;"}
1
+ {"version":3,"file":"plugin.es.js","sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite'\r\nimport { fileURLToPath } from 'url'\r\nimport { default as path, dirname } from 'path'\r\nimport { glob } from 'glob'\r\nimport { merge } from 'ts-deepmerge'\r\n\r\nconst coreAlias = '@auicore'\r\n// 避免使用 import.meta.url,在构建时会被转换为 data URL\r\nconst __filename = fileURLToPath(import.meta.url)\r\nconst __dirname = dirname(__filename)\r\n\r\n// 自定义AUI.vue文件处理插件\r\nfunction auiVuePlugin(options: AuiOptions): Plugin {\r\n return {\r\n name: 'aui-vue-plugin',\r\n enforce: 'post', // 在Vue插件之后执行\r\n transform(code, id) {\r\n if (id.endsWith(`.aui.vue`)) {\r\n const fileName = path.basename(id).replace('.aui.vue', '');\r\n const sp = code.split('export default');\r\n const last = `\r\nconst __aui_comp_define__ = ${sp.pop()};\r\nimport __aui_como_core__ from '${options.coreAlias?options.coreAlias:'agile-core'}';\r\nif(!__aui_comp_define__.name) {\r\n __aui_comp_define__.name = '${fileName}';\r\n}\r\nexport const componentStructure = __aui_comp_define__;\r\nexport default __aui_como_core__.define(__aui_comp_define__);\r\n`;\r\n const first = sp.join('export default');\r\n return {\r\n code: first + last,\r\n }\r\n }\r\n return null\r\n },\r\n }\r\n}\r\n\r\n\r\nconst IMPORT_PREFIX = 'Comp';\r\n\r\nfunction joinExport(files: string[]): string {\r\n const codes: string[] = [];\r\n files.forEach((_, index: number) => {\r\n codes.push(`[${IMPORT_PREFIX}${index}_${index}.name]: ${IMPORT_PREFIX}${index}`);\r\n });\r\n return codes.join(', ');\r\n}\r\n\r\nconst INSERT_FLAG = '// insert';\r\n\r\nfunction auiExportPlugin(): Plugin {\r\n return {\r\n name: 'aui-export-plugin',\r\n enforce: 'pre',\r\n transform(code, id) {\r\n if (id.endsWith(`.export.aui.ts`)) {\r\n\r\n if (code.indexOf(INSERT_FLAG) === -1) {\r\n throw new Error(`.export.aui.ts文件必须包含[ ${INSERT_FLAG} ]标记`);\r\n }\r\n const cwd = path.dirname(id);\r\n const files: string[] = glob.sync('**/*.aui.vue', {\r\n cwd,\r\n });\r\n\r\n if (files.length === 0) return null;\r\n\r\n const codes: string[] = [];\r\n files.forEach((file, index) => {\r\n const filePath = path.join(cwd, file).replace(/\\\\/g, '/');\r\n codes.push(`import ${IMPORT_PREFIX}${index} from '${filePath}';`);\r\n codes.push(`import {componentStructure as ${IMPORT_PREFIX}${index}_${index} } from '${filePath}';`);\r\n });\r\n codes.push(code.replace(INSERT_FLAG, joinExport(files)));\r\n return { code: codes.join(`\\n`) };\r\n }\r\n return null\r\n },\r\n }\r\n}\r\n\r\n\r\nfunction auiConfigPlugin(options?: AuiOptions) {\r\n const virtualModuleId = 'virtual:aui-config'\r\n const resolvedVirtualModuleId = '\\0' + virtualModuleId\r\n\r\n return {\r\n name: 'aui-config-plugin',\r\n resolveId(id: string) {\r\n if (id === virtualModuleId) {\r\n return resolvedVirtualModuleId\r\n }\r\n },\r\n load(id: string) {\r\n if (id === resolvedVirtualModuleId) {\r\n const auiConfig = merge({\r\n tagPrefix: 'aui',\r\n buildTime: new Date().toISOString()\r\n }, options || {})\r\n return `export default ${JSON.stringify(auiConfig)}`\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport type AuiOptions = {\r\n tagPrefix?: string,\r\n coreAlias?: string,\r\n};\r\n\r\nexport type AuiVuePlugin = {\r\n userConfig: UserConfig,\r\n isCustomElement: (tag: string) => boolean,\r\n};\r\n\r\n// 导出AUI配置函数\r\nexport function getAuiConfig(options?: AuiOptions): AuiVuePlugin {\r\n\r\n options = merge({\r\n tagPrefix: 'aui'\r\n }, options || {});\r\n\r\n const tagPrefix = options?.tagPrefix || 'aui';\r\n\r\n return {\r\n userConfig: {\r\n plugins: [auiExportPlugin(), auiVuePlugin(options), auiConfigPlugin(options)],\r\n resolve: {\r\n alias: {\r\n [`${coreAlias}`]: path.resolve(__dirname, './core')\r\n },\r\n extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.cjs.js', '.es.js'],\r\n },\r\n define: {\r\n __AUI_CONFIG__: JSON.stringify(merge({\r\n tagPrefix: 'aui',\r\n buildTime: new Date().toISOString()\r\n }, options || {}))\r\n },\r\n },\r\n isCustomElement: (tag: string) => tag.startsWith(`${tagPrefix}-`),\r\n }\r\n}"],"names":["__dirname","dirname","fileURLToPath","url","auiVuePlugin","options","name","enforce","code","id","endsWith","fileName","path","basename","replace","sp","split","last","pop","coreAlias","join","IMPORT_PREFIX","INSERT_FLAG","auiExportPlugin","indexOf","Error","cwd","files","glob","sync","length","codes","forEach","file","index","filePath","push","_","auiConfigPlugin","virtualModuleId","resolvedVirtualModuleId","auiConfig","merge","tagPrefix","buildTime","Date","toISOString","JSON","stringify","getAuiConfig","userConfig","plugins","resolve","alias","extensions","define","__AUI_CONFIG__","isCustomElement","tag","startsWith"],"mappings":";;;;AAMA,MAGMA,IAAYC,EADCC,EAAAA,YAA0BC,GAAAA,CAAAA;AAI7C,SAASC,EAAaC,IAAAA;AACpB,SAAO,EACLC,MAAM,kBACNC,SAAS,QACT,UAAUC,IAAMC,IAAAA;AACd,QAAIA,GAAGC,SAAS,UAAA,GAAa;AAC3B,YAAMC,KAAWC,EAAKC,SAASJ,EAAAA,EAAIK,QAAQ,YAAY,EAAA,GACjDC,KAAKP,GAAKQ,MAAM,mBAChBC,KAAO;AAAA,8BACSF,GAAGG,IAAAA,CAAAA;AAAAA,iCACAb,GAAQc,YAAUd,GAAQc,YAAU,YAAA;AAAA;AAAA,gCAErCR;;;;;AAMxB,aAAO,EACLH,MAFYO,GAAGK,KAAK,gBAAA,IAENH,GAAAA;AAAAA,IAElB;AACA,WAAO;AAAA,EACT,EAAA;AAEJ;AAGA,MAAMI,IAAgB;AAUtB,MAAMC,IAAc;AAEpB,SAASC,IAAAA;AACP,SAAO,EACLjB,MAAM,qBACNC,SAAS,OACT,UAAUC,IAAMC,IAAAA;AACd,QAAIA,GAAGC,SAAS,gBAAA,GAAmB;AAEjC,UAAA,OAAIF,GAAKgB,QAAQF,CAAAA,EACf,OAAM,IAAIG,MAAM,yBAAyBH,CAAAA,MAAAA;AAE3C,YAAMI,KAAMd,EAAKX,QAAQQ,EAAAA,GACnBkB,KAAkBC,EAAKC,KAAK,gBAAgB,EAChDH,KAAAA,GAAAA,CAAAA;AAGF,UAAqB,MAAjBC,GAAMG,OAAc,QAAO;AAE/B,YAAMC,KAAkB,CAAA;AAOxB,aANAJ,GAAMK,QAAQ,CAACC,IA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,cAAa;AAExC,SAAO,EACLO,YAAY,EACVC,SAAS,CAAC5B,KAAmBnB,EAAaC,EAAAA,GAAUiC,EAAgBjC,EAAAA,CAAAA,GACpE+C,SAAS,EACPC,OAAO,EACL,YAAkBzC,EAAKwC,QAAQpD,GAAW,QAAA,EAAA,GAE5CsD,YAAY,CAAC,OAAO,OAAO,QAAQ,QAAQ,SAAS,WAAW,QAAA,EAAA,GAEjEC,QAAQ,EACNC,gBAAgBT,KAAKC,UAAUN,EAAM,EACnCC,WAAW,OACXC,YAAA,oBAAeC,QAAOC,YAAAA,EAAAA,GACrBzC,MAAW,CAAA,CAAA,CAAA,EAAA,EAAA,GAGlBoD,iBAAkBC,CAAAA,OAAgBA,GAAIC,WAAW,GAAGhB;AAExD;"}
package/package.json CHANGED
@@ -1,84 +1,84 @@
1
- {
2
- "name": "agile-core",
3
- "version": "3.0.7",
4
- "main": "dist/index.cjs.js",
5
- "module": "dist/index.es.js",
6
- "types": "dist/index.d.ts",
7
- "engines": {
8
- "node": ">=22.0.0"
9
- },
10
- "files": [
11
- "dist",
12
- "types",
13
- "scripts",
14
- "assets"
15
- ],
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.es.js",
20
- "require": "./dist/index.cjs.js"
21
- },
22
- "./core": {
23
- "types": "./dist/core.d.ts",
24
- "import": "./dist/core.es.js",
25
- "require": "./dist/core.cjs.js"
26
- },
27
- "./plugin": {
28
- "types": "./dist/plugin.d.ts",
29
- "import": "./dist/plugin.es.js",
30
- "require": "./dist/plugin.cjs.js"
31
- }
32
- },
33
- "scripts": {
34
- "build": "vite build && npx tsc --project tsconfig.build.json",
35
- "dev": "vite build --watch",
36
- "prepublishOnly": "npm run build"
37
- },
38
- "author": {
39
- "name": "nandy007",
40
- "url": "https://gitee.com/nandy007"
41
- },
42
- "license": "MIT",
43
- "description": "Agile Core - A powerful component based micro front-end framework",
44
- "homepage": "https://gitee.com/nandy007/agile-core#readme",
45
- "repository": {
46
- "type": "git",
47
- "url": "git+https://gitee.com/nandy007/agile-core.git"
48
- },
49
- "bugs": {
50
- "url": "https://gitee.com/nandy007/agile-core/issues"
51
- },
52
- "keywords": [
53
- "vue",
54
- "vite",
55
- "aui",
56
- "agile",
57
- "framework",
58
- "development"
59
- ],
60
- "peerDependencies": {
61
- "vite": ">=7.0.0",
62
- "vue": ">=3.0.0"
63
- },
64
- "dependencies": {
65
- "@vue/compiler-sfc": "^3.5.17",
66
- "connect": "^3.7.0",
67
- "glob": "^11.0.3",
68
- "ts-deepmerge": "^7.0.3",
69
- "vue": "^3.5.17"
70
- },
71
- "devDependencies": {
72
- "@rollup/plugin-terser": "^0.4.4",
73
- "@types/minimist": "^1.2.5",
74
- "@types/node": "^24.0.14",
75
- "@vitejs/plugin-vue": "^6.0.0",
76
- "@vue/tsconfig": "^0.7.0",
77
- "less": "^4.4.0",
78
- "mime-types": "^3.0.1",
79
- "minimist": "^1.2.8",
80
- "typescript": "~5.8.3",
81
- "vite": "^7.0.4",
82
- "vue-tsc": "^2.2.12"
83
- }
84
- }
1
+ {
2
+ "name": "agile-core",
3
+ "version": "3.0.8",
4
+ "main": "dist/index.cjs.js",
5
+ "module": "dist/index.es.js",
6
+ "types": "dist/index.d.ts",
7
+ "engines": {
8
+ "node": ">=22.0.0"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "types",
13
+ "scripts",
14
+ "assets"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.es.js",
20
+ "require": "./dist/index.cjs.js"
21
+ },
22
+ "./core": {
23
+ "types": "./dist/core.d.ts",
24
+ "import": "./dist/core.es.js",
25
+ "require": "./dist/core.cjs.js"
26
+ },
27
+ "./plugin": {
28
+ "types": "./dist/plugin.d.ts",
29
+ "import": "./dist/plugin.es.js",
30
+ "require": "./dist/plugin.cjs.js"
31
+ }
32
+ },
33
+ "scripts": {
34
+ "build": "vite build && npx tsc --project tsconfig.build.json",
35
+ "dev": "vite build --watch",
36
+ "prepublishOnly": "npm run build"
37
+ },
38
+ "author": {
39
+ "name": "nandy007",
40
+ "url": "https://gitee.com/nandy007"
41
+ },
42
+ "license": "MIT",
43
+ "description": "Agile Core - A powerful component based micro front-end framework",
44
+ "homepage": "https://gitee.com/nandy007/agile-core#readme",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://gitee.com/nandy007/agile-core.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://gitee.com/nandy007/agile-core/issues"
51
+ },
52
+ "keywords": [
53
+ "vue",
54
+ "vite",
55
+ "aui",
56
+ "agile",
57
+ "framework",
58
+ "development"
59
+ ],
60
+ "peerDependencies": {
61
+ "vite": ">=7.0.0",
62
+ "vue": ">=3.0.0"
63
+ },
64
+ "dependencies": {
65
+ "@vue/compiler-sfc": "^3.5.17",
66
+ "connect": "^3.7.0",
67
+ "glob": "^11.0.3",
68
+ "ts-deepmerge": "^7.0.3",
69
+ "vue": "^3.5.17"
70
+ },
71
+ "devDependencies": {
72
+ "@rollup/plugin-terser": "^0.4.4",
73
+ "@types/minimist": "^1.2.5",
74
+ "@types/node": "^24.0.14",
75
+ "@vitejs/plugin-vue": "^6.0.0",
76
+ "@vue/tsconfig": "^0.7.0",
77
+ "less": "^4.4.0",
78
+ "mime-types": "^3.0.1",
79
+ "minimist": "^1.2.8",
80
+ "typescript": "~5.8.3",
81
+ "vite": "^7.0.4",
82
+ "vue-tsc": "^2.2.12"
83
+ }
84
+ }
@@ -1,80 +1,80 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue'
5
- const component: DefineComponent<{}, {}, any>
6
- export default component
7
- }
8
-
9
- // 为 Vite define 配置的全局变量添加类型声明
10
- declare const __AUI_CONFIG__: {
11
- tagPrefix: string;
12
- buildTime: string;
13
- [key: string]: any;
14
- };
15
-
16
- declare module '@auicore' {
17
-
18
- interface Component {
19
- name?: string;
20
-
21
- // 数据和属性
22
- data?: () => Record<string, any>;
23
- props?: string[] | Record<string, any>;
24
- computed?: Record<string, any>;
25
- methods?: Record<string, Function>;
26
- watch?: Record<string, any>;
27
-
28
- // 生命周期钩子
29
- beforeCreate?(): void;
30
- created?(): void;
31
- beforeMount?(): void;
32
- mounted?(): void;
33
- beforeUpdate?(): void;
34
- updated?(): void;
35
- beforeUnmount?(): void;
36
- unmounted?(): void;
37
- activated?(): void;
38
- deactivated?(): void;
39
-
40
- // 组件选项
41
- components?: Record<string, any>;
42
- directives?: Record<string, any>;
43
- filters?: Record<string, any>;
44
- mixins?: any[];
45
- extends?: any;
46
-
47
- // 模板选项
48
- template?: string;
49
- render?: Function;
50
-
51
- // AUI 特有的钩子
52
- auiInit?(): void;
53
-
54
- // 允许任意属性
55
- [key: string]: any;
56
- }
57
-
58
- type HookHandler = (c: Component) => void | Component;
59
-
60
- export { HookHandler, Component };
61
-
62
- interface AuiCoreType {
63
- /**
64
- * 对现有组件进行hook
65
- * @param name 组件完整标签名,比如aui-my-comp
66
- * @param handle hook处理函数
67
- */
68
- hookStructure(tagName: string, handle: HookHandler): void;
69
- /**
70
- * 定义组件,如果force为true,则如果组件已经定义过,则会强制重新定义
71
- * @param v
72
- * @param force
73
- */
74
- define(v: Component, force?: boolean): Component;
75
- // 其他方法可以根据需要添加
76
- }
77
-
78
- const AuiCore: AuiCoreType;
79
- export default AuiCore;
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
8
+
9
+ // 为 Vite define 配置的全局变量添加类型声明
10
+ declare const __AUI_CONFIG__: {
11
+ tagPrefix: string;
12
+ buildTime: string;
13
+ [key: string]: any;
14
+ };
15
+
16
+ declare module '@auicore' {
17
+
18
+ interface Component {
19
+ name?: string;
20
+
21
+ // 数据和属性
22
+ data?: () => Record<string, any>;
23
+ props?: string[] | Record<string, any>;
24
+ computed?: Record<string, any>;
25
+ methods?: Record<string, Function>;
26
+ watch?: Record<string, any>;
27
+
28
+ // 生命周期钩子
29
+ beforeCreate?(): void;
30
+ created?(): void;
31
+ beforeMount?(): void;
32
+ mounted?(): void;
33
+ beforeUpdate?(): void;
34
+ updated?(): void;
35
+ beforeUnmount?(): void;
36
+ unmounted?(): void;
37
+ activated?(): void;
38
+ deactivated?(): void;
39
+
40
+ // 组件选项
41
+ components?: Record<string, any>;
42
+ directives?: Record<string, any>;
43
+ filters?: Record<string, any>;
44
+ mixins?: any[];
45
+ extends?: any;
46
+
47
+ // 模板选项
48
+ template?: string;
49
+ render?: Function;
50
+
51
+ // AUI 特有的钩子
52
+ auiInit?(): void;
53
+
54
+ // 允许任意属性
55
+ [key: string]: any;
56
+ }
57
+
58
+ type HookHandler = (c: Component) => void | Component;
59
+
60
+ export { HookHandler, Component };
61
+
62
+ interface AuiCoreType {
63
+ /**
64
+ * 对现有组件进行hook
65
+ * @param name 组件完整标签名,比如aui-my-comp
66
+ * @param handle hook处理函数
67
+ */
68
+ hookStructure(tagName: string, handle: HookHandler): void;
69
+ /**
70
+ * 定义组件,如果force为true,则如果组件已经定义过,则会强制重新定义
71
+ * @param v
72
+ * @param force
73
+ */
74
+ define(v: Component, force?: boolean): Component;
75
+ // 其他方法可以根据需要添加
76
+ }
77
+
78
+ const AuiCore: AuiCoreType;
79
+ export default AuiCore;
80
80
  }
@@ -1,36 +1,36 @@
1
- import { ComponentCustomProperties } from 'vue';
2
- import { AuiComponent } from '../core/aui';
3
-
4
- declare module '@vue/runtime-core' {
5
- interface ComponentCustomProperties {
6
- /**
7
- * 设置或者获取原生DOM的value值,当没有参数时是获取,否则为设置
8
- * @param v 要设置的value值
9
- * @returns 原生DOM的value值
10
- */
11
- $value: (v?: any) => any;
12
-
13
- /**
14
- * 将任意数据转为字符串数组
15
- * @param s 要转为数组的数据
16
- * @returns 字符串数组
17
- */
18
- $anyToArray: (s: any) => string[];
19
-
20
- /**
21
- * VUE组件对应的AUI原生DOM对象
22
- * @returns AUI原生DOM对象;
23
- */
24
- $aui: () => AuiComponent | null;
25
-
26
- /**
27
- * 调用AUI原生DOM的方法
28
- * @param name 方法名
29
- * @param args 参数
30
- * @returns 方法返回值
31
- */
32
- $xcall: (name?: string, ...args: any[]) => any;
33
- }
34
- }
35
-
1
+ import { ComponentCustomProperties } from 'vue';
2
+ import { AuiComponent } from '../core/aui';
3
+
4
+ declare module '@vue/runtime-core' {
5
+ interface ComponentCustomProperties {
6
+ /**
7
+ * 设置或者获取原生DOM的value值,当没有参数时是获取,否则为设置
8
+ * @param v 要设置的value值
9
+ * @returns 原生DOM的value值
10
+ */
11
+ $value: (v?: any) => any;
12
+
13
+ /**
14
+ * 将任意数据转为字符串数组
15
+ * @param s 要转为数组的数据
16
+ * @returns 字符串数组
17
+ */
18
+ $anyToArray: (s: any) => string[];
19
+
20
+ /**
21
+ * VUE组件对应的AUI原生DOM对象
22
+ * @returns AUI原生DOM对象;
23
+ */
24
+ $aui: () => AuiComponent | null;
25
+
26
+ /**
27
+ * 调用AUI原生DOM的方法
28
+ * @param name 方法名
29
+ * @param args 参数
30
+ * @returns 方法返回值
31
+ */
32
+ $xcall: (name?: string, ...args: any[]) => any;
33
+ }
34
+ }
35
+
36
36
  export { };