forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Downloading Node and NPM deps via gclient sync.
This is necessary for WebUI to harness several Node based tools to speed up performance, as well as remove generated code that is currently checked in as source code. Discussion occurred at: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/H2IqgqwdUqs/yn_6_z0cDwAJ BUG=673825 Review-Url: https://codereview.chromium.org/2574033002 Cr-Commit-Position: refs/heads/master@{#443777}
- Loading branch information
Showing
13 changed files
with
1,427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dbeam@chromium.org | ||
dpapad@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Name: Node JS | ||
Short Name: node | ||
URL: https://github.com/nodejs/node | ||
Version: 6.9.4 | ||
Revision: f098f8295c407e5a5126b501ed5f1aa80bd86106 | ||
Date: Tue Dec 06 2016 18:07:35 GMT-0800 (PST) | ||
License: NodeJS | ||
License File: NOT_SHIPPED | ||
Security Critical: no | ||
|
||
Description: | ||
Node binaries and NPM modules necessary for buliding Chrome's WebUI. | ||
Use update_node_binaries to update Node binaries and update_npm_deps to | ||
update NPM dependencies. | ||
|
||
Local Modifications: | ||
No modifications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eb63c12c3b19b96b9142e572c3c2cfaa27e13191 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b5ac19fd2f8afaa20f698972d2b0bb1056dc258a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ce62710ad9f651016248574ecd7b07e86dd01f2b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*/.* | ||
*/example/ | ||
*/examples/ | ||
*.html | ||
hydrolysis/hydrolysis.js | ||
*/jsdoc2md/ | ||
*.md | ||
*.png | ||
*.sh | ||
*.svg | ||
*/test/ | ||
*.ts | ||
*/@types/ | ||
*.woff | ||
*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "webui-node-modules", | ||
"version": "1.0.0", | ||
"author": "dpapad@chromium.org", | ||
"dependencies": { | ||
"crisper": "2.0.2", | ||
"polymer-css-build": "0.0.7", | ||
"uglifyjs": "2.4.10", | ||
"vulcanize": "1.15.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Script for updating Node binaries. | ||
# 1) Update NODE_VERSION variable below to the desired version. | ||
# 2) Run this script. | ||
# 3) Upload the binaries to the Google Storage bucket (commands to upload | ||
# binaries are printed at step 2, look for "gsutil.py"). | ||
# 4) Land a CL with the changes generated by this script. | ||
|
||
set -eu | ||
cd "$(dirname "$0")" | ||
|
||
BASE_URL="https://nodejs.org/dist" | ||
NODE_VERSION="v6.9.4" | ||
|
||
update_unix() { | ||
local SUFFIX="$1" | ||
local FOLDER="$2" | ||
local FILENAME="node-${NODE_VERSION}-${SUFFIX}.tar.gz" | ||
local URL="${BASE_URL}/${NODE_VERSION}/${FILENAME}" | ||
|
||
rm -f "${FOLDER}/${FILENAME}" | ||
wget -P "${FOLDER}/" "${URL}" | ||
|
||
# Check SHASUMS256 of downloaded binary. | ||
local sha256_expected | ||
sha256_expected="$(grep "$FILENAME" SHASUMS256.txt | cut -d ' ' -f1)" | ||
local sha256_actual | ||
sha256_actual="$(sha256sum "${FOLDER}/${FILENAME}" | cut -d ' ' -f1)" | ||
|
||
if [ "${sha256_expected}" != "${sha256_actual}" ]; then | ||
echo "SHA256 mismatch. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
# Unpack temporarily, delete NPM symlink and re-pack. | ||
tar xfz "${FOLDER}/${FILENAME}" -C "${FOLDER}/" | ||
rm "${FOLDER}/${FILENAME}" | ||
rm "${FOLDER}/node-${NODE_VERSION}-${SUFFIX}/bin/npm" | ||
|
||
# Drop the version info from the name, since it is redundant and would make | ||
# rolling new versions more involved. | ||
rm -rf "${FOLDER}/node-${SUFFIX}/" | ||
mv "${FOLDER}/node-${NODE_VERSION}-${SUFFIX}/" "${FOLDER}/node-${SUFFIX}/" | ||
tar cfz "${FOLDER}/node-${SUFFIX}.tar.gz" -C "${FOLDER}" "node-${SUFFIX}/" | ||
local sha1 | ||
sha1="$(sha1sum ${FOLDER}/node-${SUFFIX}.tar.gz | cut -d ' ' -f1)" | ||
echo "${sha1}" > "${FOLDER}/node-${SUFFIX}.tar.gz.sha1" | ||
echo "Please execute manually the following:" | ||
echo "> gsutil.py cp ${FOLDER}/node-${SUFFIX}.tar.gz gs://chromium-nodejs/${NODE_VERSION:1}/${sha1}" | ||
echo "DONE updating for ${SUFFIX}." | ||
} | ||
|
||
update_win() { | ||
local FILENAME="node.exe" | ||
local FOLDER="win" | ||
local WINDOWS_URL="${BASE_URL}/${NODE_VERSION}/win-x64/${FILENAME}" | ||
rm -f "${FOLDER}/${FILENAME}" | ||
wget -P "${FOLDER}/" "${WINDOWS_URL}" | ||
|
||
# Check SHASUMS256 of downloaded binary. | ||
local sha256_expected | ||
sha256_expected="$(grep "win-x64/$FILENAME" SHASUMS256.txt | cut -d ' ' -f1)" | ||
local sha256_actual | ||
sha256_actual="$(sha256sum "${FOLDER}/${FILENAME}" | cut -d ' ' -f1)" | ||
|
||
if [ "${sha256_expected}" != "${sha256_actual}" ]; then | ||
echo "SHA256 mismatch. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
local sha1 | ||
sha1="$(sha1sum ${FOLDER}/node.exe | cut -d ' ' -f1)" | ||
echo "${sha1}" > "${FOLDER}/node.exe.sha1" | ||
echo "Please execute manually the following:" | ||
echo "> gsutil.py cp ${FOLDER}/node.exe gs://chromium-nodejs/${NODE_VERSION:1}/${sha1}" | ||
echo "DONE updating Windows." | ||
} | ||
|
||
# First download checksum file. | ||
rm "SHASUMS256.txt" | ||
wget "https://nodejs.org/dist/latest-v6.x/SHASUMS256.txt" | ||
|
||
update_unix "darwin-x64" "mac" | ||
update_unix "linux-x64" "linux" | ||
update_win | ||
|
||
# Update DEPS to point to the new Google Storage bucket subfolder. | ||
sed -i "s@\(chromium-nodejs/\)\([0-9\.]\)\+@\1${NODE_VERSION:1}@" ../../DEPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Script for updating WebUI's NPM deps. | ||
# 1) Update package.json file to point to the desired version. | ||
# 2) Run this script. | ||
# 3) Upload the compressed node_modules.tar.gz file to the Google Storage | ||
# bucket (commands to upload binaries are printed at step 2). | ||
# 4) Land a CL with the changes generated by this script. | ||
|
||
set -eu | ||
cd "$(dirname "$0")" | ||
|
||
rm -rf node_modules | ||
|
||
npm install --no-bin-links --only=prod | ||
rsync -c --delete -r -q --exclude-from="npm_exclude.txt" \ | ||
--prune-empty-dirs "node_modules/" "node_modules_filtered/" | ||
|
||
echo -e "\n---------------------------------------------------------" | ||
echo "Before filtering:" size: $(du -h node_modules/ | tail -n1 | cut -f1) ", files: " $(find node_modules/ -type f | wc -l) | ||
rm -r node_modules | ||
mv node_modules_filtered node_modules | ||
|
||
echo "After filtering:" size: $(du -h node_modules/ | tail -n1 | cut -f1) ", files: " $(find node_modules/ -type f | wc -l) | ||
|
||
tar cfz node_modules.tar.gz node_modules | ||
echo "After compressing:" size: $(du -h node_modules.tar.gz | tail -n1 | cut -f1) | ||
|
||
sha1="$(sha1sum node_modules.tar.gz | cut -d ' ' -f1)" | ||
echo "${sha1}" > node_modules.tar.gz.sha1 | ||
echo "Please run the following manually to update Google Storage bucket:" | ||
echo "> gsutil.py cp node_modules.tar.gz gs://chromium-nodejs/${sha1}" | ||
echo "DONE" | ||
echo -e "---------------------------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a5217c3b78a04dd8da80d4ee145577ea536a6cfc |