Skip to content

Commit e42dda9

Browse files
committed
chore(gulp): Added build workflow and CI configuration, prepared demo
- Added basic configuration files (ignores, tsconfig, tslint, ...) - Added Gulp tasks for building and linting TS & SASS, cleaning the environment, testing, and automatic semantic relelease (plus watchers) - Setup test environment with Jasmine and Karma (for now), updated Travis CI to run tests in the newest version of Chrome (no longer v37) - Updated package file
1 parent 0f2b5a2 commit e42dda9

39 files changed

+1590
-2
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
/node_modules
3+
/typings
4+
5+
# Build code
6+
/index.js
7+
/index.js.map
8+
/index.d.ts
9+
/src/**/*.js
10+
/src/**/*.js.map
11+
/src/**/*.d.ts
12+
/style.css
13+
/src/styles/**/*.css
14+
15+
# Demo build code
16+
/demo/*.js
17+
!/demo/systemjs.config.js
18+
19+
# Logs
20+
*.log
21+
22+
# Development
23+
*.todo
24+
*.old
25+
*.temp
26+
*.tmp

.npmignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Dependencies
2+
/node_modules
3+
/typings
4+
5+
# Source code
6+
/index.ts
7+
/src/**/*.ts
8+
!/src/**/*.d.ts
9+
10+
# Demo code
11+
/demo
12+
13+
# Build process
14+
/gulp-tasks
15+
/.nvmrc
16+
/.sass-lint.yml
17+
/.travis.yml
18+
/browserlist
19+
/gulpfile.js
20+
/gulpfile.config.json
21+
/karma.config.js
22+
/karma-test-shim.js
23+
/tsconfig.json
24+
/tslint.json
25+
/typings.json
26+
27+
# GitHub templates
28+
/.github
29+
30+
# Logs
31+
*.log
32+
33+
# Development
34+
*.todo
35+
*.old
36+
*.temp
37+
*.tmp

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.12

.sass-lint.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
rules:
2+
bem-depth:
3+
- 1
4+
- max-depth: 1
5+
border-zero:
6+
- 1
7+
- convention: none
8+
brace-style:
9+
- 1
10+
- style: 1tbs
11+
allow-single-line: false
12+
class-name-format:
13+
- 1
14+
- allow-leading-underscore: false
15+
convention: hyphenatedbem
16+
clean-import-paths:
17+
- 1
18+
- filename-extension: true
19+
leading-underscore: false
20+
empty-args:
21+
- 1
22+
- include: true
23+
empty-line-between-blocks:
24+
- 1
25+
- ignore-single-line-rulesets: false
26+
extends-before-declarations: 1
27+
extends-before-mixins: 1
28+
final-newline:
29+
- 1
30+
- include: true
31+
force-attribute-nesting: 1
32+
force-element-nesting: 1
33+
force-pseudo-nesting: 1
34+
function-name-format:
35+
- 1
36+
- allow-leading-underscore: false
37+
convention: hyphenatedbem
38+
hex-length:
39+
- 1
40+
- style: short
41+
hex-notation:
42+
- 1
43+
- style: uppercase
44+
id-name-format:
45+
- 1
46+
- allow-leading-underscore: false
47+
convention: hyphenatedbem
48+
indentation: 0
49+
leading-zero:
50+
- 1
51+
- include: false
52+
mixin-name-format:
53+
- 1
54+
- allow-leading-underscore: false
55+
convention: hyphenatedbem
56+
mixins-before-declarations: 1
57+
nesting-depth:
58+
- 1
59+
- max-depth: 3
60+
no-color-literals: 0
61+
no-css-comments: 1
62+
no-debug: 1
63+
no-duplicate-properties: 1
64+
no-empty-rulesets: 1
65+
no-extends: 1
66+
no-ids: 1
67+
no-important: 1
68+
no-invalid-hex: 1
69+
no-mergeable-selectors: 1
70+
no-misspelled-properties: 1
71+
no-qualifying-elements:
72+
- 1
73+
- allow-element-with-attribute: true
74+
allow-element-with-class: true
75+
allow-element-with-id: false
76+
no-trailing-zero: 1
77+
no-transition-all: 1
78+
no-url-protocols: 1
79+
no-vendor-prefixes: 1
80+
no-warn: 1
81+
one-declaration-per-line: 1
82+
placeholder-in-extend: 1
83+
placeholder-name-format:
84+
- 1
85+
- allow-leading-underscore: false
86+
convention: hyphenatedbem
87+
property-sort-order:
88+
- 1
89+
- order: smacss
90+
ignore-custom-properties: true
91+
property-units:
92+
- 1
93+
- global:
94+
- "px"
95+
- "rem"
96+
- "%"
97+
- "s"
98+
quotes:
99+
- 1
100+
- style: double
101+
shorthand-values:
102+
- 1
103+
- allowed-shorthands:
104+
- 1
105+
- 2
106+
- 3
107+
single-line-per-selector: 1
108+
space-after-bang:
109+
- 1
110+
- include: false
111+
space-after-colon:
112+
- 1
113+
- include: true
114+
space-after-comma:
115+
- 1
116+
- include: true
117+
space-around-operator:
118+
- 1
119+
- include: true
120+
space-before-bang:
121+
- 1
122+
- include: true
123+
space-before-brace:
124+
- 1
125+
- include: true
126+
space-before-colon:
127+
- 1
128+
- include: false
129+
space-between-parens:
130+
- 1
131+
- include: false
132+
trailing-semicolon: 1
133+
url-quotes: 1
134+
variable-for-property:
135+
- 1
136+
variable-name-format:
137+
- 1
138+
- allow-leading-underscore: false
139+
convention: hyphenatedlowercase
140+
zero-unit:
141+
- 1
142+
- include: false

.travis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
sudo: required # Necessary for the apt-get
2+
dist: trusty # Beta build environment (newer OS, at least it seems)
3+
language: node_js
4+
cache:
5+
directories:
6+
- node_modules
7+
addons:
8+
apt:
9+
sources:
10+
- google-chrome
11+
packages:
12+
- google-chrome-stable # Get the latest stable version of Chrome (Karma will work with it)
13+
notifications:
14+
email: false
15+
branches:
16+
only:
17+
- master # Testing, Building, Releasing
18+
- develop # Testing, Building
19+
20+
before_install:
21+
- export CHROME_BIN=/usr/bin/google-chrome # Chrome path
22+
- npm install -g npm # Update npm to its latest version
23+
install:
24+
- npm install
25+
- npm run typings install # Install typings
26+
27+
before_script:
28+
- npm prune
29+
- export DISPLAY=:99.0
30+
- sh -e /etc/init.d/xvfb start # Run xvfb to fake a display (muhaha ...)
31+
script:
32+
- npm run gulp build:prod && npm run gulp test # First build, then (if successful) test
33+
34+
before_deploy: # Automatic semantic release
35+
- git config --global user.name "dominique-mueller"; # Setup git
36+
- git config --global user.email "dominique.m.mueller@gmail.com";
37+
- git config credential.helper "store --file=.git/credentials";
38+
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials; # GH_TOKEN = env variable
39+
- git checkout master # Fix Travis CI issue of detached head in git
40+
- npm run gulp release # Release
41+
deploy:
42+
provider: npm
43+
email: dominique.m.mueller@gmail.com
44+
api_key: "${NPM_TOKEN}" # NPM_TOKEN = env variable
45+
skip_cleanup: true # Publish built files
46+
on:
47+
branch: master
48+
repo: dominique-mueller/angular-notifier

CHANGELOG.md

Whitespace-only changes.

browserlist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> 10%
2+
Last 10 versions
3+
Firefox ESR
4+
not ie <= 10 # Not sorry

demo/app.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* External imports
3+
*/
4+
import { Component } from '@angular/core';
5+
6+
/**
7+
* App component
8+
*/
9+
@Component( {
10+
selector: 'app',
11+
template: '<h1>Hello World</h1>'
12+
} )
13+
export class AppComponent { }

demo/app.module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* External imports
3+
*/
4+
import { NgModule } from '@angular/core';
5+
import { BrowserModule } from '@angular/platform-browser';
6+
7+
/**
8+
* Internal imports
9+
*/
10+
import { AppComponent } from './app.component';
11+
12+
/**
13+
* App module
14+
*/
15+
@NgModule( {
16+
imports: [ BrowserModule ],
17+
declarations: [ AppComponent ],
18+
bootstrap: [ AppComponent ]
19+
} )
20+
export class AppModule {}

demo/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
8+
<title>"angular-notifier" demo</title>
9+
10+
<!-- Load libraries, polyfills first-->
11+
<script src="./../node_modules/core-js/client/shim.min.js"></script>
12+
<script src="./../node_modules/reflect-metadata/Reflect.js"></script>
13+
<script src="./../node_modules/zone.js/dist/zone.js"></script>
14+
<script src="./../node_modules/systemjs/dist/system.src.js"></script>
15+
16+
<!-- Configure and run SystemJS module loader -->
17+
<script src="./systemjs.config.js"></script>
18+
<script>
19+
System.import( 'app' ).catch( ( error ) => {
20+
console.error( error );
21+
} );
22+
</script>
23+
24+
<!-- Load styles -->
25+
<link href="./style.css" rel="stylesheet">
26+
27+
</head>
28+
<body>
29+
<app>
30+
Loading demo for "angular-notifier" ...
31+
</app>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)