-
Notifications
You must be signed in to change notification settings - Fork 29
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
Suggestion for JS workspace improvements #27
Comments
Hey @barak007 thank you for this! And I've looked through your PR for the same, I appreciate it. Some of these items I'm definitely on board with, some of them I'm not sure. Either way, I will definitely want to go in small steps here as we move forward; I think the current #28 tries to cover too many of these things at once for my preferences. Let me respond to each task in particular–
Really? I'm excited to hear that! It was in there for something that
I get the idea, but why is workspaces better than lerna? This seems to me a bit like a "if it's not broken, don't fix it" situation. Lerna covers the same set of solutions, no?
Agree but at the same time I'm not sold: it also seems like it would make it harder for a given package to deviate from the configuration of the others if it needed to. There is a reason (unfortunately) that the different js packages use different build workflows, which makes me a bit hesitant to try to unify them too early
Definitely! Good catch, I'd love to take a PR for this one as well
I'm interested in this change, and also a bit confused– the builds do use typescript. Or do you mean that the packages ultimately ship as js with
I'm on board! For this one I'd say let's start by aligning on a config, then I'd like to approach the actual change set with 1 commit including the config files and a second commit which actually runs prettier and commits the result (imo this makes it clear when trying to follow the git history exactly what happened; you wouldn't need to go unearthing the config file from a single commit that touched many files) Let me know what you think! |
Hey good to hear. First you can see the preview for these changes in #28
This is a semi big change which raises some type questions. In order to remove babel I used
From my experience if you have npm workspace, lerna become unnecessary dependency as it's only giving you a good version bump mechanism over the workspace features of npm.
The way I see it is you have your tools in one place and you use/configure them differently in each package.
Nice
Currently this project does not build with
Sure, this is my standard {
"printWidth": 120,
"singleQuote": true,
"overrides": [
{
"files": ["*.js", "*.cjs", "*.mjs", "*.ts", "*.tsx", "*.cts", "*.mts"],
"options": {
"tabWidth": 4
}
}
]
} |
Assume
lerna
stays.Task: remove
babel
Reason: not needed anymore
Task: delete
package-lock.json
from all packages keep only one at thejs
root folder.Reason: It is not necessary to have lock file in each package when you have a workspace
Task: move all
devDependencies
from eachpackage.json
to the rootpackage.json
.Reason: it makes maintains/updating/install much simpler and keep the infra unified
Task: avoid
.sh
scripts and convert them to.js
Reason: better cross platform (Windows) support
Task: move
tsconfig
to thejs
root and extends each packageReason: unify the configuration between packages, also since the build does not uses typescript the
tsconfig
is only used by the IDE.Task: add prettier
Reason: enforce similar code format
let me know what if this sounds reasonable.
The text was updated successfully, but these errors were encountered: