Skip to content

Use Yarn workspace #7357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LABEL org.opencontainers.image.description="Docker image for ReScript developmen

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
yarn \
opam \
musl-tools \
python-is-python3 \
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.mli linguist-language=OCaml
*.res linguist-language=ReScript
*.resi linguist-language=ReScript

.yarn/releases/* binary linguist-vendored
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc

- name: Get artifact dir name
Expand Down Expand Up @@ -281,7 +282,7 @@ jobs:
key: ${{ steps.compiler-build-state-key.outputs.value }}

- name: Install npm packages
run: npm ci --ignore-scripts
run: yarn install

- name: Copy compiler exes to platform bin dir
run: node ./scripts/copyExes.js -compiler
Expand Down Expand Up @@ -429,10 +430,11 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc

- name: NPM install
run: npm ci --ignore-scripts
run: yarn install

- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -523,6 +525,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ tests/tools_tests/**/*.res.js
tests/tools_tests/lib
tests/analysis_tests*/lib
tests/analysis_tests/**/*.bs.js

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
935 changes: 935 additions & 0 deletions .yarn/releases/yarn-4.7.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
yarnPath: .yarn/releases/yarn-4.7.0.cjs

nodeLinker: node-modules

nmMode: hardlinks-global
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#### :house: Internal

- Clean up legacy tags handling. https://github.com/rescript-lang/rescript/pull/7309
- Use Yarn (Berry) workspaces for internal tooling. https://github.com/rescript-lang/rescript/pull/7309

#### :nail_care: Polish

Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Happy hacking!
> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!

- [Node.js](https://nodejs.org/) v20.x
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
- C compiler toolchain (usually installed with `xcode` on Mac)
- Python <= 3.11 (required to build ninja)
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
Expand Down Expand Up @@ -58,7 +59,7 @@ opam install . --deps-only --with-test --with-dev-setup -y

#### npm install

Run `npm install --ignore-scripts`. This will install the npm dependencies required for the build scripts.
Run `yarn install`. This will install the npm dependencies required for the build scripts.

### B. Devcontainer

Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ ninja/ninja:

ninja: ninja/ninja

node_modules/.bin/semver:
npm install

test: lib
node scripts/test.js -all

Expand All @@ -54,7 +51,7 @@ test-all: test test-gentype test-analysis test-tools
reanalyze:
reanalyze.exe -set-exit-code -all-cmt _build/default/compiler _build/default/tests -exclude-paths compiler/outcome_printer,compiler/ml,compiler/js_parser,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb

lib: build node_modules/.bin/semver
lib: build
./scripts/buildRuntime.sh
./scripts/prebuilt.js

Expand Down
4 changes: 3 additions & 1 deletion analysis/examples/example-project/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
lib
.merlin
.merlin
package-lock.json
yarn.lock
16 changes: 0 additions & 16 deletions analysis/examples/example-project/package-lock.json

This file was deleted.

4 changes: 3 additions & 1 deletion analysis/examples/larger-project/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/node_modules
/lib
/lib
package-lock.json
yarn.lock
192 changes: 0 additions & 192 deletions analysis/examples/larger-project/package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion analysis/examples/larger-project/src/Hooks.res
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type callback<'input, 'output> = React.callback<'input, 'output>
type testReactContext = React.Context.t<int>

@genType
type testReactRef = React.Ref.t<int>
type testReactRef = React.ref<int>

@genType
type testDomRef = ReactDOM.domRef
Expand Down
2 changes: 2 additions & 0 deletions analysis/examples/workspace-project/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ lib
.merlin
.bsb.lock
/node_modules/
package-lock.json
yarn.lock
14 changes: 0 additions & 14 deletions analysis/examples/workspace-project/package-lock.json

This file was deleted.

1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lineWidth": 80,
"attributePosition": "auto",
"ignore": [
".yarn/**",
"tests/build_tests/**",
"tests/tests/**",
"tests/tools_tests/**",
Expand Down
Loading