From bec1082756394d3fbb9aacc400a90c35b78e5dde Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Fri, 9 Apr 2021 12:15:27 +0900 Subject: [PATCH] ARROW-12239: [JS] Switch to yarn Closes #9918 from domoritz/yarn Lead-authored-by: Dominik Moritz Co-authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- .github/workflows/js.yml | 2 +- ci/docker/conda-integration.dockerfile | 1 + ci/docker/linux-apt-docs.dockerfile | 3 ++- ci/scripts/cpp_build.sh | 4 ++-- ci/scripts/js_build.sh | 9 ++++----- ci/scripts/js_test.sh | 4 ++-- dev/release/rat_exclude_files.txt | 1 + dev/release/verify-release-candidate.sh | 8 ++++---- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index c021e99c4..354c45c60 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -113,7 +113,7 @@ jobs: # node-version: ${{ matrix.node }} # - name: Install Platform Dependencies # shell: bash - # run: npm install -g cross-env + # run: yarn add -g cross-env # - name: Build # shell: bash # run: ci/scripts/js_build.sh $(pwd) diff --git a/ci/docker/conda-integration.dockerfile b/ci/docker/conda-integration.dockerfile index 82636e4cc..1f2c9ac5d 100644 --- a/ci/docker/conda-integration.dockerfile +++ b/ci/docker/conda-integration.dockerfile @@ -34,6 +34,7 @@ RUN conda install -q \ compilers \ maven=${maven} \ nodejs=${node} \ + yarn \ openjdk=${jdk} && \ conda clean --all --force-pkgs-dirs diff --git a/ci/docker/linux-apt-docs.dockerfile b/ci/docker/linux-apt-docs.dockerfile index b9804e018..604a05afb 100644 --- a/ci/docker/linux-apt-docs.dockerfile +++ b/ci/docker/linux-apt-docs.dockerfile @@ -69,7 +69,8 @@ ARG node=14 RUN wget -q -O - https://deb.nodesource.com/setup_${node}.x | bash - && \ apt-get install -y nodejs && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + npm install -g yarn # Sphinx is pinned because of ARROW-9693 RUN pip install \ diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index f1656ac50..8a1e4f32f 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -109,8 +109,8 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \ -DBUILD_WARNING_LEVEL=${BUILD_WARNING_LEVEL:-CHECKIN} \ -Dc-ares_SOURCE=${cares_SOURCE:-} \ -DCMAKE_BUILD_TYPE=${ARROW_BUILD_TYPE:-debug} \ - -DCMAKE_C_FLAGS=${CFLAGS:-} \ - -DCMAKE_CXX_FLAGS=${CXXFLAGS:-} \ + -DCMAKE_C_FLAGS="${CFLAGS:-}" \ + -DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \ -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \ -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \ diff --git a/ci/scripts/js_build.sh b/ci/scripts/js_build.sh index b2add45b0..10ceb41ee 100755 --- a/ci/scripts/js_build.sh +++ b/ci/scripts/js_build.sh @@ -24,14 +24,13 @@ with_docs=${2:-false} pushd ${source_dir} -npm install +yarn --frozen-lockfile # TODO(kszucs): linting should be moved to archery -npm run lint:ci -npm run build +yarn lint:ci +yarn build if [ "${with_docs}" == "true" ]; then - npm install typedoc - npm run doc + yarn doc fi popd diff --git a/ci/scripts/js_test.sh b/ci/scripts/js_test.sh index 1de4e1df1..345d6cb81 100755 --- a/ci/scripts/js_test.sh +++ b/ci/scripts/js_test.sh @@ -23,7 +23,7 @@ source_dir=${1}/js pushd ${source_dir} -npm run lint -npm run test +yarn lint +yarn test popd diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index e943dadf2..e51cd204c 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -128,6 +128,7 @@ go/parquet/go.sum js/.npmignore js/closure-compiler-scripts/* js/src/fb/*.ts +js/yarn.lock python/cmake_modules python/cmake_modules/FindPythonLibsNew.cmake python/cmake_modules/SnappyCMakeLists.txt diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index 222e70289..3fc926f4e 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -412,12 +412,12 @@ test_js() { [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" nvm install --lts + npm install -g yarn fi - npm install - # clean, lint, and build JS source - npx run-s clean:all lint build - npm run test + yarn --frozen-lockfile + yarn run-s clean:all lint build + yarn test popd }