create-module-federation 2.3.1 → 2.3.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/index.js +8 -6
- package/package.json +4 -6
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { cancel, isCancel, multiselect, note, outro, select as prompts_select, t
|
|
|
7
7
|
import external_minimist_default from "minimist";
|
|
8
8
|
import { logger } from "rslog";
|
|
9
9
|
import external_glob_default from "glob";
|
|
10
|
-
import
|
|
10
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
11
11
|
import external_handlebars_default from "handlebars";
|
|
12
12
|
const IMAGE_EXT_LIST = [
|
|
13
13
|
'.jpg',
|
|
@@ -31,12 +31,12 @@ class FsResource {
|
|
|
31
31
|
async value() {
|
|
32
32
|
const resourceFileExt = external_path_default.extname(this.filePath);
|
|
33
33
|
if (IMAGE_EXT_LIST.includes(resourceFileExt)) {
|
|
34
|
-
const buffer = await
|
|
34
|
+
const buffer = await readFile(external_path_default.resolve(this.filePath));
|
|
35
35
|
return {
|
|
36
36
|
content: buffer
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
const text = await
|
|
39
|
+
const text = await readFile(external_path_default.resolve(this.filePath), 'utf8');
|
|
40
40
|
return {
|
|
41
41
|
content: text
|
|
42
42
|
};
|
|
@@ -70,8 +70,10 @@ function renderString(template, fullData) {
|
|
|
70
70
|
}
|
|
71
71
|
async function outputFs(file, content, outputPath, options) {
|
|
72
72
|
const filePath = external_path_default.resolve(outputPath, file.toString());
|
|
73
|
-
await
|
|
74
|
-
|
|
73
|
+
await mkdir(external_path_default.dirname(filePath), {
|
|
74
|
+
recursive: true
|
|
75
|
+
});
|
|
76
|
+
await writeFile(filePath, content, options);
|
|
75
77
|
}
|
|
76
78
|
class HandlebarsAPI {
|
|
77
79
|
async renderTemplate(templateResource, target, outputFilePath, parameters = {}) {
|
|
@@ -288,7 +290,7 @@ async function create({ name, templates }) {
|
|
|
288
290
|
const cwd = process.cwd();
|
|
289
291
|
const pkgInfo = pkgFromUserAgent(process.env['npm_config_user_agent']);
|
|
290
292
|
const pkgManager = pkgInfo ? pkgInfo.name : 'npm';
|
|
291
|
-
const mfVersion = "2.3.
|
|
293
|
+
const mfVersion = "2.3.2";
|
|
292
294
|
argv.template = templates.includes(argv.template || '') ? argv.template : void 0;
|
|
293
295
|
const projectType = await getProjectType(argv.template);
|
|
294
296
|
if ("zephyr" === projectType) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Create a new Module Federation project",
|
|
4
4
|
"public": true,
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"version": "2.3.
|
|
6
|
+
"version": "2.3.2",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -28,18 +28,16 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@clack/prompts": "
|
|
31
|
+
"@clack/prompts": "0.8.2",
|
|
32
32
|
"execa": "5.1.1",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"rslog": "^1.2.3",
|
|
33
|
+
"minimist": "1.2.8",
|
|
34
|
+
"rslog": "1.2.3",
|
|
36
35
|
"glob": "7.2.0",
|
|
37
36
|
"handlebars": "4.7.7"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@types/glob": "7.2.0",
|
|
41
40
|
"@types/minimist": "^1.2.5",
|
|
42
|
-
"@types/fs-extra": "9.0.13",
|
|
43
41
|
"@rslib/core": "^0.9.0",
|
|
44
42
|
"rsbuild-plugin-publint": "^0.2.1"
|
|
45
43
|
},
|