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.
@@ -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('Set environment variables files and conf related to <deploy-id>')
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
 
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.43'
61
+ engine.version: '2.8.44'
62
62
  networks:
63
63
  - load-balancer
64
64
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.43",
5
+ "version": "2.8.44",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -106,10 +106,10 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
106
106
  </style>
107
107
  ${borderChar(1, 'black', ['.clean-cache-container'])}
108
108
  <script>
109
- window._VERSION = '${process.env.npm_package_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">${process.env.npm_package_version}</div>
113
+ <div class="clean-cache-container">${npm_package_version}</div>
114
114
  `;
115
115
  };
package/src/index.js CHANGED
@@ -21,7 +21,7 @@ class Underpost {
21
21
  * @type {String}
22
22
  * @memberof Underpost
23
23
  */
24
- static version = 'v2.8.43';
24
+ static version = 'v2.8.44';
25
25
 
26
26
  constructor() {}
27
27
 
@@ -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
- let SrrComponent = () => {};
52
- eval(await srcFormatted(fs.readFileSync(componentPath, 'utf8')));
53
- return SrrComponent;
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 };
@@ -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
- filename: `logs/${meta}/error.log`,
117
- level: 'error',
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` }),