Skip to content

Commit 26992ac

Browse files
authored
chore(*): Cleanup and refactor build process (#39)
- Use Angular Package Builder - Cleanup no longer needed dependencies - Update dependencies (except TypeScript) - Update build scripts - Update Travis CI configuration´ - Remove linters (will come back at some point though ...)
1 parent 355785e commit 26992ac

34 files changed

+1532
-5219
lines changed

.angular-package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "./node_modules/angular-package-builder/angular-package.schema.json",
3+
"entryFile": "src/lib/index.ts",
4+
"outDir": "dist"
5+
}

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.sass-lint.yml

Lines changed: 0 additions & 168 deletions
This file was deleted.

.travis.yml

Lines changed: 88 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,99 @@
1-
dist: trusty # Beta build environment (newer OS, at least it seems)
2-
sudo: false # Container instead of VM (thus, a lot faster)
1+
# General settings
2+
dist: trusty
3+
sudo: false
34
language: node_js
5+
node_js:
6+
- "lts/*"
47
cache:
58
directories:
69
- node_modules
710
notifications:
811
email: false
912
branches:
1013
only:
11-
- master # Testing, Building, Releasing
12-
- develop # Testing, Building
13-
- feature/travis # Branch specifically for testing Travis CI
14+
- master
15+
- develop
16+
- /^greenkeeper/.*$/
1417

15-
before_install:
16-
- if [ "$TRAVIS_BRANCH" == "master" ]; then
17-
git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
18-
cd "$TRAVIS_REPO_SLUG";
19-
git checkout -qf "$TRAVIS_COMMIT";
20-
fi
21-
- npm install -g npm
22-
install:
23-
- npm install
18+
# Build stages
19+
stages:
20+
- name: build
21+
- name: test
22+
- name: release
23+
if: branch = master
2424

25-
script:
26-
- npm run lint
27-
- npm run ci:test && npm run ci:coverage
28-
- npm run build
25+
# Build jobs
26+
jobs:
27+
include:
2928

30-
before_deploy:
31-
- git config --global user.name "dominique-mueller"
32-
- git config --global user.email "[email protected]"
33-
- git config credential.helper "store --file=.git/credentials"
34-
- echo "https://$GH_TOKEN:@github.com" > .git/credentials
35-
- git checkout master
36-
- npm run ci:automatic-release
37-
- npm run ci:post-automatic-release
38-
39-
- cd dist && pkg-ok module es2015 typings && cd ..
40-
- irish-pub
41-
deploy:
42-
provider: npm
43-
44-
api_key: "$NPM_TOKEN"
45-
skip_cleanup: true
46-
on:
47-
branch: master
48-
repo: dominique-mueller/angular-notifier
29+
- stage: build
30+
env:
31+
- ANGULAR=5.0.x
32+
install:
33+
- npm install
34+
- npm install @angular/common@$ANGULAR @angular/core@$ANGULAR
35+
script:
36+
- npm run build:js
37+
- npm run build:sass
38+
- npm run build:css
39+
-
40+
env:
41+
- ANGULAR=5.1.x
42+
install:
43+
- npm install
44+
- npm install @angular/common@$ANGULAR @angular/core@$ANGULAR
45+
script:
46+
- npm run build:js
47+
- npm run build:sass
48+
- npm run build:css
49+
50+
- stage: test
51+
env:
52+
- ANGULAR=5.0.x
53+
install:
54+
- npm install
55+
- npm install @angular/common@$ANGULAR @angular/core@$ANGULAR
56+
script:
57+
- npm run test
58+
-
59+
env:
60+
- ANGULAR=5.1.x
61+
install:
62+
- npm install
63+
- npm install @angular/common@$ANGULAR @angular/core@$ANGULAR
64+
script:
65+
- npm run test
66+
after_success:
67+
- npm run test:coverage
68+
69+
- stage: release
70+
before_install:
71+
# Clone the whole repository because we also need the develop branch for releasing (Travis only gives us the master by default)
72+
- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
73+
- cd "$TRAVIS_REPO_SLUG";
74+
- git checkout -qf "$TRAVIS_COMMIT";
75+
# Fix Travis CI issue of detached heads in git
76+
- git checkout master
77+
install:
78+
- npm install
79+
script:
80+
- npm run build:js
81+
- npm run build:sass
82+
- npm run build:css
83+
before_deploy:
84+
# Login to Git to be able to make commits (required by automatic-release)
85+
- git config --global user.name "dominique-mueller";
86+
- git config --global user.email "[email protected]";
87+
- git config credential.helper "store --file=.git/credentials";
88+
- echo "https://$GH_TOKEN:@github.com" > .git/credentials;
89+
# Do release
90+
- npm run release
91+
# Publish the dist folder
92+
- cd dist
93+
deploy:
94+
provider: npm
95+
96+
api_key: "$NPM_TOKEN"
97+
skip_cleanup: true
98+
after_deploy:
99+
- cd ..

browserlist

Lines changed: 0 additions & 4 deletions
This file was deleted.

codedov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
comment:
2+
layout: "diff, flags, files" # Do not show the weird graph
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
threshold: 1 # Allow the coverage to decrease by 1%
9+
patch:
10+
default:
11+
threshold: 1 # Allow the coverage to decrease by 1%

0 commit comments

Comments
 (0)