Skip to content

Commit

Permalink
refactor(build): Refactor build of stryker projects (#267)
Browse files Browse the repository at this point in the history
* refactor(build): Refactor build of stryker project
* Remove dependency on grunt
* prebuild: Clean using [rimraf](https://www.npmjs.com/package/rimraf)
* build: Compile using plain `tsc`
* postbuild: tslint
* test: Run mocha tests using [nyc](https://www.npmjs.com/package/nyc) for instrumentation.
* refactor(stryker-api-build): Remove dependency on grunt
* Remove all grunt dependencies
* prebuild: Clean using [rimraf](https://www.npmjs.com/package/rimraf)
* build: Compile using plain `tsc`
* postbuild: tslint
* test: Run mocha tests using [nyc](https://www.npmjs.com/package/nyc) for instrumentation.
* refactor(build): Remove grunt files
* refactor(build): Add 'build' to 'pretest'
* Add 'build' to 'pretest' at root level, so travis runs build before test
* refactor(test): Move integration test to own module
* Remove all build-related dev-dependencies from `packages` modules
* chore: Update bithoundrc with new file locations
* refactor(gitignore): Deduplicate gitignore files.
  • Loading branch information
nicojs authored and simondel committed Apr 7, 2017
1 parent de7d1cd commit 30e5ba3
Show file tree
Hide file tree
Showing 63 changed files with 378 additions and 420 deletions.
6 changes: 3 additions & 3 deletions .bithoundrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"wc": { "limit": 3000 }
},
"test": [
"packages/**/test/**",
"packages/**/testResources/**"
"packages/**/test/**"
],
"ignore": [
"packages/**/Gruntfile.js",
"packages/stryker/testResources/config-reader/syntax-error.conf.js"
"integrationTest/**",
"packages/**/testResources/**"
],
"dependencies": {
"unused-ignores": [
Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
node_modules
lerna-debug.log
npm-debug.log

.tscache
.stryker-tmp
*.js.map
packages/**/src/**/*.js
packages/**/test/**/*.js
packages/**/src/**/*.d.ts
packages/**/test/**/*.d.ts
.idea
*.iml
*.tmp.txt
.nyc_output
11 changes: 11 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-w", "-p", "./integrationTest/tsconfig.json"],
"showOutput": "silent",
"isBackground": true,
"problemMatcher": "$tsc-watch"
}
7 changes: 7 additions & 0 deletions integrationTest/Executor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default class Executor {
private silent;
private cwd;
constructor(cwd: string, silent?: boolean);
exec(command: string, options: any, done: (error: any, stdout: string) => any): void;
private handleProcess(child, done);
}
58 changes: 58 additions & 0 deletions integrationTest/Executor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integrationTest/Executor.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions integrationTest/install-module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integrationTest/install-module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('we have a module using stryker', function () {
describe('after installing Stryker', () => {
let executor: Executor;

before((done) => {
executor = new Executor('../../../testResources/module');
before(done => {
executor = new Executor('./module');
executor.exec('npm install', {}, (errors) => done(errors));
});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"karma": "1.0.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.1",
"stryker": "file:../../",
"stryker-api": "^0.4.1",
"stryker-jasmine": "^0.1.0",
"stryker-karma-runner": "^0.3.2",
"stryker": "file:../../packages/stryker",
"stryker-api": "file:../../packages/stryker-api",
"stryker-jasmine": "^0.2.0-0",
"stryker-karma-runner": "^0.4.0-0",
"typescript": "~2.2.2"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions integrationTest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": false
},
"include": [
"*.ts"
]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "2.0.0-beta.38",
"lerna": "2.0.0-rc.0",
"packages": [
"packages/*"
],
Expand Down
40 changes: 36 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
{
"private": true,
"devDependencies": {
"lerna": "^2.0.0-beta.38",
"typescript": "^2.2.1"
"@types/chai-as-promised": "0.0.29",
"@types/chalk": "^0.4.28",
"@types/escodegen": "0.0.6",
"@types/esprima": "^2.1.31",
"@types/estree": "0.0.32",
"@types/glob": "^5.0.29",
"@types/graceful-fs": "^2.0.29",
"@types/istanbul": "^0.4.29",
"@types/karma": "^0.13.32",
"@types/lodash": "^4.14.34",
"@types/log4js": "0.0.32",
"@types/mkdirp": "^0.3.28",
"@types/mocha": "^2.2.34",
"@types/progress": "^1.1.28",
"@types/sinon": "^1.16.33",
"@types/sinon-as-promised": "^4.0.5",
"@types/sinon-chai": "^2.7.27",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"concurrently": "^3.4.0",
"lerna": "^2.0.0-rc.0",
"mocha": "^3.2.0",
"nyc": "^10.2.0",
"rimraf": "^2.6.1",
"sinon": "^1.17.7",
"sinon-as-promised": "^4.0.3",
"sinon-chai": "^2.9.0",
"tslint": "^5.0.0",
"typescript": "^2.2.2"
},
"scripts": {
"postinstall": "lerna bootstrap",
"build": "lerna run build",
"test": "lerna run test"
"pretest": "npm run build",
"test": "lerna run test",
"posttest": "mocha integrationTest/*.js",
"start": "concurrently \"tsc -w -p integrationTest\" \"tsc -w -p packages/stryker\" \"tsc -w -p packages/stryker-api\"",
"test:stryker": "lerna run test --scope stryker",
"test:stryker-api": "lerna run test --scope stryker"
}
}
}
18 changes: 4 additions & 14 deletions packages/stryker-api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
node_modules
npm-debug.log
coverage
.tscache
typings
*.js.map
src/**/*.js
test/**/*.js
src/**/*.d.ts
test/**/*.d.ts
*.js
*.d.ts
!Gruntfile.js
!testResources
/*.js
/*.d.ts
testResources/module/**/*.js
testResources/module/**/*.d.ts
3 changes: 2 additions & 1 deletion packages/stryker-api/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ testResources
.gitattributes
.gitignore
.npmignore
.nycrc
.nyc_output
.stryker-temp
.tmp
.tscache
.vscode
stryker.conf.js
tsconfig.json
Gruntfile.js
/coverage
reports
11 changes: 11 additions & 0 deletions packages/stryker-api/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"nyc":{
"lines": 100,
"statements": 100,
"functions": 100,
"branches": 100,
"exclude": [
"testResources/**/*.js"
]
}
}
Loading

0 comments on commit 30e5ba3

Please sign in to comment.