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

Monorepo initialization & new APIs #29

Open
PalmDevs opened this issue Mar 11, 2024 · 0 comments
Open

Monorepo initialization & new APIs #29

PalmDevs opened this issue Mar 11, 2024 · 0 comments
Assignees
Labels
Feature request New feature or request

Comments

@PalmDevs
Copy link
Member

⚠️ Issues with adding new APIs

As things progress, Revenge will have to add new features and APIs. Adding these changes directly to the window.vendetta API will affect other forks, eg. Bunny. We've discussed this internally and the solution was to add new APIs into window.revenge object which plugin developers can check for and use responsibly.

❓ Why initialize a monorepo?

Using a monorepo allows for better project structure and management, as well as helping separate parts of code which makes it easier to work with.

🛠️ Implementation

This will be the project's structure:

📂 packages
|_ 🟦 vendetta
|  |_ 📂 src
|     |_ 📘 index.ts
|     |_ (...)
|_ 🧰 components
|_ 🔨 utils
|_ 💉 register
|  |_ 📂 src
|     |_ 📘 index.ts
|_ (...)

To add window.revenge, we can call the @revenge-mod/register package:

// packages/vendetta/src/index.ts

// ...
import '@revenge-mod/register';
// ...

export default async () => {
  // ...
};

In the @revenge-mod/register package, the window.revenge API is assigned:

// packages/register/src/index.ts

import components from '@revenge-mod/components';
import utils from '@revenge-mod/utils';
// ...

window.revenge = {
  components,
  utils,
  // ...
};
@PalmDevs PalmDevs added the Feature request New feature or request label Mar 11, 2024
@PalmDevs PalmDevs self-assigned this Mar 11, 2024
PalmDevs pushed a commit that referenced this issue Sep 13, 2024
* Refactored `lib/metro` and added types + cleaned up `tsconfig.json` + minor changes to `build.mjs` and `package.json`

* Made requested changes + added eslint rule to restrict top-level await

* Exclude `transform-async-to-generator` from `env` (async/await is es7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant