Skip to content
This repository was archived by the owner on Sep 11, 2018. It is now read-only.

Commit deac0e1

Browse files
author
Sean Perkins
authored
Merge pull request #6 from TeamMaestro/angular-native-seed
Completes Seed Example (i18n, lazy-load, shared components, {N} styling, tests, etc.)
2 parents f9aad54 + 015c817 commit deac0e1

Some content is hidden

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

73 files changed

+928
-124
lines changed

.angular-cli.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"project": {
4-
"name": "maestro-project"
4+
"name": "angular-seed-project"
55
},
66
"apps": [
77
{
@@ -17,7 +17,7 @@
1717
"test": "test.ts",
1818
"tsconfig": "tsconfig.app.json",
1919
"testTsconfig": "tsconfig.spec.json",
20-
"prefix": "maestro",
20+
"prefix": "seed",
2121
"styles": [
2222
"styles.scss"
2323
],

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root = true
44
[*]
55
charset = utf-8
66
indent_style = space
7-
indent_size = 2
7+
indent_size = 4
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

.proxy.conf.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"/api": {
3-
"target": "https://dev-loop.mobileagility.com",
4-
"cookieDomainRewrite": "dev-loop.mobileagility.com",
3+
"target": "https://www.example.com",
4+
"cookieDomainRewrite": "example.com",
55
"secure": true,
66
"changeOrigin": true,
77
"logLevel": "debug",
88
"headers": {
9-
"host": "dev-loop.mobileagility.com"
9+
"host": "example.com"
1010
}
1111
}
12-
}
12+
}

README.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
# Maestro Seed
1+
# Angular NativeScript Seed
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
3+
Build truly web and native applications using NativeScript and Angular. This seed allows your project to share code between the environments; having complete control over dependencies.
44

5-
## Development server
5+
## Highlights
6+
- i18n Translations
7+
- Lazy Loaded Modules
8+
- Angular CLI // Webpack // Testing
9+
- Target Phone and Tablet Templates Individually
610

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
11+
| | |
12+
|:---: |:---:|
13+
|![Web Preview](https://i.gyazo.com/1ba4d3be7b7332ce91bd6715dc752d8b.gif)|![Native Preview](https://i.gyazo.com/0a88b56cff9af632f618e5b123502f5f.gif)|
814

9-
## Code scaffolding
15+
# Contributors
1016

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
12-
13-
## Build
14-
15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16-
17-
## Running unit tests
18-
19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20-
21-
## Running end-to-end tests
22-
23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24-
Before running the tests make sure you are serving the app via `ng serve`.
25-
26-
## Further help
27-
28-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
17+
[<img alt="Don Burgess" src="https://avatars1.githubusercontent.com/u/7612751?v=3&s=117" width="117">](https://github.com/db3dev) | [<img alt="Sean perkins" src="https://avatars1.githubusercontent.com/u/13732623?v=3&s=117" width="117">](https://github.com/sean-perkins) |
18+
:---: |:---: |
19+
[Don Burgess](https://github.com/db3dev) |[Sean Perkins](https://github.com/sean-perkins)|

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "2"
22
services:
3-
maestro-angular-seed:
3+
angular-native-seed:
44
build: .
5-
image: maestroseed
5+
image: angularnativeseed
66
ports:
7-
- "8080:80"
7+
- "8080:80"

nativescript/gulpfile.js

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,74 +16,87 @@ function removePhone (path) {
1616

1717
gulp.task('resources.App_Resources', () => {
1818
return gulp.src(['App_Resources/**/*'], {follow: true})
19-
.pipe(gulp.dest(`${DEST}/App_Resources`));
19+
.pipe(gulp.dest(`${DEST}App_Resources`));
2020
});
2121

2222
gulp.task('resources.Assets', () => {
23-
return gulp.src(['src/**/*', '!src/app/', '!src/test/', '!**/*.spec.*', '!**/*.js', '!**/*.ts', '!**/*.scss', '!**/*.html'], {follow: true})
23+
return gulp.src([`${SRC}**/*`, `!${SRC}app/`, `!${SRC}test/`, '!**/*.spec.*', '!**/*.js', '!**/*.ts', '!**/*.scss', '!**/*.html'], {follow: true})
2424
.pipe(gulp.dest(DEST));
2525
});
2626

2727
gulp.task('project.Typescript', () => {
28-
return gulp.src(['src/**/*.ts', '!**/*.tns.*'], {follow: true})
29-
.pipe(debug({title: 'project.Typescript'}))
28+
return gulp.src([`${SRC}**/*.ts`, '!**/*.tns.*', '!**/*.spec.*'], {follow: true})
29+
// .pipe(debug({title: 'project.Typescript'}))
3030
.pipe(gulp.dest(DEST));
3131
});
3232

3333
gulp.task('project.Styles', () => {
34-
return gulp.src(['src/**/*.scss', '!**/*.tns.*'], {follow: true})
34+
return gulp.src([`${SRC}**/*.scss`, '!**/*.tns.*'], {follow: true})
3535
.pipe(gulp.dest(DEST));
3636
});
3737

3838
gulp.task('tns.Typescript', () => {
39-
return gulp.src(['src/**/*.tns.ts'], {follow: true})
39+
return gulp.src([`${SRC}**/*.tns.ts`], {follow: true})
4040
.pipe(rename(removeTns))
4141
// .pipe(debug({title: 'tns.Typescript'}))
4242
.pipe(gulp.dest(DEST, {overwrite: true}));
4343
});
4444

4545
gulp.task('tns.ComponentStyles', () => {
46-
return gulp.src(['src/**/*.component.ts'], {follow: true})
47-
.pipe(replace('.scss\'', '.css\''))
46+
return gulp.src([`${SRC}**/*.component.ts`], {follow: true})
47+
.pipe(replace('.scss\'', '.css\'', { logs: { enabled: false }}))
4848
// .pipe(debug({title: 'tns.ComponentStyles'}))
4949
.pipe(gulp.dest(DEST, {overwrite: true}));
5050
});
5151

5252
gulp.task('tns.Templates', () => {
53-
return gulp.src(['src/**/*.tns.html', 'src/**/*.tns.ios.html', 'src/**/*.tns.android.html'], {follow: true})
53+
return gulp.src([`${SRC}**/*.tns.html`, `${SRC}**/*.tns.ios.html`, `${SRC}**/*.tns.android.html`], {follow: true})
5454
.pipe(rename(removeTns))
55-
.pipe(debug({title: 'tns.Templates'}))
55+
// .pipe(debug({title: 'tns.Templates'}))
5656
.pipe(gulp.dest(DEST, {overwrite: true}));
5757
});
5858

5959
gulp.task('tns.Styles', () => {
60-
return gulp.src(['src/**/*.tns.scss', 'src/**/*.tns.ios.scss', 'src/**/*.tns.android.scss'], {follow: true})
60+
return gulp.src([`${SRC}**/*.tns.scss`, `${SRC}**/*.tns.ios.scss`, `${SRC}**/*.tns.android.scss`], {follow: true})
6161
.pipe(rename(removeTns))
6262
// .pipe(debug({title: 'tns.Styles'}))
6363
.pipe(gulp.dest(DEST, {overwrite: true}));
6464
});
6565

66+
gulp.task('tns.Livesync', () => {
67+
return gulp.watch([`${SRC}**/*.tns.html`, `${SRC}/**/*.tns.scss`, `${SRC}/**/*.component.ts`])
68+
.on('change', (file) => {
69+
var outputDest = file.replace(SRC, DEST);
70+
outputDest = outputDest.substring(0, outputDest.lastIndexOf('/'));
71+
gulp.src([file])
72+
.pipe(rename(removeTns))
73+
.pipe(replace('.scss\'', '.css\'', { logs: { enabled: false }}))
74+
.pipe(debug({title: 'tns.Livesync'}))
75+
.pipe(gulp.dest(outputDest, {overwrite: true}));
76+
});
77+
});
78+
6679
gulp.task('phone.Typescript', () => {
67-
return gulp.src(['src/**/*.tns.phone.ts'], {follow: true})
80+
return gulp.src([`${SRC}**/*.tns.phone.ts`], {follow: true})
6881
.pipe(rename(removeTns))
6982
.pipe(rename(removePhone))
70-
.pipe(debug({title: 'phone.Typescript'}))
83+
// .pipe(debug({title: 'phone.Typescript'}))
7184
.pipe(gulp.dest(DEST, {overwrite: true}));
7285
});
7386

7487
gulp.task('phone.Templates', () => {
75-
return gulp.src(['src/**/*.tns.phone.html', 'src/**/*.tns.ios.phone.html', 'src/**/*.tns.android.phone.html'], {follow: true})
88+
return gulp.src([`${SRC}**/*.tns.phone.html`, `${SRC}**/*.tns.ios.phone.html`, `${SRC}**/*.tns.android.phone.html`], {follow: true})
7689
.pipe(rename(removeTns))
7790
.pipe(rename(removePhone))
78-
.pipe(debug({title: 'phone.Templates'}))
91+
// .pipe(debug({title: 'phone.Templates'}))
7992
.pipe(gulp.dest(DEST, {overwrite: true}));
8093
});
8194

8295
gulp.task('phone.Styles', () => {
83-
return gulp.src(['src/**/*.tns.phone.scss', 'src/**/*.tns.ios.phone.scss', 'src/**/*.tns.android.phone.scss'], {follow: true})
96+
return gulp.src([`${SRC}**/*.tns.phone.scss`, `${SRC}**/*.tns.ios.phone.scss`, `${SRC}**/*.tns.android.phone.scss`], {follow: true})
8497
.pipe(rename(removeTns))
8598
.pipe(rename(removePhone))
86-
.pipe(debug({title: 'phone.Styles'}))
99+
// .pipe(debug({title: 'phone.Styles'}))
87100
.pipe(gulp.dest(DEST, {overwrite: true}));
88101
});
89102

nativescript/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"description": "Maestro Native",
2+
"name": "angular-native-seed",
3+
"version": "0.0.0",
34
"repository": "<fill-your-repository-here>",
45
"nativescript": {
5-
"id": "com.mobileagility.maestro",
6+
"id": "com.domain.project",
67
"tns-ios": {
78
"version": "2.5.0"
89
}
@@ -17,6 +18,8 @@
1718
"@angular/platform-browser": "~4.0.0",
1819
"@angular/platform-browser-dynamic": "~4.0.0",
1920
"@angular/router": "~4.0.0",
21+
"@ngx-translate/core": "^6.0.1",
22+
"@ngx-translate/http-loader": "0.0.3",
2023
"nativescript-angular": "~1.5.1",
2124
"nativescript-theme-core": "~1.0.2",
2225
"reflect-metadata": "~0.1.8",
@@ -62,6 +65,7 @@
6265
"build.phone-android-bundle": "npm run prepPhone && npm run build-android-bundle",
6366
"build.tablet-android-bundle": "npm run prepTablet && npm run build-android-bundle",
6467
"ns-bundle": "ns-bundle",
68+
"livesync": "gulp tns.Livesync",
6569
"start-android-bundle": "npm run ns-bundle --android --start-app",
6670
"start-ios-bundle": "npm run ns-bundle --ios --start-app",
6771
"build-android-bundle": "npm run ns-bundle --android --build-app",

nativescript/src/app.module.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ of writing your own CSS rules. For a full list of class names in the theme
1010
refer to http://docs.nativescript.org/ui/theme.
1111
*/
1212
@import 'nativescript-theme-core/css/core.light.css';
13+
14+
.container {
15+
margin:40;
16+
}
17+
18+
.h1 {
19+
font-size:32px;
20+
font-weight:bold;
21+
}

nativescript/src/assets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/seanperkins/Documents/Projects/angular-native-seed/src/assets

0 commit comments

Comments
 (0)