-
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
chore: upgrade to typescript 3.0.x and lerna 3.1.x #1626
Conversation
c0bde0b
to
466b9fd
Compare
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.
👏 awesome PR! In a followup PR now we can explore using TS Project Linking to see if it improves build times.
Just have a few questions to help me better understand some of the changes.
/** | ||
* A dummy command to get filtered packages | ||
*/ | ||
class NopCommand extends Command { |
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.
How does this help us get filtered packages?
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.
The base command has the default steps to set up filter packages. We execute a no-op command to get such information.
// Load dependencies from `packages/build/package.json` | ||
const buildDeps = require(path.join(rootPath, 'packages/build/package.json')) | ||
.dependencies; | ||
await cmd; // Execute the command |
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.
just an await
executes the command? How?
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.
The constructor returns an instance of the command, which has then()
to function as a promise to run it.
@@ -1,6 +0,0 @@ | |||
{ |
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.
Why are we getting rid of this file?
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.
It creates inconsistency against loopback-next
root level prettier
.
@@ -39,13 +39,7 @@ | |||
"lb-clean": "./bin/run-clean.js" | |||
}, | |||
"scripts": { | |||
"lint": "npm run prettier:check", |
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.
Why are we getting rid of linting in this package?
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.
No, it's just redundant as we already have npm run lint
at loopback-next
level.
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.
Oh. I thought all packages had those but just double checked and they don't. 👍
scope: scope, | ||
loglevel: 'silent', | ||
}); | ||
return cmd.run(); | ||
await cmd; |
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.
How does just awaiting a command trigger it? 🤔
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.
Please note that cmd
is a promise-like object when runs the command itself.
commitlint.config.js
Outdated
'@commitlint/config-conventional', | ||
'@commitlint/config-lerna-scopes', | ||
], | ||
extends: ['@commitlint/config-conventional', './bin/config-lerna-scopes'], |
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 know the switch to away from @commitlint/config-lerna-scopes
is because it doesn't yet support Lerna 3.x BUT they have a PR in progress to add 3.x support ... I don't think we should introduce our own script for the package as it becomes something for us to maintain. We can split this PR to land the TypeScript upgrade and give commitlint
some time to upgrade (knowing their history and the current progress of the PR I'd say a week tops) and we won't have to have a custom script to maintain?
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.
commitlint PR: https://github.com/marionebl/commitlint/pull/406
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.
Haha, I didn't see the PR and was trying to submit one. It's actually not too bad to maintain some of the commit rules for loopback-next
itself though, IMO.
e6c2823
to
9afbefb
Compare
}, | ||
"scripts": { | ||
"postinstall": "lerna bootstrap", | ||
"postinstall": "lerna bootstrap --no-ci", |
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 the record, lerna 3.x forces npm ci
instead of npm i
for CI envs. But npm ci
fails as we don't check in package-lock.json files. It's not working to set the ci
flag to false
in lerna.json
as the value is overridden.
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.
Thanks for the explanation! I had to look at the docs to find the info. Would help other reviewers. Is there an issue regarding the flag in lerna.json
not working? Would be good to remove it eventually but not a blocker for this PR.
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.
See lerna/lerna#1449
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.
Cross-posting lerna/lerna#1449 (comment)
Next release should fix this for you properly.
AFAICT, the next release has been already published, see https://github.com/lerna/lerna/releases/tag/v3.1.3
Bug Fixes
add: Avoid passing bad scope to pacote
global-options: Move env defaults to command superclass
@raymondfeng Do you have bandwidth to update our scripts and remove --no-ci
in favor of settingci: false
in lerna.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.
LOL, the follow-up pull request has been already landed, see #1632.
Please ignore my comment above.
9afbefb
to
7e9de76
Compare
@virkt25 PTAL |
In terms of the changes I don't have any more comments or concerns except I don't think we should be creating our own script for the packages given the PR in progress. It's one less thing for us to maintain.
|
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.
LGTM as far as I can tell. I wanted to look at some docs behind @lerna/project
but lerna doesn't seem to have any...
Considering the code is tiny and it also gives us flexibility to introduce extra scopes, such as We can revert it back to the |
Adding additional scopes would go against conventional commits. It should either be a package name or nothing.
That sounds reasonable to me. Can you please add a comment to |
7e9de76
to
b9129f5
Compare
Upgrade to TypeScript 3.0.x and lerna 3.1.x
Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated