Skip to content

Commit 749b9be

Browse files
sis0k0manoldonev
authored andcommitted
feat: restructure the template to match Angular web project structure (#86)
The following changes are in this PR: - the app folder is renamed to src as is in the web Angular projects. - @nativescript/schematics is a devDependency and angular.json file is added. This allows the developers to start using the Angular CLI immediately after creating a project. - App_Resources are now at root level. - nsconfing.json file is added. depends on NativeScript/nativescript-dev-webpack#633 and NativeScript/nativescript-dev-typescript#61
1 parent 583c45e commit 749b9be

File tree

79 files changed

+27
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+27
-5
lines changed

Diff for: packages/template-hello-world-ng/angular.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"cli": {
6+
"defaultCollection": "@nativescript/schematics"
7+
},
8+
"projects": {
9+
"hello-world": {
10+
"root": "",
11+
"sourceRoot": ".",
12+
"projectType": "application",
13+
"prefix": "ns"
14+
}
15+
},
16+
"defaultProject": "hello-world"
17+
}

Diff for: packages/template-hello-world-ng/nsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"appResourcesPath": "App_Resources",
3+
"appPath": "src"
4+
}

Diff for: packages/template-hello-world-ng/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
},
5252
"devDependencies": {
5353
"typescript": "~2.7.2",
54-
"nativescript-dev-typescript": "~0.7.0"
54+
"nativescript-dev-typescript": "~0.7.0",
55+
"@nativescript/schematics": "~0.2.5"
5556
}
5657
}

Diff for: packages/template-hello-world-ng/app/app.component.ts renamed to packages/template-hello-world-ng/src/app/app.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from "@angular/core";
22

33
@Component({
44
selector: "ns-app",
5-
templateUrl: "app.component.html",
5+
moduleId: module.id,
6+
templateUrl: "./app.component.html",
67
})
7-
88
export class AppComponent { }

Diff for: packages/template-hello-world-ng/app/main.aot.ts renamed to packages/template-hello-world-ng/src/main.aot.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
import { platformNativeScript } from "nativescript-angular/platform-static";
33

44
// "./app.module.ngfactory" is a dynamically generated module when compiled with AoT.
5-
import { AppModuleNgFactory } from "./app.module.ngfactory";
5+
import { AppModuleNgFactory } from "./app/app.module.ngfactory";
66

77
platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);

Diff for: packages/template-hello-world-ng/app/main.ts renamed to packages/template-hello-world-ng/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// this import should be first in order to load some required settings (like globals and reflect-metadata)
22
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
33

4-
import { AppModule } from "./app.module";
4+
import { AppModule } from "./app/app.module";
55

66
// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page.
77
// Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers.

0 commit comments

Comments
 (0)