Skip to content

Commit 0e274e4

Browse files
committed
Merge branch 'release/9.0.0'
2 parents 6d650a1 + 29a2393 commit 0e274e4

Some content is hidden

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

50 files changed

+4270
-2291
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ yarn-error.log
66
/test/*coverage
77
/test/coverage*
88
/.chrome
9+
.wwp-cache
910

1011
# Logs #
1112
logs
@@ -26,10 +27,6 @@ Thumbs.db
2627
/bower_components
2728
npm-debug.log
2829

29-
# OS generated files #
30-
.DS_Store
31-
Thumbs.db
32-
3330
# Typing #
3431
/typings/
3532

.vscode/extensions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"steoates.autoimport",
66
"EditorConfig.EditorConfig",
77
"christian-kohler.path-intellisense",
8-
"behzad88.Aurelia"
8+
"behzad88.Aurelia",
9+
"mike-co.import-sorter",
10+
"christian-kohler.npm-intellisense",
11+
"eg2.tslint",
12+
"formulahendry.auto-close-tag",
13+
"formulahendry.auto-rename-tag",
14+
"mkaufman.htmlhint"
915
]
1016
}

.vscode/settings.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"typescript.tsdk": "node_modules/typescript/lib"
3+
"files.trimTrailingWhitespace": true,
4+
"search.exclude": {
5+
"**/node_modules": true
6+
},
7+
"typescript.tsdk": "node_modules/typescript/lib",
8+
"importSorter.generalConfiguration.sortOnBeforeSave": true,
9+
"importSorter.generalConfiguration.exclude": [
10+
"main.ts"
11+
],
12+
"importSorter.importStringConfiguration.tabSize": 2,
13+
"htmlhint.options": {
14+
"tagname-lowercase": true,
15+
"attr-lowercase": true,
16+
"attr-value-double-quotes": true,
17+
"doctype-first": false,
18+
"tag-pair": true,
19+
"spec-char-escape": true,
20+
"id-unique": true,
21+
"src-not-empty": true,
22+
"attr-no-duplication": true,
23+
"title-require": true
24+
}
425
}

README.md

Lines changed: 73 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
1-
[![Build Status](https://api.travis-ci.org/w3tecch/aurelia-typescript-boilerplate.svg?branch=master)](https://travis-ci.org/w3tecch/aurelia-typescript-boilerplate)
2-
[![Build status](https://ci.appveyor.com/api/projects/status/7oyx5vxl6ue6oqsf/branch/master?svg=true)](https://ci.appveyor.com/project/dweber019/aurelia-typescript-boilerplate/branch/master)
3-
[![Dependency Status](https://david-dm.org/w3tecch/aurelia-typescript-boilerplate.svg)](https://david-dm.org/w3tecch/aurelia-typescript-boilerplate)
4-
[![devDependency Status](https://david-dm.org/w3tecch/aurelia-typescript-boilerplate/dev-status.svg)](https://david-dm.org/w3tecch/aurelia-typescript-boilerplate#info=devDependencies)
5-
6-
## Getting started
1+
<p align="center">
2+
<img src="./w3tec-logo.png" alt="w3tec" width="400" />
3+
</p>
4+
5+
<h1 align="center">Aurelia Typescript Boilerplate</h1>
6+
7+
<p align="center">
8+
<a href="https://david-dm.org/w3tecch/aurelia-typescript-boilerplate">
9+
<img src="https://david-dm.org/w3tecch/aurelia-typescript-boilerplate/status.svg?style=flat" alt="dependency" />
10+
</a>
11+
<a href="https://travis-ci.org/w3tecch/aurelia-typescript-boilerplate">
12+
<img src="https://travis-ci.org/w3tecch/aurelia-typescript-boilerplate.svg?branch=master" alt="travis" />
13+
</a>
14+
<a href="https://ci.appveyor.com/project/dweber019/aurelia-typescript-boilerplate/branch/master">
15+
<img src="https://ci.appveyor.com/api/projects/status/7oyx5vxl6ue6oqsf/branch/master?svg=true&passingText=Windows%20passing&pendingText=Windows%20pending&failingText=Windows%20failing" alt="appveyor" />
16+
</a>
17+
</p>
18+
19+
<p align="center">
20+
<b>A full configured and ready to go boilerplate/skeleton for an Aurelia app</b></br>
21+
Heavily inspired by <a href="https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript-webpack">Aurelia Skeleton</a>.<br>
22+
<sub>Made with ❤️ by <a href="https://github.com/w3tecch">w3tech</a>, <a href="https://www.linkedin.com/in/david-weber-6a0819b7/">David Weber</a> and <a href="https://github.com/w3tecch/template-gen/graphs/contributors">contributors</a></sub>
23+
</p>
24+
25+
<br />
26+
27+
## ❯ Why
28+
29+
The skeletons provided by Aurelia are great but aren't ready for an enterprise grade app. This boilerplate provides a lot of features out of the box like i18n or an optin Cordova setup.
30+
31+
## ❯ Table of Contents
32+
- [Getting Started](#-getting-started)
33+
- [Feature configuration](#-feature-configuration)
34+
- [Bundling](#-bundling)
35+
- [Running tests](#-running-tests)
36+
- [App configuration](#-app-configuration)
37+
- [HTML5 pushState routing](#-html5-pushstate-routing)
38+
- [Cordova - Mobile development](#-cordova-mobile-development)
39+
- [Docker](#-docker)
40+
- [Additional features](#-additional-features)
41+
42+
43+
## ❯ Getting started
744

845
Before you start, make sure you have a recent version of [NodeJS](http://nodejs.org/) environment *>=6.0* with NPM 3 or Yarn.
946

@@ -34,12 +71,12 @@ If you wish to try out the experimental Hot Module Reload, you may run your appl
3471
npm start -- webpack.server.hmr
3572
```
3673

37-
## Feature configuration
74+
## Feature configuration
3875

3976
Most of the configuration will happen in the `webpack.config.js` file.
4077
There, you may configure advanced loader features or add direct SASS or LESS loading support.
4178

42-
## Bundling
79+
## Bundling
4380

4481
To build an optimized, minified production bundle (output to /dist) execute:
4582

@@ -57,7 +94,7 @@ npm start -- serve
5794

5895
The production bundle includes all files that are required for deployment.
5996

60-
## Running The Tests
97+
## Running tests
6198

6299
This skeleton provides three frameworks for running tests.
63100

@@ -96,26 +133,6 @@ To run the Jest watcher (re-runs tests on changes), run:
96133
npm start -- test.jest.watch
97134
```
98135

99-
### Karma + Jasmine 2
100-
101-
Karma is also a powerful test runner, which by default runs in the browser. This means that whatever works in real browsers, should also work the same way in the unit tests. But it also means the framework is heavier to execute and not as lean to work with.
102-
103-
To ease transitioning between Jest and Karma, Jasmine 2 is configured with Jest's matchers.
104-
105-
To create new Karma tests, create files with the extension `.spec.ts`, either in the `src` directory or in the `test/unit` directory.
106-
107-
To run the Karma unit tests, run:
108-
109-
```shell
110-
npm start -- test.karma
111-
```
112-
113-
To run the Karma watcher (re-runs tests on changes), run:
114-
115-
```shell
116-
npm start -- test.karma.watch
117-
```
118-
119136
### Protractor (E2E / integration tests)
120137

121138
Integration tests can be performed with [Protractor](http://angular.github.io/protractor/#/).
@@ -128,23 +145,23 @@ Integration tests can be performed with [Protractor](http://angular.github.io/pr
128145
npm start -- e2e
129146
```
130147

131-
## Running all test suites
148+
### Running all test suites
132149

133150
To run all the unit test suites and the E2E tests, you may simply run:
134151

135152
```shell
136153
npm start -- test.all
137154
```
138155

139-
## App confugration
140-
There is an app configuration management in place. Two standart environments are already set (devlopment and production).
156+
## App configuration
157+
There is an app configuration management in place. Two standard environments are already set (development and production).
141158
You can for example build the production with:
142159

143160
```shell
144161
npm start -- webpack.build.production
145162
```
146163

147-
If you like to add an additional configuaration you have to do the following two steps:
164+
If you like to add an additional configuration you have to do the following two steps:
148165
1. Add the configuration json to ```app/config```, example preprod.json
149166
2. Add the corresponding command to ```package-script.js``` and pass the right argument like ```--env.config=preprod```
150167

@@ -166,11 +183,11 @@ preprod: {
166183
}
167184
```
168185

169-
## HTML5 pushState routing
186+
## HTML5 pushState routing
170187
By default pushState, also known as html5 routing, is enabled. The Webpack server is already configured to handle this but many webserver need
171-
extra confuration to enable this.
188+
extra configuration to enable this.
172189

173-
## Cordova - Mobile Development
190+
## Cordova - Mobile development
174191

175192
### Installation
176193
Initiate cordova with the following commands:
@@ -181,15 +198,15 @@ npm start -- mobile.setup
181198

182199
### Run and build
183200
Cordova takes the ```www``` folder source to create the Cordova app. This ```www``` folder is a symlink pointing to the ```dist``` folder.
184-
So make sure you run for example ```npm start -- build``` first before runing/building a Cordova app.
201+
So make sure you run for example ```npm start -- build``` first before running/building a Cordova app.
185202

186203
Sometimes the ```www``` symlink is removed (e.g. git clone). Run this command to fix this:
187204
```shell
188205
npm start -- mobile.link
189206
```
190207

191-
## Docker
192-
There is a ```Dockerfile``` unsing the [nginx](https://hub.docker.com/_/nginx/) image to build the docker image.
208+
## Docker
209+
There is a ```Dockerfile``` using the [nginx](https://hub.docker.com/_/nginx/) image to build the docker image.
193210

194211
### Getting started
195212
First build your aurelia app with
@@ -213,22 +230,22 @@ If you like to update the source do this
213230
docker cp ./dist/. mycontainer:/usr/share/nginx/html
214231
```
215232

216-
## Additional features
217-
This repo houses some additional features which provd to be very useful in projects.
233+
## Additional features
234+
This repository houses some additional features which prove to be very useful in projects.
218235

219-
## String polyfill
236+
### String polyfill
220237
The file `utils/polyfills.utils.ts` contains a string polyfills.
221238
With this polyfill you can do this:
222239
```
223-
'Teststring'.isEmpty() => false
224-
''.isEmpty() => true
225-
undefined.isEmpty() => true
240+
String.isEmpty('Teststring') => false
241+
String.isEmpty('') => true
242+
String.isEmpty(undefined) => true
226243
```
227244

228-
## Validation
229-
The file `utils/validation.utils.ts` contains some validatoin helper functions and regex patterns.
245+
### Validation
246+
The file `utils/validation.utils.ts` contains some validation helper functions and regex patterns.
230247

231-
The function `validateFilledFieldsWithValidationRules` us really useful as you can check a object which is already prefiled if it's valid and if not show errors.
248+
The function `validateFilledFieldsWithValidationRules` us really useful as you can check a object which is already prefilled if it's valid and if not show errors.
232249

233250
The function `controllerValidByRules` will check if a validation controller is valid.
234251

@@ -266,19 +283,19 @@ class FormExample {
266283
.ensure((user: User) => user.email)
267284
.displayName('USER.EMAIL')
268285
.email()
269-
.on(this.customerContact).rules;
286+
.on(this.user).rules;
270287
}
271288
}
272289
```
273290

274291
### i18n integration
275-
You can pass a tranlation string into the `displayName('USER.LAST_NAME')` and it will be translated for you.
292+
You can pass a translation string into the `displayName('USER.LAST_NAME')` and it will be translated for you.
276293

277-
Additionally you can translate methods like `.required()` in `src/local/*` as demostrated in the files.
294+
Additionally you can translate methods like `.required()` in `src/local/*` as demonstrated in the files.
278295

279296
If you use the the method `withMessageKey('YOUR.TRANSLATION')` you can pass a translation string and it will be translated for you.
280297

281-
## Route generator service
298+
### Route generator service
282299
If you have router tree like this
283300
```
284301
root
@@ -287,7 +304,7 @@ left right
287304
```
288305
You can't navigate from `left` to `right` with `this.router.navigateToRoute(...)` as `right` is in a branch which `left` is unaware of. This is due to the injection of the router service.
289306

290-
One solution is to use `this.router.navigate(...)` but this is unsave as if the route configuration is changed the navigation is broken as it's hardcoded.
307+
One solution is to use `this.router.navigate(...)` but this is unsafe as if the route configuration is changed the navigation is broken as it's hard coded.
291308

292309
The `route-generator.service.ts` will provide a type safe solution for save navigation.
293310

@@ -312,11 +329,11 @@ this.routeGeneratorService.navigateByRouteNames(
312329
);
313330
```
314331

315-
## Class transfomer (model handling)
332+
### Class transformer (model handling)
316333
We have included the [class transformer](https://github.com/typestack/class-transformer) which helps creating models (`src/app/models/*`). This transformation can be done
317334
in both direction (rest to model, model to rest).
318335

319-
## Dialog service
320-
There is a custom dialog implementation for simpler useage of elements in dialogs.
336+
### Dialog service
337+
There is a custom dialog implementation for simpler usage of elements in dialogs.
321338

322339
The Service is named `generic-dialog.service.ts` and an example can be found in `welcome.vm.ts`.

package-scripts.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ module.exports = {
4141
development: {
4242
default: series(
4343
'nps webpack.build.before',
44-
'webpack --progress -d --env.extractCss --env.config=development'
44+
'webpack --progress --mode development --env.extractCss --env.config=development'
4545
),
4646
inlineCss: series(
4747
'nps webpack.build.before',
48-
'webpack --progress -d --env.config=development'
48+
'webpack --progress --mode development --env.config=development'
4949
),
5050
serve: series.nps(
5151
'webpack.build.development',
@@ -55,11 +55,11 @@ module.exports = {
5555
production: {
5656
inlineCss: series(
5757
'nps webpack.build.before',
58-
'webpack --progress -p --env.production --env.config=production'
58+
'webpack --progress --mode production --env.production --env.config=production'
5959
),
6060
default: series(
6161
'nps webpack.build.before',
62-
'webpack --progress -p --env.production --env.extractCss --env.config=production'
62+
'webpack --progress --mode production --env.production --env.extractCss --env.config=production'
6363
),
6464
serve: series.nps(
6565
'webpack.build.production',
@@ -68,9 +68,9 @@ module.exports = {
6868
}
6969
},
7070
server: {
71-
default: `webpack-dev-server -d --inline --env.server --env.extractCss`,
72-
inlineCss: `webpack-dev-server -d --inline --env.server`,
73-
hmr: `webpack-dev-server -d --inline --hot --env.server`
71+
default: `webpack-dev-server --mode development --inline --env.server --env.extractCss`,
72+
inlineCss: `webpack-dev-server --mode development --inline --env.server`,
73+
hmr: `webpack-dev-server --mode development --inline --hot --env.server`
7474
},
7575
},
7676
serve: 'http-server dist --cors --gzip',
@@ -118,6 +118,18 @@ module.exports = {
118118
'cd ./cordova && ./../node_modules/.bin/cordova platform add browser'
119119
),
120120
}
121+
},
122+
analyse: "webpack --progress --mode production --env.production --env.extractCss --env.config=development --env.analyse",
123+
tg: {
124+
vm: 'tg -d ./scripts/templates vm',
125+
route: 'tg -d ./scripts/templates route',
126+
element: 'tg -d ./scripts/templates element',
127+
template: 'tg -d ./scripts/templates template',
128+
attribute: 'tg -d ./scripts/templates attribute',
129+
converter: 'tg -d ./scripts/templates converter',
130+
pipeline: 'tg -d ./scripts/templates pipeline',
131+
service: 'tg -d ./scripts/templates service',
132+
restservice: 'tg -d ./scripts/templates restservice'
121133
}
122-
},
134+
}
123135
}

0 commit comments

Comments
 (0)