Skip to content

Commit a936f2e

Browse files
committed
chore: cleanup features handling
1 parent 28e1b7c commit a936f2e

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

src/generator.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import createDebug from 'debug';
1212
import { type MemFsEditor, create as createMemFsEditor } from 'mem-fs-editor';
1313
import { type YeomanNamespace, requireNamespace, toNamespace } from '@yeoman/namespace';
1414
import type { BaseEnvironment, BaseGenerator as GeneratorApi, Logger, QueuedAdapter } from '@yeoman/types';
15-
import type { ArgumentSpec, BaseFeatures, BaseOptions, CliOptionSpec, Priority } from './types.js';
15+
import type { ArgumentSpec, BaseFeatures, BaseOptions, CliOptionSpec } from './types.js';
1616
import type { PromptAnswers, PromptQuestion, PromptQuestions, QuestionRegistrationOptions } from './questions.js';
1717
import Storage, { type StorageOptions } from './util/storage.js';
1818
import { prefillQuestions, storeAnswers } from './util/prompt-suggestion.js';
@@ -57,7 +57,6 @@ export class BaseGenerator<
5757

5858
readonly _namespace: string;
5959
readonly _namespaceId?: YeomanNamespace;
60-
readonly _customPriorities?: Priority[];
6160
readonly resolved: string;
6261
description: string;
6362
contextRoot!: string;
@@ -171,9 +170,6 @@ export class BaseGenerator<
171170
this._initOptions = { ...actualOptions };
172171
this._namespace = actualOptions.namespace;
173172
this._namespaceId = toNamespace(actualOptions.namespace);
174-
this._customPriorities = this.#features?.customPriorities;
175-
this.#features.skipParseOptions = this.#features.skipParseOptions ?? this.options.skipParseOptions;
176-
this.#features.customPriorities = this.#features.customPriorities ?? this.options.customPriorities;
177173

178174
this.option('help', {
179175
type: Boolean,

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default class Generator<
2929
}
3030

3131
// Add custom queues
32-
if (Array.isArray(this._customPriorities)) {
33-
this.registerPriorities(this._customPriorities);
32+
if (Array.isArray(this.features.customPriorities)) {
33+
this.registerPriorities(this.features.customPriorities);
3434
}
3535
}
3636

src/types.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ export type BaseOptions = OptionsApi & {
122122
skipLocalCache?: boolean;
123123

124124
description?: string;
125-
126-
/** @deprecated moved to features */
127-
skipParseOptions?: boolean;
128-
129-
/** @deprecated moved to features */
130-
customPriorities?: Priority[];
131125
};
132126

133127
export type ArgumentSpec = {

test/base.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ describe('Base', () => {
18841884
});
18851885
});
18861886

1887-
describe('#getFeatures', () => {
1887+
describe('#features', () => {
18881888
it('should return namespace as uniqueBy when unique is true', () => {
18891889
const gen = new Base([], { namespace: 'foo', env }, { unique: true });
18901890
assert.equal(gen.features.uniqueBy, 'foo');

0 commit comments

Comments
 (0)