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

chore(monorepo): initial commit to create the create-pkg monorepo #18

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

rxmarbles
Copy link
Member

@rxmarbles rxmarbles commented Jan 19, 2024

This PR initalizes the move of create-pkg from a singular repo to a monorepo starting w/ the create-pkg CLI as per #16 . There are things that are needed to be added at the root README level which I'm hoping to structure out once we move more packages in. We can also link to the package-meta-interop collabspace for more of the research and drivers for the work being done to these packages

cc @Ethan-Arrowood

In regards to maintaining git history for the rest of the packages that we plan on moving into the repo we can use lerna import. Once we have all the packages that we feel are necessary for the project we can freely remove lerna and go with a pure npm workspaces setup. Just my 2 cents but feel it would get us going on the project and implement/experiment quickly to work towards our goals. Happy to discuss further.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was fast! Thanks for the quick work, I made a few comments but they are really just nitpicks. Just having this in place makes adding the other packages so much easier. In your slack DM you mentioned using lerna import but the git commands are pretty easy to pull in a subtree (not easy enough to remember them off hand, but easy enough that I can look them up). But either way we can deal with that when we pull in the first of the other packages.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
.npmrc Outdated
@@ -1 +1 @@
package-lock=false
registry=https://registry.npmjs.org
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather drop this since it is default personally. Not super opinionated about it, but we can delete the file and who doesn't like deleting files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly put this here incase those who have private regsitries and use their work machine instead of their own personal machine. This just makes sure we are absolutely pointed to the npmjs registry. If we feel we don't need it I can remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your reasoning makes sense, but home directory .npmrc files are an anti-pattern and anyone using a private registry should be strongly suggesting that projects have their own .npmrc file which points at their internal registry. Any other configuration is a security risk and causes more friction when on-boarding new engineers.

So yes, personally I would rather not make it easier for folks using home directory configs by adding this override.

Copy link
Member

@darcyclarke darcyclarke Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably, the source of packages shouldn't matter so long as we are generating lockfiles (which is what this change aims to do). Integrity values shouldn't change across the registry mirrors/caches & would get caught by any kind of security-specific tooling.

ie. I'm a +1 to remove this file all together if we're leaning on the defaults

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably, the source of packages shouldn't matter so long as we are generating lockfiles

I think I disagree on this point. I think an organization who runs their own registry typically wants to ensure that ALL packages come from that registry. Even if it is the same content with the same integrity values, having server logs for installs is an important factory for incident response. I know for sure I don't want any packages coming from anywhere other than our registry at Netflix.

packages/create-pkg-cli/package.json Outdated Show resolved Hide resolved
"standard": "^14.3.1",
"standard-version": "^9.0.0"
},
"support": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added in this PR? Not sure it matters, but I just didn't remember it being there in the old one. Also, should be we a bit more particular about our support and use a bit more of the spec?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah not sure how that slipped in. It might have been in there already but wasn't known until i moved stuff around. We can definitely add more to the support spec for sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to block this PR, especially since support for that field is basically non-existent lol. Just something I noticed.

package-ecosystem: npm
rebase-strategy: auto
schedule:
interval: daily
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got some feedback from folks on another repo in here that we have been using renovate because dependabot is such trash. I would rather add something than nothing but also just wanted to call it out since this was new for this repo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with either tbh. We can remove this once we get the renovate setup in the repo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @ljharb or @dominykas want to chime in? I feel like it was their feedback but my memory might be off.

@wesleytodd
Copy link
Member

I got curious, so I looked up learna import and I am confident there is a much better way to do this with git directly. But here is the link for anyone interested: https://github.com/lerna/lerna/blob/main/libs/commands/import/src/index.ts

@Ethan-Arrowood
Copy link

Lerna isn't necessary afaik to retain git history. Ive done migrations like this with git alone. But if lerna worked then no big deal let's ship it 🚀

@wesleytodd
Copy link
Member

Yeah, maybe it is not worth even worrying about this until the first package is pulled in? We only need to pull in like 2 things afaik so we should't get too hung up on it.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't had a chance to fully re-review but if anyone does and gives this an approval I did not want to block that. So adding a new review as a comment to make it not a "request changes".

.npmrc Outdated Show resolved Hide resolved
@wesleytodd wesleytodd merged commit edeee00 into main Mar 14, 2024
3 checks passed
@wesleytodd
Copy link
Member

We were on the call and @darcyclarke and I both just said we are good to merge. So I just merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants