Workspaces refactor #86

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

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
Add ignore config
* Add endpoints

* endpoint

* endpoint: stats

* endpoint
* reset-password
* server-info

* endpoint
* announcements
* drive
* page-push

* page endpoint

* page id
* Update streaming.ts

* Update streaming.ts

* wip
* 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
* 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
Owner

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.
norm added 1 commit 2022-08-26 03:36:34 +00:00
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
norm added 1 commit 2022-08-26 04:11:06 +00:00
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/lint-client Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
e8699ff978
norm added 1 commit 2022-08-26 04:15:26 +00:00
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/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
b230dc98a9
Author
Owner

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
Owner

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
norm added 1 commit 2022-08-26 04:31:25 +00:00
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
norm added 1 commit 2022-08-26 04:53:29 +00:00
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/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
7420aab1b6
norm added 1 commit 2022-08-26 05:26:10 +00:00
client: Use foundkey-js instead of misskey-js
Some checks failed
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/push/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
a424426857
norm added 1 commit 2022-08-26 05:30:30 +00:00
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/test Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ebaa1960bf
norm added 2 commits 2022-08-26 05:35:53 +00:00
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
Owner

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.
norm added 1 commit 2022-08-26 06:31:46 +00:00
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/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
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 to 90adbfb2c2 2022-08-26 06:37:19 +00:00 Compare
norm added 1 commit 2022-08-26 06:44:10 +00:00
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/test Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
13b2cba980
Author
Owner

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.
norm added 1 commit 2022-08-26 16:49:07 +00:00
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/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
6bccbc0d6d
norm added 2 commits 2022-08-26 19:24:43 +00:00
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
norm added 1 commit 2022-08-26 19:33:43 +00:00
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
norm added 1 commit 2022-08-26 19:50:29 +00:00
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
norm added 2 commits 2022-08-26 20:38:58 +00:00
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
norm added 2 commits 2022-08-26 22:05:21 +00:00
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
norm added 1 commit 2022-08-26 22:15:32 +00:00
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
norm added 1 commit 2022-08-26 22:19:44 +00:00
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
Owner

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
Owner

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
Johann150 added a new dependency 2022-08-27 00:05:03 +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
Johann150 added the
upkeep
label 2022-12-23 10:26:10 +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.