@tmdjr/ngx-editor-js2 20.0.10 → 20.0.12
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 +10 -4
- package/schematics/ng-add/index.ts +21 -11
package/package.json
CHANGED
|
@@ -91,11 +91,17 @@ function ngAdd(options) {
|
|
|
91
91
|
updateAppConfig(tree, blocks, context, sourceRoot);
|
|
92
92
|
addCodeMirrorSetup(tree, blocks, context, sourceRoot);
|
|
93
93
|
if (options.demo) {
|
|
94
|
+
const appPath = `${sourceRoot}/app`;
|
|
95
|
+
if (tree.exists(appPath)) {
|
|
96
|
+
context.logger.warn(`⚠️ Deleting existing app folder at ${appPath}`);
|
|
97
|
+
// Ensure complete removal of the app directory and its content
|
|
98
|
+
tree.delete(appPath);
|
|
99
|
+
}
|
|
94
100
|
rules.push((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/demo'), [
|
|
95
|
-
(0, schematics_1.
|
|
96
|
-
(0, schematics_1.
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
(0, schematics_1.applyTemplates)({}),
|
|
102
|
+
(0, schematics_1.move)(appPath),
|
|
103
|
+
]), schematics_1.MergeStrategy.Overwrite));
|
|
104
|
+
context.logger.info(`🚨 Demo files copied to ${appPath}. Existing app was replaced!`);
|
|
99
105
|
}
|
|
100
106
|
context.logger.info('✅ Installation setup complete.');
|
|
101
107
|
return (0, schematics_1.chain)(rules);
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
SchematicContext,
|
|
9
9
|
Tree,
|
|
10
10
|
url,
|
|
11
|
-
|
|
11
|
+
MergeStrategy,
|
|
12
12
|
} from '@angular-devkit/schematics';
|
|
13
13
|
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
|
14
14
|
import {
|
|
@@ -107,16 +107,26 @@ export function ngAdd(options: any): Rule {
|
|
|
107
107
|
addCodeMirrorSetup(tree, blocks, context, sourceRoot);
|
|
108
108
|
|
|
109
109
|
if (options.demo) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
const appPath = `${sourceRoot}/app`;
|
|
111
|
+
|
|
112
|
+
if (tree.exists(appPath)) {
|
|
113
|
+
context.logger.warn(`⚠️ Deleting existing app folder at ${appPath}`);
|
|
114
|
+
// Ensure complete removal of the app directory and its content
|
|
115
|
+
tree.delete(appPath);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
rules.push(
|
|
119
|
+
mergeWith(
|
|
120
|
+
apply(url('./files/demo'), [
|
|
121
|
+
applyTemplates({}),
|
|
122
|
+
move(appPath),
|
|
123
|
+
]),
|
|
124
|
+
MergeStrategy.Overwrite, // Explicitly overwrite files
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
context.logger.info(`🚨 Demo files copied to ${appPath}. Existing app was replaced!`);
|
|
129
|
+
}
|
|
120
130
|
|
|
121
131
|
context.logger.info('✅ Installation setup complete.');
|
|
122
132
|
return chain(rules);
|