@yeoman/types 0.2.0 → 0.3.0
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeoman/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common API for yeoman's generator/environment stack",
|
|
6
6
|
"keywords": [
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"access": "public",
|
|
56
56
|
"registry": "https://registry.npmjs.org/"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6d33420db41115e6d1867dede74000470d245a6e"
|
|
59
59
|
}
|
|
@@ -2,7 +2,7 @@ import type { Transform } from 'node:stream';
|
|
|
2
2
|
import type { Store } from 'mem-fs';
|
|
3
3
|
import type { MemFsEditorFile } from 'mem-fs-editor';
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { BaseGeneratorOptions } from '../generator/generator-options.js';
|
|
6
6
|
import type { BaseGenerator } from '../generator/generator.js';
|
|
7
7
|
import type { GetGeneratorConstructor, GetGeneratorOptions } from '../generator/utils.js';
|
|
8
8
|
import type { InputOutputAdapter } from './adapter.js';
|
|
@@ -12,7 +12,7 @@ export type EnvironmentConstructor<A extends InputOutputAdapter = InputOutputAda
|
|
|
12
12
|
adapter?: A,
|
|
13
13
|
) => BaseEnvironment<A>;
|
|
14
14
|
|
|
15
|
-
export type BaseEnvironmentOptions =
|
|
15
|
+
export type BaseEnvironmentOptions = BaseGeneratorOptions & {
|
|
16
16
|
/**
|
|
17
17
|
* The working-directory of the environment.
|
|
18
18
|
*/
|
|
@@ -26,7 +26,7 @@ export type BaseEnvironmentOptions = GeneratorBaseOptions & {
|
|
|
26
26
|
/**
|
|
27
27
|
* Options to pass to every generator instantiated by this Environment.
|
|
28
28
|
*/
|
|
29
|
-
sharedOptions?:
|
|
29
|
+
sharedOptions?: BaseGeneratorOptions;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* `mem-fs` Store.
|
|
@@ -41,7 +41,7 @@ export type ApplyTransformsOptions = {
|
|
|
41
41
|
streamOptions: Parameters<Store<MemFsEditorFile>['stream']>[0];
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export type BaseEnvironment<A = InputOutputAdapter, S extends Store = Store
|
|
44
|
+
export type BaseEnvironment<A = InputOutputAdapter, S extends Store<MemFsEditorFile> = Store<MemFsEditorFile>> = {
|
|
45
45
|
cwd: string;
|
|
46
46
|
adapter: A;
|
|
47
47
|
sharedFs: S;
|
|
@@ -53,13 +53,13 @@ export type BaseEnvironment<A = InputOutputAdapter, S extends Store = Store> = {
|
|
|
53
53
|
create<G extends BaseGenerator = BaseGenerator>(
|
|
54
54
|
namespaceOrPath: string | GetGeneratorConstructor<G>,
|
|
55
55
|
args: string[],
|
|
56
|
-
options?: Partial<Omit<GetGeneratorOptions<G>, 'env' | 'resolved' | '
|
|
56
|
+
options?: Partial<Omit<GetGeneratorOptions<G>, 'env' | 'resolved' | 'namespace'>>,
|
|
57
57
|
): Promise<G>;
|
|
58
58
|
|
|
59
59
|
instantiate<G extends BaseGenerator = BaseGenerator>(
|
|
60
60
|
generator: GetGeneratorConstructor<G>,
|
|
61
61
|
args: string[],
|
|
62
|
-
options?: Partial<Omit<GetGeneratorOptions<G>, 'env' | 'resolved' | '
|
|
62
|
+
options?: Partial<Omit<GetGeneratorOptions<G>, 'env' | 'resolved' | 'namespace'>>,
|
|
63
63
|
): Promise<G>;
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -97,7 +97,7 @@ export type BaseEnvironment<A = InputOutputAdapter, S extends Store = Store> = {
|
|
|
97
97
|
* @param namespace The namespace under which the generator should be registered.
|
|
98
98
|
* @param packagePath The path to the npm package of the generator.
|
|
99
99
|
*/
|
|
100
|
-
register(filePath: string, namespace?: string, packagePath?: string):
|
|
100
|
+
register(filePath: string, namespace?: string, packagePath?: string): void;
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* Registers a stubbed generator to this environment.
|
|
@@ -2,7 +2,7 @@ import type { BaseEnvironment } from '../environment/environment.js';
|
|
|
2
2
|
|
|
3
3
|
export type GeneratorCustomOptions = Record<string, unknown>;
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type BaseGeneratorOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* Skip package manager install task.
|
|
8
8
|
*/
|
|
@@ -58,7 +58,7 @@ type GeneratorHelpOptions<H extends boolean | undefined> = {
|
|
|
58
58
|
help: H;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
export type GeneratorOptions =
|
|
61
|
+
export type GeneratorOptions = BaseGeneratorOptions &
|
|
62
62
|
GeneratorNamespace &
|
|
63
63
|
(
|
|
64
64
|
| (GeneratorHelpOptions<false | undefined> & GeneratorEnvironmentOptions)
|