Skip to content

Commit

Permalink
Switch to node 8 / yarn (Graylog2#4361)
Browse files Browse the repository at this point in the history
* Fix jquery types dependency

We need version 2 instead of 3.

* Ensure we don't leak files in graylog-web-plugin

Use `files` attributes to whitelist files that should be in node
package, instead of blacklisting in .npmignore. This helps avoiding any
leaks in dotfiles or uploading any unwanted file.

* Switch graylog-web-plugin package.json to yarn

The package can now be used with yarn v1.3, and scripts use yarn as
default. Anyway, the package will still work with npm v4.

* Add jquery package resolutions

This ensures only one copy of `jquery` and `@types/jquery` are installed
when using yarn.

* Replace npm with yarn

* Add updated vendor-modules

* Do not exclude yarn.lock file
  • Loading branch information
edmundoa authored and kroepke committed Nov 22, 2017
1 parent 32e1716 commit ed62a6c
Show file tree
Hide file tree
Showing 10 changed files with 7,837 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,20 @@

<executions>
<execution>
<id>install node and npm</id>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-npm</goal>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>v6.9.2</nodeVersion>
<npmVersion>4.0.3</npmVersion>
<nodeVersion>v8.9.1</nodeVersion>
<yarn.version>v1.3.2</yarn.version>
</configuration>
</execution>

<execution>
<id>npm install</id>
<id>yarn install</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
Expand All @@ -245,9 +245,9 @@
</execution>

<execution>
<id>npm run build</id>
<id>yarn run build</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run build</arguments>
Expand Down
14 changes: 7 additions & 7 deletions graylog-plugin-parent/graylog-plugin-web-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<nodeVersion>${nodejs.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
<yarnVersion>${yarn.version}</yarnVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-npm</goal>
<goal>install-node-and-yarn</goal>
</goals>
</execution>

<execution>
<id>npm install</id>
<id>yarn install</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
Expand All @@ -67,9 +67,9 @@
</execution>

<execution>
<id>npm run build</id>
<id>yarn run build</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run build</arguments>
Expand Down
18 changes: 9 additions & 9 deletions graylog2-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -725,21 +725,21 @@
<configuration>
<workingDirectory>${webInterface.path}</workingDirectory>
<nodeVersion>${nodejs.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
<yarnVersion>${yarn.version}</yarnVersion>
</configuration>

<executions>
<execution>
<id>install node and npm</id>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-npm</goal>
<goal>install-node-and-yarn</goal>
</goals>
</execution>

<execution>
<id>npm install</id>
<id>yarn install</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
Expand All @@ -748,19 +748,19 @@
</execution>

<execution>
<id>npm run build</id>
<id>yarn run build</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>

<execution>
<id>npm test</id>
<id>yarn test</id>
<goals>
<goal>npm</goal>
<goal>yarn</goal>
</goals>
<phase>test</phase>
<configuration>
Expand Down
2 changes: 0 additions & 2 deletions graylog2-web-interface/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ manifests/*-manifest.json
plugin
cache

yarn.lock

6 changes: 5 additions & 1 deletion graylog2-web-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"devDependencies": {
"@types/bluebird": "^3.5.8",
"@types/jquery": "^3.2.9",
"@types/jquery": "^2.0.0",
"@types/node": "^8.0.17",
"@types/sockjs-client": "^1.0.31",
"@types/toastr": "^2.1.34",
Expand Down Expand Up @@ -132,5 +132,9 @@
"webpack-dev-server": "^2.6.1",
"webpack-hot-middleware": "^2.20.0",
"webpack-merge": "^4.1.0"
},
"resolutions": {
"@types/jquery": "2.0.48",
"jquery": "2.1.4"
}
}

This file was deleted.

14 changes: 12 additions & 2 deletions graylog2-web-interface/packages/graylog-web-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
"main": "index.js",
"scripts": {
"test": "eslint src/*",
"compile": "babel -d lib/ src/",
"prepublish": "npm i --only=dev --ignore-scripts && npm run compile"
"build": "babel -d lib/ src/",
"preparebuild": "yarn install --ignore-scripts",
"compile": "yarn run preparebuild && yarn run build",
"prepublish": "yarn run compile",
"preinstall": "test -d src/ && yarn run compile || echo \"src\" folder missing, skipping preinstall"
},
"repository": {
"type": "git",
Expand All @@ -23,6 +26,13 @@
"url": "https://github.com/Graylog2/graylog-web-plugin/issues"
},
"homepage": "https://github.com/Graylog2/graylog-web-plugin#readme",
"files": [
"lib/",
"templates/",
"index.js",
"plugin.js",
"README.md"
],
"dependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^4.3.0",
Expand Down
Loading

0 comments on commit ed62a6c

Please sign in to comment.