Skip to content

Commit c86f4a9

Browse files
committed
Reset options when copying for packages mode
Resolves #2433 Co-Authored-By: @ocavue
1 parent 2f8a83e commit c86f4a9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
### Bug Fixes
44

5-
- Fixed an infinite loop when `skipLibCheck` is used to ignore some compiler errors, #2438.
5+
- Fixed default option values on options declared by plugins in packages mode, #2433.
66
- `gitRevision` will now be replaced in `sourceLinkTemplate`, #2434.
7+
- Fixed an infinite loop when `skipLibCheck` is used to ignore some compiler errors, #2438.
78

89
### Thanks!
910

11+
- @ocavue
1012
- @swarnpallav
1113

1214
## v0.25.3 (2023-10-29)

src/lib/utils/options/options.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export class Options {
114114
(reader) => reader.supportsPackages,
115115
);
116116
options._declarations = new Map(this._declarations);
117+
options.reset();
117118

118119
return options;
119120
}
@@ -168,7 +169,7 @@ export class Options {
168169
const declaration = this.getDeclaration(name);
169170
if (!declaration) {
170171
throw new Error(
171-
"Cannot reset an option which has not been declared.",
172+
`Cannot reset an option (${name}) which has not been declared.`,
172173
);
173174
}
174175

@@ -251,7 +252,9 @@ export class Options {
251252
isSet(name: NeverIfInternal<string>): boolean;
252253
isSet(name: string): boolean {
253254
if (!this._declarations.has(name)) {
254-
throw new Error("Tried to check if an undefined option was set");
255+
throw new Error(
256+
`Tried to check if an undefined option (${name}) was set`,
257+
);
255258
}
256259
return this._setOptions.has(name);
257260
}
@@ -302,7 +305,7 @@ export class Options {
302305
setValue(name: string, value: unknown, configPath?: string): void {
303306
if (this.isFrozen()) {
304307
throw new Error(
305-
"Tried to modify an option value after options have been frozen.",
308+
`Tried to modify an option (${name}) value after options have been frozen.`,
306309
);
307310
}
308311

@@ -385,7 +388,7 @@ export class Options {
385388
) {
386389
if (this.isFrozen()) {
387390
throw new Error(
388-
"Tried to modify an option value after options have been sealed.",
391+
"Tried to modify compiler options after options have been frozen.",
389392
);
390393
}
391394

@@ -454,7 +457,7 @@ export function Option<K extends keyof TypeDocOptionMap>(name: K) {
454457
},
455458
set(_value: never) {
456459
throw new Error(
457-
"Options may not be set via the Option decorator",
460+
`Options may not be set via the Option decorator when setting ${name}`,
458461
);
459462
},
460463
};

0 commit comments

Comments
 (0)