delta-comic-core 0.2.0 → 0.2.2

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:{ds:e.displayName,default:e.name},version:e.version,author:e.author,description:e.description,require:[`core`,...e.require??[]]},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
+ 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;
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 /** @default ['core'] */ require?: string[]\r\n /** @default 'src/main.ts' */ entry?: string\r\n}, command: \"build\" | \"serve\") => ({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n ds: config.displayName,\r\n default: config.name\r\n },\r\n version: config.version,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])],\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\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,EAQhC,KAAgC,CACjC,MAAO,EAAO,OAAS,cACvB,WAAY,CACV,KAAM,CACJ,GAAI,EAAO,YACX,QAAS,EAAO,KACjB,CACD,QAAS,EAAO,QAChB,OAAQ,EAAO,OACf,YAAa,EAAO,YACpB,QAAS,CAAC,OAAQ,GAAI,EAAO,SAAW,EAAE,CAAE,CAC7C,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,EAEY,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":["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"}
package/dist/bundle2.js CHANGED
@@ -2,13 +2,13 @@ const createMonkeyConfig = (e, t) => ({
2
2
  entry: e.entry ?? "src/main.ts",
3
3
  userscript: {
4
4
  name: {
5
- ds: e.displayName,
6
- default: e.name
5
+ display: e.displayName,
6
+ id: e.name
7
7
  },
8
- version: e.version,
8
+ version: `${e.version}/${e.supportCoreVersion}`,
9
9
  author: e.author,
10
10
  description: e.description,
11
- require: ["core", ...e.require ?? []]
11
+ require: ["core", ...e.require ?? []].map((e) => typeof e == "string" ? `${e}:` : `${e.id}:${e.download ?? ""}`)
12
12
  },
13
13
  build: { externalGlobals: t == "serve" ? {} : {
14
14
  vue: "window.$$lib$$.Vue",
@@ -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 /** @default ['core'] */ require?: string[]\r\n /** @default 'src/main.ts' */ entry?: string\r\n}, command: \"build\" | \"serve\") => ({\r\n entry: config.entry ?? 'src/main.ts',\r\n userscript: {\r\n name: {\r\n ds: config.displayName,\r\n default: config.name\r\n },\r\n version: config.version,\r\n author: config.author,\r\n description: config.description,\r\n require: ['core', ...(config.require ?? [])],\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\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,GAQhC,OAAgC;CACjC,OAAO,EAAO,SAAS;CACvB,YAAY;EACV,MAAM;GACJ,IAAI,EAAO;GACX,SAAS,EAAO;GACjB;EACD,SAAS,EAAO;EAChB,QAAQ,EAAO;EACf,aAAa,EAAO;EACpB,SAAS,CAAC,QAAQ,GAAI,EAAO,WAAW,EAAE,CAAE;EAC7C;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,GAEY,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":["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"}
@@ -2305,3 +2305,4 @@ export declare const Store: {
2305
2305
  export * from './plugin/index';
2306
2306
  export * from './depends';
2307
2307
  export * from './plugin/define.ts';
2308
+ export declare const version: string;
@@ -4,3 +4,28 @@ export declare const definePlugin: (config: PluginConfig | ((safe: boolean) => P
4
4
  plugin: string;
5
5
  result: void;
6
6
  }[] | undefined;
7
+ export interface RawPluginMeta {
8
+ 'name:display': string;
9
+ 'name:id': string;
10
+ version: string;
11
+ author: string | undefined;
12
+ description: string;
13
+ require?: string[] | string;
14
+ }
15
+ export interface PluginMeta {
16
+ name: {
17
+ display: string;
18
+ id: string;
19
+ };
20
+ version: {
21
+ plugin: string;
22
+ supportCore: string;
23
+ };
24
+ author: string;
25
+ description: string;
26
+ require: {
27
+ id: string;
28
+ download?: string | undefined;
29
+ }[];
30
+ }
31
+ export declare const decodePluginMeta: (v: RawPluginMeta) => PluginMeta;
@@ -19,7 +19,7 @@ export declare class SourcedValue<T extends [string, string]> {
19
19
  stringify(value: T): string;
20
20
  constructor(separator?: string);
21
21
  }
22
- export type SourcedKeyType<T extends SourcedKeyMap<any, any>> = Parameters<T['get']>[0];
22
+ export type SourcedKeyType<T extends SourcedKeyMap<[string, string], any> | SourcedValue<any>> = T extends SourcedKeyMap<[string, string], any> ? Parameters<T['get']>[0] : Parameters<T['toJSON']>[0];
23
23
  /**
24
24
  * 相比较于普通的Map,这个元素的key操作可以是`TKey | string`
25
25
  * _但内部保存仍使用`SourcedValue.toString`作为key_
@@ -12,7 +12,7 @@ export type SharedFunctions = {
12
12
  addPlugin(ins: PluginConfig): void;
13
13
  addRecent(item: uni.item.Item): PromiseLike<any>;
14
14
  routeToContent(contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.content.PreloadValue): PromiseLike<any>;
15
- routeToSearch(input: string, source?: string, sort?: string): PromiseLike<any>;
15
+ routeToSearch(input: string, source?: [plugin: string, name: string], sort?: string): PromiseLike<any>;
16
16
  addAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
17
17
  removeAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
18
18
  getIsAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<boolean>;
package/dist/pack.tgz CHANGED
Binary file
@@ -4,7 +4,14 @@ export declare const createMonkeyConfig: (config: {
4
4
  version: string;
5
5
  author?: string;
6
6
  description: string;
7
- /** @default ['core'] */ require?: string[];
8
- /** @default 'src/main.ts' */ entry?: string;
7
+ /** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定 */
8
+ supportCoreVersion: string;
9
+ /** @default ['core'] */
10
+ require?: ({
11
+ id: string;
12
+ download?: string;
13
+ } | string)[];
14
+ /** @default 'src/main.ts' */
15
+ entry?: string;
9
16
  }, command: "build" | "serve") => any;
10
17
  export declare const createExternalConfig: (command: "build" | "serve") => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delta-comic-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "我曾亲眼见证神的熟视无睹.",
5
5
  "homepage": "https://github.com/wenxig/delta-comic-core",
6
6
  "repository": {