Skip to content

Commit 113a515

Browse files
domoritzkou
andcommitted
ARROW-12239: [JS] Switch to yarn
Closes apache#9918 from domoritz/yarn Lead-authored-by: Dominik Moritz <domoritz@gmail.com> Co-authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 493b205 commit 113a515

14 files changed

Lines changed: 10752 additions & 17945 deletions

.github/workflows/js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
# node-version: ${{ matrix.node }}
114114
# - name: Install Platform Dependencies
115115
# shell: bash
116-
# run: npm install -g cross-env
116+
# run: yarn add -g cross-env
117117
# - name: Build
118118
# shell: bash
119119
# run: ci/scripts/js_build.sh $(pwd)

ci/docker/conda-integration.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ RUN conda install -q \
3434
compilers \
3535
maven=${maven} \
3636
nodejs=${node} \
37+
yarn \
3738
openjdk=${jdk} && \
3839
conda clean --all --force-pkgs-dirs
3940

ci/docker/linux-apt-docs.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ ARG node=14
6969
RUN wget -q -O - https://deb.nodesource.com/setup_${node}.x | bash - && \
7070
apt-get install -y nodejs && \
7171
apt-get clean && \
72-
rm -rf /var/lib/apt/lists/*
72+
rm -rf /var/lib/apt/lists/* && \
73+
npm install -g yarn
7374

7475
# Sphinx is pinned because of ARROW-9693
7576
RUN pip install \

ci/scripts/cpp_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
109109
-DBUILD_WARNING_LEVEL=${BUILD_WARNING_LEVEL:-CHECKIN} \
110110
-Dc-ares_SOURCE=${cares_SOURCE:-} \
111111
-DCMAKE_BUILD_TYPE=${ARROW_BUILD_TYPE:-debug} \
112-
-DCMAKE_C_FLAGS=${CFLAGS:-} \
113-
-DCMAKE_CXX_FLAGS=${CXXFLAGS:-} \
112+
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
113+
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
114114
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \
115115
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \
116116
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \

ci/scripts/js_build.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ with_docs=${2:-false}
2424

2525
pushd ${source_dir}
2626

27-
npm install
27+
yarn --frozen-lockfile
2828
# TODO(kszucs): linting should be moved to archery
29-
npm run lint:ci
30-
npm run build
29+
yarn lint:ci
30+
yarn build
3131

3232
if [ "${with_docs}" == "true" ]; then
33-
npm install typedoc
34-
npm run doc
33+
yarn doc
3534
fi
3635

3736
popd

ci/scripts/js_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source_dir=${1}/js
2323

2424
pushd ${source_dir}
2525

26-
npm run lint
27-
npm run test
26+
yarn lint
27+
yarn test
2828

2929
popd

dev/release/rat_exclude_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ go/parquet/go.sum
128128
js/.npmignore
129129
js/closure-compiler-scripts/*
130130
js/src/fb/*.ts
131+
js/yarn.lock
131132
python/cmake_modules
132133
python/cmake_modules/FindPythonLibsNew.cmake
133134
python/cmake_modules/SnappyCMakeLists.txt

dev/release/verify-release-candidate.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ test_js() {
412412
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
413413

414414
nvm install --lts
415+
npm install -g yarn
415416
fi
416417

417-
npm install
418-
# clean, lint, and build JS source
419-
npx run-s clean:all lint build
420-
npm run test
418+
yarn --frozen-lockfile
419+
yarn run-s clean:all lint build
420+
yarn test
421421
popd
422422
}
423423

js/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jspm_packages/
6161
.npm
6262

6363
# JS package manager files
64-
yarn.lock
64+
package-lock.json
6565

6666
# Optional eslint cache
6767
.eslintcache

js/DEVELOP.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
Even if you do not plan to contribute to Apache Arrow itself or Arrow
2323
integrations in other projects, we'd be happy to have you involved:
2424

25-
* Join the mailing list: send an email to
26-
[dev-subscribe@arrow.apache.org][1]. Share your ideas and use cases for the
27-
project.
25+
* Join the mailing list: send an email to [dev-subscribe@arrow.apache.org][1].
26+
Share your ideas and use cases for the project.
2827
* [Follow our activity on JIRA][3]
2928
* [Learn the format][2]
3029
* Contribute code to one of the reference implementations
3130

32-
We prefer to receive contributions in the form of GitHub pull requests. Please send pull requests against the [github.com/apache/arrow][4] repository.
31+
We prefer to receive contributions in the form of GitHub pull requests.
32+
Please send pull requests against the [github.com/apache/arrow][4] repository.
3333

3434
If you are looking for some ideas on what to contribute, check out the [JIRA
3535
issues][3] for the Apache Arrow project. Comment on the issue and/or contact
@@ -40,28 +40,30 @@ If you’d like to report a bug but don’t have time to fix it, you can still p
4040
it on JIRA, or email the mailing list
4141
[dev@arrow.apache.org](http://mail-archives.apache.org/mod_mbox/arrow-dev/)
4242

43-
# The npm scripts
43+
# The package.json scripts
4444

45-
* `npm run clean` - cleans targets
46-
* `npm run build` - cleans and compiles all targets
47-
* `npm test` - executes tests against built targets
45+
We use [yarn](https://yarnpkg.com/) to install dependencies and run scrips.
4846

49-
These npm scripts accept argument lists of targets × modules:
47+
* `yarn clean` - cleans targets
48+
* `yarn build` - cleans and compiles all targets
49+
* `yarn test` - executes tests against built targets
50+
51+
These scripts accept argument lists of targets × modules:
5052

5153
* Available `targets` are `es5`, `es2015`, `esnext`, and `all` (default: `all`)
5254
* Available `modules` are `cjs`, `esm`, `umd`, and `all` (default: `all`)
5355

5456
Examples:
5557

56-
* `npm run build` -- builds all ES targets in all module formats
57-
* `npm run build -- -t es5 -m all` -- builds the ES5 target in all module formats
58-
* `npm run build -- -t all -m cjs` -- builds all ES targets in the CommonJS module format
59-
* `npm run build -- --targets es5 es2015 -m all` -- builds the ES5 and ES2015 targets in all module formats
60-
* `npm run build -- -t es5 --modules cjs esm` -- builds the ES5 target in CommonJS and ESModules module formats
58+
* `yarn build` -- builds all ES targets in all module formats
59+
* `yarn build -t es5 -m all` -- builds the ES5 target in all module formats
60+
* `yarn build -t all -m cjs` -- builds all ES targets in the CommonJS module format
61+
* `yarn build --targets es5 es2015 -m all` -- builds the ES5 and ES2015 targets in all module formats
62+
* `yarn build -t es5 --modules cjs esm` -- builds the ES5 target in CommonJS and ESModules module formats
6163

6264
This argument configuration also applies to `clean` and `test` scripts.
6365

64-
* `npm run deploy`
66+
* `yarn deploy`
6567

6668
Uses [lerna](https://github.com/lerna/lerna) to publish each build target to npm with [conventional](https://conventionalcommits.org/) [changelogs](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli).
6769

@@ -103,7 +105,7 @@ Uses [lerna](https://github.com/lerna/lerna) to publish each build target to npm
103105
mv File{_generated,}.ts && mv Schema{_generated,}.ts && mv Message{_generated,}.ts
104106
```
105107

106-
2. Execute `npm run lint` from the `js` directory to fix the linting errors
108+
2. Execute `yarn lint` from the `js` directory to fix the linting errors
107109

108110
[1]: mailto:dev-subscribe@arrow.apache.org
109111
[2]: https://github.com/apache/arrow/tree/master/format

0 commit comments

Comments
 (0)