|
1 | 1 | import { AngularUtilities, NavElementTypes } from '../../../angular'; |
2 | | -import { ANGULAR_JSON_FILE_NAME, APPS_DIRECTORY_NAME, BASE_TS_CONFIG_FILE_NAME, DOCKER_FILE_NAME, GIT_IGNORE_FILE_NAME } from '../../../constants'; |
| 2 | +import { ANGULAR_APP_COMPONENT_FILE_NAME, ANGULAR_JSON_FILE_NAME, APPS_DIRECTORY_NAME, BASE_TS_CONFIG_FILE_NAME, DOCKER_FILE_NAME, GIT_IGNORE_FILE_NAME } from '../../../constants'; |
3 | 3 | import { DockerUtilities } from '../../../docker'; |
4 | 4 | import { FsUtilities, JsonUtilities, QuestionsFor } from '../../../encapsulation'; |
5 | 5 | import { DefaultEnvKeys, EnvUtilities } from '../../../env'; |
@@ -82,7 +82,7 @@ export class AddAngularWebsiteCommand extends BaseAddCommand<AddAngularWebsiteCo |
82 | 82 |
|
83 | 83 | await AngularUtilities.addSitemapAndRobots(root, config.name, domain); |
84 | 84 |
|
85 | | - await this.cleanUp(root); |
| 85 | + await this.cleanUp(root, config.name); |
86 | 86 | await this.setupTsConfig(root, config.name); |
87 | 87 | await this.createDockerfile(root, config); |
88 | 88 | await AngularUtilities.setupNavigation(root, config.name); |
@@ -222,9 +222,19 @@ export class AddAngularWebsiteCommand extends BaseAddCommand<AddAngularWebsiteCo |
222 | 222 | await FsUtilities.createFile(getPath(root, 'tsconfig.eslint.json'), JsonUtilities.stringify(eslintTsconfig)); |
223 | 223 | } |
224 | 224 |
|
225 | | - private async cleanUp(root: string): Promise<void> { |
| 225 | + private async cleanUp(root: string, name: string): Promise<void> { |
226 | 226 | // eslint-disable-next-line no-console |
227 | 227 | console.log('cleans up'); |
| 228 | + await FsUtilities.replaceInFile( |
| 229 | + getPath(root, 'src', 'app', ANGULAR_APP_COMPONENT_FILE_NAME), |
| 230 | + `protected readonly title = signal('${name}');`, |
| 231 | + ' constructor() {}' |
| 232 | + ); |
| 233 | + await FsUtilities.replaceInFile( |
| 234 | + getPath(root, 'src', 'app', ANGULAR_APP_COMPONENT_FILE_NAME), |
| 235 | + 'Component, signal', |
| 236 | + 'Component' |
| 237 | + ); |
228 | 238 | await FsUtilities.rm(getPath(root, '.vscode')); |
229 | 239 | await FsUtilities.rm(getPath(root, '.editorconfig')); |
230 | 240 | await FsUtilities.rm(getPath(root, GIT_IGNORE_FILE_NAME)); |
|
0 commit comments