diff --git a/src/add-ns/_ns-files/__sourceDir__/app/__entryModuleName@dasherize__.module__nsext__.ts b/src/add-ns/_ns-files/__sourceDir__/app/__entryModuleName@dasherize__.module__nsext__.ts index feb1484..7a86357 100644 --- a/src/add-ns/_ns-files/__sourceDir__/app/__entryModuleName@dasherize__.module__nsext__.ts +++ b/src/add-ns/_ns-files/__sourceDir__/app/__entryModuleName@dasherize__.module__nsext__.ts @@ -8,7 +8,7 @@ import { HomeComponent } from './home/home.component'; import { BarcelonaModule } from './barcelona/barcelona.module';<% } %> // Uncomment and add to NgModule imports if you need to use two-way binding -// import { NativeScriptFormsModule } from "nativescript-angular/forms"; +// import { NativeScriptFormsModule } from 'nativescript-angular/forms'; // Uncomment and add to NgModule imports if you need to use the HTTP wrapper // import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client'; diff --git a/src/add-ns/_sample-files/barcelona/barcelona.common.ts b/src/add-ns/_sample-files/barcelona/barcelona.common.ts index 42a5421..2eb397f 100644 --- a/src/add-ns/_sample-files/barcelona/barcelona.common.ts +++ b/src/add-ns/_sample-files/barcelona/barcelona.common.ts @@ -1,7 +1,7 @@ import { Routes } from '@angular/router'; -import { PlayersComponent } from "./players/players.component"; -import { PlayerDetailComponent } from "./player-detail/player-detail.component"; +import { PlayersComponent } from './players/players.component'; +import { PlayerDetailComponent } from './player-detail/player-detail.component'; import { PlayerService } from './player.service'; export const componentDeclarations: any[] = [ diff --git a/src/add-web/index.ts b/src/add-web/index.ts index 1b73dbd..1b27cd7 100644 --- a/src/add-web/index.ts +++ b/src/add-web/index.ts @@ -329,8 +329,8 @@ function mergeDependenciesJSON(nsPackageJson: any, webPackageJson: any) { /** * renames main.ts to main.tns.ts - * and updates: import { AppModule } from "./app.module"; - * to: import { AppModule } from "./app.module.tns"; + * and updates: import { AppModule } from './app.module'; + * to: import { AppModule } from './app.module.tns'; */ // const updateMain = (tree: Tree) => { // const importPath = projectSettings.entryModuleImportPath; diff --git a/src/angular-json/index_spec.ts b/src/angular-json/index_spec.ts index 55f5bd9..6a9cbf1 100644 --- a/src/angular-json/index_spec.ts +++ b/src/angular-json/index_spec.ts @@ -9,14 +9,14 @@ describe('Angular JSON Config Schematic', () => { path.join(__dirname, '../collection.json'), ); - const projName = "leproj" + const projName = 'leproj'; const defaultOptions: angularJsonOptions = { name: projName, }; const configPath = `/angular.json`; - describe("with default options (name only)", () => { + describe('with default options (name only)', () => { let tree: UnitTestTree; beforeAll(() => { tree = schematicRunner.runSchematic('angular-json', defaultOptions); @@ -48,7 +48,7 @@ describe('Angular JSON Config Schematic', () => { }); it('should create files inside path when specified', () => { - const path = "/path/to/my/app"; + const path = '/path/to/my/app'; const appJsonPath = `${path}/angular.json`; const options = { ...defaultOptions, path }; diff --git a/src/angular-project-parser.ts b/src/angular-project-parser.ts index 8fc8375..f2f2837 100644 --- a/src/angular-project-parser.ts +++ b/src/angular-project-parser.ts @@ -13,40 +13,40 @@ export interface AngularProjectSettings { /** ng Npm Version */ ngSemVer: SemVer; - /** default: "" */ + /** default: '' */ root: string; - /** default: "src" */ + /** default: 'src' */ sourceRoot: string; - /** default: "main"*/ + /** default: 'main'*/ mainName: string; - /** default: "src/main.ts"*/ + /** default: 'src/main.ts'*/ mainPath: string; - /** default: "app" */ + /** default: 'app' */ prefix: string; - /** default: "src/tsconfig.json" */ + /** default: 'src/tsconfig.json' */ tsConfig: string; - /** default: "AppModule"*/ + /** default: 'AppModule'*/ entryModuleClassName: string; - /** default: "App"*/ + /** default: 'App'*/ entryModuleName: string; - /** default: "src/app/app.module.ts"*/ + /** default: 'src/app/app.module.ts'*/ entryModulePath: string; - /** default: "./app/app.module"*/ + /** default: './app/app.module'*/ entryModuleImportPath: string; - /** default: "AppComponent" */ + /** default: 'AppComponent' */ entryComponentClassName: string; - /** default: "App" */ + /** default: 'App' */ entryComponentName: string; - /** default: "src/app/app.component.ts" */ + /** default: 'src/app/app.component.ts' */ entryComponentPath: string; - /** default: "./app.component" */ + /** default: './app.component' */ entryComponentImportPath: string; - /** default: "app-root"*/ + /** default: 'app-root'*/ indexAppRootTag: string; } @@ -173,7 +173,7 @@ export function getProjectObject(tree: Tree, projectName: string) { // Step 2 - get entryModule and entryModulePath => open ${sourceRoot}/${main}.ts // - get entryModule from .bootstrapModule(__value__) -// - get entryModulePath from import { ${entryModule} } from "__value__" -- might need to remove ./ +// - get entryModulePath from import { ${entryModule} } from '__value__' -- might need to remove ./ function getEntryModuleMetadata(tree: Tree, mainPath: string): ClassMetadata { const source = getSourceFile(tree, mainPath); @@ -197,7 +197,7 @@ function getEntryModuleMetadata(tree: Tree, mainPath: string): ClassMetadata { // Step 3 - get appComponent and appComponentPath => open ${appRoot}/${entryModulePath} // - get appComponent from bootstrap: [ __value__ ] -// - get appComponentPath from import { ${appComponent} } from "__value__" +// - get appComponentPath from import { ${appComponent} } from '__value__' function getEntryComponentMetadata(tree: Tree, entryModulePath: string): ClassMetadata { const source = getSourceFile(tree, entryModulePath); @@ -227,7 +227,7 @@ function getEntryComponentMetadata(tree: Tree, entryModulePath: string): ClassMe }; } -// Step 4 - get indexAppRootTag => open ${appRoot}/${appComponentPath} - get from selector: "__value__" +// Step 4 - get indexAppRootTag => open ${appRoot}/${appComponentPath} - get from selector: '__value__' function getAppRootTag(tree: Tree, entryComponentPath: string): string { const source = getSourceFile(tree, entryComponentPath); diff --git a/src/ast-utils.ts b/src/ast-utils.ts index 1a8fa37..b0e7e77 100644 --- a/src/ast-utils.ts +++ b/src/ast-utils.ts @@ -290,7 +290,7 @@ function normalizeNodeToRemove(node: T, source: ts.Node) const start = nodeStart - source.getFullStart(); const symbolBefore = content.substring(start - 1, start); - if (symbolBefore === ",") { + if (symbolBefore === ',') { return new RemoveContent(nodeStart - 1, nodeEnd); } else { return new RemoveContent(nodeStart, nodeEnd + 1); @@ -614,7 +614,6 @@ export function findImportPath(source: ts.Node, name) { return moduleSpecifier.text; } - export const updateNodeText = (tree: Tree, node: ts.Node, newText: string) => { const recorder = tree.beginUpdate(node.getSourceFile().fileName); recorder.remove(node.getStart(), node.getText().length); diff --git a/src/generate-template/master-detail/_files-shared/__name__/__detail__-detail/__detail__-detail.component.__nsext__.html b/src/generate-template/master-detail/_files-shared/__name__/__detail__-detail/__detail__-detail.component__nsext__.html similarity index 100% rename from src/generate-template/master-detail/_files-shared/__name__/__detail__-detail/__detail__-detail.component.__nsext__.html rename to src/generate-template/master-detail/_files-shared/__name__/__detail__-detail/__detail__-detail.component__nsext__.html diff --git a/src/generate-template/master-detail/_files-shared/__name__/__master__.module.__nsext__.ts b/src/generate-template/master-detail/_files-shared/__name__/__master__.module__nsext__.ts similarity index 100% rename from src/generate-template/master-detail/_files-shared/__name__/__master__.module.__nsext__.ts rename to src/generate-template/master-detail/_files-shared/__name__/__master__.module__nsext__.ts diff --git a/src/generate-template/master-detail/_files-shared/__name__/__master__/__master__.component.__nsext__.html b/src/generate-template/master-detail/_files-shared/__name__/__master__/__master__.component__nsext__.html similarity index 100% rename from src/generate-template/master-detail/_files-shared/__name__/__master__/__master__.component.__nsext__.html rename to src/generate-template/master-detail/_files-shared/__name__/__master__/__master__.component__nsext__.html diff --git a/src/generate/utils.ts b/src/generate/utils.ts index c803b8e..a4b39b9 100644 --- a/src/generate/utils.ts +++ b/src/generate/utils.ts @@ -1,6 +1,6 @@ -import { getNsConfig, getPackageJson } from "../utils"; -import { Tree, SchematicsException } from "@angular-devkit/schematics"; -import { extname } from "path"; +import { getNsConfig, getPackageJson } from '../utils'; +import { Tree, SchematicsException } from '@angular-devkit/schematics'; +import { extname } from 'path'; import { Schema as ComponentOptions } from './component/schema'; import { Schema as ModuleOptions } from './module/schema'; @@ -83,8 +83,8 @@ export const getExtensions = (tree: Tree, options: Options): Extensions => { } return { - ns: parseExtension(ns || ""), - web: parseExtension(web || "") + ns: parseExtension(ns || ''), + web: parseExtension(web || '') } } diff --git a/src/ng-new/application/_files/__sourcedir__/app.module.ts b/src/ng-new/application/_files/__sourcedir__/app.module.ts index 02412da..5a98396 100644 --- a/src/ng-new/application/_files/__sourcedir__/app.module.ts +++ b/src/ng-new/application/_files/__sourcedir__/app.module.ts @@ -6,7 +6,7 @@ import { AppComponent } from './app.component'; import { HomeComponent } from './home/home.component'; // Uncomment and add to NgModule imports if you need to use two-way binding -// import { NativeScriptFormsModule } from "nativescript-angular/forms"; +// import { NativeScriptFormsModule } from 'nativescript-angular/forms'; // Uncomment and add to NgModule imports if you need to use the HTTP wrapper // import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client'; diff --git a/src/ng-new/shared/_files/__sourcedir__/app/app.module.tns.ts b/src/ng-new/shared/_files/__sourcedir__/app/app.module.tns.ts index 76a24c3..43b4b83 100644 --- a/src/ng-new/shared/_files/__sourcedir__/app/app.module.tns.ts +++ b/src/ng-new/shared/_files/__sourcedir__/app/app.module.tns.ts @@ -8,7 +8,7 @@ import { HomeComponent } from './home/home.component'; import { BarcelonaModule } from './barcelona/barcelona.module';<% } %> // Uncomment and add to NgModule imports if you need to use two-way binding -// import { NativeScriptFormsModule } from "nativescript-angular/forms"; +// import { NativeScriptFormsModule } from 'nativescript-angular/forms'; // Uncomment and add to NgModule imports if you need to use the HTTP wrapper // import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client'; diff --git a/src/ng-new/shared/_sample-files/barcelona/barcelona.common.ts b/src/ng-new/shared/_sample-files/barcelona/barcelona.common.ts index 42a5421..2eb397f 100644 --- a/src/ng-new/shared/_sample-files/barcelona/barcelona.common.ts +++ b/src/ng-new/shared/_sample-files/barcelona/barcelona.common.ts @@ -1,7 +1,7 @@ import { Routes } from '@angular/router'; -import { PlayersComponent } from "./players/players.component"; -import { PlayerDetailComponent } from "./player-detail/player-detail.component"; +import { PlayersComponent } from './players/players.component'; +import { PlayerDetailComponent } from './player-detail/player-detail.component'; import { PlayerService } from './player.service'; export const componentDeclarations: any[] = [ diff --git a/src/node-utils.ts b/src/node-utils.ts index 83b2332..f6bfc22 100644 --- a/src/node-utils.ts +++ b/src/node-utils.ts @@ -1,5 +1,5 @@ -import { Tree, SchematicsException } from "@angular-devkit/schematics"; -import { getPackageJson, safeGet } from "./utils"; +import { Tree, SchematicsException } from '@angular-devkit/schematics'; +import { getPackageJson, safeGet } from './utils'; export class SemVer { constructor( diff --git a/src/utils.ts b/src/utils.ts index f898719..d84fe95 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -154,17 +154,17 @@ export const renameFilesForce = (paths: FromTo[]) => }); export function createEmptyNsOnlyProject(projectName: string, extension: string = ''): UnitTestTree { - let appTree = schematicRunner.runSchematic("angular-json", { name: projectName, sourceRoot: "src" }); + let appTree = schematicRunner.runSchematic('angular-json', { name: projectName, sourceRoot: 'src' }); appTree = createAppModule(appTree, `/src/app/app.module${extension}.ts`); appTree.create('/package.json', JSON.stringify({ - nativescript: { id: "proj" }, + nativescript: { id: 'proj' }, dependencies: { - "@angular/core": "^6.1.0" + '@angular/core': '^6.1.0' }, devDependencies: { - "@angular/cli": "^6.1.0" + '@angular/cli': '^6.1.0' }, })); @@ -176,11 +176,11 @@ export function createEmptySharedProject(projectName: string, webExtension: stri appTree = createAppModule(appTree, `/src/app/app.module${webExtension}.ts`); appTree.create('/nsconfig.json', JSON.stringify({ - "appResourcesPath": "App_Resources", - "appPath": "src", - "nsext": ".tns", - "webext": "", - "shared": true + 'appResourcesPath': 'App_Resources', + 'appPath': 'src', + 'nsext': '.tns', + 'webext': '', + 'shared': true })); return appTree;