@ng-prism/plugin-box-model 21.12.0-beta.1 → 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 +7 -2
- 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 = 'boxModelPlugin';
|
|
4
|
+
const PLUGIN_IMPORT_FROM = '@ng-prism/plugin-box-model';
|
|
5
|
+
const PLUGIN_CALL = 'boxModelPlugin()';
|
|
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-box-model",
|
|
3
|
-
"version": "21.12.0
|
|
3
|
+
"version": "21.12.0",
|
|
4
4
|
"description": "CSS box model inspector for ng-prism.",
|
|
5
|
+
"ng-add": {
|
|
6
|
+
"save": "devDependencies"
|
|
7
|
+
},
|
|
8
|
+
"schematics": "./schematics/collection.json",
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@ng-prism/core",
|
|
7
11
|
"box-model",
|
|
@@ -25,12 +29,13 @@
|
|
|
25
29
|
},
|
|
26
30
|
"files": [
|
|
27
31
|
"dist",
|
|
32
|
+
"schematics",
|
|
28
33
|
"!**/*.tsbuildinfo"
|
|
29
34
|
],
|
|
30
35
|
"peerDependencies": {
|
|
31
36
|
"@angular/core": ">=21.0.0",
|
|
32
37
|
"rxjs": ">=7.0.0",
|
|
33
|
-
"@ng-prism/core": "
|
|
38
|
+
"@ng-prism/core": "^21.12.0-0"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
41
|
"@ng-prism/core": "*"
|
|
@@ -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-box-model 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": "NgPrismPluginBoxModelNgAdd",
|
|
4
|
+
"title": "Add @ng-prism/plugin-box-model",
|
|
5
|
+
"description": "Registers @ng-prism/plugin-box-model 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
|
+
}
|