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

Bump ora from 5.4.1 to 6.1.2 #2152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Jun 28, 2022

Bumps ora from 5.4.1 to 6.1.2.

Release notes

Sourced from ora's releases.

v6.1.2

sindresorhus/ora@v6.1.1...v6.1.2

v6.1.1

  • Fix preserving stdin's pause state (#210) 77ccc1e

sindresorhus/ora@v6.1.0...v6.1.1

v6.1.0

  • Expose the spinner interval as a getter 447812b
  • Internal refactoring. If you use any undocumented properties, this may break for you.

sindresorhus/ora@v6.0.1...v6.1.0

v6.0.1

  • Upgrade dependencies 26ba606

sindresorhus/ora@v6.0.0...v6.0.1

v6.0.0

Breaking

  • Require Node.js 12.20 ede1a54
  • This package is now pure ESM. Please read this.
  • ora.promise is now a named import called oraPromise (#181) 9c01990
    • import {oraPromise} from 'ora';
  • oraPromise now returns the given promise instead of this (#181) 9c01990
    • This lets you await it directly, which is more useful than chaining.

Improvements

  • Improve performance of the .clear() method (#182) d51c971

sindresorhus/ora@v5.4.1...v6.0.0

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [ora](https://github.com/sindresorhus/ora) from 5.4.1 to 6.1.2.
- [Release notes](https://github.com/sindresorhus/ora/releases)
- [Commits](sindresorhus/ora@v5.4.1...v6.1.2)

---
updated-dependencies:
- dependency-name: ora
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from a team as a code owner June 28, 2022 07:05
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 28, 2022
@gitpod-io
Copy link

gitpod-io bot commented Jun 28, 2022

@jywarren
Copy link
Member

jywarren commented Jun 28, 2022

Whoa that was a fast update.... anyways here were my notes from the previous:

ora.promise is now a named import called oraPromise ([#181](https://github-redirect.dependabot.com/sindresorhus/ora/issues/181)) 9c01990
import {oraPromise} from 'ora';
oraPromise now returns the given promise instead of this ([#181](https://github-redirect.dependabot.com/sindresorhus/ora/issues/181)) 9c01990
This lets you await it directly, which is more useful than chaining.

Referencing sindresorhus/ora#181

Ora usages:

Looks like the first one is more relevant maybe... more use of asynchronous?

var spinnerObj = { succeed: () => { }, stop: () => { } };
if (!process.env.TEST)
spinnerObj = Spinner('Your Image is being processed..').start();
// Run the sequencer.
sequencer.run({ progressObj: spinnerObj }, function() {
// Export all images or final image as binary files.
sequencer.exportBin(program.output, program.basic, outputFilename);
//check if spinner was not overriden stop it
if (!spinnerObj.overrideFlag) {
spinnerObj.succeed();
console.log('\nDone!!');
}
});
});

var spinner = Spinner('Now Installing...').start();
childProcess.execSync(`npm i ${params[1]}`);
sequencer.saveNewModule(params[0], params[1]);
sequencer.loadNewModule(params[0], require(params[1]));
spinner.stop();

@jywarren
Copy link
Member

Yes, it now returns a promise instead of the spinner object:

https://github.com/sindresorhus/ora/pull/181/files#diff-5a831ea67cf5cf8703b0de46901ab25bd191f56b320053be9332d9a3b0d01d15L229

So now we need to change starting on line 74 here, to receive spinnerPromise instead of spinnerObj, and to stop it differently on line 82-3?:

var spinnerObj = { succeed: () => { }, stop: () => { } };
if (!process.env.TEST)
spinnerObj = Spinner('Your Image is being processed..').start();
// Run the sequencer.
sequencer.run({ progressObj: spinnerObj }, function() {
// Export all images or final image as binary files.
sequencer.exportBin(program.output, program.basic, outputFilename);
//check if spinner was not overriden stop it
if (!spinnerObj.overrideFlag) {
spinnerObj.succeed();
console.log('\nDone!!');
}
});
});

@jywarren
Copy link
Member

jywarren commented Jun 28, 2022

Oh you know what, the error is actually about the require() usage:

internal/modules/cjs/loader.js:1102
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/runner/work/image-sequencer/image-sequencer/node_modules/ora/index.js
require() of ES modules is not supported.
require() of /home/runner/work/image-sequencer/image-sequencer/node_modules/ora/index.js from /home/runner/work/image-sequencer/image-sequencer/src/cli/installModule.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/runner/work/image-sequencer/image-sequencer/node_modules/ora/package.json.

Maybe the promises stuff is not actually causing an issue... although we should check the spinner still stops properly.

The change is instead probably:

var Spinner = require('ora');

var Spinner = require('ora');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant