-
Notifications
You must be signed in to change notification settings - Fork 1
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!: migrate to ESM #397
Conversation
BREAKING CHANGES: ESM and node 18 minimum
This issue has been linked to a new work item: W-14350069 |
src/commands/schema/generate.ts
Outdated
return (hookFiles as string[]).map(h => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) | ||
const hookFiles = Object.values(this.base.config.pjson.oclif?.hooks ?? {}).reduce( | ||
(x: string[], y: string | string[]) => (Array.isArray(y) ? [...x, ...y] : [...x, y]), | ||
[] as string[], |
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 string[], | |
[], |
src/commands/schema/generate.ts
Outdated
[] as string[], | ||
) | ||
const {outDir, rootDir} = this.getDirs() | ||
return (hookFiles as string[]).map((h) => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) |
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.
return (hookFiles as string[]).map((h) => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) | |
return (hookFiles).map((h) => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) |
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.
seems like the types have been strengthened, but the usages are still using as ...
src/commands/snapshot/compare.ts
Outdated
|
||
public async run(): Promise<CompareResponse> { | ||
const {flags} = await this.parse(Compare) | ||
const oldCommands = JSON.parse(fs.readFileSync(flags.filepath).toString('utf8')) as SnapshotEntry[] |
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 I'm guilty for writing some of these, but we can change to fs.readFileSync(flags..., 'utf-8')
instead of using .toString
- but that's a NIT
QA Notes
|
BREAKING CHANGES: ESM and node 18 minimum