Skip to content

Commit dc78d0d

Browse files
committed
fix: add missing type declarations to source control
The .gitignore had *.d.ts which caused type declarations to be ignored. This broke CI builds on Node 24 while working locally because the files existed only in working directory. - Remove *.d.ts from .gitignore - Add commander-fork/index.d.ts for commander fork types - Add engine/gh-pages.d.ts for gh-pages internal API types - Add deploy/schema.d.ts generated from schema.json - Remove unused "types" typeRoot from tsconfig.json
1 parent dd717ba commit dc78d0d

File tree

5 files changed

+254
-3
lines changed

5 files changed

+254
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ node_modules
55
.bash_history
66
*.swp
77
*.swo
8-
*.d.ts
98
.idea
109

1110
*.classpath

src/commander-fork/index.d.ts

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// Type definitions for commander-fork (based on commander v3.0.2)
2+
// Stripped to minimal API for angular-cli-ghpages
3+
// Original: https://github.com/DefinitelyTyped/DefinitelyTyped
4+
5+
///<reference types="node" />
6+
7+
declare namespace local {
8+
9+
class Option {
10+
flags: string;
11+
required: boolean;
12+
optional: boolean;
13+
negate: boolean;
14+
short?: string;
15+
long: string;
16+
description: string;
17+
18+
constructor(flags: string, description?: string);
19+
}
20+
21+
class Command extends NodeJS.EventEmitter {
22+
[key: string]: any;
23+
24+
args: string[];
25+
26+
constructor(name?: string);
27+
28+
/**
29+
* Set the program version to `str`.
30+
*
31+
* This method auto-registers the "-V, --version" flag
32+
* which will print the version number when passed.
33+
*
34+
* You can optionally supply the flags and description to override the defaults.
35+
*/
36+
version(str: string, flags?: string, description?: string): Command;
37+
38+
/**
39+
* Define option with `flags`, `description` and optional
40+
* coercion `fn`.
41+
*
42+
* The `flags` string should contain both the short and long flags,
43+
* separated by comma, a pipe or space.
44+
*
45+
* Examples:
46+
* // simple boolean defaulting to false
47+
* program.option('-p, --pepper', 'add pepper');
48+
*
49+
* // simple boolean defaulting to true
50+
* program.option('-C, --no-cheese', 'remove cheese');
51+
*
52+
* // required argument
53+
* program.option('-C, --chdir <path>', 'change the working directory');
54+
*
55+
* // optional argument
56+
* program.option('-c, --cheese [type]', 'add cheese [marble]');
57+
*/
58+
option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
59+
option(flags: string, description?: string, defaultValue?: any): Command;
60+
61+
/**
62+
* Allow unknown options on the command line.
63+
*/
64+
allowUnknownOption(arg?: boolean): Command;
65+
66+
/**
67+
* Parse `argv`, settings options and invoking commands when defined.
68+
*/
69+
parse(argv: string[]): Command;
70+
71+
/**
72+
* Parse options from `argv` returning `argv` void of these options.
73+
*/
74+
parseOptions(argv: string[]): commander.ParseOptionsResult;
75+
76+
/**
77+
* Return an object containing options as key-value pairs
78+
*/
79+
opts(): { [key: string]: any };
80+
81+
/**
82+
* Set the description to `str`.
83+
*/
84+
description(str: string, argsDescription?: {[argName: string]: string}): Command;
85+
description(): string;
86+
87+
/**
88+
* Set or get the command usage.
89+
*/
90+
usage(str: string): Command;
91+
usage(): string;
92+
93+
/**
94+
* Set the name of the command.
95+
*/
96+
name(str: string): Command;
97+
98+
/**
99+
* Get the name of the command.
100+
*/
101+
name(): string;
102+
103+
/**
104+
* Return help information for this command as a string.
105+
*/
106+
helpInformation(): string;
107+
108+
/**
109+
* Output help information for this command.
110+
*
111+
* When listener(s) are available for the helpLongFlag
112+
* those callbacks are invoked.
113+
*/
114+
outputHelp(cb?: (str: string) => string): void;
115+
116+
/**
117+
* You can pass in flags and a description to override the help
118+
* flags and help description for your command.
119+
*/
120+
helpOption(flags?: string, description?: string): Command;
121+
122+
/**
123+
* Output help information and exit.
124+
*/
125+
help(cb?: (str: string) => string): never;
126+
}
127+
128+
}
129+
130+
declare namespace commander {
131+
132+
type Command = local.Command
133+
134+
type Option = local.Option
135+
136+
interface ParseOptionsResult {
137+
args: string[];
138+
unknown: string[];
139+
}
140+
141+
interface CommanderStatic extends Command {
142+
Command: typeof local.Command;
143+
Option: typeof local.Option;
144+
ParseOptionsResult: ParseOptionsResult;
145+
}
146+
147+
}
148+
149+
declare const commander: commander.CommanderStatic;
150+
export = commander;

src/deploy/schema.d.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run json-schema-to-typescript to regenerate this file.
6+
*/
7+
8+
/**
9+
* Deployment of Angular CLI applications to GitHub pages (angular-cli-ghpages)
10+
*/
11+
export interface Schema {
12+
/**
13+
* Base url for the application being built. Same as `ng build --base-href=/XXX/`.
14+
*/
15+
baseHref?: string;
16+
/**
17+
* A named build target, as specified in the `configurations` section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. This is equivalent to calling the command `ng build --configuration=XXX`.
18+
*/
19+
buildTarget?: string;
20+
/**
21+
* @deprecated
22+
* DEPRECATED: Use buildTarget instead. Legacy alias kept for backwards compatibility only.
23+
*/
24+
browserTarget?: string;
25+
/**
26+
* Architect target for prerendering/SSG. Takes precedence over buildTarget when specified. Requires a prerender target configured in angular.json.
27+
*/
28+
prerenderTarget?: string;
29+
/**
30+
* Skip build process during deployment.
31+
*/
32+
noBuild?: boolean;
33+
/**
34+
* Provide the remote name. If no value is provided, `origin` is used. Has no function if --repo is set.
35+
*/
36+
remote?: string;
37+
/**
38+
* Provide the repository URL. If no value is provided, a remote of the current working directory is used (defaults to `origin`; see --remote for details).
39+
*/
40+
repo?: string;
41+
/**
42+
* The commit message.
43+
*/
44+
message?: string;
45+
/**
46+
* The git branch to push your pages to.
47+
*/
48+
branch?: string;
49+
/**
50+
* The git user-name which is associated with this commit.
51+
*/
52+
name?: string;
53+
/**
54+
* The git user-email which is associated with this commit.
55+
*/
56+
email?: string;
57+
/**
58+
* Deprecated! This parameter is no longer needed. It will be ignored.
59+
*/
60+
noSilent?: boolean;
61+
/**
62+
* Exclude dotfiles (files starting with `.`) from deployment.
63+
*/
64+
noDotfiles?: boolean;
65+
/**
66+
* By default a 404.html file is created for SPA routing on GitHub Pages. For Cloudflare Pages, you must use --no-notfound to enable native SPA routing.
67+
*/
68+
noNotfound?: boolean;
69+
/**
70+
* Skip creating the .nojekyll file.
71+
*/
72+
noNojekyll?: boolean;
73+
/**
74+
* Generate a CNAME file for the specified domain.
75+
*/
76+
cname?: string;
77+
/**
78+
* Only add, and never remove existing files from the GitHub pages branch.
79+
*/
80+
add?: boolean;
81+
/**
82+
* Overrides the directory for all published sources, relative to the current working directory.
83+
*/
84+
dir?: string;
85+
/**
86+
* For testing: Run through without making any changes. Execute with --dry-run and nothing will happen.
87+
*/
88+
dryRun?: boolean;
89+
[k: string]: unknown;
90+
}

src/engine/gh-pages.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Type declarations for gh-pages internal modules
3+
*
4+
* gh-pages/lib/git is an internal API we use to get the remote URL.
5+
* See engine.prepare-options-helpers.ts for usage and upgrade risk documentation.
6+
*/
7+
declare module 'gh-pages/lib/git' {
8+
class Git {
9+
constructor(cwd: string, git?: string);
10+
getRemoteUrl(remote?: string): Promise<string>;
11+
}
12+
export = Git;
13+
}

src/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@
2929
"strictMetadataEmit": true,
3030
"enableSummariesForJit": false
3131
},
32-
"exclude": ["node_modules", "dist"],
33-
"typeRoots": ["node_modules/@types"]
32+
"exclude": ["node_modules", "dist"]
3433
}

0 commit comments

Comments
 (0)