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

refactor: migrate to Yarn Berry (v3.2.1) #8764

Merged
merged 120 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
5c7fca4
Yarn berry
ThatOneCalculator May 29, 2022
76e399c
Add `.yarn` to dockerignore
ThatOneCalculator May 29, 2022
ea7d535
Mention in CHANGELOG
ThatOneCalculator May 29, 2022
9652183
Update Dockerfile
ThatOneCalculator May 29, 2022
3140a3f
Proper upgrade to yarn
ThatOneCalculator May 29, 2022
9d1c8b4
use `"packageManager"`
ThatOneCalculator May 30, 2022
fd8170f
Replace `install-packages.js` with workspaces
ThatOneCalculator May 30, 2022
6ba6dd1
Replace `install-packages.js` with workspaces
ThatOneCalculator May 30, 2022
9afb410
Typo
ThatOneCalculator May 30, 2022
7df83d7
`corepack enable` for linting
ThatOneCalculator May 30, 2022
7bd65cf
Remove `packages/*/yarn.lock`
ThatOneCalculator May 30, 2022
f035817
Merge branch 'yarn-3' of https://github.com/ThatOneCalculator/misskey…
ThatOneCalculator May 30, 2022
6254a1e
Improve lint workflow
ThatOneCalculator May 30, 2022
ff99a92
Update .github/workflows/lint.yml
ThatOneCalculator May 30, 2022
3208a2e
Update .github/workflows/lint.yml
ThatOneCalculator May 30, 2022
4970bef
Add `eslint`
ThatOneCalculator May 30, 2022
322fe72
Regenerate yarn.lock
ThatOneCalculator May 30, 2022
39f8cb3
🙏‍
ThatOneCalculator May 30, 2022
6f2a9d5
Update lint.yml
ThatOneCalculator May 30, 2022
c05cc01
Merge branch 'misskey-dev:develop' into yarn-3
ThatOneCalculator May 30, 2022
db86110
Fix workflow!
ThatOneCalculator May 30, 2022
44c42f1
yarn lint my beloved
ThatOneCalculator May 30, 2022
bc94eb8
corepack enable for mocha/e2e
ThatOneCalculator May 30, 2022
88c7594
Update CHANGELOG.md
ThatOneCalculator May 30, 2022
dd1bfae
fix the code that depends on node_modules
ThatOneCalculator May 30, 2022
299ec96
tbh
ThatOneCalculator May 30, 2022
d76ec57
tbh
ThatOneCalculator May 30, 2022
95aff06
More yarn workspaces stuff
ThatOneCalculator May 31, 2022
5cf5a83
🍀
ThatOneCalculator May 31, 2022
de29d9a
Change `browser-image-resizer`
ThatOneCalculator May 31, 2022
a2f9e1c
:finnadie:
ThatOneCalculator May 31, 2022
54ed997
Merge branch 'misskey-dev:develop' into yarn-3
ThatOneCalculator May 31, 2022
9daea49
Merge branch 'yarn-3' of https://github.com/ThatOneCalculator/misskey…
ThatOneCalculator May 31, 2022
71a9070
:goberserk:
ThatOneCalculator May 31, 2022
a872e6e
:godmode:
ThatOneCalculator May 31, 2022
33c58df
Remove yarnrc for workspaces
ThatOneCalculator May 31, 2022
75d2336
🙏
ThatOneCalculator May 31, 2022
099c623
Add proper packages for eslint
ThatOneCalculator May 31, 2022
d5af0a6
Skip extra install
ThatOneCalculator May 31, 2022
2208df1
New steps for test.yml too
ThatOneCalculator May 31, 2022
e4dde13
uhh
ThatOneCalculator May 31, 2022
7bba487
Update .dockerignore
ThatOneCalculator May 31, 2022
e0c57cf
Update lint.yml
ThatOneCalculator May 31, 2022
789d0f8
Update test.yml
ThatOneCalculator May 31, 2022
e489c53
Merge branch 'yarn-3' of https://github.com/ThatOneCalculator/misskey…
ThatOneCalculator May 31, 2022
66ab759
Make client/backend lints seperate workflows
ThatOneCalculator May 31, 2022
3820a07
package.json names
ThatOneCalculator Jun 1, 2022
db0344e
pnpm = dont change paths
ThatOneCalculator Jun 1, 2022
4d16fb7
Fix changelog
ThatOneCalculator Jun 1, 2022
e21919c
:bowtie:
ThatOneCalculator Jun 1, 2022
f4059eb
I don't know why github workflows hates me...
ThatOneCalculator Jun 1, 2022
d34bb62
test
ThatOneCalculator Jun 1, 2022
021a52c
?????
ThatOneCalculator Jun 1, 2022
a53663f
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jun 2, 2022
9264b50
continue-on-error: true
tamaina Jun 2, 2022
3e38e47
Fix yarn.lock
tamaina Jun 2, 2022
71538d4
add @rollup/pluginutils
tamaina Jun 3, 2022
9b727f6
add packageExtensions for chartjs_date-fns
tamaina Jun 3, 2022
ac89f25
npm run => yarn
tamaina Jun 3, 2022
1a837bb
wip
tamaina Jun 4, 2022
41fadc9
yarn node => node
tamaina Jun 4, 2022
dea1322
fix
tamaina Jun 4, 2022
fd55957
fix http-signature
tamaina Jun 4, 2022
09d1ba9
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jun 4, 2022
77a3c76
fix
tamaina Jun 4, 2022
c0fea1c
fix
tamaina Jun 4, 2022
d8ef0ca
add packageExtensions
tamaina Jun 4, 2022
93b5dd7
:v:
tamaina Jun 4, 2022
ff1f652
remove `yarn set version berry`
tamaina Jun 4, 2022
b85397c
yarn install --immutable
tamaina Jun 4, 2022
fba88e1
https://github.com/misskey-dev/misskey/pull/8764#discussion_r885749892
tamaina Jun 4, 2022
b53a67b
enable actions/setup-node's global cache
tamaina Jun 4, 2022
772cf15
Update .gitignore
tamaina Jun 4, 2022
014ef17
revival gulp build
tamaina Jun 4, 2022
11fbd54
fix lockfile
tamaina Jun 4, 2022
7ddfd04
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jun 16, 2022
9851b44
Update packages/backend/package.json
tamaina Jun 16, 2022
f2e593a
remove packagemanager
tamaina Jun 16, 2022
4746ef5
Merge branch 'yarn-3' of https://github.com/thatonecalculator/misskey…
tamaina Jun 16, 2022
15ec284
Merge branch 'misskey-dev:develop' into yarn-3
ThatOneCalculator Jun 17, 2022
308f57d
`yarn run gulp` in `build` instead of just `gulp`
ThatOneCalculator Jun 17, 2022
4335e09
Update CHANGELOG.md
ThatOneCalculator Jun 17, 2022
b9154cd
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jun 28, 2022
1739603
update lockfile
tamaina Jun 28, 2022
47f05ad
Merge branch 'misskey-dev:develop' into yarn-3
ThatOneCalculator Jun 28, 2022
4f0f4ed
Merge branch 'yarn-3' of https://github.com/ThatOneCalculator/misskey…
ThatOneCalculator Jun 28, 2022
bfedb98
Add .yarn/cache to gitignore for packages
ThatOneCalculator Jun 28, 2022
9cd1526
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jul 5, 2022
02a18fb
?
tamaina Jul 5, 2022
c81e5ae
move resolutions
tamaina Jul 5, 2022
6fab21c
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Jul 19, 2022
79b6ad2
:v:
tamaina Jul 19, 2022
23c0c97
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Aug 1, 2022
84d01ac
update lockfie
tamaina Aug 1, 2022
9326445
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Aug 9, 2022
03efc87
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Aug 19, 2022
656e672
update-lockfile
tamaina Aug 19, 2022
338a076
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Sep 20, 2022
e54ab1d
update yarn.lock
tamaina Sep 20, 2022
b44dc9d
fix build
tamaina Sep 20, 2022
029f6c3
fix
tamaina Sep 20, 2022
3eda1d1
fix
tamaina Sep 20, 2022
f7f4628
fix: add @tensorflow/tfjs
tamaina Sep 20, 2022
673c522
ダメ
tamaina Sep 20, 2022
155af07
modify lockfile
tamaina Sep 20, 2022
585519f
use yarnrc
tamaina Sep 21, 2022
13f4e92
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Sep 21, 2022
c8200e6
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Sep 23, 2022
a7d3585
update yarnlock
tamaina Sep 23, 2022
4b8becb
add jest-mock
tamaina Sep 23, 2022
088d66a
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Oct 13, 2022
7e5d7b5
update-lockfile
tamaina Oct 13, 2022
24a2bb5
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Oct 29, 2022
fad2d65
update lockfile
tamaina Oct 29, 2022
d4b8c0e
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Nov 7, 2022
7c406ea
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Nov 13, 2022
1615135
update lockfile
tamaina Nov 13, 2022
af8fd01
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Nov 14, 2022
61568ad
Merge branch 'develop' into pr/ThatOneCalculator/8764
tamaina Nov 22, 2022
461b36c
move jest-mock, update lockfile
tamaina Nov 22, 2022
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 .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ node_modules/
redis/
files/
misskey-assets/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
36 changes: 14 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,24 @@ on:
pull_request:

jobs:
backend:
lint:
strategy:
matrix:
workspace:
- backend
- client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v3.2.0
with:
node-version: 18.x
cache: 'yarn'
cache-dependency-path: |
Copy link
Contributor

@ishowta ishowta May 31, 2022

Choose a reason for hiding this comment

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

消してもキャッシュされるのでしょうか?
Will it still be cached if removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

https://dev.classmethod.jp/articles/caching-dependencies-in-workflow-execution-on-github-actions/

グローバルパッケージをキャッシュする(??)ものなのであんまり関係ない気がする

packages/backend/yarn.lock
- run: yarn install
- run: yarn --cwd ./packages/backend lint

client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
cache-dependency-path: |
packages/client/yarn.lock
- run: yarn install
- run: yarn --cwd ./packages/client lint
- run: corepack enable
- run: yarn set version berry
tamaina marked this conversation as resolved.
Show resolved Hide resolved
- run: yarn install --immutable
env:
YARN_CHECKSUM_BEHAVIOR: update
ThatOneCalculator marked this conversation as resolved.
Show resolved Hide resolved
tamaina marked this conversation as resolved.
Show resolved Hide resolved
- run: yarn workspace ${{ matrix.workspace }} run lint
25 changes: 10 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
env:
POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust
YARN_CHECKSUM_BEHAVIOR: update
redis:
image: redis:6
ports:
Expand All @@ -36,12 +37,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: |
packages/backend/yarn.lock
packages/client/yarn.lock
- name: Install dependencies
run: yarn install
- run: corepack enable
- run: yarn set version berry
tamaina marked this conversation as resolved.
Show resolved Hide resolved
- run: yarn workspaces foreach install --immutable
- name: Check yarn.lock
run: git diff --exit-code yarn.lock
- name: Copy Configure
Expand Down Expand Up @@ -87,14 +85,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: |
packages/backend/yarn.lock
packages/client/yarn.lock
- name: Install dependencies
run: yarn install
- name: Check yarn.lock
run: git diff --exit-code yarn.lock
- run: corepack enable
- run: yarn set version berry
tamaina marked this conversation as resolved.
Show resolved Hide resolved
- run: yarn workspaces foreach install --immutable
env:
YARN_CHECKSUM_BEHAVIOR: update
- name: Copy Configure
run: cp .github/misskey/test.yml .config
- name: Build
Expand All @@ -106,7 +101,7 @@ jobs:
uses: cypress-io/github-action@v2
with:
install: false
start: npm run start:test
start: yarn start:test
wait-on: 'http://localhost:61812'
headless: false
browser: ${{ matrix.browser }}
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
node_modules
report.*.json

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
packages/*/.yarn/*
tamaina marked this conversation as resolved.
Show resolved Hide resolved

# Cypress
cypress/screenshots
cypress/videos
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.0.0
v18.2.0
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
httpTimeout: 600000

nmHoistingLimits: none

nodeLinker: pnpm

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

progressBarStyle: "patrick"

packageExtensions:
"chartjs-adapter-date-fns@*":
peerDependencies:
date-fns: "*"
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ You should also include the user name that made the change.
- Perform port diagnosis at startup only when Listen fails @mei23
- Rate limiting is now also usable for non-authenticated users. @Johann150 @mei23
Admins should make sure the reverse proxy sets the `X-Forwarded-For` header to the original address.
- Migrate to Yarn v3.2.0 @ThatOneCalculator

### Bugfixes
- Client: fix settings page @tamaina
Expand Down Expand Up @@ -186,7 +187,7 @@ You should also include the user name that made the change.
## 12.104.0 (2022/02/09)

### Note
ビルドする前に`npm run clean`を実行してください。
ビルドする前に`yarn clean`を実行してください。

このリリースはマイグレーションの規模が大きいため、インスタンスによってはマイグレーションに時間がかかる可能性があります。
マイグレーションが終わらない場合は、チャートの情報はリセットされてしまいますが`__chart__`で始まるテーブルの**レコード**を全て削除(テーブル自体は消さないでください)してから再度試す方法もあります。
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Thank you for your PR! Before creating a PR, please check the following:
- Check if there are any documents that need to be created or updated due to this change.
- If you have added a feature or fixed a bug, please add a test case if possible.
- Please make sure that tests and Lint are passed in advance.
- You can run it with `npm run test` and `npm run lint`. [See more info](#testing)
- You can run it with `yarn test` and `yarn lint`. [See more info](#testing)
- If this PR includes UI changes, please attach a screenshot in the text.

Thanks for your cooperation 🤗
Expand Down Expand Up @@ -92,7 +92,7 @@ If your language is not listed in Crowdin, please open an issue.
![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg)

## Development
During development, it is useful to use the `npm run dev` command.
During development, it is useful to use the `yarn dev` command.
This command monitors the server-side and client-side source files and automatically builds them if they are modified.
In addition, it will also automatically start the Misskey server process.

Expand All @@ -112,7 +112,7 @@ Alternatively, prepare an empty (data can be erased) DB and edit `.config/test.y

Run all test.
```
npm run test
yarn test
```

#### Run specify test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.0.0-alpine3.15 AS base
FROM node:18.2.0-alpine3.15 AS base
Copy link
Contributor

@ishowta ishowta May 31, 2022

Choose a reason for hiding this comment

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

I guess you have to see if it works with Docker


ARG NODE_ENV=production

Expand Down
36 changes: 23 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,36 @@
"type": "git",
"url": "https://github.com/misskey-dev/misskey.git"
},
"packageManager": "yarn@3.2.1",
"workspaces": [
"packages/client",
"packages/backend",
"packages/sw"
],
"private": true,
"scripts": {
"postinstall": "node ./scripts/install-packages.js",
"build": "node ./scripts/build.js",
"start": "cd packages/backend && node --experimental-json-modules ./built/index.js",
"start:test": "cd packages/backend && cross-env NODE_ENV=test node --experimental-json-modules ./built/index.js",
"init": "npm run migrate",
"build": "yarn workspaces foreach run build",
Copy link
Contributor

@ishowta ishowta May 31, 2022

Choose a reason for hiding this comment

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

gulpのbuild commandも実行する必要があると思います。

"start": "cd packages/backend && yarn node --experimental-json-modules ./built/index.js",
"start:test": "cd packages/backend && cross-env NODE_ENV=test yarn node --experimental-json-modules ./built/index.js",
"init": "yarn migrate",
"migrate": "cd packages/backend && npx typeorm migration:run -d ormconfig.js",
"migrateandstart": "npm run migrate && npm run start",
"migrateandstart": "yarn migrate && yarn start",
"gulp": "gulp build",
"watch": "npm run dev",
"watch": "yarn dev",
"dev": "node ./scripts/dev.js",
"lint": "node ./scripts/lint.js",
"lint": "yarn workspaces foreach run lint",
"cy:open": "cypress open",
"cy:run": "cypress run",
"e2e": "start-server-and-test start:test http://localhost:61812 cy:run",
"mocha": "cd packages/backend && cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" npx mocha",
tamaina marked this conversation as resolved.
Show resolved Hide resolved
"test": "npm run mocha",
"test": "yarn mocha",
"format": "gulp format",
"clean": "node ./scripts/clean.js",
"clean-all": "node ./scripts/clean-all.js",
"cleanall": "npm run clean-all"
"cleanall": "yarn clean-all"
},
"dependencies": {
"eslint": "^8.16.0",
"execa": "5.1.1",
"gulp": "4.0.2",
"gulp-cssnano": "2.1.3",
Expand All @@ -41,10 +47,14 @@
"devDependencies": {
"@types/gulp": "4.0.9",
"@types/gulp-rename": "2.0.1",
"@typescript-eslint/parser": "5.18.0",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "5.27.0",
"cross-env": "7.0.3",
"cypress": "9.5.3",
"cypress": "9.7.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-vue": "latest",
"start-server-and-test": "1.14.0",
"typescript": "4.6.3"
"typescript": "4.7.2",
"vue-eslint-parser": "^9.0.2"
ThatOneCalculator marked this conversation as resolved.
Show resolved Hide resolved
}
}
2 changes: 0 additions & 2 deletions packages/backend/.npmrc

This file was deleted.

1 change: 0 additions & 1 deletion packages/backend/.yarnrc

This file was deleted.

Loading