@tmdjr/ngx-editor-js2 20.0.10 → 20.0.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmdjr/ngx-editor-js2",
3
- "version": "20.0.10",
3
+ "version": "20.0.11",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "^20.0.4",
@@ -91,11 +91,19 @@ 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
+ // Recursively delete everything under src/app
98
+ tree.getDir(appPath).visit(filePath => {
99
+ tree.delete(filePath);
100
+ });
101
+ }
94
102
  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'),
103
+ (0, schematics_1.applyTemplates)({}),
104
+ (0, schematics_1.move)(appPath),
98
105
  ])));
106
+ context.logger.info(`🚨 Demo files copied to ${appPath}. Existing app was replaced!`);
99
107
  }
100
108
  context.logger.info('✅ Installation setup complete.');
101
109
  return (0, schematics_1.chain)(rules);
@@ -107,15 +107,23 @@ export function ngAdd(options: any): Rule {
107
107
  addCodeMirrorSetup(tree, blocks, context, sourceRoot);
108
108
 
109
109
  if (options.demo) {
110
+ const appPath = `${sourceRoot}/app`;
111
+ if (tree.exists(appPath)) {
112
+ context.logger.warn(`⚠️ Deleting existing app folder at ${appPath}`);
113
+ // Recursively delete everything under src/app
114
+ tree.getDir(appPath).visit(filePath => {
115
+ tree.delete(filePath);
116
+ });
117
+ }
110
118
  rules.push(
111
119
  mergeWith(
112
120
  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'),
121
+ applyTemplates({}),
122
+ move(appPath),
116
123
  ])
117
124
  )
118
125
  );
126
+ context.logger.info(`🚨 Demo files copied to ${appPath}. Existing app was replaced!`);
119
127
  }
120
128
 
121
129
  context.logger.info('✅ Installation setup complete.');