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

feat!: migrate to ESM #550

Merged
merged 12 commits into from
Nov 6, 2023
Merged

feat!: migrate to ESM #550

merged 12 commits into from
Nov 6, 2023

Conversation

mdonnalley
Copy link
Contributor

BREAKING CHANGES: ESM and node 18 minimum

What does this PR do?

  • Migrate to ESM
    • removed all uses of __dirname and require()
    • updated various imports to be stubbable by sinon
    • bumped got to latest esm version
  • Node 18 minimum
  • Publish oclif.lock

What issues does this PR fix or reference?

[skip-validate-pr]

BREAKING CHANGES: ESM and node 18 minimum
@mdonnalley mdonnalley added enhancement New feature or request and removed enhancement New feature or request labels Oct 25, 2023
"init": [
"./lib/hooks/init/init_doctor.js"
]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this hook removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not needed because we can initialize the Doctor class at the beginning of the doctor command execution. Also hooks are fairly expensive in terms of performance, especially the init hooks since they'll run on every single command execution, even --help and --version

@iowillhoit
Copy link
Contributor

iowillhoit commented Nov 2, 2023

QA NOTES

  • 🟢 sf whatsnew works
  • 🟢 I can pass versions and channels with --version
  • 🟢 Created a prerelease of sf, running an npm install with --foreground-scripts shows notes
  • 🟢 Release notes show after running sf update esm
  • 🟢 Able to run sf doctor
  • 🟢 Able to run plugin diagnostics sf doctor --plugin @salesforce/plugin-source
  • 🟢 Able to run a command in diagnostic mode

A few unrelated issues (can be in another WI)

  • The first time you run sf update (no /Users/ewillhoit/.local/share/sf/client dir), you get this warning that could probably be silenced:
    • Error: ENOENT: no such file or directory, open '/Users/ewillhoit/.local/share/sf/client/bin/sf'
  • Start with sf update stable (or stable-rc), then update to sf update dev or esm and you'll see this error.
    • /Users/ewillhoit/.local/share/sf/client/bin/sf: line 17: update: command not found
    • For some reason, this only seems to happen when switching to a prerelease version
  • Sometimes, for seemingly no reason, the release notes will not show
Screenshot 2023-11-02 at 2 26 41 PM

@mdonnalley mdonnalley merged commit 75b2b4f into main Nov 6, 2023
9 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/esm branch November 6, 2023 19:47
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.

3 participants