Skip to content

Commit

Permalink
chore: integrate jison into webpack build
Browse files Browse the repository at this point in the history
  • Loading branch information
sagea committed Aug 3, 2019
1 parent 2d88982 commit cfea52f
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 7,015 deletions.
10 changes: 0 additions & 10 deletions gulpfile.js

This file was deleted.

8 changes: 6 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const path = require('path')

module.exports = {
transform: {
'^.+\\.jsx?$': './transformer.js'
'^.+\\.jsx?$': './transformer.js',
'^.+\\.jison$': path.resolve(__dirname, './jisonTransformer.js')
},
transformIgnorePatterns: ['/node_modules/(?!dagre-d3-renderer/lib).*\\.js'],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy'
}
},
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'jison']
}
6 changes: 6 additions & 0 deletions jisonLoader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { Generator } = require('jison')
const { getOptions } = require('loader-utils')

module.exports = function jisonLoader (source) {
return new Generator(source, getOptions(this)).generate()
}
9 changes: 9 additions & 0 deletions jisonTransformer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { Generator } = require('jison')

module.exports = {
process (source, filename, config, transformOptions) {
return new Generator(source, {
'token-stack': true
}).generate()
}
}
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"dev": "yarn lint && webpack-dev-server --config webpack.config.e2e.js",
"test": "yarn lint && jest src",
"test:watch": "jest --watch src",
"jison": "node -r @babel/register node_modules/.bin/gulp jison",
"prepublishOnly": "yarn build && yarn release && yarn test",
"prepush": "yarn test"
},
Expand All @@ -50,7 +49,6 @@
"dagre-layout": "^0.8.8",
"documentation": "^12.0.1",
"graphlibrary": "^2.2.0",
"gulp-print": "^5.0.2",
"he": "^1.2.0",
"lodash": "^4.17.11",
"minify": "^4.1.1",
Expand All @@ -67,8 +65,6 @@
"coveralls": "^3.0.2",
"css-loader": "^2.0.1",
"css-to-string-loader": "^0.1.3",
"gulp": "^4.0.0",
"gulp-jison": "^1.2.0",
"husky": "^1.2.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^23.6.0",
Expand Down
Loading

0 comments on commit cfea52f

Please sign in to comment.