Skip to content

Commit

Permalink
feat(typescript): initial TypeScript setup
Browse files Browse the repository at this point in the history
- Adds TypeScript loader to Webpack configuration
- Upgrade Webpack dependencies to latest
- Modifies TravisCI build to publish from correct directories
- Adds TS linting (in conjunction to current 'standard' lint)
- Updates TS Declarations to be lint compatible

Initial work for #76
  • Loading branch information
mefellows committed Aug 19, 2017
1 parent 2275e2c commit c6e6c3a
Show file tree
Hide file tree
Showing 14 changed files with 4,260 additions and 627 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ coverage
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
dist
dist-web

# Dependency directory
node_modules
Expand Down
13 changes: 2 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,10 @@ deploy:
tags: true
branch: master
node: '6'
- provider: npm
email: [email protected]
api_key:
secure: jvmoyItvKvPrPZjWtD8/l12fjkIunhdBaKduPjzrJ9xGrnRRigI+NY6WVdWlPJ6IMbHi5f258idUhrP3nTL7QCPMSIb0P/JZyrrkHliPLyRhBP+yc/s+AuzYJm09O454JgvxnWuENGsLtR5q6swo6pDGFwthIyAHL/O8AXEavz3jG7GULjwIL/LtBKCzoK+L4WdS8SC0X8WUP6+/hgoiqmydHWKn23EQuw7Ia8ETp6yTuihuap/x8y869HUU+8+punx62Fav6ChsR8olN0WOakI9hC4B+dmz7TRRPTCN2WGa68f5UctAedSba2T/ChBpufAPnHJYAz2T372OMjQtHuD14DDVHoar6X3I5djaq6M1k06hJ7WMTCP0gItaUXMiy6I5Nlo/5tvOIXsUxiO3Ll7GzK5rpj/pqwIrm6Ecda9kPMzaC6IdEPZ9v+yglSd9zsbs2wfAuXlfJvH5/3oeWSCdIzYwJL8v63xQienxhxfAfMLqXP+GyuntqIV/NrHuunpSAjZGqXALJ5Ff1oWybQQVPDTlxWi4VdHfrw1lhPwUWVzNbaFq8hsnrujmLcpq0/X3p3QXgEMB2A3pJ49mm2Y9/YI9m2MPryhBL1x1WmtI+1udONlb1VIeU6KOUUulUXufRPv5gS/3NnisdhYj7KkF4GyrPaQYQAxh8tvy9Xs
skip_cleanup: true
on:
tags: true
branch: master
node: '6'
- provider: script
skip_cleanup: true
script: npm publish dist --access public
script: ./scripts/deploy.sh
on:
branch: master
tags: true
branch: master
node: '6'
27 changes: 16 additions & 11 deletions config/webpack.web.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable */
var path = require('path');
var webpack = require('webpack');

var DIST = path.resolve(__dirname, '../dist');
var APP = path.resolve(__dirname, '../src');
const path = require('path');
const webpack = require('webpack');
const DIST = path.resolve(__dirname, '../dist-web');
const APP = path.resolve(__dirname, '../src');

module.exports = {
entry: path.resolve(APP, 'pact-web.js'),
Expand All @@ -14,27 +13,33 @@ module.exports = {
umdNamedDefine: true,
filename: 'pact-web.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
target: 'web',
externals: ['mitm'],
node: {
net: 'empty'
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: 'ignore-loader' },
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader'
},
{
loader: 'babel-loader',
test: APP,
exclude: /node_modules/,
query: { presets: ['es2015'] }
query: {
presets: ['es2015']
}
}
]
],
},
plugins: [
new webpack.DefinePlugin({ 'global.GENTLY': false }),
new webpack.IgnorePlugin(/vertx/),
new webpack.optimize.DedupePlugin(),
new webpack.NoErrorsPlugin()
new webpack.NoEmitOnErrorsPlugin()
],
devtool: 'source-map'
}
2 changes: 1 addition & 1 deletion karma/jasmine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function (config) {

// list of files / patterns to load in the browser
files: [
'../../dist/pact-web.js',
'../../dist-web/pact-web.js',
// Example Using NPM package
// 'node_modules/pact-web/pact-web.js',
'client.js',
Expand Down
2 changes: 1 addition & 1 deletion karma/mocha/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function (config) {
// list of files / patterns to load in the browser
files: [
// if you are using this example to setup your own project load pact from the node_modules directory
'../../dist/pact-web.js',
'../../dist-web/pact-web.js',
// Example Using NPM package
// 'node_modules/pact-web/pact-web.js',
'client.js',
Expand Down
Loading

0 comments on commit c6e6c3a

Please sign in to comment.