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

[Proof of concept] The ultimate TypeScript setup rework #1975

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5c5c972
Fix typescript-checkJS script
aweebit Aug 13, 2023
f26eceb
Fix option value source type
aweebit Aug 13, 2023
057a191
Fix executableDir() return type
aweebit Aug 13, 2023
2e03e2c
Fix description(): do not set command description if not provided
aweebit Aug 13, 2023
2103bc9
Refactor code to avoid need for type assertions
aweebit Aug 13, 2023
9bacf8d
Add type assertions
aweebit Aug 13, 2023
120135d
Fix internal return types
aweebit Aug 13, 2023
7255c25
Merge branch 'fix/executableDir-return-type' into fix/type-errors
aweebit Aug 13, 2023
146aff4
Merge branch 'fix/undefined-command-description' into fix/type-errors
aweebit Aug 13, 2023
b5b7030
Merge branch 'fix/option-value-source-type' into fix/type-errors
aweebit Aug 13, 2023
d3bf6df
Add assertions for fixed return type of getOptionValueSource()
aweebit Aug 13, 2023
257693f
Revert "Fix typescript-checkJS script"
aweebit Aug 15, 2023
d3627cc
Add type guards for CommanderError
aweebit Aug 15, 2023
326df3c
Remove @ts-check directives
aweebit Aug 16, 2023
6a629a6
Remove test of default export in TypeScript
aweebit Aug 17, 2023
b99af12
Use indentation consistent with other files in tsconfig.json
aweebit Aug 17, 2023
d71c1de
Set "module" to "node16" in TSConfig
aweebit Aug 17, 2023
c0e3e9c
Add tests for aggregated import in TypeScript
aweebit Aug 17, 2023
90ac942
Fix aggregated import in TypeScript
aweebit Aug 17, 2023
ccc0245
Rework TypeScript workflow
aweebit Aug 17, 2023
77d256c
Move entry points to ./lib/exports
aweebit Aug 17, 2023
bcb5a46
Merge branch 'fix/typescript-import' into feature/typescript-workflow
aweebit Aug 17, 2023
f1a2fc6
Merge branch 'fix/type-errors' into feature/typescript-workflow
aweebit Aug 17, 2023
71d0966
Prepare entry points for automatic typings generation
aweebit Aug 17, 2023
cd4338b
Use @package instead of @api private in JSDoc
aweebit Aug 17, 2023
735128b
Let ESLint ignore auto-generated type declaration files
aweebit Aug 17, 2023
f384ecf
Run typings autogeneration for the first time
aweebit Aug 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* program.executableDir('subcommands');
*
* @param {string} [path]
* @return {string|Command}
* @return {string|null|Command}
*/

executableDir(path) {
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ export class Command {
/**
* Get the executable search directory.
*/
executableDir(): string;
executableDir(): string | null;

/**
* Output help information for this command.
Expand Down
2 changes: 1 addition & 1 deletion typings/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ expectType<commander.Command>(program.nameFromFilename(__filename));

// executableDir
expectType<commander.Command>(program.executableDir(__dirname));
expectType<string>(program.executableDir());
expectType<string | null>(program.executableDir());

// outputHelp
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type, @typescript-eslint/no-confusing-void-expression
Expand Down