Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit b5b29af

Browse files
committed
tsd -> typings
1 parent 1a3c0bd commit b5b29af

File tree

8 files changed

+69
-65
lines changed

8 files changed

+69
-65
lines changed

es6-babel-react-flux-karma/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## Getting started
44

5-
You'll need [node / npm](https://nodejs.org/) and [tsd](http://definitelytyped.org/tsd/) installed globally. To get up and running just enter:
5+
You'll need [node / npm](https://nodejs.org/) and [Typings](https://github.com/typings/typings) installed globally. To get up and running just enter:
66

77
```
88
npm install
9-
tsd install
9+
typings install
1010
npm run serve
1111
```
1212

1313
This will:
1414

1515
1. Download the npm packages you need
16-
2. Download the typings from DefinitelyTyped that you need.
16+
2. Download the type definitions you need.
1717
3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080)
1818

1919
Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really.

es6-babel-react-flux-karma/gulp/tests.js

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,42 @@ var Server = require('karma').Server;
44
var path = require('path');
55
var gutil = require('gulp-util');
66

7-
module.exports = {
8-
watch: function() {
9-
// Documentation: https://karma-runner.github.io/0.13/dev/public-api.html
10-
var karmaConfig = {
11-
configFile: path.join(__dirname, '../karma.conf.js'),
12-
singleRun: false,
7+
function runTests(options) {
8+
// Documentation: https://karma-runner.github.io/0.13/dev/public-api.html
9+
var karmaConfig = {
10+
configFile: path.join(__dirname, '../karma.conf.js'),
11+
singleRun: !options.shouldWatch,
12+
13+
plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', 'karma-sourcemap-loader', 'karma-phantomjs-launcher'],
14+
reporters: ['mocha']
15+
};
1316

14-
// Fancy runner
15-
plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher'],
16-
reporters: ['mocha']
17-
};
17+
if (options.done) {
18+
karmaConfig.plugins.push('karma-junit-reporter');
19+
karmaConfig.reporters.push('junit');
20+
} else {
21+
karmaConfig.plugins.push('karma-notify-reporter');
22+
karmaConfig.reporters.push('notify');
23+
}
1824

19-
new Server(karmaConfig, karmaCompleted).start();
25+
new Server(karmaConfig, karmaCompleted).start();
2026

21-
function karmaCompleted(exitCode) {
22-
gutil.log('Karma has exited with:', exitCode);
27+
function karmaCompleted(exitCode) {
28+
if (options.done) {
29+
if (exitCode === 1) {
30+
gutil.log('Karma: tests failed with code ' + exitCode);
31+
} else {
32+
gutil.log('Karma completed!');
33+
}
34+
options.done();
35+
}
36+
else {
2337
process.exit(exitCode);
2438
}
2539
}
40+
}
41+
42+
module.exports = {
43+
run: function(done) { return runTests({ shouldWatch: false, done: done }); },
44+
watch: function() { return runTests({ shouldWatch: true }); }
2645
};

es6-babel-react-flux-karma/gulp/webpack.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var gulp = require('gulp');
44
var gutil = require('gulp-util');
55
var webpack = require('webpack');
6+
var failPlugin = require('webpack-fail-plugin');
67
var WebpackNotifierPlugin = require('webpack-notifier');
78
var webpackConfig = require('../webpack.config.js');
89

@@ -14,12 +15,13 @@ function buildProduction(done) {
1415
myProdConfig.plugins = myProdConfig.plugins.concat(
1516
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }),
1617
new webpack.optimize.DedupePlugin(),
17-
new webpack.optimize.UglifyJsPlugin()
18+
new webpack.optimize.UglifyJsPlugin(),
19+
failPlugin
1820
);
1921

2022
// run webpack
2123
webpack(myProdConfig, function(err, stats) {
22-
if(err) { throw new gutil.PluginError('webpack:build', err); }
24+
if (err) { throw new gutil.PluginError('webpack:build', err); }
2325
gutil.log('[webpack:build]', stats.toString({
2426
colors: true
2527
}));
@@ -46,7 +48,7 @@ function createDevCompiler() {
4648
function buildDevelopment(done, devCompiler) {
4749
// run webpack
4850
devCompiler.run(function(err, stats) {
49-
if(err) { throw new gutil.PluginError('webpack:build-dev', err); }
51+
if (err) { throw new gutil.PluginError('webpack:build-dev', err); }
5052
gutil.log('[webpack:build-dev]', stats.toString({
5153
chunks: false,
5254
colors: true

es6-babel-react-flux-karma/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@
5454
"karma-coverage": "^0.5.2",
5555
"karma-jasmine": "^0.3.6",
5656
"karma-junit-reporter": "^0.3.7",
57-
"karma-mocha-reporter": "^1.1.1",
57+
"karma-mocha-reporter": "^2.0.0",
58+
"karma-notify-reporter": "^0.1.1",
5859
"karma-phantomjs-launcher": "^1.0.0",
59-
"karma-phantomjs-shim": "^1.1.1",
6060
"karma-sourcemap-loader": "^0.3.6",
6161
"karma-webpack": "^1.7.0",
62-
"phantomjs": "^2.1.3",
6362
"phantomjs-prebuilt": "^2.1.4",
6463
"react": "^0.14.3",
6564
"react-addons-test-utils": "^0.14.3",
6665
"react-dom": "^0.14.3",
6766
"ts-loader": "^0.8.1",
6867
"typescript": "^1.8.0",
6968
"webpack": "^1.12.2",
69+
"webpack-fail-plugin": "^1.0.4",
7070
"webpack-notifier": "^1.2.1"
7171
}
7272
}

es6-babel-react-flux-karma/src/tsconfig.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"compileOnSave": false,
33
"filesGlob": [
4-
"../typings/**/*.*.ts",
5-
"!../typings/jasmine/jasmine.d.ts",
6-
"!../typings/react/react-addons-test-utils.d.ts",
4+
"../typings/browser/**/*.*.ts",
5+
"!../typings/browser/ambient/jasmine/index.d.ts",
6+
"!../typings/browser/ambient/react-addons-test-utils/index.d.ts",
77
"**/*.{ts,tsx}"
88
],
99
"compilerOptions": {
@@ -15,11 +15,10 @@
1515
"sourceMap": true
1616
},
1717
"files": [
18-
"../typings/flux/flux.d.ts",
19-
"../typings/node/node.d.ts",
20-
"../typings/react/react-dom.d.ts",
21-
"../typings/react/react.d.ts",
22-
"../typings/tsd.d.ts",
18+
"../typings/browser/ambient/flux/index.d.ts",
19+
"../typings/browser/ambient/node/index.d.ts",
20+
"../typings/browser/ambient/react-dom/index.d.ts",
21+
"../typings/browser/ambient/react/index.d.ts",
2322
"actions/GreetingActions.ts",
2423
"components/App.tsx",
2524
"components/Greeting.tsx",

es6-babel-react-flux-karma/test/tsconfig.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compileOnSave": false,
33
"filesGlob": [
44
"**/*.{ts,tsx}",
5-
"../typings/**/*.*.ts"
5+
"../typings/browser/**/*.*.ts"
66
],
77
"compilerOptions": {
88
"jsx": "preserve",
@@ -19,13 +19,12 @@
1919
"components/Greeting.tests.tsx",
2020
"components/WhoToGreet.tests.tsx",
2121
"stores/GreetingStore.tests.ts",
22-
"../typings/flux/flux.d.ts",
23-
"../typings/jasmine/jasmine.d.ts",
24-
"../typings/node/node.d.ts",
25-
"../typings/react/react-addons-test-utils.d.ts",
26-
"../typings/react/react-dom.d.ts",
27-
"../typings/react/react.d.ts",
28-
"../typings/tsd.d.ts"
22+
"../typings/browser/ambient/flux/index.d.ts",
23+
"../typings/browser/ambient/jasmine/index.d.ts",
24+
"../typings/browser/ambient/node/index.d.ts",
25+
"../typings/browser/ambient/react-addons-test-utils/index.d.ts",
26+
"../typings/browser/ambient/react-dom/index.d.ts",
27+
"../typings/browser/ambient/react/index.d.ts"
2928
],
3029
"exclude": [],
3130
"atom": {

es6-babel-react-flux-karma/tsd.json

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "es6-babel-react-flux-karma",
3+
"version": false,
4+
"ambientDependencies": {
5+
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054",
6+
"flux": "github:DefinitelyTyped/DefinitelyTyped/flux/flux.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054",
7+
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054",
8+
"react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054",
9+
"react-dom": "github:DefinitelyTyped/DefinitelyTyped/react/react-dom.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054",
10+
"react-addons-test-utils": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-test-utils.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054"
11+
}
12+
}

0 commit comments

Comments
 (0)