-
Notifications
You must be signed in to change notification settings - Fork 38
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
BREAKING CHANGE: dropping support for eof node versions 12, 14 and 16; upgrade dependencies #605
Conversation
53fc79f
to
d214686
Compare
.eslintrc.js
Outdated
@@ -17,6 +17,7 @@ module.exports = { | |||
}, | |||
rules: { | |||
'@typescript-eslint/no-unsafe-assignment': 'off', | |||
'@typescript-eslint/no-unsafe-argument': 'off', |
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.
To handle the pervasive use of implicit any everywhere. We should follow-up with proper typing but out-of-scope of this PR as it is an existing issue and scope is narrowed down to dependency management at this time.
@@ -19,7 +19,7 @@ jobs: | |||
- name: Setup Node.js | |||
uses: actions/setup-node@v2 | |||
with: | |||
node-version: 12 | |||
node-version: 18 |
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.
Bumping to minimum supported version.
@@ -5,7 +5,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
strategy: | |||
matrix: | |||
node: ['12', '14', '16'] | |||
node: ['18', '20'] |
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.
As mentioned in the description, versions < 18 are EOL as of 9/11/2023.
@@ -26,7 +26,7 @@ export interface IMigrationSpec { | |||
|
|||
export function loadSpec(directory: string): IMigrationSpec { | |||
const docPath = path.join(directory, 'shepherd.yml'); | |||
const spec = yaml.safeLoad(fs.readFileSync(docPath, 'utf8')); | |||
const spec = yaml.load(fs.readFileSync(docPath, 'utf8')); |
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.
Yaml package renamed safeLoad to load. In this PR, we update to the new name.
@@ -16,7 +16,7 @@ const jsonStringify = (data: any) => JSON.stringify(data, undefined, 2); | |||
const migrateToJsonIfNeeded = async (migrationContext: IMigrationContext) => { | |||
const legacyFile = getLegacyRepoListFile(migrationContext); | |||
if (await fs.pathExists(legacyFile)) { | |||
const data = yaml.safeLoad(await fs.readFile(legacyFile, 'utf8')); | |||
const data = yaml.load(await fs.readFile(legacyFile, 'utf8')); |
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.
Same as previous comment.
Need to ensure the major version gets bumped as dropping support for Node versions is a breaking change. |
de207d0
to
38355d3
Compare
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@nerdwallet/shepherd", | |||
"version": "1.16.0", | |||
"version": "2.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.
This manual bump is unnecessary as semantic-release will bump the major version.
1757a44
to
04be4ca
Compare
src/logger/index.ts
Outdated
this.oraInstance = ora(message).start(); | ||
this.spinnerActive = true; | ||
this.oraInstance.start(); | ||
import('ora') |
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.
This dynamic import is a workaround and not a good one. It causes race conditions that are more challenging to solve than to convert to using a different spinner. Need to evaluate alternatives.
src/logger/index.ts
Outdated
@@ -58,28 +56,34 @@ export default class ConsoleLogger implements ILogger { | |||
}; | |||
|
|||
public succeedIcon = (message: string): void => { | |||
this.info(`${logSymbols.success} ${message}`); | |||
this.info(`✅ ${message}`); |
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.
One option to removing dependency on log-symbols which, as in the case of ora, requires dynamic imports. I'm fine with using emoji, unless there's a preference or reason to do otherwise.
Almost there. Local testing looks good but there are a few issues left outstanding that need to be resolved:
I'm leaning towards deprecation of both log-symbols and ora. Open to feedback :) |
45460bb
to
16a094e
Compare
This PR is ready to ship. Unit tests pass as before and tested local as well. |
@@ -16,17 +16,19 @@ module.exports = { | |||
sourceType: 'module', | |||
}, | |||
rules: { | |||
'@typescript-eslint/no-unsafe-assignment': 'off', |
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.
Prefer integer value. 0 = off, 1 = warn, and 2 = error.
Changes