yeoman-generator 8.0.0 → 8.0.2
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/actions/fs.d.ts +8 -9
- package/dist/actions/fs.js +8 -20
- package/package.json +1 -1
package/dist/actions/fs.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type MemFsEditor } from 'mem-fs-editor';
|
|
2
|
-
import type { OverloadParameters, OverloadReturnType } from '../types-utils.js';
|
|
3
2
|
import type { BaseGenerator } from '../generator.js';
|
|
4
3
|
type ExtractOverload1<T> = T extends {
|
|
5
4
|
(...args: infer P): infer R;
|
|
@@ -57,13 +56,13 @@ export declare class FsMixin {
|
|
|
57
56
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
58
57
|
* Shortcut for this.fs!.copy(this.templatePath(from), this.destinationPath(to))
|
|
59
58
|
*/
|
|
60
|
-
copyTemplate(this: BaseGenerator, ...args:
|
|
59
|
+
copyTemplate(this: BaseGenerator, ...args: Parameters<MemFsEditor['copy']>): ReturnType<MemFsEditor['copy']>;
|
|
61
60
|
/**
|
|
62
61
|
* Copy file from templates folder to destination folder.
|
|
63
62
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
64
63
|
* Shortcut for this.fs!.copy(this.templatePath(from), this.destinationPath(to))
|
|
65
64
|
*/
|
|
66
|
-
copyTemplateAsync(this: BaseGenerator, ...args:
|
|
65
|
+
copyTemplateAsync(this: BaseGenerator, ...args: Parameters<MemFsEditor['copyAsync']>): ReturnType<MemFsEditor['copyAsync']>;
|
|
67
66
|
/**
|
|
68
67
|
* Read file from destination folder
|
|
69
68
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
@@ -83,37 +82,37 @@ export declare class FsMixin {
|
|
|
83
82
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
84
83
|
* Shortcut for this.fs!.write(this.destinationPath(filepath)).
|
|
85
84
|
*/
|
|
86
|
-
writeDestination(this: BaseGenerator, ...args:
|
|
85
|
+
writeDestination(this: BaseGenerator, ...args: Parameters<MemFsEditor['write']>): ReturnType<MemFsEditor['write']>;
|
|
87
86
|
/**
|
|
88
87
|
* Write json file to destination folder
|
|
89
88
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
90
89
|
* Shortcut for this.fs!.writeJSON(this.destinationPath(filepath)).
|
|
91
90
|
*/
|
|
92
|
-
writeDestinationJSON(this: BaseGenerator, ...args:
|
|
91
|
+
writeDestinationJSON(this: BaseGenerator, ...args: Parameters<MemFsEditor['writeJSON']>): ReturnType<MemFsEditor['writeJSON']>;
|
|
93
92
|
/**
|
|
94
93
|
* Delete file from destination folder
|
|
95
94
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
96
95
|
* Shortcut for this.fs!.delete(this.destinationPath(filepath)).
|
|
97
96
|
*/
|
|
98
|
-
deleteDestination(this: BaseGenerator, ...args:
|
|
97
|
+
deleteDestination(this: BaseGenerator, ...args: Parameters<MemFsEditor['delete']>): ReturnType<MemFsEditor['delete']>;
|
|
99
98
|
/**
|
|
100
99
|
* Copy file from destination folder to another destination folder.
|
|
101
100
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
102
101
|
* Shortcut for this.fs!.copy(this.destinationPath(from), this.destinationPath(to)).
|
|
103
102
|
*/
|
|
104
|
-
copyDestination(this: BaseGenerator, ...args:
|
|
103
|
+
copyDestination(this: BaseGenerator, ...args: Parameters<MemFsEditor['copy']>): ReturnType<MemFsEditor['copy']>;
|
|
105
104
|
/**
|
|
106
105
|
* Move file from destination folder to another destination folder.
|
|
107
106
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
108
107
|
* Shortcut for this.fs!.move(this.destinationPath(from), this.destinationPath(to)).
|
|
109
108
|
*/
|
|
110
|
-
moveDestination(this: BaseGenerator, ...args:
|
|
109
|
+
moveDestination(this: BaseGenerator, ...args: Parameters<MemFsEditor['move']>): ReturnType<MemFsEditor['move']>;
|
|
111
110
|
/**
|
|
112
111
|
* Exists file on destination folder.
|
|
113
112
|
* mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
|
|
114
113
|
* Shortcut for this.fs!.exists(this.destinationPath(filepath)).
|
|
115
114
|
*/
|
|
116
|
-
existsDestination(this: BaseGenerator, ...args:
|
|
115
|
+
existsDestination(this: BaseGenerator, ...args: Parameters<MemFsEditor['exists']>): ReturnType<MemFsEditor['exists']>;
|
|
117
116
|
/**
|
|
118
117
|
* Copy a template from templates folder to the destination.
|
|
119
118
|
*
|
package/dist/actions/fs.js
CHANGED
|
@@ -91,16 +91,10 @@ export class FsMixin {
|
|
|
91
91
|
existsDestination(...args) {
|
|
92
92
|
return this.fs.exists(...applyToFirstStringArg(this.destinationPath.bind(this), args));
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* @param destination - destination, absolute or relative to destinationPath().
|
|
99
|
-
* @param templateData - ejs data
|
|
100
|
-
* @param templateOptions - ejs options
|
|
101
|
-
* @param copyOptions - mem-fs-editor copy options
|
|
102
|
-
*/
|
|
103
|
-
renderTemplate(source = '', destination = source, templateData, copyOptions) {
|
|
94
|
+
renderTemplate(source = '', destination = source, templateData, copyOptions, compatOptions) {
|
|
95
|
+
if (compatOptions || 'context' in (copyOptions ?? {})) {
|
|
96
|
+
copyOptions = { ...compatOptions, transformOptions: copyOptions };
|
|
97
|
+
}
|
|
104
98
|
if (templateData === undefined || typeof templateData === 'string') {
|
|
105
99
|
templateData = this._templateData(templateData);
|
|
106
100
|
}
|
|
@@ -117,16 +111,10 @@ export class FsMixin {
|
|
|
117
111
|
},
|
|
118
112
|
});
|
|
119
113
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* @param destination - destination, absolute or relative to destinationPath().
|
|
125
|
-
* @param templateData - ejs data
|
|
126
|
-
* @param templateOptions - ejs options
|
|
127
|
-
* @param copyOptions - mem-fs-editor copy options
|
|
128
|
-
*/
|
|
129
|
-
async renderTemplateAsync(source = '', destination = source, templateData, copyOptions) {
|
|
114
|
+
async renderTemplateAsync(source = '', destination = source, templateData, copyOptions, compatOptions) {
|
|
115
|
+
if (compatOptions || 'context' in (copyOptions ?? {})) {
|
|
116
|
+
copyOptions = { ...compatOptions, transformOptions: copyOptions };
|
|
117
|
+
}
|
|
130
118
|
if (templateData === undefined || typeof templateData === 'string') {
|
|
131
119
|
templateData = this._templateData(templateData);
|
|
132
120
|
}
|