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: use require style import of yargs for --help #6986

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

forivall
Copy link
Contributor

@forivall forivall commented Oct 29, 2020

Description of change

Use import yargs = require("yargs") instead of import * to work around this issue

Without this change, i see the following behaviour:

» typeorm migration:generate --help
Options:
  --help     Show help                                                 [boolean]
  --version  Show version number

with this change, we get the full help

» typeorm migration:generate --help
typeorm migration:generate

Generates a new migration file with sql needs to be executed to update schema.

Options:
  -h, --help        Show help                                          [boolean]
  -c, --connection  Name of the connection on which run a query.
                                                            [default: "default"]
  -n, --name        Name of the migration class.             [string] [required]
  -d, --dir         Directory where migration should be created.
  -p, --pretty      Pretty-print generated SQL        [boolean] [default: false]
  -f, --config      Name of the file with connection configuration.
                                                          [default: "ormconfig"]
  -v, --version     Show version number                                [boolean]

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000 idk if there is an open issue. i searched but there are many open issues
  • There are new or updated unit tests validating the change N/A
  • Documentation has been updated to reflect this change N/A
  • The new commits follow conventions explained in CONTRIBUTING.md

@imnotjames
Copy link
Contributor

imnotjames commented Oct 29, 2020

Just confirming - we can't use import yargs from "yargs"? I think this technique (import * as yargs) was when we were using a much older version of yargs and the newer one might differ & allow the default import?

@imnotjames imnotjames added the hacktoberfest-accepted label hacktoberfest label Oct 29, 2020
@forivall
Copy link
Contributor Author

import yargs from "yargs" may work -- i just made this change from the github web interface. Depending on the tsconfig, there's a chance it might not work. I'll make that tweak and checks it works later today or tomorrow.

@forivall
Copy link
Contributor Author

forivall commented Nov 6, 2020

@imnotjames sorry for the delay. import yargs from "yargs" works fine, and i've pushed the change.

@imnotjames imnotjames merged commit 6ef8ffe into typeorm:master Nov 9, 2020
@imnotjames
Copy link
Contributor

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted label hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants