| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 537c17e commit 2e83381
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,12 +69,10 @@ jobs: | |||
| 69 | 69 | subsystem: deps | |
| 70 | 70 | label: dependencies | |
| 71 | 71 | run: | | |
| 72 | - NEW_VERSION=$(npm view undici dist-tags.latest) | ||
| 73 | - CURRENT_VERSION=$(node -p "require('./deps/undici/src/package.json').version") | ||
| 74 | - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then | ||
| 75 | - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | ||
| 76 | - ./tools/update-undici.sh | ||
| 77 | - fi | ||
| 72 | + ./tools/dep_updaters/update-undici.sh > temp-output | ||
| 73 | + cat temp-output | ||
| 74 | + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
| 75 | + rm temp-output | ||
| 78 | 76 | - id: postject | |
| 79 | 77 | subsystem: deps,test | |
| 80 | 78 | label: test | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | # Maintaining brotli | |
| 2 | 2 | ||
| 3 | - The [brotli](https://github.com/google/brotli) dependency is used for | ||
| 3 | + The [brotli](https://github.com/google/brotli) dependency is used for | ||
| 4 | 4 | the homonym generic-purpose lossless compression algorithm. | |
| 5 | 5 | ||
| 6 | 6 | ## Updating brotli | |
@@ -10,17 +10,16 @@ brotli source files. | |||
| 10 | 10 | ||
| 11 | 11 | Check that Node.js still builds and tests. | |
| 12 | 12 | ||
| 13 | - ## Committing postject | ||
| 13 | + ## Committing brotli | ||
| 14 | 14 | ||
| 15 | 15 | 1. Add brotli: | |
| 16 | 16 | ```console | |
| 17 | 17 | $ git add deps/brotli | |
| 18 | 18 | ``` | |
| 19 | 19 | 2. Commit the changes: `git commit`. | |
| 20 | 20 | 3. Add a message like: | |
| 21 | - | ||
| 22 | 21 | ```text | |
| 23 | - deps,test: update brotli to <version> | ||
| 22 | + deps: update brotli to <version> | ||
| 24 | 23 | ||
| 25 | 24 | Updated as described in doc/contributing/maintaining-brotli.md. | |
| 26 | 25 | ``` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,6 +62,8 @@ more control is required. The current plan is for the following APIs: | |||
| 62 | 62 | Fetch-based API. As this gets worked out we will discuss which | |
| 63 | 63 | APIs to expose in the Node.js API surface. | |
| 64 | 64 | ||
| 65 | + For info see [maintaining undici][]. | ||
| 66 | + | ||
| 65 | 67 | ### Server APIs | |
| 66 | 68 | ||
| 67 | 69 | For the server APIs we do not yet have a clear path, other than wanting | |
@@ -116,3 +118,4 @@ The low-level implementation of | |||
| 116 | 118 | is based on [nghttp2](https://nghttp2.org/). See [maintaining nghttp2][]. | |
| 117 | 119 | ||
| 118 | 120 | [maintaining nghttp2]: ./maintaining-nghttp2.md | |
| 121 | + [maintaining undici]: ./maintaining-undici.md | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,6 @@ Check that Node.js still builds and tests. | |||
| 19 | 19 | ``` | |
| 20 | 20 | 2. Commit the changes: `git commit`. | |
| 21 | 21 | 3. Add a message like: | |
| 22 | - | ||
| 23 | 22 | ```text | |
| 24 | 23 | deps,test: update postject to <version> | |
| 25 | 24 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,25 @@ | |||
| 1 | + # Maintaining undici | ||
| 2 | + | ||
| 3 | + The [undici](https://github.com/nodejs/undici) dependency is | ||
| 4 | + an HTTP/1.1 client, written from scratch for Node.js. | ||
| 5 | + | ||
| 6 | + ## Updating undici | ||
| 7 | + | ||
| 8 | + The `tools/dep_updaters/update-undici.sh` script automates the update of the | ||
| 9 | + undici source files. | ||
| 10 | + | ||
| 11 | + Check that Node.js still builds and tests. | ||
| 12 | + | ||
| 13 | + ## Committing undici | ||
| 14 | + | ||
| 15 | + 1. Add undici: | ||
| 16 | + ```console | ||
| 17 | + $ git add deps/undici | ||
| 18 | + ``` | ||
| 19 | + 2. Commit the changes: `git commit`. | ||
| 20 | + 3. Add a message like: | ||
| 21 | + ```text | ||
| 22 | + deps: update undici to <version> | ||
| 23 | + | ||
| 24 | + Updated as described in doc/contributing/maintaining-undici.md. | ||
| 25 | + ``` | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,22 @@ | |||
| 7 | 7 | ||
| 8 | 8 | set -ex | |
| 9 | 9 | ||
| 10 | - cd "$( dirname "$0" )/.." || exit | ||
| 10 | + ROOT=$(cd "$(dirname "$0")/../.." && pwd) | ||
| 11 | + [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" | ||
| 12 | + [ -x "$NODE" ] || NODE=$(command -v node) | ||
| 13 | + NPM="$ROOT/deps/npm/bin/npm-cli.js" | ||
| 14 | + | ||
| 15 | + NEW_VERSION=$("$NODE" "$NPM" view undici dist-tags.latest) | ||
| 16 | + CURRENT_VERSION=$("$NODE" -p "require('./deps/undici/src/package.json').version") | ||
| 17 | + | ||
| 18 | + echo "Comparing $NEW_VERSION with $CURRENT_VERSION" | ||
| 19 | + | ||
| 20 | + if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then | ||
| 21 | + echo "Skipped because Undici is on the latest version." | ||
| 22 | + exit 0 | ||
| 23 | + fi | ||
| 24 | + | ||
| 25 | + cd "$( dirname "$0" )/../.." || exit | ||
| 11 | 26 | rm -rf deps/undici/src | |
| 12 | 27 | rm -f deps/undici/undici.js | |
| 13 | 28 | ||
@@ -16,25 +31,18 @@ rm -f deps/undici/undici.js | |||
| 16 | 31 | mkdir undici-tmp | |
| 17 | 32 | cd undici-tmp || exit | |
| 18 | 33 | ||
| 19 | - ROOT="$PWD/.." | ||
| 20 | - [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" | ||
| 21 | - [ -x "$NODE" ] || NODE=$(command -v node) | ||
| 22 | - NPM="$ROOT/deps/npm/bin/npm-cli.js" | ||
| 23 | - | ||
| 24 | 34 | "$NODE" "$NPM" init --yes | |
| 25 | 35 | ||
| 26 | 36 | "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts undici | |
| 27 | 37 | cd node_modules/undici | |
| 28 | 38 | "$NODE" "$NPM" run build:node | |
| 29 | - # get the new version of undici | ||
| 30 | - UNDICI_VERSION=$("$NODE" -p "require('./package.json').version") | ||
| 31 | 39 | # update this version information in src/undici_version.h | |
| 32 | 40 | FILE_PATH="$ROOT/src/undici_version.h" | |
| 33 | 41 | echo "// This is an auto generated file, please do not edit." > "$FILE_PATH" | |
| 34 | 42 | echo "// Refer to tools/update-undici.sh" >> "$FILE_PATH" | |
| 35 | 43 | echo "#ifndef SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" | |
| 36 | 44 | echo "#define SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" | |
| 37 | - echo "#define UNDICI_VERSION \"$UNDICI_VERSION\"" >> "$FILE_PATH" | ||
| 45 | + echo "#define UNDICI_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH" | ||
| 38 | 46 | echo "#endif // SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" | |
| 39 | 47 | ) | |
| 40 | 48 | ||
@@ -43,3 +51,7 @@ mv deps/undici/src/undici-fetch.js deps/undici/undici.js | |||
| 43 | 51 | cp deps/undici/src/LICENSE deps/undici/LICENSE | |
| 44 | 52 | ||
| 45 | 53 | rm -rf undici-tmp/ | |
| 54 | + | ||
| 55 | + # The last line of the script should always print the new version, | ||
| 56 | + # as we need to add it to $GITHUB_ENV variable. | ||
| 57 | + echo "NEW_VERSION=$NEW_VERSION" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments