@tmdjr/ngx-editor-js2 20.0.8 → 20.0.9
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/package.json +1 -1
- package/schematics/ng-add/index.js +6 -7
- package/schematics/ng-add/index.ts +21 -10
package/package.json
CHANGED
|
@@ -62,6 +62,7 @@ const optionalBlocks = {
|
|
|
62
62
|
};
|
|
63
63
|
function ngAdd(options) {
|
|
64
64
|
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const rules = [];
|
|
65
66
|
const blocks = options.blocks || [];
|
|
66
67
|
blocks.forEach((block) => {
|
|
67
68
|
const { package: pkg, peers } = optionalBlocks[block];
|
|
@@ -90,15 +91,13 @@ function ngAdd(options) {
|
|
|
90
91
|
updateAppConfig(tree, blocks, context, sourceRoot);
|
|
91
92
|
addCodeMirrorSetup(tree, blocks, context, sourceRoot);
|
|
92
93
|
if (options.demo) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
(0, schematics_1.move)('src/app'), // adjust this path if needed
|
|
98
|
-
]))(tree, context);
|
|
94
|
+
rules.push((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/demo'), [
|
|
95
|
+
(0, schematics_1.applyTemplates)({}), // Pass in vars if you want
|
|
96
|
+
(0, schematics_1.move)('src/app'),
|
|
97
|
+
])));
|
|
99
98
|
}
|
|
100
99
|
context.logger.info('✅ Installation setup complete.');
|
|
101
|
-
return
|
|
100
|
+
return (0, schematics_1.chain)(rules);
|
|
102
101
|
});
|
|
103
102
|
}
|
|
104
103
|
function updateStylesScss(tree, blocks, context, sourceRoot) {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
apply,
|
|
3
|
+
applyTemplates,
|
|
4
|
+
mergeWith,
|
|
5
|
+
move,
|
|
6
|
+
Rule,
|
|
7
|
+
chain,
|
|
8
|
+
SchematicContext,
|
|
9
|
+
Tree,
|
|
10
|
+
url,
|
|
11
|
+
} from '@angular-devkit/schematics';
|
|
2
12
|
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
|
3
13
|
import {
|
|
4
14
|
addPackageJsonDependency,
|
|
@@ -63,6 +73,7 @@ const optionalBlocks: Record<
|
|
|
63
73
|
|
|
64
74
|
export function ngAdd(options: any): Rule {
|
|
65
75
|
return async (tree: Tree, context: SchematicContext) => {
|
|
76
|
+
const rules: Rule[] = [];
|
|
66
77
|
const blocks: string[] = options.blocks || [];
|
|
67
78
|
|
|
68
79
|
blocks.forEach((block) => {
|
|
@@ -95,18 +106,18 @@ export function ngAdd(options: any): Rule {
|
|
|
95
106
|
addCodeMirrorSetup(tree, blocks, context, sourceRoot);
|
|
96
107
|
|
|
97
108
|
if (options.demo) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
)
|
|
109
|
+
rules.push(
|
|
110
|
+
mergeWith(
|
|
111
|
+
apply(url('./files/demo'), [
|
|
112
|
+
applyTemplates({}), // Pass in vars if you want
|
|
113
|
+
move('src/app'),
|
|
114
|
+
])
|
|
115
|
+
)
|
|
116
|
+
);
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
context.logger.info('✅ Installation setup complete.');
|
|
109
|
-
return
|
|
120
|
+
return chain(rules);
|
|
110
121
|
};
|
|
111
122
|
}
|
|
112
123
|
|