Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function electronMain() {
return `import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
// libs
import { environment } from '@${getNpmScope()}/core';
// app
import { AppElectronModule } from './app/app.electron.module';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppElectronModule)
.catch(err => console.log(err));
`;
}
function mainContent() {
return `import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
// libs
import { environment } from '@${getNpmScope()}/core';
// app
import { AppModule } from './app/app.module';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.log(err));
`;
}
function appCmpContent() {
return `import { Component } from '@angular/core';
// xplat
import { AppBaseComponent } from '@${getNpmScope()}/${XplatHelpers.getXplatFoldername(
'web',
'angular'
)}';
@Component({
selector: '${getPrefix()}-root',
templateUrl: './app.component.html'
})
export class AppComponent extends AppBaseComponent {
constructor() {
super();
}
}
`;
}
function appModuleContent(options) {
return `import { NgModule } from '@angular/core';
// libs
import { environment } from '@${getNpmScope()}/core';
// app
import { CoreModule } from './core/core.module';
import { SharedModule } from './features/shared/shared.module';
${options.routing ? `import { AppRoutingModule } from './app.routing';` : ''}
import { AppComponent } from './app.component';
@NgModule({
imports: [
CoreModule,
SharedModule${
options.routing
? `,
AppRoutingModule`
: ''
}
function electronModule() {
return `import { NgModule } from '@angular/core';
import { ${stringUtils.classify(
getPrefix()
)}ElectronCoreModule } from '@${getNpmScope()}/${XplatHelpers.getXplatFoldername(
'electron',
'angular'
)}';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';
@NgModule({
imports: [AppModule, ${stringUtils.classify(getPrefix())}ElectronCoreModule],
bootstrap: [AppComponent]
})
export class AppElectronModule {}`;
}
function indexContent(name: string) {
return `
<title>${getNpmScope()} ${name}</title>
<${getPrefix()}-root>
`;
}