underpost 2.8.43 → 2.8.44
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/.vscode/settings.json +4 -1
- package/bin/index.js +2 -2
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/client/ssr/body/CacheControl.js +2 -2
- package/src/index.js +1 -1
- package/src/server/client-build.js +1 -10
- package/src/server/client-formatted.js +5 -3
- package/src/server/logger.js +4 -4
package/.vscode/settings.json
CHANGED
|
@@ -113,5 +113,8 @@
|
|
|
113
113
|
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
114
114
|
},
|
|
115
115
|
"docwriter.progress.trackTypes": true,
|
|
116
|
-
"docwriter.hotkey.mac": "⌘ + ."
|
|
116
|
+
"docwriter.hotkey.mac": "⌘ + .",
|
|
117
|
+
"[dotenv]": {
|
|
118
|
+
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
119
|
+
}
|
|
117
120
|
}
|
package/bin/index.js
CHANGED
|
@@ -68,8 +68,8 @@ program
|
|
|
68
68
|
|
|
69
69
|
program
|
|
70
70
|
.command('root')
|
|
71
|
-
.description('
|
|
72
|
-
.action(getNpmRootPath);
|
|
71
|
+
.description('Get npm root path')
|
|
72
|
+
.action(() => console.log(getNpmRootPath()));
|
|
73
73
|
|
|
74
74
|
program.command('test').description('Run tests').action(Underpost.runTest);
|
|
75
75
|
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -106,10 +106,10 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
|
106
106
|
</style>
|
|
107
107
|
${borderChar(1, 'black', ['.clean-cache-container'])}
|
|
108
108
|
<script>
|
|
109
|
-
window._VERSION = '${
|
|
109
|
+
window._VERSION = '${npm_package_version}';
|
|
110
110
|
const CacheControl = ${CacheControl};
|
|
111
111
|
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
|
|
112
112
|
</script>
|
|
113
|
-
<div class="clean-cache-container">${
|
|
113
|
+
<div class="clean-cache-container">${npm_package_version}</div>
|
|
114
114
|
`;
|
|
115
115
|
};
|
package/src/index.js
CHANGED
|
@@ -191,8 +191,7 @@ const buildClient = async (options = { liveClientBuildPaths: [], instances: [] }
|
|
|
191
191
|
|
|
192
192
|
if (redirect || disabledRebuild) continue;
|
|
193
193
|
|
|
194
|
-
if (fullBuildEnabled)
|
|
195
|
-
// !(confServer[host]['/'] && confServer[host]['/'].liteBuild)
|
|
194
|
+
if (fullBuildEnabled)
|
|
196
195
|
await fullBuild({
|
|
197
196
|
path,
|
|
198
197
|
logger,
|
|
@@ -205,14 +204,6 @@ const buildClient = async (options = { liveClientBuildPaths: [], instances: [] }
|
|
|
205
204
|
iconsBuild,
|
|
206
205
|
metadata,
|
|
207
206
|
});
|
|
208
|
-
if (apis && false)
|
|
209
|
-
for (const apiBuildScript of apis) {
|
|
210
|
-
const scriptPath = `src/api/${apiBuildScript}/${apiBuildScript}.build.js`;
|
|
211
|
-
if (fs.existsSync(`./${scriptPath}`)) {
|
|
212
|
-
shellExec(`node ${scriptPath}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
207
|
|
|
217
208
|
if (components)
|
|
218
209
|
for (const module of Object.keys(components)) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
|
+
import vm from 'node:vm';
|
|
4
5
|
|
|
5
6
|
const srcFormatted = (src) =>
|
|
6
7
|
src
|
|
@@ -48,9 +49,10 @@ const viewFormatted = (src, dists, proxyPath, baseHost = '') => {
|
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
const ssrFactory = async (componentPath = `./src/client/ssr/Render.js`) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const context = { SrrComponent: () => {}, npm_package_version: process.env.npm_package_version };
|
|
53
|
+
vm.createContext(context);
|
|
54
|
+
vm.runInContext(await srcFormatted(fs.readFileSync(componentPath, 'utf8')), context);
|
|
55
|
+
return context.SrrComponent;
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
export { srcFormatted, JSONweb, componentFormatted, viewFormatted, ssrFactory };
|
package/src/server/logger.js
CHANGED
|
@@ -112,10 +112,10 @@ const loggerFactory = (meta = { url: '' }) => {
|
|
|
112
112
|
// Allow the use the terminal to print the messages
|
|
113
113
|
new winston.transports.Console(),
|
|
114
114
|
// Allow to print all the error level messages inside the error.log file
|
|
115
|
-
new winston.transports.File({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}),
|
|
115
|
+
// new winston.transports.File({
|
|
116
|
+
// filename: `logs/${meta}/error.log`,
|
|
117
|
+
// level: 'error',
|
|
118
|
+
// }),
|
|
119
119
|
// Allow to print all the error message inside the all.log file
|
|
120
120
|
// (also the error log that are also printed inside the error.log(
|
|
121
121
|
new winston.transports.File({ filename: `logs/${meta}/all.log` }),
|