Problem/Motivation
Currently there is no ability to specify JavaScript dependences, or test commands for Drupal. package.json is a file use by npm to configure dependencies, tools settings (like eslint configuration, babel configuration) as well as dependencies. Eventually it might be used to control our third party dependencies such as jquery, jquery once, etc. It's pretty much like composer.json for javascript.
An example can be found here: http://browsenpm.org/package.json
This file will also hold the commands to run unit tests once we have that set up.
Proposed resolution
Adding a package.json would allow us to manage development dependencies (to compile ES6 down to ES5) as well as automate the execution of coding standards tests for JavaScript.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | core-package-2809165-7.patch | 352 bytes | nod_ |
| #5 | core-package-2809165-5.patch | 474 bytes | nod_ |
| #2 | 2809165-2.patch | 767 bytes | GrandmaGlassesRopeMan |
| packagejson.patch | 775 bytes | GrandmaGlassesRopeMan |
Comments
Comment #2
GrandmaGlassesRopeManJust a minor fix to the pattern match for
JavaScriptfiles as well as a correct version number.Comment #3
nod_Comment #4
wim leersThis would be another place that core committers would have to keep the version number up-to-date…
Comment #5
nod_Simplified this, dev dependencies will be added in a follow-up.
Comment #7
GrandmaGlassesRopeMan@Wim Leers
I'd love to be able to remove the version from
package.json, but sadly it's not a valid file without one.Comment #8
nod_(>_<)
Comment #9
GrandmaGlassesRopeManWhoopsComment #10
attiks commented#8 Looks enough to get us started, true that core committers have to update version before tagging a new release, but not much we can do about it, it's a required field, although if it doesn't get updated not much is going to happen, version is mainly required for modules installed using npm.
Comment #11
nod_And the
private: truein the package.json makes sure this doesn't get on npm by error.Comment #12
alexpottI think we should do this in #2809477: Add ES6 to ES5 build process since we've been discussing the location there.