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