Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Module browser bundle configuration using webpack #48

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ea9763c
Adding webpack config to create bundle
schrepfler Nov 15, 2016
243d810
Adding browser bundle declaration in package.json
schrepfler Nov 15, 2016
10ac03a
Describing feature to changelog
schrepfler Nov 15, 2016
4c9b4ff
Adding reference to webpack in package.json
schrepfler Nov 15, 2016
30a1d44
Adding webpack step to prepublish and declaring library name and targ…
schrepfler Nov 18, 2016
e0dd42e
Change library export as graphql-subscriptions
schrepfler Nov 19, 2016
3195c4a
As the name is actually an existing artifact, changed to subscription…
schrepfler Nov 19, 2016
ee4b77f
Adding config which exposes the client as a global.
schrepfler Nov 20, 2016
c0939a8
Taking care of PR review comments.
schrepfler Dec 24, 2016
8d35f0c
Reverting dependency updates to leave for a future patch
schrepfler Jan 1, 2017
815d97e
Adding webpack config to create bundle
schrepfler Nov 15, 2016
8b6fd90
Adding browser bundle declaration in package.json
schrepfler Nov 15, 2016
b001028
Describing feature to changelog
schrepfler Nov 15, 2016
c2e7a47
Adding reference to webpack in package.json
schrepfler Nov 15, 2016
c0604b9
Adding webpack step to prepublish and declaring library name and targ…
schrepfler Nov 18, 2016
ad34073
Change library export as graphql-subscriptions
schrepfler Nov 19, 2016
a481a65
As the name is actually an existing artifact, changed to subscription…
schrepfler Nov 19, 2016
af2ffa0
Adding config which exposes the client as a global.
schrepfler Nov 20, 2016
5fc3497
Rebased
schrepfler Feb 2, 2017
90a160b
Tried rebase, had to modify package.json as was getting in loop
schrepfler Feb 2, 2017
e1d68de
Reverting to master dependencies
schrepfler Feb 2, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
coverage
typings
npm-debug.log
browser/
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

### vNEXT

- ...
- Webpack configuration to export the generated code into a browser compatible bundle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: reference this PR number in the changelog

[PR #48](https://github.com/apollostack/subscriptions-transport-ws/pull/48)

### v0.3.1

Expand Down
34 changes: 21 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
},
"dependencies": {
"backo2": "^1.0.2",
"graphql-subscriptions": "^0.2.0",
"json-loader": "^0.5.4",
"lodash.isobject": "^3.0.2",
"lodash.isstring": "^4.0.1",
"ts-loader": "^1.3.3",
"websocket": "^1.0.23"
},
"scripts": {
Expand All @@ -24,29 +25,36 @@
"testonly": "mocha --reporter spec --full-trace ./dist/test/tests.js",
"coverage": "node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js",
"postcoverage": "remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info",
"prepublish": "npm run compile"
"browser-compile": "webpack",
"prepublish": "npm run compile && npm run browser-compile"
},
"devDependencies": {
"@types/chai": "^3.4.32",
"@types/lodash": "^4.14.34",
"@types/mocha": "^2.2.31",
"@types/node": "^6.0.38",
"@types/sinon": "^1.16.31",
"@types/chai": "^3.4.34",
"@types/lodash": "^4.14.44",
"@types/mocha": "^2.2.34",
"@types/node": "^6.0.53",
"@types/sinon": "^1.16.33",
"@types/websocket": "^0.0.32",
"chai": "^3.5.0",
"graphql": "^0.7.0",
"graphql": "^0.8.2",
"istanbul": "^1.0.0-alpha.2",
"mocha": "^3.0.0",
"remap-istanbul": "^0.7.0",
"mocha": "^3.1.1",
"remap-istanbul": "^0.8.0",
"sinon": "^1.17.6",
"tslint": "^3.13.0",
"typed-graphql": "^1.0.1",
"typescript": "^2.0.0",
"typings": "^1.3.2"
"typed-graphql": "^1.0.2",
"typescript": "^2.0.3",
"typings": "^1.3.2",
"webpack": "^1.14.0",
"graphql-subscriptions": "^0.2.2"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating all of those packages broke the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only these three all or should I revert all of them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remap-istanbul particularly since it broke the build

"peerDependencies": {
"graphql-subscriptions": "^0.2.2"
},
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
},
"browser": "browser/bundle.js",
"license": "MIT"
}
20 changes: 20 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var path = require('path');

module.exports = {
context: path.join(__dirname, '/src'),
entry: './client.ts',
output: {
path: path.join(__dirname, '/browser'),
filename: 'bundle.js',
library: 'SubscriptionsTransportWs'
},
resolve: {
extensions: ['', '.json', '.ts', '.js']
},
module: {
loaders: [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.json$/, loader: 'json-loader' }
]
}
}