Skip to content

Commit

Permalink
release: fix stackblitz
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 20, 2024
1 parent 037c455 commit 3442c4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
27 changes: 4 additions & 23 deletions src/app/core/code/code.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,10 @@ export class CodeService {
return `node_modules/@delon/theme/${this.appSrv.theme}.css`;
}

private genPackage({
dependencies = [],
includeCli = false
}: {
dependencies: string[];
includeCli: boolean;
}): Record<string, string | Record<string, string>> {
private genPackage({ includeCli = false }: { includeCli: boolean }): Record<string, string | Record<string, string>> {
const ngCoreVersion = pkg.dependencies['@angular/core'];
// const mainVersion = ngCoreVersion.substring(1).split('.').shift();
const res = packageJSON as Record<string, NzSafeAny>;
[
'ng-zorro-antd',
'ng-antd-color-picker',
'@delon/theme',
'@delon/abc',
'@delon/chart',
'@delon/acl',
'@delon/auth',
'@delon/cache',
'@delon/mock',
'@delon/form',
'@delon/util',
...dependencies
];
if (includeCli) {
res.devDependencies = {
'@angular-devkit/build-angular': '^17.0.0',
Expand All @@ -74,6 +54,7 @@ export class CodeService {
});
});
res.dependencies['@angular/core'] = ngCoreVersion;
console.log(res);

return res;
}
Expand Down Expand Up @@ -136,7 +117,7 @@ export class CodeService {
const res = this.parseCode(appComponentCode);
const json = deepCopy(angularJSON);
json.projects.demo.architect.build.options.styles.splice(0, 0, this.themePath);
const packageJson = this.genPackage({ dependencies: [], includeCli });
const packageJson = this.genPackage({ includeCli });
packageJson.description = title;
const files: Record<string, string> = {
'angular.json': `${JSON.stringify(json, null, 2)}`,
Expand Down Expand Up @@ -188,7 +169,7 @@ export class CodeService {
const mockObj = this.genMock;
const json = deepCopy(angularJSON);
json.projects.demo.architect.build.options.styles.splice(0, 0, this.themePath);
const packageJson = this.genPackage({ dependencies: [], includeCli });
const packageJson = this.genPackage({ includeCli });
// packageJson.name = 'NG-ALAIN';
packageJson.description = title;
const files: {
Expand Down
1 change: 1 addition & 0 deletions src/app/core/code/files/package.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default {
'@delon/mock': '~17.0.3',
'@delon/form': '~17.0.3',
'@delon/util': '~17.0.3',
'ng-zorro-antd': '^17.1.0',
'ng-antd-color-picker': '^0.0.2',
ajv: '^8.12.0',
'ajv-formats': '^2.1.1',
Expand Down

0 comments on commit 3442c4b

Please sign in to comment.