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

Apps directory can be repetitive #31

Closed
Tracked by #48
elliotBraem opened this issue Dec 4, 2023 · 2 comments
Closed
Tracked by #48

Apps directory can be repetitive #31

elliotBraem opened this issue Dec 4, 2023 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@elliotBraem
Copy link
Contributor

elliotBraem commented Dec 4, 2023

After setting up multiple bos-workspaces across the ecosystem, I've encountered some recurring feedback.

Typically, bos-workspaces have not been used as monorepos handling multiple different apps and will instead use one app + deploy accountId, which will be setup in a Github Action

A common flow I've had to do is the following:

For bluntdao, I needed to initialize a bos-workspace, pull in existing widgets, then set up the workflow

mkdir bluntdao-components
cd bluntdao-components

mkdir apps
mkdir apps/bluntdao
mkdir apps/bluntdao/widget
touch apps/bluntdao/bos.config.json
touch apps/bluntdao/widget/hello.jsx

cd apps/bluntdao
bos components download bluntdao.near
// this downloads all bluntdao components to a /src directory
 // now we need to move them all to the widget directory 
mv src/widget/* widget/.  

npm init (create package.json)
npm install bos-workspace

// create npm run dev and npm run build in package.json -> bw dev, bw build

// copy over github workflows
// modify github workflow working directory to be the app name (bluntdao)

npm run dev

And then sometimes, if there are multiple apps, such as genadrop; instead of dedicate different accounts for each app, they add a prefix like in genadrop, so there are prefixes GenaDrop and CPlanet, and so you can have a structure that looks like this:

apps/bluntdao/widget/bluntdao/hello.jsx


I think the multi-app flow is powerful, and maybe GenaDrop and CPlanet should be following it rather than what they are doing now deploying to the same account

But it is very common to set up a github repository for only one app + to only configure one deploy and signer account for it for the Github Action; and so the deep directories repeating the same app name can be confusing.

I feel like both should be supported, especially considering the context of #25 and #19; but it may mean changing default behavior or reducing a layer; food for thought

@elliotBraem elliotBraem added bug Something isn't working help wanted Extra attention is needed labels Dec 4, 2023
@sekaiking
Copy link
Collaborator

sekaiking commented Dec 6, 2023

This definitely need to be addressed, in my opinion the best approach is to let the apps location dependent on bos.config.json location, this way bos-workspace will be less opiniated, and if implemented correctly it will be still compatible with the current projects too.

Scenario 1: Single App

- widget
  - CPlanet
    - index.jsx
  - GenaDrop
    - index.jsx
- bos.config.json
- package.json

Scenario 2: Multiple Apps

- [folder1]
  - widget
    - index.jsx
  - bos.config.json
- [folder2]
  - widget
    - index.jsx
  - bos.config.json
- package.json

Scenario 3: Old way

- [apps|folder0]
  - [folder1]
    - widget
      - index.jsx
    - bos.config.json
  - [folder2]
    - widget
      - index.jsx
    - bos.config.json
- package.json

What do you think?

@elliotBraem
Copy link
Contributor Author

@sekaiking I think it makes a lot of sense to depend on the bos.config.json. Great idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants