@ng-prism/plugin-perf 21.12.0-beta.2 → 21.12.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/schematics/ng-add/index.d.ts +4 -0
- package/dist/schematics/ng-add/index.d.ts.map +1 -0
- package/dist/schematics/ng-add/index.js +25 -0
- package/dist/schematics/ng-add/schema.d.ts +4 -0
- package/dist/schematics/ng-add/schema.d.ts.map +1 -0
- package/dist/schematics/ng-add/schema.js +1 -0
- package/package.json +6 -1
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/schema.json +16 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAGV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyBtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { addPluginToConfig } from '@ng-prism/core/schematics/utils';
|
|
3
|
+
const PLUGIN_IMPORT_NAME = 'perfPlugin';
|
|
4
|
+
const PLUGIN_IMPORT_FROM = '@ng-prism/plugin-perf';
|
|
5
|
+
const PLUGIN_CALL = 'perfPlugin()';
|
|
6
|
+
function injectPlugin(options) {
|
|
7
|
+
return (tree, context) => {
|
|
8
|
+
const configPath = options.configPath ?? 'ng-prism.config.ts';
|
|
9
|
+
const changed = addPluginToConfig(tree, configPath, {
|
|
10
|
+
importName: PLUGIN_IMPORT_NAME,
|
|
11
|
+
importFrom: PLUGIN_IMPORT_FROM,
|
|
12
|
+
call: PLUGIN_CALL,
|
|
13
|
+
});
|
|
14
|
+
if (changed) {
|
|
15
|
+
context.logger.info(` ${PLUGIN_IMPORT_FROM} → added to ${configPath}`);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
context.logger.info(` ${PLUGIN_IMPORT_FROM} already configured — skipped`);
|
|
19
|
+
}
|
|
20
|
+
return tree;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function ngAdd(options) {
|
|
24
|
+
return chain([injectPlugin(options)]);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-prism/plugin-perf",
|
|
3
|
-
"version": "21.12.0
|
|
3
|
+
"version": "21.12.0",
|
|
4
4
|
"description": "Performance profiling panel for ng-prism — bundle size, render time, memory footprint.",
|
|
5
|
+
"ng-add": {
|
|
6
|
+
"save": "devDependencies"
|
|
7
|
+
},
|
|
8
|
+
"schematics": "./schematics/collection.json",
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@ng-prism/core",
|
|
7
11
|
"performance",
|
|
@@ -26,6 +30,7 @@
|
|
|
26
30
|
},
|
|
27
31
|
"files": [
|
|
28
32
|
"dist",
|
|
33
|
+
"schematics",
|
|
29
34
|
"!**/*.tsbuildinfo"
|
|
30
35
|
],
|
|
31
36
|
"peerDependencies": {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Adds @ng-prism/plugin-perf to the ng-prism config",
|
|
6
|
+
"factory": "../dist/schematics/ng-add/index#ngAdd",
|
|
7
|
+
"schema": "./ng-add/schema.json"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "NgPrismPluginPerfNgAdd",
|
|
4
|
+
"title": "Add @ng-prism/plugin-perf",
|
|
5
|
+
"description": "Registers @ng-prism/plugin-perf in ng-prism.config.ts",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"configPath": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Path to ng-prism.config.ts",
|
|
11
|
+
"default": "ng-prism.config.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": [],
|
|
15
|
+
"additionalProperties": false
|
|
16
|
+
}
|