@webiny/plugins 0.0.0-unstable.aad28a72ae → 0.0.0-unstable.acacc54f0e
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/Plugin.js +0 -7
- package/Plugin.js.map +1 -1
- package/PluginsContainer.d.ts +2 -0
- package/PluginsContainer.js +25 -33
- package/PluginsContainer.js.map +1 -1
- package/index.js +0 -3
- package/index.js.map +1 -1
- package/package.json +10 -10
- package/types.js +0 -1
- package/types.js.map +1 -1
package/Plugin.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Plugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
class Plugin {
|
|
13
10
|
constructor() {
|
|
14
11
|
(0, _defineProperty2.default)(this, "name", void 0);
|
|
15
|
-
|
|
16
12
|
if (!this.constructor.type) {
|
|
17
13
|
throw Error(`Missing "type" definition in "${this.constructor.name}"!`);
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
get type() {
|
|
22
17
|
return this.constructor.type;
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
}
|
|
26
|
-
|
|
27
20
|
exports.Plugin = Plugin;
|
|
28
21
|
(0, _defineProperty2.default)(Plugin, "type", void 0);
|
package/Plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","constructor","type","Error","name"],"sources":["Plugin.ts"],"sourcesContent":["export abstract class Plugin {\n public static readonly type: string;\n public name?: string;\n\n constructor() {\n if (!(this.constructor as typeof Plugin).type) {\n throw Error(`Missing \"type\" definition in \"${this.constructor.name}\"!`);\n }\n }\n\n get type() {\n return (this.constructor as typeof Plugin).type;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Plugin","constructor","_defineProperty2","default","type","Error","name","exports"],"sources":["Plugin.ts"],"sourcesContent":["export abstract class Plugin {\n public static readonly type: string;\n public name?: string;\n\n constructor() {\n if (!(this.constructor as typeof Plugin).type) {\n throw Error(`Missing \"type\" definition in \"${this.constructor.name}\"!`);\n }\n }\n\n get type() {\n return (this.constructor as typeof Plugin).type;\n }\n}\n"],"mappings":";;;;;;;;AAAO,MAAeA,MAAM,CAAC;EAIzBC,WAAWA,CAAA,EAAG;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACV,IAAI,CAAE,IAAI,CAACF,WAAW,CAAmBG,IAAI,EAAE;MAC3C,MAAMC,KAAK,CAAE,iCAAgC,IAAI,CAACJ,WAAW,CAACK,IAAK,IAAG,CAAC;IAC3E;EACJ;EAEA,IAAIF,IAAIA,CAAA,EAAG;IACP,OAAQ,IAAI,CAACH,WAAW,CAAmBG,IAAI;EACnD;AACJ;AAACG,OAAA,CAAAP,MAAA,GAAAA,MAAA;AAAA,IAAAE,gBAAA,CAAAC,OAAA,EAbqBH,MAAM"}
|
package/PluginsContainer.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class PluginsContainer {
|
|
|
7
7
|
byType<T extends Plugin>(type: T["type"]): T[];
|
|
8
8
|
atLeastOneByType<T extends Plugin>(type: T["type"]): T[];
|
|
9
9
|
oneByType<T extends Plugin>(type: T["type"]): T;
|
|
10
|
+
merge(input: PluginsContainer | PluginCollection): void;
|
|
11
|
+
mergeByType(container: PluginsContainer, type: string): void;
|
|
10
12
|
all<T extends Plugin>(): T[];
|
|
11
13
|
register(...args: any): void;
|
|
12
14
|
unregister(name: string): void;
|
package/PluginsContainer.js
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PluginsContainer = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _uniqid = _interopRequireDefault(require("uniqid"));
|
|
13
|
-
|
|
14
10
|
const isOptionsObject = item => item && !Array.isArray(item) && !item.type && !item.name;
|
|
15
|
-
|
|
16
11
|
const normalizeArgs = args => {
|
|
17
|
-
let options = {};
|
|
12
|
+
let options = {};
|
|
18
13
|
|
|
14
|
+
// Check if last item in the plugins array is actually an options object.
|
|
19
15
|
if (isOptionsObject(args[args.length - 1])) {
|
|
20
16
|
[options] = args.splice(-1, 1);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
return [args, options];
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
const assign = (plugins, options, target) => {
|
|
27
|
-
for (
|
|
28
|
-
const plugin = plugins[i];
|
|
29
|
-
|
|
21
|
+
for (const plugin of plugins) {
|
|
30
22
|
if (Array.isArray(plugin)) {
|
|
31
23
|
assign(plugin, options, target);
|
|
32
24
|
continue;
|
|
33
25
|
}
|
|
34
|
-
|
|
26
|
+
if (typeof plugin !== "object") {
|
|
27
|
+
throw new Error(`Could not register plugin. Expected an object, but got ${typeof plugin}.`);
|
|
28
|
+
}
|
|
29
|
+
if (!plugin.type) {
|
|
30
|
+
let name = "";
|
|
31
|
+
if (plugin.name) {
|
|
32
|
+
name = ` "${plugin.name}"`;
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Could not register plugin${name}. Missing "type" definition.`);
|
|
35
|
+
}
|
|
35
36
|
let name = plugin._name || plugin.name;
|
|
36
|
-
|
|
37
37
|
if (!name) {
|
|
38
38
|
plugin.name = name = (0, _uniqid.default)(plugin.type + "-");
|
|
39
|
-
}
|
|
40
|
-
|
|
39
|
+
}
|
|
41
40
|
|
|
41
|
+
// If skip existing was set to true, and a plugin with the same name was already registered, skip registration.
|
|
42
42
|
if (!options.skipExisting || !target[name]) {
|
|
43
43
|
target[name] = plugin;
|
|
44
44
|
plugin.init && plugin.init();
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
|
|
49
48
|
class PluginsContainer {
|
|
50
49
|
constructor(...args) {
|
|
51
50
|
(0, _defineProperty2.default)(this, "plugins", {});
|
|
52
51
|
(0, _defineProperty2.default)(this, "_byTypeCache", {});
|
|
53
52
|
this.register(...args);
|
|
54
53
|
}
|
|
55
|
-
|
|
56
54
|
byName(name) {
|
|
57
55
|
if (!name) {
|
|
58
56
|
return null;
|
|
@@ -60,62 +58,56 @@ class PluginsContainer {
|
|
|
60
58
|
/**
|
|
61
59
|
* We can safely cast name as string, we know it is so.
|
|
62
60
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
61
|
return this.plugins[name];
|
|
66
62
|
}
|
|
67
|
-
|
|
68
63
|
byType(type) {
|
|
69
64
|
if (this._byTypeCache[type]) {
|
|
70
65
|
return Array.from(this._byTypeCache[type]);
|
|
71
66
|
}
|
|
72
|
-
|
|
73
67
|
const plugins = this.findByType(type);
|
|
74
68
|
this._byTypeCache[type] = plugins;
|
|
75
69
|
return Array.from(plugins);
|
|
76
70
|
}
|
|
77
|
-
|
|
78
71
|
atLeastOneByType(type) {
|
|
79
72
|
const list = this.byType(type);
|
|
80
|
-
|
|
81
73
|
if (list.length === 0) {
|
|
82
74
|
throw new Error(`There are no plugins by type "${type}".`);
|
|
83
75
|
}
|
|
84
|
-
|
|
85
76
|
return list;
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
oneByType(type) {
|
|
89
79
|
const list = this.atLeastOneByType(type);
|
|
90
|
-
|
|
91
80
|
if (list.length > 1) {
|
|
92
81
|
throw new Error(`There is a requirement for plugin of type "${type}" to be only one registered.`);
|
|
93
82
|
}
|
|
94
|
-
|
|
95
83
|
return list[0];
|
|
96
84
|
}
|
|
97
|
-
|
|
85
|
+
merge(input) {
|
|
86
|
+
if (input instanceof PluginsContainer) {
|
|
87
|
+
this.register(...input.all());
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.register(input);
|
|
91
|
+
}
|
|
92
|
+
mergeByType(container, type) {
|
|
93
|
+
this.register(...container.byType(type));
|
|
94
|
+
}
|
|
98
95
|
all() {
|
|
99
96
|
return Object.values(this.plugins);
|
|
100
97
|
}
|
|
101
|
-
|
|
102
98
|
register(...args) {
|
|
103
99
|
// reset the cache when adding new plugins
|
|
104
100
|
this._byTypeCache = {};
|
|
105
101
|
const [plugins, options] = normalizeArgs(args);
|
|
106
102
|
assign(plugins, options, this.plugins);
|
|
107
103
|
}
|
|
108
|
-
|
|
109
104
|
unregister(name) {
|
|
110
105
|
// reset the cache when removing a plugin
|
|
111
106
|
this._byTypeCache = {};
|
|
112
107
|
delete this.plugins[name];
|
|
113
108
|
}
|
|
114
|
-
|
|
115
109
|
findByType(type) {
|
|
116
110
|
return Object.values(this.plugins).filter(pl => pl.type === type);
|
|
117
111
|
}
|
|
118
|
-
|
|
119
112
|
}
|
|
120
|
-
|
|
121
113
|
exports.PluginsContainer = PluginsContainer;
|
package/PluginsContainer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isOptionsObject","item","Array","isArray","type","name","normalizeArgs","args","options","length","splice","assign","plugins","target","
|
|
1
|
+
{"version":3,"names":["_uniqid","_interopRequireDefault","require","isOptionsObject","item","Array","isArray","type","name","normalizeArgs","args","options","length","splice","assign","plugins","target","plugin","Error","_name","uniqid","skipExisting","init","PluginsContainer","constructor","_defineProperty2","default","register","byName","byType","_byTypeCache","from","findByType","atLeastOneByType","list","oneByType","merge","input","all","mergeByType","container","Object","values","unregister","filter","pl","exports"],"sources":["PluginsContainer.ts"],"sourcesContent":["import { Plugin, PluginCollection } from \"./types\";\nimport uniqid from \"uniqid\";\n\nconst isOptionsObject = (item?: any) => item && !Array.isArray(item) && !item.type && !item.name;\nconst normalizeArgs = (args: any[]): [Plugin[], any] => {\n let options = {};\n\n // Check if last item in the plugins array is actually an options object.\n if (isOptionsObject(args[args.length - 1])) {\n [options] = args.splice(-1, 1);\n }\n\n return [args, options];\n};\n\nconst assign = (\n plugins: Plugin[] | Plugin[][],\n options: any,\n target: Record<string, any>\n): void => {\n for (const plugin of plugins) {\n if (Array.isArray(plugin)) {\n assign(plugin, options, target);\n continue;\n }\n\n if (typeof plugin !== \"object\") {\n throw new Error(\n `Could not register plugin. Expected an object, but got ${typeof plugin}.`\n );\n }\n\n if (!plugin.type) {\n let name = \"\";\n if (plugin.name) {\n name = ` \"${plugin.name}\"`;\n }\n throw new Error(`Could not register plugin${name}. Missing \"type\" definition.`);\n }\n\n let name = plugin._name || plugin.name;\n if (!name) {\n plugin.name = name = uniqid(plugin.type + \"-\");\n }\n\n // If skip existing was set to true, and a plugin with the same name was already registered, skip registration.\n if (!options.skipExisting || !target[name]) {\n target[name] = plugin;\n plugin.init && plugin.init();\n }\n }\n};\n\nexport class PluginsContainer {\n private plugins: Record<string, Plugin> = {};\n private _byTypeCache: Record<string, Plugin[]> = {};\n\n constructor(...args: PluginCollection) {\n this.register(...args);\n }\n\n public byName<T extends Plugin>(name: T[\"name\"]): T | null {\n if (!name) {\n return null;\n }\n /**\n * We can safely cast name as string, we know it is so.\n */\n return this.plugins[name as string] as T;\n }\n\n public byType<T extends Plugin>(type: T[\"type\"]): T[] {\n if (this._byTypeCache[type]) {\n return Array.from(this._byTypeCache[type]) as T[];\n }\n const plugins = this.findByType<T>(type);\n this._byTypeCache[type] = plugins;\n return Array.from(plugins);\n }\n\n public atLeastOneByType<T extends Plugin>(type: T[\"type\"]): T[] {\n const list = this.byType<T>(type);\n if (list.length === 0) {\n throw new Error(`There are no plugins by type \"${type}\".`);\n }\n return list;\n }\n\n public oneByType<T extends Plugin>(type: T[\"type\"]): T {\n const list = this.atLeastOneByType<T>(type);\n if (list.length > 1) {\n throw new Error(\n `There is a requirement for plugin of type \"${type}\" to be only one registered.`\n );\n }\n return list[0];\n }\n\n public merge(input: PluginsContainer | PluginCollection): void {\n if (input instanceof PluginsContainer) {\n this.register(...input.all());\n return;\n }\n this.register(input);\n }\n\n public mergeByType(container: PluginsContainer, type: string): void {\n this.register(...container.byType(type));\n }\n\n public all<T extends Plugin>(): T[] {\n return Object.values(this.plugins) as T[];\n }\n\n public register(...args: any): void {\n // reset the cache when adding new plugins\n this._byTypeCache = {};\n const [plugins, options] = normalizeArgs(args);\n assign(plugins, options, this.plugins);\n }\n\n public unregister(name: string): void {\n // reset the cache when removing a plugin\n this._byTypeCache = {};\n delete this.plugins[name];\n }\n\n private findByType<T extends Plugin>(type: T[\"type\"]): T[] {\n return Object.values(this.plugins).filter((pl): pl is T => pl.type === type) as T[];\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,eAAe,GAAIC,IAAU,IAAKA,IAAI,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,IAAI,CAACA,IAAI,CAACG,IAAI,IAAI,CAACH,IAAI,CAACI,IAAI;AAChG,MAAMC,aAAa,GAAIC,IAAW,IAAsB;EACpD,IAAIC,OAAO,GAAG,CAAC,CAAC;;EAEhB;EACA,IAAIR,eAAe,CAACO,IAAI,CAACA,IAAI,CAACE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE;IACxC,CAACD,OAAO,CAAC,GAAGD,IAAI,CAACG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;EAClC;EAEA,OAAO,CAACH,IAAI,EAAEC,OAAO,CAAC;AAC1B,CAAC;AAED,MAAMG,MAAM,GAAGA,CACXC,OAA8B,EAC9BJ,OAAY,EACZK,MAA2B,KACpB;EACP,KAAK,MAAMC,MAAM,IAAIF,OAAO,EAAE;IAC1B,IAAIV,KAAK,CAACC,OAAO,CA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AAC,CAAC;EAC5C;EAEO+B,GAAGA,CAAA,EAA0B;IAChC,OAAOG,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC3B,OAAO,CAAC;EACtC;EAEOY,QAAQA,CAAC,GAAGjB,IAAS,EAAQ;IAChC;IACA,IAAI,CAACoB,YAAY,GAAG,CAAC,CAAC;IACtB,MAAM,CAACf,OAAO,EAAEJ,OAAO,CAAC,GAAGF,aAAa,CAACC,IAAI,CAAC;IAC9CI,MAAM,CAACC,OAAO,EAAEJ,OAAO,EAAE,IAAI,CAACI,OAAO,CAAC;EAC1C;EAEO4B,UAAUA,CAACnC,IAAY,EAAQ;IAClC;IACA,IAAI,CAACsB,YAAY,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAACf,OAAO,CAACP,IAAI,CAAC;EAC7B;EAEQwB,UAAUA,CAAmBzB,IAAe,EAAO;IACvD,OAAOkC,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC3B,OAAO,CAAC,CAAC6B,MAAM,CAAEC,EAAE,IAAcA,EAAE,CAACtC,IAAI,KAAKA,IAAI,CAAC;EAChF;AACJ;AAACuC,OAAA,CAAAvB,gBAAA,GAAAA,gBAAA"}
|
package/index.js
CHANGED
|
@@ -16,10 +16,7 @@ Object.defineProperty(exports, "PluginsContainer", {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
exports.plugins = void 0;
|
|
19
|
-
|
|
20
19
|
var _PluginsContainer = require("./PluginsContainer");
|
|
21
|
-
|
|
22
20
|
var _Plugin = require("./Plugin");
|
|
23
|
-
|
|
24
21
|
const plugins = new _PluginsContainer.PluginsContainer();
|
|
25
22
|
exports.plugins = plugins;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["plugins","PluginsContainer"],"sources":["index.ts"],"sourcesContent":["import { PluginsContainer } from \"./PluginsContainer\";\nimport { Plugin } from \"./Plugin\";\n\nconst plugins = new PluginsContainer();\n\nexport { Plugin, PluginsContainer, plugins };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_PluginsContainer","require","_Plugin","plugins","PluginsContainer","exports"],"sources":["index.ts"],"sourcesContent":["import { PluginsContainer } from \"./PluginsContainer\";\nimport { Plugin } from \"./Plugin\";\n\nconst plugins = new PluginsContainer();\n\nexport { Plugin, PluginsContainer, plugins };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,OAAO,GAAG,IAAIC,kCAAgB,CAAC,CAAC;AAACC,OAAA,CAAAF,OAAA,GAAAA,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/plugins",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.acacc54f0e",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@babel/runtime": "7.
|
|
16
|
+
"@babel/runtime": "7.22.6",
|
|
17
17
|
"uniqid": "5.4.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@babel/cli": "
|
|
21
|
-
"@babel/core": "
|
|
22
|
-
"@types/uniqid": "
|
|
23
|
-
"@webiny/cli": "
|
|
24
|
-
"@webiny/project-utils": "
|
|
25
|
-
"rimraf": "
|
|
26
|
-
"ttypescript": "
|
|
20
|
+
"@babel/cli": "7.22.6",
|
|
21
|
+
"@babel/core": "7.22.8",
|
|
22
|
+
"@types/uniqid": "5.3.2",
|
|
23
|
+
"@webiny/cli": "0.0.0-unstable.acacc54f0e",
|
|
24
|
+
"@webiny/project-utils": "0.0.0-unstable.acacc54f0e",
|
|
25
|
+
"rimraf": "3.0.2",
|
|
26
|
+
"ttypescript": "1.5.15",
|
|
27
27
|
"typescript": "4.7.4"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"build": "yarn webiny run build",
|
|
35
35
|
"watch": "yarn webiny run watch"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "acacc54f0e1216fdb3e384b6a7e3d7c201d021d7"
|
|
38
38
|
}
|
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export { PluginsContainer } from \"./PluginsContainer\";\n\nexport type Plugin<T = Record<string, any>> = {\n type: string;\n name?: string;\n init?: () => void;\n [key: string]: any;\n} & T;\n\nexport type PluginCollection = (Plugin | PluginCollection)[];\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_PluginsContainer","require"],"sources":["types.ts"],"sourcesContent":["export { PluginsContainer } from \"./PluginsContainer\";\n\nexport type Plugin<T = Record<string, any>> = {\n type: string;\n name?: string;\n init?: () => void;\n [key: string]: any;\n} & T;\n\nexport type PluginCollection = (Plugin | PluginCollection)[];\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA"}
|