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

fix 'add --help' typo, refactor ora to dynamic import, move colors.js #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ixc7
Copy link

@ixc7 ixc7 commented Feb 18, 2022

Summary

Fixes 'add --help' typo, refactors ora to dynamic import statement, moves colors.js

What are the specific steps to test this change?

For example:

  1. Clone the repository
  2. run 'npm i -D'
  3. run ./bin/apostrophe add --help
  4. run ./bin/apostrophe create (any name here)

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Moves "require('colors')" statement from bin/apostrophe to lib/util.js where it is used.

Fixes typo for "./bin/apostrophe add --help"
see https://asciinema.org/a/469939

Changes ora to dynamic import() statement
see sindresorhus/ora#189

apostrophe-cms/cli/lib/util.js:12
const ora = require('ora');
            ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/admin/work/node/apostrophe-cms/cli/node_modules/.pnpm/ora@6.0.1/node_modules/ora/index.js from /Users/admin/work/node/apostrophe-cms/cli/lib/util.js not supported.
Instead change the require of index.js in /Users/admin/work/node/apostrophe-cms/cli/lib/util.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/admin/work/node/apostrophe-cms/cli/lib/util.js:12:13)
    at Object.<anonymous> (/Users/admin/work/node/apostrophe-cms/cli/bin/apostrophe:6:14) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v17.4.0

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.

None yet

1 participant