Permalink
Browse files

Initial commit with Aurelia project setup based on skeleton.

  • Loading branch information...
Mateusz Korzel
Mateusz Korzel committed Jan 14, 2017
1 parent 0eef283 commit e90db931b33a8b46a34c9016a85c804619d01116
Showing with 1,772 additions and 1 deletion.
  1. +18 −0 .editorconfig
  2. +11 −0 .gitignore
  3. +3 −0 .npmignore
  4. +34 −0 .sass-lint.yml
  5. +21 −0 .vscode/launch.json
  6. +5 −0 .vscode/settings.json
  7. +15 −0 .vscode/tasks.json
  8. +102 −1 README.md
  9. +14 −0 build/args.js
  10. +40 −0 build/bundles.js
  11. +23 −0 build/export.js
  12. +51 −0 build/paths.js
  13. +98 −0 build/tasks/build.js
  14. +18 −0 build/tasks/bundle.js
  15. +10 −0 build/tasks/clean.js
  16. +28 −0 build/tasks/dev.js
  17. +99 −0 build/tasks/export-release.js
  18. +19 −0 build/tasks/lint.js
  19. +40 −0 build/tasks/prepare-release.js
  20. +56 −0 build/tasks/serve.js
  21. +93 −0 build/tasks/test.js
  22. +21 −0 build/tasks/watch.js
  23. +197 −0 config.js
  24. BIN favicon.ico
  25. BIN fonts/glyphicons-halflings-regular.eot
  26. +288 −0 fonts/glyphicons-halflings-regular.svg
  27. BIN fonts/glyphicons-halflings-regular.ttf
  28. BIN fonts/glyphicons-halflings-regular.woff
  29. BIN fonts/glyphicons-halflings-regular.woff2
  30. +7 −0 gulpfile.js
  31. +23 −0 index.html
  32. +81 −0 karma.conf.js
  33. +90 −0 package.json
  34. +9 −0 src/app.html
  35. +15 −0 src/app.ts
  36. +3 −0 src/config/app.config.deploy.json
  37. +10 −0 src/config/app.config.json
  38. +4 −0 src/config/app.config.json.d.ts
  39. +9 −0 src/home.html
  40. +2 −0 src/home.ts
  41. +14 −0 src/main.ts
  42. +25 −0 src/templates/nav-bar.html
  43. +5 −0 src/templates/unexpected-error/unexpected-error.html
  44. +2 −0 src/templates/unexpected-error/unexpected-error.ts
  45. +8 −0 styles/main.scss
  46. +33 −0 styles/sass/_layout.scss
  47. +37 −0 test/unit/app.spec.ts
  48. +3 −0 test/unit/setup.ts
  49. +35 −0 tsconfig.json
  50. +18 −0 tslint.json
  51. +35 −0 typings.json
@@ -0,0 +1,18 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Windows-style newlines with no newline ending every file
[*]
end_of_line = crlf
insert_final_newline = false
# 2 space indentation
[**.*]
indent_style = space
indent_size = 2
[*.scss]
indent_style = space
indent_size = 4
@@ -0,0 +1,11 @@
node_modules
jspm_packages
.idea
.DS_STORE
/dist
/test/dist
/test/unit/all-modules.spec.ts
coverage
/typings
/export
/styles/main.css
@@ -0,0 +1,3 @@
jspm_packages
bower_components
.idea
@@ -0,0 +1,34 @@
# Converted by http://sasstools.github.io/make-sass-lint-config/
# sass-lint config generated by make-sass-lint-config v0.1.1
#
# The following scss-lint Linters are not yet supported by sass-lint:
# SelectorDepth
#
# The following settings/values are unsupported by sass-lint:
# Linter Indentation, option "allow_non_nested_indentation"
# Linter Indentation, option "character"
files:
include: '**/*.s+(a|c)ss'
options:
formatter: stylish
merge-default-rules: false
rules:
final-newline: 0
indentation:
- 2
- size: 4
nesting-depth:
- 2
- max-depth: 6
no-important: 0
no-qualifying-elements:
- 2
- allow-element-with-attribute: true
allow-element-with-class: true
no-vendor-prefixes: 0
quotes:
- 2
- style: single
single-line-per-selector: 0
#property-sort-order: 2
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:9000",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
},
{
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
]
}
@@ -0,0 +1,5 @@
// Place your settings in this file to overwrite default and user settings.
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.detectIndentation": true
}
@@ -0,0 +1,15 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": ["--no-color"],
"showOutput": "always",
"tasks": [
{
"taskName": "watch",
"isBuildCommand": true
}
]
}
103 README.md
@@ -1,2 +1,103 @@
# simple-aurelia-app
Simple Aurelia App using Typescript & JSPM
## Running The App
To run the app, follow these steps.
1. Ensure that [NodeJS](http://nodejs.org/) is installed. This provides the platform on which the build tooling runs.
2. From the project folder, execute the following command:
```shell
npm install
```
3. Ensure that [Gulp](http://gulpjs.com/) is installed globally. If you need to install it, use the following command:
```shell
npm install -g gulp
```
> **Note:** Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
4. Ensure that [jspm](http://jspm.io/) is installed globally. If you need to install it, use the following command:
```shell
npm install -g jspm
```
> **Note:** jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
> **Note:** jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing `jspm registry config github` and following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHub `Settings > Personal Access Tokens`), `public_repo` access for the token is required.
5. Install the client-side dependencies with jspm:
```shell
jspm install -y
```
>**Note:** Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing `npm install -g unzip` and then re-running `jspm install`.
6. To run the app, execute the following command:
```shell
gulp watch
```
7. Browse to [http://localhost:9000](http://localhost:9000) to see the app. You can make changes in the code found under `src` and the browser should auto-refresh itself as you save files.
> The Skeleton App uses [BrowserSync](http://www.browsersync.io/) for automated page refreshes on code/markup changes concurrently across multiple browsers. If you prefer to disable the mirroring feature set the [ghostMode option](http://www.browsersync.io/docs/options/#option-ghostMode) to false
## Bundling
Bundling is performed by [Aurelia Bundler](http://github.com/aurelia/bundler). A gulp task is already configured for that. Use the following command to bundle the app:
```shell
gulp bundle
```
You can also unbundle using the command bellow:
```shell
gulp unbundle
```
To start the bundled app, execute the following command:
```shell
gulp serve-bundle
```
#### Configuration
The configuration is done by ```bundles.js``` file.
##### Optional
Under ```options``` of ```dist/aurelia``` add ```rev: true``` to add bundle file revision/version.
## Running The Unit Tests
To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:
1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command:
```shell
npm install -g karma-cli
```
2. Install Aurelia libs for test visibility:
```shell
jspm install aurelia-framework
jspm install aurelia-http-client
jspm install aurelia-router
```
3. You can now run the tests with this command:
```shell
karma start
```
## Exporting bundled production version
A gulp task is already configured for that. Use the following command to export the app:
```shell
gulp export
```
The app will be exported into ```export``` directory preserving the directory structure.
To start the exported app, execute the following command:
```shell
gulp serve-export
```
#### Configuration
The configuration is done by ```bundles.js``` file.
In addition, ```export.js``` file is available for including individual files.
@@ -0,0 +1,14 @@
var yargs = require('yargs');
var argv = yargs.argv;
var validBumpTypes = 'major|minor|patch|prerelease'.split('|');
var bump = (argv.bump || 'patch').toLowerCase();
if (validBumpTypes.indexOf(bump) === -1) {
throw new Error('Unrecognized bump "' + bump + '".');
}
module.exports = {
bump: bump,
depth: parseInt(argv.depth || '0')
};
@@ -0,0 +1,40 @@
module.exports = {
"bundles": {
"dist/app-build": {
"includes": [
"[**/*.js]",
"**/*.html!text",
"**/*.css!text"
],
"options": {
"inject": true,
"minify": true,
"depCache": true,
"rev": true
}
},
"dist/lib-build": {
"includes": [
"aurelia-framework",
"aurelia-bootstrapper",
"aurelia-fetch-client",
"aurelia-router",
"aurelia-animator-css",
"aurelia-templating-binding",
"aurelia-polyfills",
"aurelia-templating-resources",
"aurelia-templating-router",
"aurelia-loader-default",
"aurelia-history-browser",
"aurelia-logging-console",
"fetch"
],
"options": {
"inject": true,
"minify": true,
"depCache": false,
"rev": true
}
}
}
};
@@ -0,0 +1,23 @@
// this file provides a list of unbundled files that
// need to be included when exporting the application
// for production.
module.exports = {
'list': [
'index.html',
'config.js',
'favicon.ico',
"jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js",
'jspm_packages/system.js',
'jspm_packages/system-polyfills.js',
'jspm_packages/system-csp-production.js',
'jspm_packages/github/systemjs/plugin-json@0.1.2.js',
'jspm_packages/github/systemjs/plugin-json@0.1.2/*.js',
'styles/main.css'
],
// this section lists any jspm packages that have
// unbundled resources that need to be exported.
// these files are in versioned folders and thus
// must be 'normalized' by jspm to get the proper
// path.
'normalize': [ ]
};
@@ -0,0 +1,51 @@
var appRoot = 'src/',
appConfig = 'config/',
outputRoot = 'dist/',
exporSrvtRoot = 'export/',
stylesRoot = 'styles/',
fontsRoot = 'fonts/',
imgRoot = 'images/',
testRoot = 'test/';
module.exports = {
root: appRoot,
source: appRoot + '**/*.ts',
testsRoot: testRoot,
tests: testRoot + 'unit/**/*.ts',
testsOutput: testRoot + 'dist/',
html: appRoot + '**/*.html',
css: appRoot + '**/*.css',
style: stylesRoot + '**/*.css',
styleFolder: stylesRoot,
sass: stylesRoot + '**/*.scss',
output: outputRoot,
exportSrv: exporSrvtRoot,
doc: './doc',
dtsSrc: [
'./typings/**/*.d.ts',
'./custom_typings/**/*.d.ts',
'./src/**/*.d.ts'
],
config: {
file: 'app.config.json',
folder: appConfig,
local: appRoot + appConfig + 'app.config.json',
deploy: appRoot + appConfig + 'app.config.deploy.json'
},
fonts: {
folder: fontsRoot,
files: [
'jspm_packages/github/twbs/bootstrap-sass@3.3.7/assets/fonts/bootstrap/*.*'
]
},
img: {
folder: imgRoot,
files: [ ]
},
coverage: {
instrumentationFilePath: testRoot + 'unit/all-modules.spec.ts',
excludePaths: [
'.d.ts'
]
}
}
Oops, something went wrong.

0 comments on commit e90db93

Please sign in to comment.