Skip to content
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

Yarn4 migration #212

Merged
merged 7 commits into from
Nov 19, 2024
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Enable Corepack
run: |
corepack enable
- name: Install tox
run: |
pip install --upgrade pip
Expand Down
11 changes: 10 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules/*

dist
dist-ssr
*.local
Expand All @@ -22,3 +22,12 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Yarn directories
node_modules/*
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
Comment on lines +25 to +33
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

934 changes: 934 additions & 0 deletions client/.yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
nodeLinker: pnp
8 changes: 7 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint:tsc": "vue-tsc --noEmit",
"lint:check": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --fix ",
"lint:format": "prettier src --write",
"lint": "npm-run-all lint:*",
"lint": "npm-run-all lint:tsc lint:check lint:format",
"dev": "NODE_ENV=development vite --port 8080",
"build:clean": "rimraf ../imagedephi/web_static",
"build:compile": "vite build --outDir ../imagedephi/web_static",
Expand Down Expand Up @@ -36,5 +36,11 @@
"vite": "^4.5.5",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^1.8.5"
},
"packageManager": "yarn@4.5.1+sha256.dc2e45a77f87a9c2a76708d098ab54ca0cfdd5ec2cf7d9e3c1f24bf786a2383c",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(do you need to specify yarn version berry to run tox -e binary or just tox?).

Locally I am able to run tox and tox -e binary in a terminal with yarn v1.22.0 and still have it build correctly so long as I am using node 20+ with corepack enabled. I believe this line is why.

Copy link
Collaborator Author

@marySalvi marySalvi Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some investigation, yes this line combined with corepack is the magic. Once it is enabled corepack is able to detect the correct yarn version. I have updated the ci yaml to reflect this.

Corepack is also what allows us to switch to different projects using different versions without manually setting a new version each time. Huzzah!

https://nodejs.org/api/corepack.html#configuring-a-package

"dependenciesMeta": {
"remixicon@3.7.0": {
"unplugged": true
}
}
}
6,972 changes: 4,233 additions & 2,739 deletions client/yarn.lock

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ With the virtual environment active, run the CLI:
imagedephi
```

### Developing the Web GUI
### Development
#### Requirements

```bash
python ^3.11
node ^20
```

#### Initial Install
This project uses yarn modern. As such you'll need to enable corepack to detect the correct yarn version:

```bash
cd /client
corepack enable
```


#### Developing the Web GUI
While developing the web GUI, it may be useful to launch web server
that auto-reloads code changes and shows in-browser exception tracebacks:
```bash
Expand Down
Loading