Workspaces refactor #86

Merged
norm merged 189 commits from refactor/workspaces into main 2022-08-28 14:46:45 +00:00
Contributor

This PR aims to refactor the FoundKey repo to use Yarn Workspaces.
Notably, foundkey-js (fork of misskey-js) has been added as a workspace.

I'm not sure how much work it'll be to adopt workspaces, but it does seem like Misskey already does use sub-packages so this should hopefully not be too hard.

Help in refactoring would be very much appreciated.

Useful information on workspaces:

Once done, should resolve #24, #12, and #13

This PR aims to refactor the FoundKey repo to use Yarn Workspaces. Notably, `foundkey-js` (fork of `misskey-js`) has been added as a workspace. I'm not sure how much work it'll be to adopt workspaces, but it does seem like Misskey already does use sub-packages so this should hopefully not be too hard. Help in refactoring would be very much appreciated. Useful information on workspaces: - https://classic.yarnpkg.com/lang/en/docs/workspaces/ (Yarn 1.x) - https://yarnpkg.com/features/workspaces (Yarn 2.x+) Once done, should resolve https://akkoma.dev/FoundKeyGang/FoundKey/issues/24, https://akkoma.dev/FoundKeyGang/FoundKey/issues/12, and https://akkoma.dev/FoundKeyGang/FoundKey/issues/13
norm added 166 commits 2022-08-26 01:50:06 +00:00
✌️ b53a6bfe0c
Add ignore config
* Add endpoints

* endpoint

* endpoint: stats

* endpoint
* reset-password
* server-info

* endpoint
* announcements
* drive
* page-push

* page endpoint

* page id
✌️ 2f8f6431d1
* Update streaming.ts

* Update streaming.ts

* wip
✌️ e8c856924c
* update endpoints

* add endpoints
* endpoint
* endpoints

* update announcements endpoint

* replace to DateString

* update antennas endpoints

* update app endpoints

* update auth endpoints

* update entity: Antenna

* admin/delete-all-files-of-a-user

* fix

* admin/delete-logs

* update endpoints
* admin/ad/delete
* admin/announcements/delete

* update endpoints
* admin/federation/delete-all-files
* clips/delete

* update endpoints
* drive/files/delete
* drive/folders/delete
* gallery/posts/delete
* i/delete-account
* mute/delete

* update endpoints
* notes/favorites/delete
* notes/reactions/delete
* notes/watching/delete
* users/groups/delete
* users/lists/delete

* specifical id

* update antennas/notes endpoint
✌️ 8d3f9d7e34
* fix messaging

* add changelog
* Update entities.ts

* Update entities.ts

* extract

* fix app define
extract

* appの定義を修正

* 改行コード修正

* add changelog

* fix

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* fix fetch

* add comment

* 表現を変更
* add: type definition for messagingMessage event

* update: changelog
* Add missing main stream types

* changelog, fix

* update api

* fix

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* UserDetailed, MeDetailed

* npm run api

* remote: lastFetchedAt

* Update misskey-js.api.md

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Fix #43
Some components of Misskey like the image viewer use this property, but it hasn't been defined in the type definition itself.
Reviewed-on: norm/foundkey.js#46
git-subtree-dir: packages/foundkey-js
git-subtree-mainline: aa144e803c
git-subtree-split: 637c6f1411
add workspaces to package.json
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/build Pipeline failed
3b921ece5d
Author
Contributor

The large amount of commits is because these are originally from the misskey.js repo plus a few more that I added in my fork.

I used git-subtree to import the repo and its commit history as a subdirectory of this repo.

The large amount of commits is because these are originally from the [misskey.js repo](https://github.com/misskey-dev/misskey.js) plus a few more that I added in [my fork](https://akkoma.dev/norm/foundkey.js). I used `git-subtree` to import the repo and its commit history as a subdirectory of this repo.
Fix build errors
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
c1242cfde2
Update yarn lockfile
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
e8699ff978
fix import path for TreeAdapter
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
b230dc98a9
Author
Contributor

Ok, so server finally starts and all, but like the icons are missing for some reason...

Seems like more import paths needs fixing...

Ok, so server finally starts and all, but like the icons are missing for some reason... Seems like more import paths needs fixing...
Author
Contributor

Also wondering if we should jump to Yarn 2.x+ or stick to 1.x

Also wondering if we should jump to Yarn 2.x+ or stick to 1.x
Fix paths for twemoji and font-awesome
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
33146ffa5e
chore: update foundkey-js package.json
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
7420aab1b6
client: Use foundkey-js instead of misskey-js
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
a424426857
foundkey-js: remove github files
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
ebaa1960bf
sw: switch to foundkey-js
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
622731d1bd
Owner

Also wondering if we should jump to Yarn 2.x+ or stick to 1.x

I think I brought that up on IRC a bit ago because there is a PR by thatonecalculator to bring misskey to yarn 2 if I remember correctly. But we have probably changed quite a lot from misskey already that we couldn't just merge that one in.

> Also wondering if we should jump to Yarn 2.x+ or stick to 1.x I think I brought that up on IRC a bit ago because there is a PR by thatonecalculator to bring misskey to yarn 2 if I remember correctly. But we have probably changed quite a lot from misskey already that we couldn't just merge that one in.
Author
Contributor

Yeah, there's a bunch of stuff that hardcodes to various paths that I had to change to make things work in this refactor. Moving to yarn 2 would probably require more of those sorts of changes.

Yeah, there's a bunch of stuff that hardcodes to various paths that I had to change to make things work in this refactor. Moving to yarn 2 would probably require more of those sorts of changes.
remove install-packages.js
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
99bed3f872
Since we're now using workspaces, the dependencies of all modules in the
repo are automatically fetched.
norm force-pushed refactor/workspaces from 7ee8034909
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
to 90adbfb2c2
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
2022-08-26 06:37:19 +00:00
Compare
foundkey-js: mark as module
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
13b2cba980
Author
Contributor

Judging by calckey's package.json it seems like they're already using workspaces, and also the use of workspaces seems to have eliminated much of the need for the various scripts, so I'll see which we can remove.

Judging by [calckey's package.json](https://codeberg.org/thatonecalculator/calckey/src/branch/develop/package.json) it seems like they're already using workspaces, and also the use of workspaces seems to have eliminated much of the need for the various scripts, so I'll see which we can remove.
switch to yarn for scripts and move start to backend
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
6bccbc0d6d
migrate to Yarn 3.2.3
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline failed
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
6bb3f39c36
fix typo in ci
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
b3548cf9a0
ci: combine install and lint/build tasks
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
759d031a5f
add foundkey-js to each workspace package.json
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
bc0f0bf08f
foundkey-js: use prepack instead of prepare
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
d36d9692b8
explicitly build foundkey-js before everything else
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
91e4c159b8
use topological for build
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
122482e0a2
Author
Contributor

Finally gotten the build step to work properly. The yarn workspaces foreach command also supports --parallel and it does work locally on my own machine, but I'm not sure if it would be too much to handle on a small VPS...

That could be made into a separate build-parallel script if needed be.

Finally gotten the build step to work properly. The `yarn workspaces foreach` command also supports `--parallel` and it does work locally on my own machine, but I'm not sure if it would be too much to handle on a small VPS... That could be made into a separate `build-parallel` script if needed be.
norm changed title from WIP: Workspaces refactor to Workspaces refactor 2022-08-26 22:34:52 +00:00
Author
Contributor

I think everything works now. This should be ready for review.

I think everything works now. This should be ready for review.
Owner

You may want to rebase this - I somehow doubt all 100 ancient syuilo commits are relevant.

You may want to rebase this - I somehow doubt all 100 ancient syuilo commits are relevant.
Owner

@toast I belive those are from misskey.js:

The large amount of commits is because these are originally from the misskey.js repo plus a few more that I added in my fork.

I used git-subtree to import the repo and its commit history as a subdirectory of this repo.
-- #86 (comment)

@toast I belive those are from misskey.js: > The large amount of commits is because these are originally from the misskey.js repo plus a few more that I added in my fork. > > I used git-subtree to import the repo and its commit history as a subdirectory of this repo. -- https://akkoma.dev/FoundKeyGang/FoundKey/pulls/86#issuecomment-2519
Johann150 approved these changes 2022-08-26 23:25:38 +00:00
Johann150 left a comment
Owner

This is a lot of stuff, thanks for doing this! 🙏

Didn't see anything that would be obviously wrong, but since its so much I'm also trusting that you tested it and it works. :)

This is a lot of stuff, thanks for doing this! 🙏 Didn't see anything that would be obviously wrong, but since its so much I'm also trusting that you tested it and it works. :)
Johann150 added this to the (deleted) project 2022-08-27 00:03:47 +00:00
norm merged commit 10caf861e8 into main 2022-08-28 14:46:45 +00:00
norm deleted branch refactor/workspaces 2022-08-28 14:46:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
FoundKeyGang/FoundKey!86
No description provided.