yeoman-environment 4.0.0-beta.6 → 4.0.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/dist/commit.d.ts +2 -7
- package/dist/commit.js +5 -6
- package/dist/environment-base.js +1 -1
- package/dist/environment-full.d.ts +2 -1
- package/dist/environment-full.js +3 -3
- package/package.json +85 -26
package/dist/commit.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type { PipelineSource } from 'node:stream';
|
|
3
1
|
import type { InputOutputAdapter } from '@yeoman/types';
|
|
4
2
|
import { type ConflicterOptions } from '@yeoman/conflicter';
|
|
5
3
|
import type { Store } from 'mem-fs';
|
|
6
4
|
import { type MemFsEditorFile } from 'mem-fs-editor';
|
|
7
5
|
/**
|
|
8
6
|
* Commits the MemFs to the disc.
|
|
9
|
-
* @param {Stream} [stream] - files stream, defaults to this.sharedFs.stream().
|
|
10
|
-
* @return {Promise}
|
|
11
7
|
*/
|
|
12
|
-
export declare const commitSharedFsTask: ({ adapter, conflicterOptions, sharedFs,
|
|
8
|
+
export declare const commitSharedFsTask: ({ adapter, conflicterOptions, sharedFs, }: {
|
|
13
9
|
adapter: InputOutputAdapter;
|
|
14
10
|
conflicterOptions?: ConflicterOptions | undefined;
|
|
15
11
|
sharedFs: Store<MemFsEditorFile>;
|
|
16
|
-
|
|
17
|
-
}) => any;
|
|
12
|
+
}) => Promise<void>;
|
package/dist/commit.js
CHANGED
|
@@ -2,16 +2,15 @@ import { createConflicterTransform, createYoResolveTransform, forceYoFiles } fro
|
|
|
2
2
|
import createdLogger from 'debug';
|
|
3
3
|
import { create as createMemFsEditor } from 'mem-fs-editor';
|
|
4
4
|
// eslint-disable-next-line n/file-extension-in-import
|
|
5
|
+
import { createCommitTransform } from 'mem-fs-editor/transform';
|
|
6
|
+
// eslint-disable-next-line n/file-extension-in-import
|
|
5
7
|
import { isFilePending } from 'mem-fs-editor/state';
|
|
6
8
|
const debug = createdLogger('yeoman:environment:commit');
|
|
7
9
|
/**
|
|
8
10
|
* Commits the MemFs to the disc.
|
|
9
|
-
* @param {Stream} [stream] - files stream, defaults to this.sharedFs.stream().
|
|
10
|
-
* @return {Promise}
|
|
11
11
|
*/
|
|
12
|
-
export const commitSharedFsTask = ({ adapter, conflicterOptions, sharedFs,
|
|
12
|
+
export const commitSharedFsTask = async ({ adapter, conflicterOptions, sharedFs, }) => {
|
|
13
13
|
debug('Running commitSharedFsTask');
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
return fs.commit([createYoResolveTransform(), forceYoFiles(), createConflicterTransform(adapter, conflicterOptions)], stream);
|
|
14
|
+
const editor = createMemFsEditor(sharedFs);
|
|
15
|
+
await sharedFs.pipeline({ filter: (file) => isFilePending(file) || file.path.endsWith('.yo-resolve') }, createYoResolveTransform(), forceYoFiles(), createConflicterTransform(adapter, conflicterOptions), createCommitTransform());
|
|
17
16
|
};
|
package/dist/environment-base.js
CHANGED
|
@@ -610,7 +610,7 @@ export default class EnvironmentBase extends EventEmitter {
|
|
|
610
610
|
// Conflicter can change files add listener before commit task.
|
|
611
611
|
this.sharedFs.once('change', queueCommit);
|
|
612
612
|
debug('Running conflicts');
|
|
613
|
-
const { customCommitTask = () => commitSharedFsTask(this) } = this.composedStore;
|
|
613
|
+
const { customCommitTask = async () => commitSharedFsTask(this) } = this.composedStore;
|
|
614
614
|
if (typeof customCommitTask === 'function') {
|
|
615
615
|
await customCommitTask();
|
|
616
616
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BaseGeneratorConstructor } from '@yeoman/types';
|
|
1
2
|
import { type LookupOptions } from './generator-lookup.js';
|
|
2
3
|
import EnvironmentBase, { type EnvironmentOptions } from './environment-base.js';
|
|
3
4
|
declare class FullEnvironment extends EnvironmentBase {
|
|
@@ -62,7 +63,7 @@ declare class FullEnvironment extends EnvironmentBase {
|
|
|
62
63
|
* @param {string[]} args
|
|
63
64
|
*/
|
|
64
65
|
execute(generatorNamespace: string, args?: never[]): Promise<void>;
|
|
65
|
-
requireGenerator(namespace: string): Promise<
|
|
66
|
+
requireGenerator(namespace: string): Promise<BaseGeneratorConstructor | undefined>;
|
|
66
67
|
/**
|
|
67
68
|
* Install generators at the custom local repository and register.
|
|
68
69
|
*
|
package/dist/environment-full.js
CHANGED
|
@@ -164,9 +164,9 @@ class FullEnvironment extends EnvironmentBase {
|
|
|
164
164
|
async requireGenerator(namespace) {
|
|
165
165
|
if (namespace === undefined) {
|
|
166
166
|
try {
|
|
167
|
-
// @ts-expect-error
|
|
168
|
-
//
|
|
169
|
-
const { default: Generator } = await import('yeoman-generator');
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
const { default: Generator } = await import('yeoman-generator'); // eslint-disable-line @typescript-eslint/naming-convention
|
|
170
170
|
return Generator;
|
|
171
171
|
}
|
|
172
172
|
catch { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yeoman-environment",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Handles the lifecyle and bootstrapping of generators in a specific environment",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"development",
|
|
@@ -58,54 +58,113 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@yeoman/adapter": "^1.4.0",
|
|
61
|
-
"@yeoman/conflicter": "^
|
|
61
|
+
"@yeoman/conflicter": "^2.0.0-alpha.2",
|
|
62
62
|
"@yeoman/namespace": "^1.0.0",
|
|
63
63
|
"@yeoman/transform": "^1.2.0",
|
|
64
64
|
"arrify": "^3.0.0",
|
|
65
|
-
"chalk": "^5.
|
|
66
|
-
"commander": "^11.
|
|
65
|
+
"chalk": "^5.3.0",
|
|
66
|
+
"commander": "^11.1.0",
|
|
67
67
|
"debug": "^4.3.4",
|
|
68
68
|
"execa": "^8.0.1",
|
|
69
|
-
"fly-import": "^0.
|
|
70
|
-
"globby": "^13.
|
|
69
|
+
"fly-import": "^0.4.0",
|
|
70
|
+
"globby": "^13.2.2",
|
|
71
71
|
"grouped-queue": "^2.0.0",
|
|
72
72
|
"locate-path": "^7.2.0",
|
|
73
73
|
"lodash-es": "^4.17.21",
|
|
74
|
-
"mem-fs": "^
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"slash": "^5.0.1",
|
|
74
|
+
"mem-fs-editor": "^11.0.0",
|
|
75
|
+
"semver": "^7.5.4",
|
|
76
|
+
"slash": "^5.1.0",
|
|
78
77
|
"untildify": "^5.0.0",
|
|
79
78
|
"which-package-manager": "^0.0.1"
|
|
80
79
|
},
|
|
81
80
|
"devDependencies": {
|
|
82
|
-
"@types/debug": "^4.1.
|
|
83
|
-
"@types/lodash-es": "^4.17.
|
|
84
|
-
"@types/semver": "^7.5.
|
|
85
|
-
"c8": "^8.0.
|
|
81
|
+
"@types/debug": "^4.1.9",
|
|
82
|
+
"@types/lodash-es": "^4.17.9",
|
|
83
|
+
"@types/semver": "^7.5.3",
|
|
84
|
+
"c8": "^8.0.1",
|
|
86
85
|
"cpy-cli": "^5.0.0",
|
|
87
86
|
"esmocha": "^1.0.1",
|
|
88
87
|
"fs-extra": "^11.1.1",
|
|
89
|
-
"inquirer": "^9.2.
|
|
88
|
+
"inquirer": "^9.2.11",
|
|
90
89
|
"jsdoc": "^4.0.2",
|
|
91
90
|
"prettier": "3.0.3",
|
|
92
|
-
"prettier-plugin-packagejson": "^2.4.
|
|
93
|
-
"rimraf": "^5.0.
|
|
94
|
-
"sinon": "^
|
|
91
|
+
"prettier-plugin-packagejson": "^2.4.6",
|
|
92
|
+
"rimraf": "^5.0.5",
|
|
93
|
+
"sinon": "^16.1.0",
|
|
95
94
|
"sinon-test": "^3.1.5",
|
|
96
|
-
"strip-ansi": "^7.0
|
|
95
|
+
"strip-ansi": "^7.1.0",
|
|
97
96
|
"typescript": "5.2.2",
|
|
98
97
|
"xo": "0.56.0",
|
|
99
98
|
"yeoman-assert": "^3.1.1",
|
|
100
|
-
"yeoman-
|
|
101
|
-
"yeoman-
|
|
99
|
+
"yeoman-environment": "file:./",
|
|
100
|
+
"yeoman-generator-2": "npm:yeoman-generator@^2.0.5",
|
|
101
|
+
"yeoman-generator-4": "npm:yeoman-generator@^4.13.0",
|
|
102
|
+
"yeoman-generator-5": "npm:yeoman-generator@^5.9.0",
|
|
103
|
+
"yeoman-generator-6": "npm:yeoman-generator@^6.0.1",
|
|
104
|
+
"yeoman-test": "^8.1.0"
|
|
102
105
|
},
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
+
"overrides": {
|
|
107
|
+
"yeoman-generator-2": {
|
|
108
|
+
"chalk": "^4.1.0",
|
|
109
|
+
"dargs": "^7.0.0",
|
|
110
|
+
"debug": "^4.1.1",
|
|
111
|
+
"execa": "^5.1.1",
|
|
112
|
+
"github-username": "^6.0.0",
|
|
113
|
+
"lodash": "^4.17.11",
|
|
114
|
+
"mem-fs-editor": "^9.0.0",
|
|
115
|
+
"minimist": "^1.2.5",
|
|
116
|
+
"pacote": "^15.2.0",
|
|
117
|
+
"read-pkg-up": "^7.0.1",
|
|
118
|
+
"run-async": "^2.0.0",
|
|
119
|
+
"semver": "^7.2.1",
|
|
120
|
+
"shelljs": "^0.8.5",
|
|
121
|
+
"sort-keys": "^4.2.0",
|
|
122
|
+
"text-table": "^0.2.0",
|
|
123
|
+
"yeoman-environment": "^3.19.3"
|
|
124
|
+
},
|
|
125
|
+
"yeoman-generator-4": {
|
|
126
|
+
"chalk": "^4.1.0",
|
|
127
|
+
"dargs": "^7.0.0",
|
|
128
|
+
"debug": "^4.1.1",
|
|
129
|
+
"execa": "^5.1.1",
|
|
130
|
+
"github-username": "^6.0.0",
|
|
131
|
+
"lodash": "^4.17.11",
|
|
132
|
+
"mem-fs-editor": "^9.0.0",
|
|
133
|
+
"minimist": "^1.2.5",
|
|
134
|
+
"pacote": "^15.2.0",
|
|
135
|
+
"read-pkg-up": "^7.0.1",
|
|
136
|
+
"run-async": "^2.0.0",
|
|
137
|
+
"semver": "^7.2.1",
|
|
138
|
+
"shelljs": "^0.8.5",
|
|
139
|
+
"sort-keys": "^4.2.0",
|
|
140
|
+
"text-table": "^0.2.0",
|
|
141
|
+
"yeoman-environment": "^3.19.3"
|
|
142
|
+
},
|
|
143
|
+
"yeoman-generator-5": {
|
|
144
|
+
"chalk": "^4.1.0",
|
|
145
|
+
"dargs": "^7.0.0",
|
|
146
|
+
"debug": "^4.1.1",
|
|
147
|
+
"execa": "^5.1.1",
|
|
148
|
+
"github-username": "^6.0.0",
|
|
149
|
+
"lodash": "^4.17.11",
|
|
150
|
+
"mem-fs-editor": "^9.0.0",
|
|
151
|
+
"minimist": "^1.2.5",
|
|
152
|
+
"pacote": "^15.2.0",
|
|
153
|
+
"read-pkg-up": "^7.0.1",
|
|
154
|
+
"run-async": "^2.0.0",
|
|
155
|
+
"semver": "^7.2.1",
|
|
156
|
+
"shelljs": "^0.8.5",
|
|
157
|
+
"sort-keys": "^4.2.0",
|
|
158
|
+
"text-table": "^0.2.0",
|
|
159
|
+
"yeoman-environment": "*"
|
|
160
|
+
},
|
|
161
|
+
"yeoman-generator-6": {
|
|
162
|
+
"yeoman-environment": "*"
|
|
163
|
+
}
|
|
106
164
|
},
|
|
107
|
-
"
|
|
108
|
-
"
|
|
165
|
+
"peerDependencies": {
|
|
166
|
+
"@yeoman/types": "^1.1.1",
|
|
167
|
+
"mem-fs": "^4.0.0"
|
|
109
168
|
},
|
|
110
169
|
"engines": {
|
|
111
170
|
"node": "^18.17.0 || >=20.5.0"
|