Skip to content

Commit

Permalink
release: try release
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Dec 8, 2023
1 parent 0965d88 commit 6681791
Show file tree
Hide file tree
Showing 8 changed files with 8,094 additions and 355 deletions.
82 changes: 14 additions & 68 deletions src/app/core/code/code.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,22 @@ import type { NzSafeAny } from 'ng-zorro-antd/core/types';

import angularJSON from './files/angular.json';
import appConfigTS from './files/app.config';
import delonABCModuleTS from './files/delon-abc.module';
import delonChartModuleTS from './files/delon-chart.module';
import environmentTS from './files/environment';
import mainTS from './files/main';
import mockUser from './files/mock-user';
import nzZorroAntdModuleTS from './files/ng-zorro-antd.module';
import packageJSON from './files/package.json';
import readme from './files/readme-cli';
import sandboxConfigJSON from './files/sandbox';
import startupServiceTS from './files/startup.service';
import tsconfigJSON from './files/tsconfig.json';
import yarnLock from './files/yarn.lock';
import pkg from '../../../../package.json';
import { AppService } from '../app.service';

@Injectable({ providedIn: 'root' })
export class CodeService {
private document: Document;

// private get dependencies(): { [key: string]: string } {
// const res: { [key: string]: string } = {};
// [
// '@angular/animations',
// '@angular/compiler',
// '@angular/common',
// '@angular/core',
// '@angular/forms',
// '@angular/platform-browser',
// '@angular/platform-browser-dynamic',
// '@angular/router',
// '@ant-design/icons-angular',
// '[email protected]',
// 'rxjs',
// 'tslib',
// 'zone.js',
// 'date-fns',
// `@angular/cdk@^${MAX_MAIN_VERSION}.x`,
// 'ng-zorro-antd',
// '@delon/theme',
// '@delon/abc',
// '@delon/chart',
// '@delon/acl',
// '@delon/auth',
// '@delon/cache',
// '@delon/mock',
// '@delon/form',
// '@delon/util',
// 'ajv',
// 'ajv-formats'
// ].forEach(key => {
// const includeVersion = key.lastIndexOf(`@`);
// if (includeVersion > 1) {
// res[key.substring(0, includeVersion)] = key.substring(includeVersion + 1);
// return;
// }
// const version = key.startsWith('@delon')
// ? `~${pkg.version}`
// : (
// (pkg.dependencies || pkg.devDependencies) as {
// [key: string]: string;
// }
// )[key];
// res[key] = version || '*';
// });
// return res;
// }

private get themePath(): string {
return `node_modules/@delon/theme/${this.appSrv.theme}.css`;
}
Expand Down Expand Up @@ -132,7 +82,6 @@ export class CodeService {
});
// res.dependencies['core-js'] = `~3.8.3`;
if (!includeCli) res;
console.log(res);

return res;
}
Expand Down Expand Up @@ -202,6 +151,18 @@ export class CodeService {
...(packageJson.devDependencies as Record<string, string>)
},
files: {
'.stackblitzrc': JSON.stringify(
{
installDependencies: true,
startCommand: 'yarn start',
env: {
ENABLE_CJS_IMPORTS: true
}
},
null,
2
),
'yarn.lock': yarnLock,
'angular.json': `${JSON.stringify(json, null, 2)}`,
'tsconfig.json': `${JSON.stringify(tsconfigJSON, null, 2)}`,
'package.json': `${JSON.stringify(packageJson, null, 2)}`,
Expand All @@ -210,14 +171,11 @@ export class CodeService {
'src/main.ts': mainTS(res.componentName),
'src/app/app.component.ts': appComponentCode,
'src/app/app.config.ts': appConfigTS,
'src/app/ng-zorro-antd.module.ts': nzZorroAntdModuleTS,
'src/app/delon-abc.module.ts': delonABCModuleTS,
'src/app/delon-chart.module.ts': delonChartModuleTS,
'src/app/startup.service.ts': this.genStartupService,
'src/styles.css': ``,
...this.genMock
},
template: 'angular-cli'
template: 'node'
},
{
openFile: `src/app/app.component.ts`
Expand Down Expand Up @@ -272,18 +230,6 @@ export class CodeService {
content: appComponentCode,
isBinary: false
},
'src/app/ng-zorro-antd.module.ts': {
content: nzZorroAntdModuleTS,
isBinary: false
},
'src/app/delon-abc.module.ts': {
content: delonABCModuleTS,
isBinary: false
},
'src/app/delon-chart.module.ts': {
content: delonChartModuleTS,
isBinary: false
},
'src/app/startup.service.ts': {
content: this.genStartupService,
isBinary: false
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/code/files/angular.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
browser: 'src/main.ts',
outputPath: 'dist/demo',
scripts: [],
styles: ['node_modules/@delon/theme/default.css', 'src/styles.css'],
styles: ['src/styles.css'],
tsConfig: 'tsconfig.json'
}
},
Expand Down
70 changes: 0 additions & 70 deletions src/app/core/code/files/delon-abc.module.ts

This file was deleted.

45 changes: 0 additions & 45 deletions src/app/core/code/files/delon-chart.module.ts

This file was deleted.

Loading

0 comments on commit 6681791

Please sign in to comment.