New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate bundle.min.cjs in Node.js install script #3794
Conversation
@@ -22,5 +22,9 @@ | |||
"bugs": { | |||
"url": "https://github.com/gorhill/uBlock/issues" | |||
}, | |||
"homepage": "https://github.com/gorhill/uBlock#readme" | |||
"homepage": "https://github.com/gorhill/uBlock#readme", | |||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that these dependencies are a bad idea. Ideally the benchmark package should do all of this on its own. But in the interest of moving things forward it's OK for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was happy to not have external dependencies... Maybe eventually this could be a special make target which would patch package.json to add those dependencies -- not sure if this makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this bundle should be provided at all in the end. I'll try to do this in the benchmark repo and if it works out alright then this stuff can be removed.
@@ -22,5 +22,9 @@ | |||
"bugs": { | |||
"url": "https://github.com/gorhill/uBlock/issues" | |||
}, | |||
"homepage": "https://github.com/gorhill/uBlock#readme" | |||
"homepage": "https://github.com/gorhill/uBlock#readme", | |||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was happy to not have external dependencies... Maybe eventually this could be a special make target which would patch package.json to add those dependencies -- not sure if this makes sense
Follow-up here: ghostery/adblocker#2095 |
I get an error when I do
Never mind, I realize I have to |
// module.exports. Once all included files are written like ES modules, using | ||
// export statements, this should no longer be necessary. | ||
if (typeof module !== 'undefined' && typeof exports !== 'undefined') { | ||
module.exports = exports; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.jshintrc
is already present in the repo.
As for the lint
command, I am going to have to read to find out best way to do this -- here is says to add
lint:
./node_modules/.bin/jshint ...
Which means I need to add a ./node_modules/.bin/jshint
target as well I guess? My installation of jshint
is outside the ublock project and I use a specific path to access the command in my text editor, not suitable for the public Makefile here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.jshintrc
is already present in the repo.
Sorry, my bad!
Which means I need to add a
./node_modules/.bin/jshint
target as well I guess? My installation ofjshint
is outside the ublock project and I use a specific path to access the command in my text editor, not suitable for the public Makefile here.
It's OK to expect people to install jshint manually via npm install -g jshint
. Maybe this should be added to the CONTRIBUTING.md
file.
As for the lint
target, let me see how this works on the command line since I haven't used it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems JSHint removed indentation level checks a long time ago: https://github.com/jshint/jshint/releases/tag/2.5.0
I'll see if I can add some basic ESLint configuration that matches the JSHint configuration and also adds options for indentation, etc. to match the current coding style.
Following up from the discussion here: ghostery/adblocker#2091 (comment)
The Node.js install script now generates a
bundle.min.cjs
file.