Skip to content

Commit

Permalink
Major refactoring of development and continuous integration scripts, f…
Browse files Browse the repository at this point in the history
…ixes #294 (#295)

* Major refactoring of dev and ci scripts, adding support for npm 6.x, fixes #294

* Don't use package-lock.json

* Correct --prefix syntax

* Remove test throw

* Workaround for npm creating weird symlinks on Windows

* Use cd instead of --prefix, npm is weird on windows
  • Loading branch information
erikbarke committed Oct 30, 2018
1 parent eb43379 commit a5832e5
Show file tree
Hide file tree
Showing 54 changed files with 280 additions and 307 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dist
*.tgz
bower_components
coverage
dist
node_modules
npm-debug.log
package-lock.json
tmp
.idea
12 changes: 11 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
.editorconfig
.eslintrc.js
*.tgz
*.yml
assets
bower_components
ci
coverage
examples
node_modules
npm-debug.log
tmp
src
tests
tmp
tsconfig.json
tslint.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: required

language: node_js

node_js: 6
node_js: 8

before_script:
- "sudo chown root /opt/google/chrome/chrome-sandbox"
Expand All @@ -12,7 +12,7 @@ addons:
chrome: stable

install:
- ./ci/install.sh
- npm run setup

script:
- npm run ci
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (C) 2016-2017 Erik Barke, Monounity.
Copyright (C) 2016-2018 Erik Barke, Monounity.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,4 +647,4 @@ These are the environments reported failing/working:

This software is licensed with the MIT license.

© 2016-2017 Erik Barke, Monounity
© 2016-2018 Erik Barke, Monounity
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
environment:
nodejs_version: "6"
nodejs_version: "8"

install:
- ps: Install-Product node $env:nodejs_version
- set PATH=%APPDATA%\npm;%PATH%
- node -v
- npm -v
- ci\install.bat
- npm run setup

test_script:
- npm run ci
Expand Down
27 changes: 0 additions & 27 deletions ci/install.bat

This file was deleted.

41 changes: 0 additions & 41 deletions ci/install.sh

This file was deleted.

48 changes: 0 additions & 48 deletions ci/run.js

This file was deleted.

1 change: 1 addition & 0 deletions examples/angular2/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
8 changes: 5 additions & 3 deletions examples/angular2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Typescript on the fly in Karma with Angular2 and Istanbul coverage.
## Installation

```
npm install karma-typescript
cd node_modules/karma-typescript/examples/angular2
git clone https://github.com/monounity/karma-typescript.git
cd karma-typescript
npm run build
cd examples/angular2
npm install
```

Expand Down Expand Up @@ -91,4 +93,4 @@ karmaTypescriptConfig: {

This software is licensed with the MIT license.

© 2016-2017 Erik Barke, Monounity
© 2016-2018 Erik Barke, Monounity
4 changes: 3 additions & 1 deletion examples/angular2/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = function(config) {

reporters: ["dots", "karma-typescript"],

browsers: ["Chrome"]
browsers: ["ChromeHeadless"],

singleRun: true
});
};
7 changes: 1 addition & 6 deletions examples/angular2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"private": true,
"license": "MIT",
"scripts": {
"dev": "gulp dev --cwd . && karma start",
"dev:ci": "gulp dev:ci --cwd . && karma start --browsers ChromeHeadless --single-run",
"test": "karma start"
},
"dependencies": {
Expand All @@ -29,13 +27,10 @@
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.0.2",
"karma-typescript": "../../",
"karma-typescript": "file:../../karma-typescript-3.0.13.tgz",
"karma-typescript-angular2-transform": "latest",
"rxjs": "^5.3.0",
"typescript": "latest",
"zone.js": "^0.8.8"
},
"devDependencies": {
"gulp": "^3.9.1"
}
}
1 change: 1 addition & 0 deletions examples/angularjs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
15 changes: 11 additions & 4 deletions examples/angularjs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Runnable example of unit testing Typescript on the fly in Karma with AngularJS and Istanbul coverage

To run the example tests, issue the following commands:
## Installation

```
npm install karma-typescript
cd node_modules/karma-typescript/examples/angularjs
git clone https://github.com/monounity/karma-typescript.git
cd karma-typescript
npm run build
cd examples/angularjs
npm install
```

## Running

```
npm test
```

Expand All @@ -15,4 +22,4 @@ The example unit tests should now run in Karma and html test coverage should be

This software is licensed with the MIT license.

© 2016-2017 Erik Barke, Monounity
© 2016-2018 Erik Barke, Monounity
4 changes: 3 additions & 1 deletion examples/angularjs/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = function(config) {
tsconfig: "./tsconfig.json"
},

browsers: ["Chrome"]
browsers: ["ChromeHeadless"],

singleRun: true
});
};
7 changes: 1 addition & 6 deletions examples/angularjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"private": true,
"license": "MIT",
"scripts": {
"dev": "gulp dev --cwd . && karma start",
"dev:ci": "gulp dev:ci --cwd . && karma start --browsers ChromeHeadless --single-run",
"test": "karma start"
},
"dependencies": {
Expand All @@ -25,10 +23,7 @@
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.0",
"karma-typescript": "../../",
"karma-typescript": "file:../../karma-typescript-3.0.13.tgz",
"typescript": "latest"
},
"devDependencies": {
"gulp": "^3.9.1"
}
}
1 change: 1 addition & 0 deletions examples/docker/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
1 change: 1 addition & 0 deletions examples/gulp/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion examples/gulp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"karma": "1.5.0",
"karma-jasmine": "^1.0.2",
"karma-nyan-reporter": "0.2.4",
"karma-typescript": "../../",
"karma-typescript": "file:../../karma-typescript-3.0.13.tgz",
"karma-phantomjs-launcher": "1.0.2",
"run-sequence": "1.2.2",
"gulp": "3.9.1",
Expand Down
3 changes: 0 additions & 3 deletions examples/mocha/.npmignore

This file was deleted.

1 change: 1 addition & 0 deletions examples/mocha/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
15 changes: 11 additions & 4 deletions examples/mocha/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Runnable example of unit testing Typescript on the fly in Karma with Istanbul coverage and Mocha

To run the example tests, issue the following commands:
## Installation

```
npm install karma-typescript
cd node_modules/karma-typescript/examples/mocha
git clone https://github.com/monounity/karma-typescript.git
cd karma-typescript
npm run build
cd examples/mocha
npm install
```

## Running

```
npm test
```

Expand All @@ -15,4 +22,4 @@ The example unit tests should now run in Karma and html test coverage should be

This software is licensed with the MIT license.

© 2016-2017 Erik Barke, Monounity
© 2016-2018 Erik Barke, Monounity
4 changes: 3 additions & 1 deletion examples/mocha/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = function(config) {

reporters: ["dots", "karma-typescript"],

browsers: ["Chrome"]
browsers: ["ChromeHeadless"],

singleRun: true
});
};
7 changes: 1 addition & 6 deletions examples/mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"private": true,
"license": "MIT",
"scripts": {
"dev": "gulp dev --cwd . && karma start",
"dev:ci": "gulp dev:ci --cwd . && karma start --browsers ChromeHeadless --single-run",
"test": "karma start"
},
"dependencies": {
Expand All @@ -23,11 +21,8 @@
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-typescript": "../../",
"karma-typescript": "file:../../karma-typescript-3.0.13.tgz",
"mocha": "^3.1.2",
"typescript": "latest"
},
"devDependencies": {
"gulp": "^3.9.1"
}
}
1 change: 1 addition & 0 deletions examples/typescript-1.6.2/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
Loading

0 comments on commit a5832e5

Please sign in to comment.