@module-federation/treeshake-server 0.0.1-alpha.1 → 0.23.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/index.js +6 -3
- package/dist/index.mjs +6 -3
- package/dist/server.js +6 -3
- package/dist/server.mjs +6 -3
- package/dist/template/re-shake-share/package.json +2 -2
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -348,7 +348,7 @@ const prepareProject = async (config, excludeShared)=>{
|
|
|
348
348
|
const installDependencies = async (cwd)=>{
|
|
349
349
|
markInstallStart();
|
|
350
350
|
try {
|
|
351
|
-
await runCommand("pnpm i --ignore-scripts --
|
|
351
|
+
await runCommand("pnpm i --ignore-scripts --prefer-offline --reporter=silent ", {
|
|
352
352
|
cwd,
|
|
353
353
|
env: {
|
|
354
354
|
npm_config_registry: 'https://registry.npmjs.org/'
|
|
@@ -622,9 +622,11 @@ async function uploadProject(uploadResults, sharedFilePaths, normalizedConfig, p
|
|
|
622
622
|
}
|
|
623
623
|
return uploaded;
|
|
624
624
|
} finally{
|
|
625
|
-
|
|
625
|
+
promises_default().rm(tmpDir, {
|
|
626
626
|
recursive: true,
|
|
627
627
|
force: true
|
|
628
|
+
}).catch((err)=>{
|
|
629
|
+
logger_logger.error(`Failed to cleanup dir ${tmpDir}: ${err}`);
|
|
628
630
|
});
|
|
629
631
|
}
|
|
630
632
|
}
|
|
@@ -928,7 +930,8 @@ class LocalObjectStore {
|
|
|
928
930
|
localObjectStore_define_property(this, "rootDir", void 0);
|
|
929
931
|
localObjectStore_define_property(this, "publicBaseUrl", void 0);
|
|
930
932
|
this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? external_node_path_default().join(process.cwd(), 'log', 'static');
|
|
931
|
-
const
|
|
933
|
+
const port = process.env.PORT || 3000;
|
|
934
|
+
const base = (null == opts ? void 0 : opts.publicBaseUrl) === '/' ? `http://localhost:${port}/` : (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
|
|
932
935
|
this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
|
|
933
936
|
}
|
|
934
937
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -302,7 +302,7 @@ const prepareProject = async (config, excludeShared)=>{
|
|
|
302
302
|
const installDependencies = async (cwd)=>{
|
|
303
303
|
markInstallStart();
|
|
304
304
|
try {
|
|
305
|
-
await runCommand("pnpm i --ignore-scripts --
|
|
305
|
+
await runCommand("pnpm i --ignore-scripts --prefer-offline --reporter=silent ", {
|
|
306
306
|
cwd,
|
|
307
307
|
env: {
|
|
308
308
|
npm_config_registry: 'https://registry.npmjs.org/'
|
|
@@ -574,9 +574,11 @@ async function uploadProject(uploadResults, sharedFilePaths, normalizedConfig, p
|
|
|
574
574
|
}
|
|
575
575
|
return uploaded;
|
|
576
576
|
} finally{
|
|
577
|
-
|
|
577
|
+
promises.rm(tmpDir, {
|
|
578
578
|
recursive: true,
|
|
579
579
|
force: true
|
|
580
|
+
}).catch((err)=>{
|
|
581
|
+
logger_logger.error(`Failed to cleanup dir ${tmpDir}: ${err}`);
|
|
580
582
|
});
|
|
581
583
|
}
|
|
582
584
|
}
|
|
@@ -877,7 +879,8 @@ class LocalObjectStore {
|
|
|
877
879
|
localObjectStore_define_property(this, "rootDir", void 0);
|
|
878
880
|
localObjectStore_define_property(this, "publicBaseUrl", void 0);
|
|
879
881
|
this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? node_path.join(process.cwd(), 'log', 'static');
|
|
880
|
-
const
|
|
882
|
+
const port = process.env.PORT || 3000;
|
|
883
|
+
const base = (null == opts ? void 0 : opts.publicBaseUrl) === '/' ? `http://localhost:${port}/` : (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
|
|
881
884
|
this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
|
|
882
885
|
}
|
|
883
886
|
}
|
package/dist/server.js
CHANGED
|
@@ -87,7 +87,8 @@ class LocalObjectStore {
|
|
|
87
87
|
_define_property(this, "rootDir", void 0);
|
|
88
88
|
_define_property(this, "publicBaseUrl", void 0);
|
|
89
89
|
this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? external_node_path_default().join(process.cwd(), 'log', 'static');
|
|
90
|
-
const
|
|
90
|
+
const port = process.env.PORT || 3000;
|
|
91
|
+
const base = (null == opts ? void 0 : opts.publicBaseUrl) === '/' ? `http://localhost:${port}/` : (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
|
|
91
92
|
this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -492,7 +493,7 @@ const prepareProject = async (config, excludeShared)=>{
|
|
|
492
493
|
const installDependencies = async (cwd)=>{
|
|
493
494
|
markInstallStart();
|
|
494
495
|
try {
|
|
495
|
-
await runCommand("pnpm i --ignore-scripts --
|
|
496
|
+
await runCommand("pnpm i --ignore-scripts --prefer-offline --reporter=silent ", {
|
|
496
497
|
cwd,
|
|
497
498
|
env: {
|
|
498
499
|
npm_config_registry: 'https://registry.npmjs.org/'
|
|
@@ -764,9 +765,11 @@ async function uploadProject(uploadResults, sharedFilePaths, normalizedConfig, p
|
|
|
764
765
|
}
|
|
765
766
|
return uploaded;
|
|
766
767
|
} finally{
|
|
767
|
-
|
|
768
|
+
promises_default().rm(tmpDir, {
|
|
768
769
|
recursive: true,
|
|
769
770
|
force: true
|
|
771
|
+
}).catch((err)=>{
|
|
772
|
+
logger_logger.error(`Failed to cleanup dir ${tmpDir}: ${err}`);
|
|
770
773
|
});
|
|
771
774
|
}
|
|
772
775
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -73,7 +73,8 @@ class LocalObjectStore {
|
|
|
73
73
|
_define_property(this, "rootDir", void 0);
|
|
74
74
|
_define_property(this, "publicBaseUrl", void 0);
|
|
75
75
|
this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? node_path.join(process.cwd(), 'log', 'static');
|
|
76
|
-
const
|
|
76
|
+
const port = process.env.PORT || 3000;
|
|
77
|
+
const base = (null == opts ? void 0 : opts.publicBaseUrl) === '/' ? `http://localhost:${port}/` : (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
|
|
77
78
|
this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -465,7 +466,7 @@ const prepareProject = async (config, excludeShared)=>{
|
|
|
465
466
|
const installDependencies = async (cwd)=>{
|
|
466
467
|
markInstallStart();
|
|
467
468
|
try {
|
|
468
|
-
await runCommand("pnpm i --ignore-scripts --
|
|
469
|
+
await runCommand("pnpm i --ignore-scripts --prefer-offline --reporter=silent ", {
|
|
469
470
|
cwd,
|
|
470
471
|
env: {
|
|
471
472
|
npm_config_registry: 'https://registry.npmjs.org/'
|
|
@@ -735,9 +736,11 @@ async function uploadProject(uploadResults, sharedFilePaths, normalizedConfig, p
|
|
|
735
736
|
}
|
|
736
737
|
return uploaded;
|
|
737
738
|
} finally{
|
|
738
|
-
|
|
739
|
+
promises.rm(tmpDir, {
|
|
739
740
|
recursive: true,
|
|
740
741
|
force: true
|
|
742
|
+
}).catch((err)=>{
|
|
743
|
+
logger_logger.error(`Failed to cleanup dir ${tmpDir}: ${err}`);
|
|
741
744
|
});
|
|
742
745
|
}
|
|
743
746
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/treeshake-server",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Build service powered by Hono that installs dependencies, builds with Rspack, and uploads artifacts.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -15,14 +15,6 @@
|
|
|
15
15
|
"bin": {
|
|
16
16
|
"treeshake-server": "bin/treeshake-server.js"
|
|
17
17
|
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "pnpm -C ../treeshake-frontend build && rslib build && node scripts/copy-frontend.js",
|
|
20
|
-
"lint": "biome lint src scripts",
|
|
21
|
-
"prestart": "npm run build",
|
|
22
|
-
"dev": "node scripts/dev.js",
|
|
23
|
-
"start": "node dist/server.js",
|
|
24
|
-
"test": "rstest"
|
|
25
|
-
},
|
|
26
18
|
"files": [
|
|
27
19
|
"bin/",
|
|
28
20
|
"dist/",
|
|
@@ -64,5 +56,13 @@
|
|
|
64
56
|
"type": "git",
|
|
65
57
|
"url": "git+https://github.com/module-federation/core.git",
|
|
66
58
|
"directory": "packages/treeshake-server"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "pnpm -C ../treeshake-frontend build && rslib build && node scripts/copy-frontend.js",
|
|
62
|
+
"lint": "biome lint src scripts",
|
|
63
|
+
"prestart": "npm run build",
|
|
64
|
+
"dev": "node scripts/dev.js",
|
|
65
|
+
"start": "node dist/server.js",
|
|
66
|
+
"test": "node ../../scripts/ensure-playwright.js && rstest"
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|