How to use the @nstudio/xplat.getNpmScope function in @nstudio/xplat

To help you get started, we’ve selected a few @nstudio/xplat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
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));
  `;
}
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
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));
`;
}
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
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();
    }
}
`;
}
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
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`
            : ''
        }
github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
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 {}`;
}
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
function indexContent(name: string) {
  return `


    
    <title>${getNpmScope()} ${name}</title>
    

    
    


    &lt;${getPrefix()}-root&gt;

`;
}