Developer-DAO / create-dao

MIT License
93 stars 15 forks source link

private settings in package.json #20

Closed e-roy closed 2 years ago

e-roy commented 2 years ago

For publishing to npm, private must be set to false.

But workspaces to work properly, private must be set to true.

Lerna helps solve this problem for monorepos.

@Dhaiwat10 please assign this to me

e-roy commented 2 years ago

@Dhaiwat10 so after looking into this a little bit further, Lerna is awesome for managing multiple packages under one repo. Currently we only really only have one package in this repo. I think the answer to this is a bit simpler.

I don't think we even need this line "private": "true", https://github.com/Developer-DAO/create-dao/blob/0709815bf658dee5ae747c3591acea46003cb1e1/package.json#L4

I think just deleting this line will solve this issue. Can you try this and test publishing?

Dhaiwat10 commented 2 years ago

@e-roy if I remove that line:

a) Yes, I can publish the package to npm. b) I cannot install the dependencies by running yarn.

error Workspaces can only be enabled in private projects.
e-roy commented 2 years ago

@Dhaiwat10 I see.

I've created a test for this here for you to see file structure and a working test example. This has scripts to run for next development, version update, and npm publish. This will require a huge change in the file structure, but will layout properly for future other packages to be held here in a monorepo. It wouldn't take too long to do, but since it does have such a huge change, it might be good to clear up any PRs before starting.

The current structure is:

├── helpers
│  ├── git.js
│  ├── install.js
│  └── ...
├── template
│  ├── components
│  │  └── ...
│  ├── contracts
│  │  └── ...
│  ├── pages
│  │  └── ...
│  └──...
├── README.md
├── create-app.js
├── index.js
├── .gitignore
├── package.json
└── ...

adding lerna will need this structure

├── packages
│  └──create-dao
│  │  ├── helpers
│  │  │  ├── git.js
│  │  │  ├── install.js
│  │  │  └── ...
│  │  ├── template
│  │  │  ├── components
│  │  │  │  └── ...
│  │  │  ├── contracts
│  │  │  │  └── ...
│  │  │  ├── pages
│  │  │  │  └── ...
│  │  │  └──...
│  │  ├── README.md
│  │  ├── create-app.js
│  │  ├── index.js
│  │  ├── .gitignore
│  │  ├── package.json
│  │  └── ...
├── README.md
├── .gitignore
├── lerna.json
└── package.json
Dhaiwat10 commented 2 years ago

@e-roy thanks for trying that out. This looks really promising. Can you put in a PR so that we can test this out?