-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add a script to scaffold and bootstrap a new package #4984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the idea of automating the task of creating new packages, I agree the current "copy & paste" process is too error prone.
I feel it's important to write some tests to verify what content the new package contains and even more importantly to verify that it's correctly registered in our monorepo (see https://github.com/strongloop/loopback-next/blob/master/docs/site/DEVELOPING.md#adding-a-new-package).
Without that, I don't see much value in this script, when compared to running lb4 extension && lerna bootstrap
manually.
bin/add-extension-package.js
Outdated
|
||
console.log('Adding project %s/%s...', location, name); | ||
|
||
// Run `lb4 extension` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we want to add a regular package (packages/{name}
) or even an acceptance test (acceptance/{name}
) - is lb4 extension
a good command to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For regular package, yes. But not for acceptance tests.
4467e86
to
69096b9
Compare
Please see updated |
I'll add the copyright step once #4994 is landed. |
Not sure if we want to write tests for internal scripts. |
17e1a56
to
9fa601c
Compare
Thank you for the updates, I'll take another look next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps update the issue title to match the commit title? To me, they seem like different things. thx.
@raymondfeng ^
9fa601c
to
bfb5ead
Compare
bfb5ead
to
25f3cc5
Compare
@bajtos Since it's an internal script. I went ahead to merge it. Please continue to provide feedback so that we can improve it if necessary. |
3. Tidy up the project | ||
|
||
- Remove unused files | ||
- Rename `tsconfig.json` to `tsconfig.build.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raymondfeng I think this is no longer accurate, now that we are using project references (via #5155)?
We often need to add new packages to
loopback-next
. Copy/paste is error prone. This script scaffolds a new project underpackages
orextensions
depending on the current directory. Then it useslerna bootstrap
to set up dependencies.Depends on #4994
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈