delta-comic-core 0.3.4 → 0.4.0

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/bundle2.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const e=(e,t)=>({entry:e.entry??`src/main.ts`,userscript:{name:{display:e.displayName,id:e.name},version:`${e.version}/${e.supportCoreVersion}`,author:e.author,description:e.description,require:[`core`,...e.require??[]].map(e=>typeof e==`string`?`${e}:`:`${e.id}:${e.download??``}`)},build:{externalGlobals:t==`serve`?{}:{vue:`window.$$lib$$.Vue`,vant:`window.$$lib$$.Vant`,"naive-ui":`window.$$lib$$.Naive`,axios:`window.$$lib$$.Axios`,"es-toolkit":`window.$$lib$$.EsKits`,"delta-comic-core":`window.$$lib$$.Dcc`,"vue-router":`window.$$lib$$.VR`,"crypto-js":`window.$$lib$$.Crypto`}},server:{mountGmApi:!1,open:!1,prefix:!1}}),t=e=>e==`build`?{}:{externals:{vue:`window.$$lib$$.Vue`,vant:`window.$$lib$$.Vant`,"naive-ui":`window.$$lib$$.Naive`,axios:`window.$$lib$$.Axios`,"es-toolkit":`window.$$lib$$.EsKits`,"delta-comic-core":`window.$$lib$$.Dcc`,"vue-router":`window.$$lib$$.VR`,"crypto-js":`window.$$lib$$.Crypto`}};exports.createExternalConfig=t,exports.createMonkeyConfig=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-BzfTdyRg.cjs`);let t=require(`vite-plugin-external`);t=e.r(t);let n=require(`vite-plugin-monkey`);n=e.r(n);const r=(e,r)=>[r==`build`?!1:(0,t.default)({externals:{vue:`window.$$lib$$.Vue`,vant:`window.$$lib$$.Vant`,"naive-ui":`window.$$lib$$.Naive`,axios:`window.$$lib$$.Axios`,"es-toolkit":`window.$$lib$$.EsKits`,"delta-comic-core":`window.$$lib$$.Dcc`,"vue-router":`window.$$lib$$.VR`,"crypto-js":`window.$$lib$$.Crypto`}}),(0,n.default)({entry:e.entry??`src/main.ts`,userscript:{name:{display:e.displayName,id:e.name},version:`${e.version}/${e.supportCoreVersion}/${!!e.lockCoreVersion}`,author:e.author,description:e.description,require:[`core`,...e.require??[]].map(e=>typeof e==`string`?`${e}:`:`${e.id}:${e.download??``}`)},build:{externalGlobals:r==`serve`?{}:{vue:`window.$$lib$$.Vue`,vant:`window.$$lib$$.Vant`,"naive-ui":`window.$$lib$$.Naive`,axios:`window.$$lib$$.Axios`,"es-toolkit":`window.$$lib$$.EsKits`,"delta-comic-core":`window.$$lib$$.Dcc`,"vue-router":`window.$$lib$$.VR`,"crypto-js":`window.$$lib$$.Crypto`}},server:{mountGmApi:!1,open:!1,prefix:!1}})];exports.deltaComic=r;
2
2
  //# sourceMappingURL=bundle2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle2.cjs","names":[],"sources":["../vite/index.ts"],"sourcesContent":["export const createMonkeyConfig = (config: {\r\n name: string\r\n displayName: string\r\n version: string\r\n author?: string\r\n description: string\r\n /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定 */\r\n supportCoreVersion: string\r\n /** @default ['core'] */\r\n require?: ({\r\n id: string\r\n download?: string\r\n } | string)[]\r\n /** @default 'src/main.ts' */\r\n entry?: string\r\n}, command: \"build\" | \"serve\") => ({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n display: config.displayName,\r\n id: config.name\r\n },\r\n version: `${config.version}/${config.supportCoreVersion}`,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])].map(v => {\r\n if (typeof v == 'string') return `${v}:`\r\n return `${v.id}:${v.download ?? ''}`\r\n }),\r\n },\r\n build: {\r\n externalGlobals: command == 'serve' ? {} : {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n },\r\n },\r\n server: {\r\n mountGmApi: false,\r\n open: false,\r\n prefix: false\r\n }\r\n} as any)\r\n\r\n\r\nexport const createExternalConfig = (command: \"build\" | \"serve\") => command == 'build' ? {} : {\r\n externals: {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n }\r\n} as any\r\n"],"mappings":"AAAA,MAAa,GAAsB,EAehC,KAAgC,CACjC,MAAO,EAAO,OAAS,cACvB,WAAY,CACV,KAAM,CACJ,QAAS,EAAO,YAChB,GAAI,EAAO,KACZ,CACD,QAAS,GAAG,EAAO,QAAQ,GAAG,EAAO,qBACrC,OAAQ,EAAO,OACf,YAAa,EAAO,YACpB,QAAS,CAAC,OAAQ,GAAI,EAAO,SAAW,EAAE,CAAE,CAAC,IAAI,GAC3C,OAAO,GAAK,SAAiB,GAAG,EAAE,GAC/B,GAAG,EAAE,GAAG,GAAG,EAAE,UAAY,KAChC,CACH,CACD,MAAO,CACL,gBAAiB,GAAW,QAAU,EAAE,CAAG,CACzC,IAAK,qBACL,KAAM,sBACN,WAAY,uBACZ,MAAO,uBACP,aAAc,wBACd,mBAAoB,qBACpB,aAAc,oBACd,YAAa,wBACd,CACF,CACD,OAAQ,CACN,WAAY,GACZ,KAAM,GACN,OAAQ,GACT,CACF,EAGY,EAAwB,GAA+B,GAAW,QAAU,EAAE,CAAG,CAC5F,UAAW,CACT,IAAK,qBACL,KAAM,sBACN,WAAY,uBACZ,MAAO,uBACP,aAAc,wBACd,mBAAoB,qBACpB,aAAc,oBACd,YAAa,wBACd,CACF"}
1
+ {"version":3,"file":"bundle2.cjs","names":[],"sources":["../vite/index.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\r\n\r\n\r\nimport external from 'vite-plugin-external'\r\nimport monkey from 'vite-plugin-monkey'\r\n/** vite插件,自动配置了库的外部化与脚本头 */\r\nexport const deltaComic = (config: {\r\n name: string\r\n displayName: string\r\n version: string\r\n author?: string\r\n description: string\r\n /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定,所有的`>=`会替换为`^`,除非`lockCoreVersion为`true` */\r\n supportCoreVersion: string\r\n /** 如果为`true`,则`supportCoreVersion`的`>=`不会替换为`^` */\r\n lockCoreVersion?: boolean\r\n /** @default ['core'] */\r\n require?: ({\r\n id: string\r\n download?: string\r\n } | string)[]\r\n /** @default 'src/main.ts' */\r\n entry?: string\r\n},\r\n command: \"build\" | \"serve\"): PluginOption => [\r\n command == 'build' ? false : external({\r\n externals: {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n }\r\n }),\r\n monkey({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n display: config.displayName,\r\n id: config.name\r\n },\r\n version: `${config.version}/${config.supportCoreVersion}/${!!config.lockCoreVersion}`,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])].map(v => {\r\n if (typeof v == 'string') return `${v}:`\r\n return `${v.id}:${v.download ?? ''}`\r\n }),\r\n },\r\n build: {\r\n externalGlobals: command == 'serve' ? {} : {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n },\r\n },\r\n server: {\r\n mountGmApi: false,\r\n open: false,\r\n prefix: false\r\n }\r\n })\r\n ]"],"mappings":"uMAMA,MAAa,GAAc,EAkBzB,IAA6C,CAC3C,GAAW,QAAU,IAAA,EAAA,EAAA,SAAiB,CACpC,UAAW,CACT,IAAK,qBACL,KAAM,sBACN,WAAY,uBACZ,MAAO,uBACP,aAAc,wBACd,mBAAoB,qBACpB,aAAc,oBACd,YAAa,wBACd,CACF,CAAC,EAAA,EAAA,EAAA,SACK,CACL,MAAO,EAAO,OAAS,cACvB,WAAY,CACV,KAAM,CACJ,QAAS,EAAO,YAChB,GAAI,EAAO,KACZ,CACD,QAAS,GAAG,EAAO,QAAQ,GAAG,EAAO,mBAAmB,GAAG,CAAC,CAAC,EAAO,kBACpE,OAAQ,EAAO,OACf,YAAa,EAAO,YACpB,QAAS,CAAC,OAAQ,GAAI,EAAO,SAAW,EAAE,CAAE,CAAC,IAAI,GAC3C,OAAO,GAAK,SAAiB,GAAG,EAAE,GAC/B,GAAG,EAAE,GAAG,GAAG,EAAE,UAAY,KAChC,CACH,CACD,MAAO,CACL,gBAAiB,GAAW,QAAU,EAAE,CAAG,CACzC,IAAK,qBACL,KAAM,sBACN,WAAY,uBACZ,MAAO,uBACP,aAAc,wBACd,mBAAoB,qBACpB,aAAc,oBACd,YAAa,wBACd,CACF,CACD,OAAQ,CACN,WAAY,GACZ,KAAM,GACN,OAAQ,GACT,CACF,CAAC,CAAA"}
package/dist/bundle2.js CHANGED
@@ -1,16 +1,27 @@
1
- const createMonkeyConfig = (e, t) => ({
2
- entry: e.entry ?? "src/main.ts",
1
+ import external from "vite-plugin-external";
2
+ import monkey from "vite-plugin-monkey";
3
+ const deltaComic = (n, r) => [r == "build" ? !1 : external({ externals: {
4
+ vue: "window.$$lib$$.Vue",
5
+ vant: "window.$$lib$$.Vant",
6
+ "naive-ui": "window.$$lib$$.Naive",
7
+ axios: "window.$$lib$$.Axios",
8
+ "es-toolkit": "window.$$lib$$.EsKits",
9
+ "delta-comic-core": "window.$$lib$$.Dcc",
10
+ "vue-router": "window.$$lib$$.VR",
11
+ "crypto-js": "window.$$lib$$.Crypto"
12
+ } }), monkey({
13
+ entry: n.entry ?? "src/main.ts",
3
14
  userscript: {
4
15
  name: {
5
- display: e.displayName,
6
- id: e.name
16
+ display: n.displayName,
17
+ id: n.name
7
18
  },
8
- version: `${e.version}/${e.supportCoreVersion}`,
9
- author: e.author,
10
- description: e.description,
11
- require: ["core", ...e.require ?? []].map((e) => typeof e == "string" ? `${e}:` : `${e.id}:${e.download ?? ""}`)
19
+ version: `${n.version}/${n.supportCoreVersion}/${!!n.lockCoreVersion}`,
20
+ author: n.author,
21
+ description: n.description,
22
+ require: ["core", ...n.require ?? []].map((e) => typeof e == "string" ? `${e}:` : `${e.id}:${e.download ?? ""}`)
12
23
  },
13
- build: { externalGlobals: t == "serve" ? {} : {
24
+ build: { externalGlobals: r == "serve" ? {} : {
14
25
  vue: "window.$$lib$$.Vue",
15
26
  vant: "window.$$lib$$.Vant",
16
27
  "naive-ui": "window.$$lib$$.Naive",
@@ -25,16 +36,7 @@ const createMonkeyConfig = (e, t) => ({
25
36
  open: !1,
26
37
  prefix: !1
27
38
  }
28
- }), createExternalConfig = (e) => e == "build" ? {} : { externals: {
29
- vue: "window.$$lib$$.Vue",
30
- vant: "window.$$lib$$.Vant",
31
- "naive-ui": "window.$$lib$$.Naive",
32
- axios: "window.$$lib$$.Axios",
33
- "es-toolkit": "window.$$lib$$.EsKits",
34
- "delta-comic-core": "window.$$lib$$.Dcc",
35
- "vue-router": "window.$$lib$$.VR",
36
- "crypto-js": "window.$$lib$$.Crypto"
37
- } };
38
- export { createExternalConfig, createMonkeyConfig };
39
+ })];
40
+ export { deltaComic };
39
41
 
40
42
  //# sourceMappingURL=bundle2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle2.js","names":[],"sources":["../vite/index.ts"],"sourcesContent":["export const createMonkeyConfig = (config: {\r\n name: string\r\n displayName: string\r\n version: string\r\n author?: string\r\n description: string\r\n /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定 */\r\n supportCoreVersion: string\r\n /** @default ['core'] */\r\n require?: ({\r\n id: string\r\n download?: string\r\n } | string)[]\r\n /** @default 'src/main.ts' */\r\n entry?: string\r\n}, command: \"build\" | \"serve\") => ({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n display: config.displayName,\r\n id: config.name\r\n },\r\n version: `${config.version}/${config.supportCoreVersion}`,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])].map(v => {\r\n if (typeof v == 'string') return `${v}:`\r\n return `${v.id}:${v.download ?? ''}`\r\n }),\r\n },\r\n build: {\r\n externalGlobals: command == 'serve' ? {} : {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n },\r\n },\r\n server: {\r\n mountGmApi: false,\r\n open: false,\r\n prefix: false\r\n }\r\n} as any)\r\n\r\n\r\nexport const createExternalConfig = (command: \"build\" | \"serve\") => command == 'build' ? {} : {\r\n externals: {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n }\r\n} as any\r\n"],"mappings":"AAAA,MAAa,sBAAsB,GAehC,OAAgC;CACjC,OAAO,EAAO,SAAS;CACvB,YAAY;EACV,MAAM;GACJ,SAAS,EAAO;GAChB,IAAI,EAAO;GACZ;EACD,SAAS,GAAG,EAAO,QAAQ,GAAG,EAAO;EACrC,QAAQ,EAAO;EACf,aAAa,EAAO;EACpB,SAAS,CAAC,QAAQ,GAAI,EAAO,WAAW,EAAE,CAAE,CAAC,KAAI,MAC3C,OAAO,KAAK,WAAiB,GAAG,EAAE,KAC/B,GAAG,EAAE,GAAG,GAAG,EAAE,YAAY,KAChC;EACH;CACD,OAAO,EACL,iBAAiB,KAAW,UAAU,EAAE,GAAG;EACzC,KAAK;EACL,MAAM;EACN,YAAY;EACZ,OAAO;EACP,cAAc;EACd,oBAAoB;EACpB,cAAc;EACd,aAAa;EACd,EACF;CACD,QAAQ;EACN,YAAY;EACZ,MAAM;EACN,QAAQ;EACT;CACF,GAGY,wBAAwB,MAA+B,KAAW,UAAU,EAAE,GAAG,EAC5F,WAAW;CACT,KAAK;CACL,MAAM;CACN,YAAY;CACZ,OAAO;CACP,cAAc;CACd,oBAAoB;CACpB,cAAc;CACd,aAAa;CACd,EACF"}
1
+ {"version":3,"file":"bundle2.js","names":[],"sources":["../vite/index.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\r\n\r\n\r\nimport external from 'vite-plugin-external'\r\nimport monkey from 'vite-plugin-monkey'\r\n/** vite插件,自动配置了库的外部化与脚本头 */\r\nexport const deltaComic = (config: {\r\n name: string\r\n displayName: string\r\n version: string\r\n author?: string\r\n description: string\r\n /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定,所有的`>=`会替换为`^`,除非`lockCoreVersion为`true` */\r\n supportCoreVersion: string\r\n /** 如果为`true`,则`supportCoreVersion`的`>=`不会替换为`^` */\r\n lockCoreVersion?: boolean\r\n /** @default ['core'] */\r\n require?: ({\r\n id: string\r\n download?: string\r\n } | string)[]\r\n /** @default 'src/main.ts' */\r\n entry?: string\r\n},\r\n command: \"build\" | \"serve\"): PluginOption => [\r\n command == 'build' ? false : external({\r\n externals: {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n }\r\n }),\r\n monkey({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n display: config.displayName,\r\n id: config.name\r\n },\r\n version: `${config.version}/${config.supportCoreVersion}/${!!config.lockCoreVersion}`,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])].map(v => {\r\n if (typeof v == 'string') return `${v}:`\r\n return `${v.id}:${v.download ?? ''}`\r\n }),\r\n },\r\n build: {\r\n externalGlobals: command == 'serve' ? {} : {\r\n vue: 'window.$$lib$$.Vue',\r\n vant: 'window.$$lib$$.Vant',\r\n 'naive-ui': 'window.$$lib$$.Naive',\r\n axios: 'window.$$lib$$.Axios',\r\n 'es-toolkit': 'window.$$lib$$.EsKits',\r\n 'delta-comic-core': 'window.$$lib$$.Dcc',\r\n 'vue-router': 'window.$$lib$$.VR',\r\n 'crypto-js': 'window.$$lib$$.Crypto'\r\n },\r\n },\r\n server: {\r\n mountGmApi: false,\r\n open: false,\r\n prefix: false\r\n }\r\n })\r\n ]"],"mappings":";;AAMA,MAAa,cAAc,GAkBzB,MAA6C,CAC3C,KAAW,UAAU,KAAQ,SAAS,EACpC,WAAW;CACT,KAAK;CACL,MAAM;CACN,YAAY;CACZ,OAAO;CACP,cAAc;CACd,oBAAoB;CACpB,cAAc;CACd,aAAa;CACd,EACF,CAAC,EACF,OAAO;CACL,OAAO,EAAO,SAAS;CACvB,YAAY;EACV,MAAM;GACJ,SAAS,EAAO;GAChB,IAAI,EAAO;GACZ;EACD,SAAS,GAAG,EAAO,QAAQ,GAAG,EAAO,mBAAmB,GAAG,CAAC,CAAC,EAAO;EACpE,QAAQ,EAAO;EACf,aAAa,EAAO;EACpB,SAAS,CAAC,QAAQ,GAAI,EAAO,WAAW,EAAE,CAAE,CAAC,KAAI,MAC3C,OAAO,KAAK,WAAiB,GAAG,EAAE,KAC/B,GAAG,EAAE,GAAG,GAAG,EAAE,YAAY,KAChC;EACH;CACD,OAAO,EACL,iBAAiB,KAAW,UAAU,EAAE,GAAG;EACzC,KAAK;EACL,MAAM;EACN,YAAY;EACZ,OAAO;EACP,cAAc;EACd,oBAAoB;EACpB,cAAc;EACd,aAAa;EACd,EACF;CACD,QAAQ;EACN,YAAY;EACZ,MAAM;EACN,QAAQ;EACT;CACF,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&&t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
@@ -1,5 +1,4 @@
1
1
  import { ContentPageLike, ViewLayoutComp, ContentPage } from '../struct/content';
2
- import { ProcessInstance, Image } from '../struct/image';
3
2
  import { CommentRow } from '../struct/comment';
4
3
  import { UserCardComp } from '../struct/user';
5
4
  import { RStream, RPromiseContent } from '../utils/data';
@@ -7,13 +6,15 @@ import { Item, RawItem, Author, ItemCardComp } from '../struct/item';
7
6
  import { Component, MaybeRefOrGetter } from 'vue';
8
7
  import { ConfigPointer } from '../config';
9
8
  import { SharedFunctions } from '../utils/eventBus';
9
+ import { ProcessInstance, ResourceType } from '../struct/resource';
10
+ import { Image } from '../struct/image';
10
11
  export type PluginDefineResult = {
11
12
  api?: Record<string, string | undefined | false>;
12
13
  };
13
14
  export interface PluginConfig {
14
15
  name: string;
15
16
  content?: PluginConfigContent;
16
- image?: PluginConfigImage;
17
+ resource?: PluginConfigResource;
17
18
  api?: Record<string, PluginConfigApi>;
18
19
  user?: PluginConfigUser;
19
20
  auth?: PluginConfigAuth;
@@ -189,22 +190,9 @@ export interface PluginConfigApi {
189
190
  */
190
191
  test: (fork: string, signal: AbortSignal) => PromiseLike<void>;
191
192
  }
192
- export interface PluginConfigImage {
193
- /**
194
- * @description
195
- * key: namespace
196
- * value: url
197
- * 与`Image.setFork(name, key, value)`等价
198
- */
199
- forks: Record<string, string[]>;
200
- test: string;
201
- /**
202
- * @description
203
- * key: reference name
204
- * value: process function
205
- * 与`Image.setProcess(name, key, value)`等价
206
- */
193
+ export interface PluginConfigResource {
207
194
  process?: Record<string, ProcessInstance>;
195
+ types?: ResourceType[];
208
196
  }
209
197
  export type PluginConfigContent = Record<string, {
210
198
  /**
@@ -1,10 +1,5 @@
1
- import { SourcedKeyMap, Struct, MetaData } from '../utils/data';
2
- export type ProcessInstance = (nowPath: string, img: Image) => Promise<[path: string, exit: boolean]>;
3
- export interface ProcessStep {
4
- referenceName: string;
5
- ignoreExit?: boolean;
6
- }
7
- type ProcessStep_ = ProcessStep | string;
1
+ import { MetaData } from '../utils/data';
2
+ import { Resource, RawResource, ProcessStep_ } from './resource';
8
3
  export interface RawImage {
9
4
  $$plugin: string;
10
5
  $$meta?: MetaData;
@@ -12,26 +7,19 @@ export interface RawImage {
12
7
  forkNamespace: string;
13
8
  processSteps?: ProcessStep_[];
14
9
  }
15
- export declare class Image extends Struct<RawImage> implements RawImage {
10
+ export declare class Image extends Resource {
16
11
  aspect?: {
17
12
  width: number;
18
13
  height: number;
19
14
  } | undefined;
20
- static processInstances: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, referenceName: string], ProcessInstance>>;
21
- static fork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, namespace: string], string[]>>;
22
- static activeFork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, namespace: string], string>>;
23
15
  static is(value: unknown): value is Image;
24
- static create(v: RawImage, aspect?: {
16
+ static create(v: RawResource | RawImage, aspect?: {
25
17
  width: number;
26
18
  height: number;
27
19
  }): Image;
28
- private constructor();
29
- forkNamespace: string;
30
- path: string;
31
- processSteps: ProcessStep[];
32
- $$meta?: MetaData;
33
- $$plugin: string;
34
- getUrl(): Promise<string>;
20
+ protected constructor(v: RawResource | RawImage, aspect?: {
21
+ width: number;
22
+ height: number;
23
+ } | undefined);
35
24
  }
36
25
  export type Image_ = string | Image;
37
- export {};
@@ -4,6 +4,7 @@ import * as _content from "./content";
4
4
  import * as _ep from "./ep";
5
5
  import * as _comment from "./comment";
6
6
  import * as _user from "./user";
7
+ import * as _resource from './resource';
7
8
  export declare namespace uni {
8
9
  export import user = _user;
9
10
  export import comment = _comment;
@@ -11,4 +12,5 @@ export declare namespace uni {
11
12
  export import image = _image;
12
13
  export import item = _item;
13
14
  export import ep = _ep;
15
+ export import resource = _resource;
14
16
  }
@@ -5,6 +5,7 @@ import { Ep, RawEp } from './ep';
5
5
  import { Component, StyleValue } from 'vue';
6
6
  import { PluginConfigContentItemTranslator } from '../plugin/define';
7
7
  import { uni } from '.';
8
+ import { RawResource } from './resource';
8
9
  import * as image from "./image";
9
10
  export interface Category {
10
11
  name: string;
@@ -17,7 +18,7 @@ export interface Category {
17
18
  }
18
19
  export interface Author {
19
20
  label: string;
20
- icon: image.RawImage | string;
21
+ icon: RawResource | string;
21
22
  description: string;
22
23
  /**
23
24
  * 为空则不可订阅
@@ -28,7 +29,7 @@ export interface Author {
28
29
  $$plugin: string;
29
30
  }
30
31
  export interface RawItem {
31
- cover: image.RawImage;
32
+ cover: RawResource;
32
33
  title: string;
33
34
  id: string;
34
35
  /** @alias tags */
@@ -80,7 +81,7 @@ export declare abstract class Item extends Struct<RawItem> implements RawItem {
80
81
  abstract report(signal?: AbortSignal): PromiseLike<any>;
81
82
  abstract sendComment(text: string, signal?: AbortSignal): PromiseLike<any>;
82
83
  static is(value: unknown): value is Item;
83
- cover: image.RawImage;
84
+ cover: RawResource;
84
85
  get $cover(): image.Image;
85
86
  title: string;
86
87
  id: string;
@@ -0,0 +1,36 @@
1
+ import { SourcedKeyMap, Struct, MetaData } from '../utils/data';
2
+ export type ProcessInstance = (nowPath: string, resource: Resource) => Promise<[path: string, exit: boolean]>;
3
+ export interface ProcessStep {
4
+ referenceName: string;
5
+ ignoreExit?: boolean;
6
+ }
7
+ export type ProcessStep_ = ProcessStep | string;
8
+ export interface ResourceType {
9
+ type: string;
10
+ urls: string[];
11
+ test: (url: string, signal: AbortSignal) => PromiseLike<void>;
12
+ }
13
+ export interface RawResource {
14
+ $$plugin: string;
15
+ $$meta?: MetaData;
16
+ pathname: string;
17
+ type: string;
18
+ processSteps?: ProcessStep_[];
19
+ }
20
+ export declare class Resource extends Struct<RawResource> implements RawResource {
21
+ static processInstances: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, referenceName: string], ProcessInstance>>;
22
+ static fork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, type: string], ResourceType>>;
23
+ static precedenceFork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, type: string], string>>;
24
+ static is(value: unknown): value is Resource;
25
+ static create(v: RawResource): Resource;
26
+ protected constructor(v: RawResource);
27
+ type: string;
28
+ pathname: string;
29
+ processSteps: ProcessStep[];
30
+ $$meta?: MetaData;
31
+ $$plugin: string;
32
+ getUrl(): Promise<string>;
33
+ omittedForks: import('vue').ShallowReactive<Set<string>>;
34
+ getThisFork(): string;
35
+ localChangeFork(): boolean;
36
+ }
@@ -1,10 +1,11 @@
1
1
  import { AuthorAction, PluginConfigSubscribe } from '../plugin/define';
2
2
  import { uni } from '.';
3
- import { Image, RawImage } from './image';
3
+ import { Image } from './image';
4
4
  import { Component } from 'vue';
5
5
  import { SourcedKeyMap } from '../utils/data';
6
+ import { RawResource } from './resource';
6
7
  export interface RawUser {
7
- avatar?: RawImage;
8
+ avatar?: RawResource;
8
9
  name: string;
9
10
  id: string;
10
11
  $$plugin: string;
package/dist/pack.tgz CHANGED
Binary file
@@ -1,11 +1,15 @@
1
- export declare const createMonkeyConfig: (config: {
1
+ import { PluginOption } from 'vite';
2
+ /** vite插件,自动配置了库的外部化与脚本头 */
3
+ export declare const deltaComic: (config: {
2
4
  name: string;
3
5
  displayName: string;
4
6
  version: string;
5
7
  author?: string;
6
8
  description: string;
7
- /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定 */
9
+ /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定,所有的`>=`会替换为`^`,除非`lockCoreVersion为`true` */
8
10
  supportCoreVersion: string;
11
+ /** 如果为`true`,则`supportCoreVersion`的`>=`不会替换为`^` */
12
+ lockCoreVersion?: boolean;
9
13
  /** @default ['core'] */
10
14
  require?: ({
11
15
  id: string;
@@ -13,5 +17,4 @@ export declare const createMonkeyConfig: (config: {
13
17
  } | string)[];
14
18
  /** @default 'src/main.ts' */
15
19
  entry?: string;
16
- }, command: "build" | "serve") => any;
17
- export declare const createExternalConfig: (command: "build" | "serve") => any;
20
+ }, command: "build" | "serve") => PluginOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delta-comic-core",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "我曾亲眼见证神的熟视无睹.",
5
5
  "homepage": "https://github.com/wenxig/delta-comic-core",
6
6
  "repository": {
@@ -10,16 +10,18 @@
10
10
  "license": "AGPL-3.0-only",
11
11
  "type": "module",
12
12
  "dependencies": {
13
- "@capacitor/status-bar": "^7.0.3",
13
+ "@capacitor/status-bar": "^8.0.0",
14
14
  "@lhlyu/vue-virtual-waterfall": "^1.0.8",
15
15
  "@vant/use": "^1.6.0",
16
16
  "@vicons/antd": "^0.13.0",
17
17
  "@vicons/material": "^0.13.0",
18
- "@vueuse/core": "14.0.0",
19
- "dayjs": "^1.11.18",
18
+ "@vueuse/core": "14.1.0",
19
+ "dayjs": "^1.11.19",
20
20
  "mitt": "^3.0.1",
21
21
  "tailwindcss-safe-area-capacitor": "^0.5.1",
22
- "vidstack": "^1.12.13"
22
+ "vidstack": "^1.12.13",
23
+ "vite-plugin-external": "^6.2.2",
24
+ "vite-plugin-monkey": "^7.1.8"
23
25
  },
24
26
  "peerDependencies": {
25
27
  "axios": "^1.12.2",
@@ -33,18 +35,18 @@
33
35
  "vue-router": "4.6.3"
34
36
  },
35
37
  "devDependencies": {
36
- "@tailwindcss/vite": "^4.1.14",
38
+ "@tailwindcss/vite": "^4.1.18",
37
39
  "@types/crypto-js": "^4.2.2",
38
- "@types/node": "^24.8.1",
39
- "@vitejs/plugin-vue": "^6.0.1",
40
- "@vitejs/plugin-vue-jsx": "^5.1.1",
41
- "browserslist": "^4.26.3",
40
+ "@types/node": "^25.0.3",
41
+ "@vitejs/plugin-vue": "^6.0.3",
42
+ "@vitejs/plugin-vue-jsx": "^5.1.2",
43
+ "browserslist": "^4.28.1",
42
44
  "lightningcss": "^1.30.2",
43
- "tailwindcss": "^4.1.14",
45
+ "tailwindcss": "^4.1.18",
44
46
  "unplugin-vue-components": "30.0.0",
45
- "vite": "npm:rolldown-vite@^7.1.20",
47
+ "vite": "npm:rolldown-vite@^7.1.17",
46
48
  "vite-plugin-dts": "^4.5.4",
47
- "vue-component-type-helpers": "^3.1.1"
49
+ "vue-component-type-helpers": "^3.2.1"
48
50
  },
49
51
  "files": [
50
52
  "dist"