yeoman-generator 8.1.2 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ export declare class HelpMixin {
22
22
  *
23
23
  * @param description
24
24
  */
25
- desc(this: BaseGenerator, description: string): BaseGenerator<Record<any, any>, import("../types.js").BaseOptions, import("../types.js").BaseFeatures, Record<any, any>, Record<any, any>, Record<any, any>>;
25
+ desc(this: BaseGenerator, description: string): typeof this;
26
26
  /**
27
27
  * Get help text for arguments
28
28
  * @returns Text of options in formatted table
@@ -145,6 +145,6 @@ export declare abstract class TasksMixin {
145
145
  */
146
146
  queueTransformStream(this: BaseGeneratorImpl, options?: GeneratorPipelineOptions & {
147
147
  priorityToQueue?: string;
148
- }, ...transforms: Array<FileTransform<MemFsEditorFile>>): BaseGeneratorImpl<Record<any, any>, BaseOptions, import("../types.js").BaseFeatures, Record<any, any>, Record<any, any>, Record<any, any>>;
148
+ }, ...transforms: Array<FileTransform<MemFsEditorFile>>): typeof this;
149
149
  }
150
150
  export {};
package/dist/index.d.ts CHANGED
@@ -1,12 +1,16 @@
1
- import { type SimpleGit } from 'simple-git';
1
+ import { CheckRepoActions, CleanOptions, type SimpleGit, type SimpleGitOptions } from 'simple-git';
2
2
  import { BaseGenerator } from './generator.js';
3
3
  import type { BaseFeatures, BaseOptions } from './types.js';
4
4
  export type * from './types.js';
5
5
  export type * from './questions.js';
6
6
  export type * from './util/storage.js';
7
7
  export { default as Storage } from './util/storage.js';
8
+ type SimpleGitWithConstants = SimpleGit & {
9
+ CheckRepoActions: typeof CheckRepoActions;
10
+ CleanOptions: typeof CleanOptions;
11
+ };
8
12
  export default class Generator<C extends Record<any, any> = Record<any, any>, O extends BaseOptions = BaseOptions, F extends BaseFeatures = BaseFeatures> extends BaseGenerator<C, O, F> {
9
- _simpleGit?: SimpleGit;
10
- constructor(...args: any[]);
11
- get simpleGit(): SimpleGit;
13
+ constructor(arguments_?: string[], options?: O, features?: F);
14
+ get simpleGit(): SimpleGitWithConstants;
15
+ createSimpleGit(options?: Partial<SimpleGitOptions>): SimpleGitWithConstants;
12
16
  }
package/dist/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import process from 'node:process';
2
- import { simpleGit } from 'simple-git';
2
+ import { CheckRepoActions, CleanOptions, simpleGit } from 'simple-git';
3
3
  import { BaseGenerator } from './generator.js';
4
- import { DESTINATION_ROOT_CHANGE_EVENT } from './constants.js';
5
4
  export { default as Storage } from './util/storage.js';
6
5
  export default class Generator extends BaseGenerator {
7
- _simpleGit;
8
- constructor(...args) {
9
- super(...args);
6
+ constructor(arguments_, options, features) {
7
+ super(arguments_, options, features);
10
8
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11
9
  // @ts-expect-error
12
10
  this._queues = {};
@@ -20,15 +18,17 @@ export default class Generator extends BaseGenerator {
20
18
  }
21
19
  }
22
20
  get simpleGit() {
23
- if (!this._simpleGit) {
24
- this._simpleGit = simpleGit({ baseDir: this.destinationPath() }).env({
25
- ...process.env,
26
- LANG: 'en',
27
- });
28
- this.on(DESTINATION_ROOT_CHANGE_EVENT, () => {
29
- this._simpleGit = undefined;
30
- });
31
- }
32
- return this._simpleGit;
21
+ return this.createSimpleGit();
22
+ }
23
+ createSimpleGit(options) {
24
+ const git = simpleGit({ baseDir: this.destinationPath(), ...options }).env({
25
+ HOME: process.env.HOME,
26
+ PATH: process.env.PATH,
27
+ LANG: 'C',
28
+ LC_ALL: 'C',
29
+ });
30
+ git.CheckRepoActions = CheckRepoActions;
31
+ git.CleanOptions = CleanOptions;
32
+ return git;
33
33
  }
34
34
  }
package/dist/types.d.ts CHANGED
@@ -7,7 +7,7 @@ import type {
7
7
  } from '@yeoman/types';
8
8
  import type { PipelineOptions } from 'mem-fs';
9
9
  import type { MemFsEditorFile } from 'mem-fs-editor';
10
- import type { JsonValue } from 'type-fest';
10
+ import type { JsonValue, Merge } from 'type-fest';
11
11
  import type Storage from './util/storage.js';
12
12
  import type Generator from './index.js';
13
13
 
@@ -77,40 +77,43 @@ export type Task<TaskContext = any> = TaskOptions & {
77
77
  taskName: string;
78
78
  };
79
79
 
80
- export type BaseFeatures = FeaturesApi & {
81
- /** The Generator instance unique identifier. The Environment will ignore duplicated identifiers. */
82
- uniqueBy?: string;
80
+ // Use Merge to override local features by official features from @yeoman/types when they are available.
81
+ export type BaseFeatures = Merge<
82
+ {
83
+ /** UniqueBy calculation method */
84
+ unique?: true | 'argument' | 'namespace';
83
85
 
84
- /** UniqueBy calculation method */
85
- unique?: true | 'argument' | 'namespace';
86
+ /** Only queue methods that matches a priority. */
87
+ tasksMatchingPriority?: boolean;
86
88
 
87
- /** Only queue methods that matches a priority. */
88
- tasksMatchingPriority?: boolean;
89
+ /** Tasks methods starts with prefix. Allows api methods (non tasks) without prefix. */
90
+ taskPrefix?: string;
89
91
 
90
- /** Tasks methods starts with prefix. Allows api methods (non tasks) without prefix. */
91
- taskPrefix?: string;
92
-
93
- /** Provides a custom install task. Environment built-in task will not be executed */
94
- customInstallTask?: boolean | ((...args: any[]) => void | Promise<void>);
92
+ // Provided by @yeoman/types since v1.11.0
93
+ /** Provides a custom install task. Environment built-in task will not be executed */
94
+ customInstallTask?: boolean | ((...args: any[]) => void | Promise<void>);
95
95
 
96
- /** Provides a custom commit task. */
97
- customCommitTask?: boolean | ((...args: any[]) => void | Promise<void>);
96
+ // Provided by @yeoman/types since v1.11.0
97
+ /** Provides a custom commit task. */
98
+ customCommitTask?: boolean | ((...args: any[]) => void | Promise<void>);
98
99
 
99
- /** Disable args/options parsing. Whenever options/arguments are provided parsed like using commander based parsing. */
100
- skipParseOptions?: boolean;
100
+ /** Disable args/options parsing. Whenever options/arguments are provided parsed like using commander based parsing. */
101
+ skipParseOptions?: boolean;
101
102
 
102
- /** Disable args/options support. Whenever options/arguments are provided parsed like using commander based parsing. */
103
- disableInGeneratorOptionsSupport?: boolean;
103
+ /** Disable args/options support. Whenever options/arguments are provided parsed like using commander based parsing. */
104
+ disableInGeneratorOptionsSupport?: boolean;
104
105
 
105
- /** Custom priorities for more fine tuned workflows. */
106
- customPriorities?: Priority[];
106
+ /** Custom priorities for more fine tuned workflows. */
107
+ customPriorities?: Priority[];
107
108
 
108
- /** Inherit tasks from parent prototypes, implies tasksMatchingPriority */
109
- inheritTasks?: boolean;
109
+ /** Inherit tasks from parent prototypes, implies tasksMatchingPriority */
110
+ inheritTasks?: boolean;
110
111
 
111
- /** Transform the configuration before reading. */
112
- configTransform?: StorageTransform<Record<string, any>>;
113
- };
112
+ /** Transform the configuration before reading. */
113
+ configTransform?: StorageTransform<Record<string, any>>;
114
+ },
115
+ FeaturesApi
116
+ >;
114
117
 
115
118
  export type BaseOptions = OptionsApi & {
116
119
  destinationRoot?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeoman-generator",
3
- "version": "8.1.2",
3
+ "version": "8.2.1",
4
4
  "description": "Rails-inspired generator system that provides scaffolding for your apps",
5
5
  "keywords": [
6
6
  "development",
@@ -45,53 +45,52 @@
45
45
  "doc:prettier": "prettier $npm_package_config_doc_path$DOC_FOLDER --write --ignore-path .prettierignore-doc",
46
46
  "fix": "eslint . --fix && prettier . --write",
47
47
  "prepare": "npm run build",
48
- "pretest": "eslint . && prettier . --check && npm run build",
48
+ "pretest": "eslint . && prettier . --check && npm run build && tsc -p tsconfig.spec.json",
49
49
  "test": "vitest run --coverage"
50
50
  },
51
51
  "config": {
52
52
  "doc_path": "../yeoman-generator-doc/"
53
53
  },
54
54
  "dependencies": {
55
- "@types/debug": "^4.1.12",
55
+ "@types/debug": "^4.1.13",
56
56
  "@types/lodash-es": "^4.17.12",
57
- "@yeoman/namespace": "^1.0.1",
57
+ "@yeoman/namespace": "^2.1.0",
58
58
  "chalk": "^5.6.2",
59
59
  "debug": "^4.4.3",
60
60
  "execa": "^9.6.1",
61
61
  "latest-version": "^9.0.0",
62
- "lodash-es": "^4.17.23",
63
- "mem-fs-editor": "^12.0.2",
62
+ "lodash-es": "^4.18.1",
63
+ "mem-fs-editor": "^12.0.4",
64
64
  "minimist": "^1.2.8",
65
65
  "read-package-up": "^12.0.0",
66
66
  "semver": "^7.7.4",
67
- "simple-git": "^3.32.3",
67
+ "simple-git": "^3.36.0",
68
68
  "sort-keys": "^6.0.0",
69
69
  "text-table": "^0.2.0",
70
- "type-fest": "^5.4.4"
70
+ "type-fest": "^5.6.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/ejs": "^3.1.5",
74
74
  "@types/minimist": "^1.2.5",
75
- "@types/picomatch": "^4.0.2",
75
+ "@types/node": "^24.12.2",
76
+ "@types/picomatch": "^4.0.3",
76
77
  "@types/semver": "^7.7.1",
77
- "@types/sinon": "^21.0.0",
78
78
  "@types/text-table": "^0.2.5",
79
- "@vitest/coverage-v8": "^4.0.18",
79
+ "@typescript-eslint/parser": "^8.59.1",
80
+ "@vitest/coverage-v8": "^4.1.5",
80
81
  "@yeoman/adapter": "^4.0.2",
81
- "@yeoman/eslint": "1.0.0",
82
- "@yeoman/transform": "^2.1.0",
83
- "@yeoman/types": "^1.10.3",
82
+ "@yeoman/eslint": "1.1.0",
83
+ "@yeoman/transform": "^2.1.1",
84
+ "@yeoman/types": "^1.11.0",
84
85
  "cpy-cli": "^7.0.0",
85
- "ejs": "^5.0.1",
86
- "eslint": "9.39.3",
86
+ "ejs": "^5.0.2",
87
+ "eslint": "10.2.1",
87
88
  "jsdoc": "^4.0.5",
88
- "prettier": "3.8.1",
89
- "prettier-plugin-packagejson": "3.0.0",
90
- "sinon": "^21.0.1",
91
- "typescript": "5.9.3",
92
- "vitest": "^4.0.18",
93
- "yeoman-assert": "^3.1.1",
94
- "yeoman-environment": "^6.0.0",
89
+ "prettier": "3.8.3",
90
+ "prettier-plugin-packagejson": "3.0.2",
91
+ "typescript": "6.0.3",
92
+ "vitest": "^4.1.5",
93
+ "yeoman-environment": "^6.0.1",
95
94
  "yeoman-test": "^11.3.1"
96
95
  },
97
96
  "peerDependencies": {