miqro 7.0.5 → 7.0.7

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.
@@ -7,6 +7,7 @@ export declare function esBuild(options: {
7
7
  entryPoints: [string];
8
8
  mainFields?: string;
9
9
  bundle?: boolean;
10
+ keepNames?: boolean;
10
11
  jsxFactory?: string;
11
12
  jsxFragment?: string;
12
13
  minify?: boolean;
@@ -50,7 +50,7 @@ export async function esBuild(options, logger) {
50
50
  try {
51
51
  //const logger = getLogger(`${SERVER_IDENTIFIER}_ESBUILD`);
52
52
  const valid = await validateESBuild(logger);
53
- const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map(e => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}`;
53
+ const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map(e => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}${options.keepNames ? ` --keep-names` : ""}`;
54
54
  logger?.trace(esBuildCMD);
55
55
  if (!valid) {
56
56
  const err = new Error(`esbuild installation at [${getESBuildBinaryPath()}] tampered`);
@@ -15,6 +15,7 @@ const parser = new Parser();
15
15
  const DEFAULT_ESOPTION = {
16
16
  platform: "neutral",
17
17
  mainFields: "module,main",
18
+ keepNames: true,
18
19
  // platform: "node",
19
20
  bundle: true,
20
21
  jsxFactory: "JSX.createElement",
@@ -69,7 +69,7 @@ async function main() {
69
69
  cache,
70
70
  localCache,
71
71
  loggerProvider,
72
- wsManager: webSocketManager,
72
+ webSocketManager,
73
73
  logger: loggerProvider.getLogger("server"),
74
74
  dbManager,
75
75
  port: PORT
@@ -77,6 +77,8 @@ async function main() {
77
77
 
78
78
  await Promise.all([${DBCONFIGLIST}]);
79
79
 
80
+ ${SERVERCONFIGLIST ? `\n await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));\n` : ""}
81
+
80
82
  ${!WSLIST ? "" : `\n webSocketManager.replaceALLWS(await Promise.all([${WSLIST}]))`}
81
83
  const app = new App({
82
84
  onUpgrade: (req, socket, head) => {
@@ -88,7 +90,7 @@ async function main() {
88
90
  }
89
91
  }
90
92
  });
91
- ${SERVERCONFIGLIST ? `\n await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));\n` : ""}
93
+
92
94
  app.use(ServerRequestHandler(serverInterface));
93
95
  app.use(LoggerHandler());
94
96
  ${services.map(service => `app.use(await (await require("./${join(service, "router.cjs")}")).setupRouter());`).join("\n")}
package/build/lib.cjs CHANGED
@@ -2813,7 +2813,7 @@ var init_websocket = __esm({
2813
2813
  async onUpgrade(req, socket, head) {
2814
2814
  const acceptKey = req.headers["sec-websocket-key"];
2815
2815
  req.logger.debug("validating with acceptKey [%s]", acceptKey);
2816
- if (!socket || (!req.headers.connection || req.headers.connection.indexOf("Upgrade") === -1) || req.headers.upgrade !== "websocket" || String(req.method).toUpperCase() !== "GET" || !acceptKey) {
2816
+ if (!socket || (!req.headers.connection || String(req.headers.connection).toLocaleLowerCase().indexOf("upgrade") === -1) || String(req.headers.upgrade).toLocaleLowerCase() !== "websocket" || String(req.method).toUpperCase() !== "GET" || !acceptKey) {
2817
2817
  req.logger.warn("bad request");
2818
2818
  socket.end("HTTP/1.1 400 Bad Request");
2819
2819
  socket.destroy();
@@ -9361,7 +9361,7 @@ async function esBuild2(options, logger) {
9361
9361
  return new Promise(async (resolve24, reject) => {
9362
9362
  try {
9363
9363
  const valid = await validateESBuild(logger);
9364
- const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map((e) => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}`;
9364
+ const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map((e) => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}${options.keepNames ? ` --keep-names` : ""}`;
9365
9365
  logger?.trace(esBuildCMD);
9366
9366
  if (!valid) {
9367
9367
  const err = new Error(`esbuild installation at [${getESBuildBinaryPath()}] tampered`);
@@ -9409,6 +9409,7 @@ var parser = new Parser();
9409
9409
  var DEFAULT_ESOPTION = {
9410
9410
  platform: "neutral",
9411
9411
  mainFields: "module,main",
9412
+ keepNames: true,
9412
9413
  // platform: "node",
9413
9414
  bundle: true,
9414
9415
  jsxFactory: "JSX.createElement",
@@ -13084,7 +13085,7 @@ async function main() {
13084
13085
  cache,
13085
13086
  localCache,
13086
13087
  loggerProvider,
13087
- wsManager: webSocketManager,
13088
+ webSocketManager,
13088
13089
  logger: loggerProvider.getLogger("server"),
13089
13090
  dbManager,
13090
13091
  port: PORT
@@ -13092,6 +13093,10 @@ async function main() {
13092
13093
 
13093
13094
  await Promise.all([${DBCONFIGLIST}]);
13094
13095
 
13096
+ ${SERVERCONFIGLIST ? `
13097
+ await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));
13098
+ ` : ""}
13099
+
13095
13100
  ${!WSLIST ? "" : `
13096
13101
  webSocketManager.replaceALLWS(await Promise.all([${WSLIST}]))`}
13097
13102
  const app = new App({
@@ -13104,9 +13109,7 @@ async function main() {
13104
13109
  }
13105
13110
  }
13106
13111
  });
13107
- ${SERVERCONFIGLIST ? `
13108
- await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));
13109
- ` : ""}
13112
+
13110
13113
  app.use(ServerRequestHandler(serverInterface));
13111
13114
  app.use(LoggerHandler());
13112
13115
  ${services.map((service) => `app.use(await (await require("./${(0, import_node_path14.join)(service, "router.cjs")}")).setupRouter());`).join("\n")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miqro",
3
- "version": "7.0.5",
3
+ "version": "7.0.7",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "build/esm/src/lib.js",
@@ -57,6 +57,7 @@ export async function esBuild(options: {
57
57
  entryPoints: [string];
58
58
  mainFields?: string;
59
59
  bundle?: boolean;
60
+ keepNames?: boolean;
60
61
  jsxFactory?: string;
61
62
  jsxFragment?: string;
62
63
  minify?: boolean;
@@ -72,7 +73,7 @@ export async function esBuild(options: {
72
73
  try {
73
74
  //const logger = getLogger(`${SERVER_IDENTIFIER}_ESBUILD`);
74
75
  const valid = await validateESBuild(logger);
75
- const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map(e => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}`;
76
+ const esBuildCMD = `${getESBuildBinaryPath()} "${options.entryPoints[0]}" ${(options.external ? options.external : NODEJS_EXTERNAL).map(e => `--external:${e}`).join(" ")} --loader:.js=jsx --jsx-factory=${options.jsxFactory} --jsx-fragment=${options.jsxFragment} ${options.bundle ? " --bundle" : ""}${options.minify ? " --minify" : ""}${options.outfile ? ` --outfile="${options.outfile}"` : ""}${options.platform ? ` --platform=${options.platform}` : ""}${options.mainFields ? ` --main-fields=${options.mainFields}` : ""}${options.keepNames ? ` --keep-names` : ""}`;
76
77
  logger?.trace(esBuildCMD);
77
78
  if (!valid) {
78
79
  const err = new Error(`esbuild installation at [${getESBuildBinaryPath()}] tampered`);
package/src/common/jsx.ts CHANGED
@@ -59,6 +59,7 @@ export interface InflateOptions {
59
59
  const DEFAULT_ESOPTION = {
60
60
  platform: "neutral",
61
61
  mainFields: "module,main",
62
+ keepNames: true,
62
63
  // platform: "node",
63
64
  bundle: true,
64
65
  jsxFactory: "JSX.createElement",