-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
8,094 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`; | ||
} | ||
|
@@ -132,7 +82,6 @@ export class CodeService { | |
}); | ||
// res.dependencies['core-js'] = `~3.8.3`; | ||
if (!includeCli) res; | ||
console.log(res); | ||
|
||
return res; | ||
} | ||
|
@@ -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)}`, | ||
|
@@ -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` | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.