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(deno): update types for deno ^1.4.0 #1772

Merged
merged 2 commits into from Oct 1, 2020

Conversation

luke-john
Copy link
Contributor

@luke-john luke-john commented Sep 30, 2020

In version 1.4 Deno adopted;

These require the use of;

  • type only imports for values which are only used as types (importsNotUsedAsValues)
  • type only exports for types which are re-exported (isolatedModules)

I've added more details at #1771.

related prs:

@luke-john
Copy link
Contributor Author

While preparing this pr and the related ones in yargs-parse and y18n, vscode showed most files as full of errors due to the use of file extensions in imports which don't match the actual source files extension

ie

// https://github.com/yargs/yargs/blob/master/lib/typings/yargs-parser-types.ts#L3
import type { Dictionary, ValueOf } from './common-types.js'

In this example common-types is a typescript file with the extension .ts common-types.ts

While there's some build tooling and to support the builds to the build folder, I was still seeing issues in the files under /build.

Are these intentional (possibly for the cjs builds)?

@bcoe
Copy link
Member

bcoe commented Sep 30, 2020

@luke-john I will need to dig into these CI/CD issues, I just fixed a bug related to how we parse commands, not sure how I failed to update this failing test.

In version 1.4 Deno adopted;

- the tsconfig setting [importsNotUsedAsValues](https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues) - denoland/deno#7413
- the tsconfig setting [isolatedModules](https://www.typescriptlang.org/tsconfig#isolatedModules) when using the deno `--unstable` flag - denoland/deno#7326 ([intended to be enabled by default in 1.5](denoland/deno#7326))

These require the use of;
- type only imports for values which are only used as types (`importsNotUsedAsValues`)
- type only exports for types which are re-exported (`isolatedModules`)
@luke-john luke-john force-pushed the YARGS-1771_support-new-deno-version branch from 913b644 to a8fac27 Compare October 1, 2020 12:46
@luke-john luke-john changed the base branch from deno to master October 1, 2020 12:46
@luke-john
Copy link
Contributor Author

No problems, I've just updated this to be against master instead of Deno.

@bcoe bcoe merged commit 0801752 into yargs:master Oct 1, 2020
@bcoe
Copy link
Member

bcoe commented Oct 16, 2020

@luke-john hey Luke, just wanted to let you know that the latest version of yargs should have this problem fixed for you.

Let me know if you continue to bump into any issues?

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

2 participants