silgi 0.37.11 → 0.37.13

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/cli/dev.mjs CHANGED
@@ -34,7 +34,13 @@ async function watchDev() {
34
34
  silgi.options.watchOptions.ignoreInitial = true;
35
35
  if (Array.isArray(silgi.options.watchOptions.ignored)) {
36
36
  silgi.options.watchOptions.ignored.push(
37
- `!${join(silgi.options.silgi.serverDir, "config")}`
37
+ // `!${join(silgi.options.silgi.serverDir, 'config')}`,
38
+ `!${join(silgi.options.silgi.serverDir, "permission.ts")}`,
39
+ `!${join(silgi.options.silgi.serverDir, "core.ts")}`,
40
+ `!${join(silgi.options.silgi.serverDir, "rules.ts")}`,
41
+ `!${join(silgi.options.silgi.serverDir, "configs.ts")}`,
42
+ `!${join(silgi.options.silgi.serverDir, "vfs")}`,
43
+ `!${join(silgi.options.silgi.serverDir, "scan.ts")}`
38
44
  );
39
45
  }
40
46
  silgi.options.devServer.watch.push(
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.37.11";
4
+ const version = "0.37.13";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -811,6 +811,14 @@ function substitutePathParams(path, pathParams) {
811
811
  return `:${key}`;
812
812
  });
813
813
  }
814
+ function withDuplexIfBody(options) {
815
+ if (!options)
816
+ return options;
817
+ if (options.body && !("duplex" in options)) {
818
+ return { ...options, duplex: "half" };
819
+ }
820
+ return options;
821
+ }
814
822
  function createSilgiCore(event) {
815
823
  return {
816
824
  resolve: async (path, method, context) => {
@@ -821,7 +829,7 @@ function createSilgiCore(event) {
821
829
  const routeStr = substitutePathParams(String(path), context?.pathParams);
822
830
  const methodStr = String(method);
823
831
  const match = findRoute(silgiCtx.router, methodStr, routeStr);
824
- return match?.data?.setup;
832
+ return match?.data?.service;
825
833
  }
826
834
  };
827
835
  }
@@ -836,9 +844,9 @@ async function silgiFetch(_request, options, context) {
836
844
  const proto = getHeader("X-Forwarded-Proto", options?.headers) === "https" ? "https" : "http";
837
845
  url = `${proto}://${host}${url}`;
838
846
  }
839
- request = new Request(url, options);
847
+ request = new Request(url, withDuplexIfBody(options));
840
848
  } else if (options || _request instanceof URL) {
841
- request = new Request(_request, options);
849
+ request = new Request(_request, withDuplexIfBody(options));
842
850
  } else {
843
851
  request = _request;
844
852
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.37.11",
4
+ "version": "0.37.13",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {