Skip to content

Commit 94a56ec

Browse files
sebawitasis0k0
authored andcommitted
chore: change " => ' in .ts files (#80)
1 parent 13516d6 commit 94a56ec

File tree

15 files changed

+47
-48
lines changed

15 files changed

+47
-48
lines changed

src/add-ns/_ns-files/__sourceDir__/app/__entryModuleName@dasherize__.module__nsext__.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { HomeComponent } from './home/home.component';
88
import { BarcelonaModule } from './barcelona/barcelona.module';<% } %>
99

1010
// Uncomment and add to NgModule imports if you need to use two-way binding
11-
// import { NativeScriptFormsModule } from "nativescript-angular/forms";
11+
// import { NativeScriptFormsModule } from 'nativescript-angular/forms';
1212

1313
// Uncomment and add to NgModule imports if you need to use the HTTP wrapper
1414
// import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client';

src/add-ns/_sample-files/barcelona/barcelona.common.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Routes } from '@angular/router';
22

3-
import { PlayersComponent } from "./players/players.component";
4-
import { PlayerDetailComponent } from "./player-detail/player-detail.component";
3+
import { PlayersComponent } from './players/players.component';
4+
import { PlayerDetailComponent } from './player-detail/player-detail.component';
55
import { PlayerService } from './player.service';
66

77
export const componentDeclarations: any[] = [

src/add-web/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ function mergeDependenciesJSON(nsPackageJson: any, webPackageJson: any) {
329329

330330
/**
331331
* renames main.ts to main.tns.ts
332-
* and updates: import { AppModule } from "./app.module";
333-
* to: import { AppModule } from "./app.module.tns";
332+
* and updates: import { AppModule } from './app.module';
333+
* to: import { AppModule } from './app.module.tns';
334334
*/
335335
// const updateMain = (tree: Tree) => {
336336
// const importPath = projectSettings.entryModuleImportPath;

src/angular-json/index_spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe('Angular JSON Config Schematic', () => {
99
path.join(__dirname, '../collection.json'),
1010
);
1111

12-
const projName = "leproj"
12+
const projName = 'leproj';
1313
const defaultOptions: angularJsonOptions = {
1414
name: projName,
1515
};
1616
const configPath = `/angular.json`;
1717

1818

19-
describe("with default options (name only)", () => {
19+
describe('with default options (name only)', () => {
2020
let tree: UnitTestTree;
2121
beforeAll(() => {
2222
tree = schematicRunner.runSchematic('angular-json', defaultOptions);
@@ -48,7 +48,7 @@ describe('Angular JSON Config Schematic', () => {
4848
});
4949

5050
it('should create files inside path when specified', () => {
51-
const path = "/path/to/my/app";
51+
const path = '/path/to/my/app';
5252
const appJsonPath = `${path}/angular.json`;
5353
const options = { ...defaultOptions, path };
5454

src/angular-project-parser.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,40 @@ export interface AngularProjectSettings {
1313
/** ng Npm Version */
1414
ngSemVer: SemVer;
1515

16-
/** default: "" */
16+
/** default: '' */
1717
root: string;
1818

19-
/** default: "src" */
19+
/** default: 'src' */
2020
sourceRoot: string;
2121

22-
/** default: "main"*/
22+
/** default: 'main'*/
2323
mainName: string;
24-
/** default: "src/main.ts"*/
24+
/** default: 'src/main.ts'*/
2525
mainPath: string;
26-
/** default: "app" */
26+
/** default: 'app' */
2727
prefix: string;
28-
/** default: "src/tsconfig.json" */
28+
/** default: 'src/tsconfig.json' */
2929
tsConfig: string;
3030

31-
/** default: "AppModule"*/
31+
/** default: 'AppModule'*/
3232
entryModuleClassName: string;
33-
/** default: "App"*/
33+
/** default: 'App'*/
3434
entryModuleName: string;
35-
/** default: "src/app/app.module.ts"*/
35+
/** default: 'src/app/app.module.ts'*/
3636
entryModulePath: string;
37-
/** default: "./app/app.module"*/
37+
/** default: './app/app.module'*/
3838
entryModuleImportPath: string;
3939

40-
/** default: "AppComponent" */
40+
/** default: 'AppComponent' */
4141
entryComponentClassName: string;
42-
/** default: "App" */
42+
/** default: 'App' */
4343
entryComponentName: string;
44-
/** default: "src/app/app.component.ts" */
44+
/** default: 'src/app/app.component.ts' */
4545
entryComponentPath: string;
46-
/** default: "./app.component" */
46+
/** default: './app.component' */
4747
entryComponentImportPath: string;
4848

49-
/** default: "app-root"*/
49+
/** default: 'app-root'*/
5050
indexAppRootTag: string;
5151
}
5252

@@ -173,7 +173,7 @@ export function getProjectObject(tree: Tree, projectName: string) {
173173

174174
// Step 2 - get entryModule and entryModulePath => open ${sourceRoot}/${main}.ts
175175
// - get entryModule from .bootstrapModule(__value__)
176-
// - get entryModulePath from import { ${entryModule} } from "__value__" -- might need to remove ./
176+
// - get entryModulePath from import { ${entryModule} } from '__value__' -- might need to remove ./
177177
function getEntryModuleMetadata(tree: Tree, mainPath: string): ClassMetadata {
178178
const source = getSourceFile(tree, mainPath);
179179

@@ -197,7 +197,7 @@ function getEntryModuleMetadata(tree: Tree, mainPath: string): ClassMetadata {
197197

198198
// Step 3 - get appComponent and appComponentPath => open ${appRoot}/${entryModulePath}
199199
// - get appComponent from bootstrap: [ __value__ ]
200-
// - get appComponentPath from import { ${appComponent} } from "__value__"
200+
// - get appComponentPath from import { ${appComponent} } from '__value__'
201201
function getEntryComponentMetadata(tree: Tree, entryModulePath: string): ClassMetadata {
202202
const source = getSourceFile(tree, entryModulePath);
203203

@@ -227,7 +227,7 @@ function getEntryComponentMetadata(tree: Tree, entryModulePath: string): ClassMe
227227
};
228228
}
229229

230-
// Step 4 - get indexAppRootTag => open ${appRoot}/${appComponentPath} - get from selector: "__value__"
230+
// Step 4 - get indexAppRootTag => open ${appRoot}/${appComponentPath} - get from selector: '__value__'
231231
function getAppRootTag(tree: Tree, entryComponentPath: string): string {
232232
const source = getSourceFile(tree, entryComponentPath);
233233

src/ast-utils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function normalizeNodeToRemove<T extends ts.Node>(node: T, source: ts.Node)
290290
const start = nodeStart - source.getFullStart();
291291
const symbolBefore = content.substring(start - 1, start);
292292

293-
if (symbolBefore === ",") {
293+
if (symbolBefore === ',') {
294294
return new RemoveContent(nodeStart - 1, nodeEnd);
295295
} else {
296296
return new RemoveContent(nodeStart, nodeEnd + 1);
@@ -614,7 +614,6 @@ export function findImportPath(source: ts.Node, name) {
614614
return moduleSpecifier.text;
615615
}
616616

617-
618617
export const updateNodeText = (tree: Tree, node: ts.Node, newText: string) => {
619618
const recorder = tree.beginUpdate(node.getSourceFile().fileName);
620619
recorder.remove(node.getStart(), node.getText().length);

src/generate/utils.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { getNsConfig, getPackageJson } from "../utils";
2-
import { Tree, SchematicsException } from "@angular-devkit/schematics";
3-
import { extname } from "path";
1+
import { getNsConfig, getPackageJson } from '../utils';
2+
import { Tree, SchematicsException } from '@angular-devkit/schematics';
3+
import { extname } from 'path';
44
import { Schema as ComponentOptions } from './component/schema';
55
import { Schema as ModuleOptions } from './module/schema';
66

@@ -83,8 +83,8 @@ export const getExtensions = (tree: Tree, options: Options): Extensions => {
8383
}
8484

8585
return {
86-
ns: parseExtension(ns || ""),
87-
web: parseExtension(web || "")
86+
ns: parseExtension(ns || ''),
87+
web: parseExtension(web || '')
8888
}
8989
}
9090

src/ng-new/application/_files/__sourcedir__/app.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AppComponent } from './app.component';
66
import { HomeComponent } from './home/home.component';
77

88
// Uncomment and add to NgModule imports if you need to use two-way binding
9-
// import { NativeScriptFormsModule } from "nativescript-angular/forms";
9+
// import { NativeScriptFormsModule } from 'nativescript-angular/forms';
1010

1111
// Uncomment and add to NgModule imports if you need to use the HTTP wrapper
1212
// import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client';

src/ng-new/shared/_files/__sourcedir__/app/app.module.tns.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { HomeComponent } from './home/home.component';
88
import { BarcelonaModule } from './barcelona/barcelona.module';<% } %>
99

1010
// Uncomment and add to NgModule imports if you need to use two-way binding
11-
// import { NativeScriptFormsModule } from "nativescript-angular/forms";
11+
// import { NativeScriptFormsModule } from 'nativescript-angular/forms';
1212

1313
// Uncomment and add to NgModule imports if you need to use the HTTP wrapper
1414
// import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client';

src/ng-new/shared/_sample-files/barcelona/barcelona.common.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Routes } from '@angular/router';
22

3-
import { PlayersComponent } from "./players/players.component";
4-
import { PlayerDetailComponent } from "./player-detail/player-detail.component";
3+
import { PlayersComponent } from './players/players.component';
4+
import { PlayerDetailComponent } from './player-detail/player-detail.component';
55
import { PlayerService } from './player.service';
66

77
export const componentDeclarations: any[] = [

src/node-utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Tree, SchematicsException } from "@angular-devkit/schematics";
2-
import { getPackageJson, safeGet } from "./utils";
1+
import { Tree, SchematicsException } from '@angular-devkit/schematics';
2+
import { getPackageJson, safeGet } from './utils';
33

44
export class SemVer {
55
constructor(

src/utils.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,17 @@ export const renameFilesForce = (paths: FromTo[]) =>
154154
});
155155

156156
export function createEmptyNsOnlyProject(projectName: string, extension: string = ''): UnitTestTree {
157-
let appTree = schematicRunner.runSchematic("angular-json", { name: projectName, sourceRoot: "src" });
157+
let appTree = schematicRunner.runSchematic('angular-json', { name: projectName, sourceRoot: 'src' });
158158

159159
appTree = createAppModule(<any>appTree, `/src/app/app.module${extension}.ts`);
160160

161161
appTree.create('/package.json', JSON.stringify({
162-
nativescript: { id: "proj" },
162+
nativescript: { id: 'proj' },
163163
dependencies: {
164-
"@angular/core": "^6.1.0"
164+
'@angular/core': '^6.1.0'
165165
},
166166
devDependencies: {
167-
"@angular/cli": "^6.1.0"
167+
'@angular/cli': '^6.1.0'
168168
},
169169
}));
170170

@@ -176,11 +176,11 @@ export function createEmptySharedProject(projectName: string, webExtension: stri
176176
appTree = createAppModule(<any>appTree, `/src/app/app.module${webExtension}.ts`);
177177

178178
appTree.create('/nsconfig.json', JSON.stringify({
179-
"appResourcesPath": "App_Resources",
180-
"appPath": "src",
181-
"nsext": ".tns",
182-
"webext": "",
183-
"shared": true
179+
'appResourcesPath': 'App_Resources',
180+
'appPath': 'src',
181+
'nsext': '.tns',
182+
'webext': '',
183+
'shared': true
184184
}));
185185

186186
return appTree;

0 commit comments

Comments
 (0)