How to use the @nstudio/xplat.getPrefix 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 / angular / src / schematics / elements / index.ts View on Github external
(tree: Tree) => {
      if (!options.builderModule) {
        const workspacePrefix = options.prefix || getPrefix() || '';
        const htmlElementList = [];
        componentSymbols = [];
        // parse component names to standard convention
        const componentNames = options.components.split(',');
        for (let component of componentNames) {
          // using short name ("menu" for a component named "MenuComponent")
          // convert to fully best practice name
          const isShortName =
            component.toLowerCase().indexOf('component') === -1;
          let selector = `${workspacePrefix ? `${workspacePrefix}-` : ''}`;
          if (isShortName) {
            selector += component.toLowerCase();
          } else {
            const parts = component.toLowerCase().split('component');
            selector += parts[0];
          }
github nstudio / xplat / packages / angular / src / utils / xplat.ts View on Github external
return (tree: Tree, context: SchematicContext) => {
      const prefix = getPrefix();

      return updateJsonInTree('tslint.json', json => {
        json.rules = json.rules || {};
        // remove forin rule as collides with LogService
        delete json.rules['forin'];
        // adjust console rules to work with LogService
        json.rules['no-console'] = [true, 'debug', 'time', 'timeEnd', 'trace'];
        json.rules['directive-selector'] = [
          true,
          'attribute',
          prefix,
          'camelCase'
        ];
        json.rules['component-selector'] = [
          true,
          'element',
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;

`;
}
github nstudio / xplat / packages / nativescript / src / schematics / application / index.ts View on Github external
(tree: Tree, context: SchematicContext) => {
      const platformApp = options.name.replace('-', '.');
      const directory = options.directory ? `${options.directory}/` : '';
      const projects = {};
      projects[`${options.name}`] = {
        root: `apps/${directory}${options.name}/`,
        sourceRoot: `apps/${directory}${options.name}/src`,
        projectType: 'application',
        prefix: getPrefix(),
        architect: {
          serve: {
            builder: '@nrwl/workspace:run-commands',
            options: {
              commands: [
                {
                  command: `yarn start.${platformApp}.preview`
                }
              ]
            },
            configurations: {
              ios: {
                commands: [
                  {
                    command: `yarn start.${platformApp}.ios`
                  }
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
function appCmpHtml(name: string) {
  return `<div class="p-x-20">
  &lt;${getPrefix()}-header title="${name}"&gt;

  <h2>Nx</h2>

  An open source toolkit for enterprise Angular applications. Nx is designed to help you create and build enterprise grade
  Angular applications. It provides an opinionated approach to application project structure and patterns.

  <h3>Quick Start &amp; Documentation</h3>

  <a href="https://nrwl.io/nx">Watch a 5-minute video on how to get started with Nx.</a>

  <h1>{{'welcome' | translate}}!</h1>
  <h3>Try things out</h3>

  <a href="https://nstudio.io/xplat">Learn more about xplat.</a>
</div>`;
}
github nstudio / xplat / packages / ionic / src / schematics / application / index.ts View on Github external
(tree: Tree, context: SchematicContext) => {
      const directory = options.directory ? `${options.directory}/` : '';
      const projects = {};
      projects[`${options.name}`] = {
        root: `apps/${directory}${options.name}/`,
        sourceRoot: `apps/${directory}${options.name}/src`,
        projectType: 'application',
        prefix: getPrefix()
      };
      return updateWorkspace({ projects })(tree, context);
    },
    (tree: Tree) => {
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 / 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 {}`;
}