@reboot-dev/reboot 0.43.0 → 0.44.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dependencies": {
3
3
  "@bufbuild/protoplugin": "1.10.1",
4
4
  "@bufbuild/protoc-gen-es": "1.10.1",
5
- "@reboot-dev/reboot-api": "0.43.0",
5
+ "@reboot-dev/reboot-api": "0.44.0",
6
6
  "chalk": "^4.1.2",
7
7
  "node-addon-api": "^7.0.0",
8
8
  "node-gyp": ">=10.2.0",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "type": "module",
24
24
  "name": "@reboot-dev/reboot",
25
- "version": "0.43.0",
25
+ "version": "0.44.0",
26
26
  "description": "npm package for Reboot",
27
27
  "scripts": {
28
28
  "preinstall": "node preinstall.cjs",
package/reboot_native.cc CHANGED
@@ -1646,7 +1646,7 @@ Napi::Value Reboot_up(const Napi::CallbackInfo& info) {
1646
1646
 
1647
1647
  py::object* py_application = js_external_application.Value(info.Env()).Data();
1648
1648
 
1649
- bool local_envoy = false;
1649
+ std::optional<bool> local_envoy;
1650
1650
  if (!info[2].IsUndefined()) {
1651
1651
  local_envoy = info[2].As<Napi::Boolean>();
1652
1652
  }
@@ -1666,6 +1666,10 @@ Napi::Value Reboot_up(const Napi::CallbackInfo& info) {
1666
1666
  py_application,
1667
1667
  local_envoy,
1668
1668
  local_envoy_port]() {
1669
+ py::object py_local_envoy = py::none();
1670
+ if (local_envoy.has_value()) {
1671
+ py_local_envoy = py::bool_(*local_envoy);
1672
+ }
1669
1673
  return py_reboot->attr("up")(
1670
1674
  py_application,
1671
1675
  // NOTE: while we support subprocess servers
@@ -1674,7 +1678,7 @@ Napi::Value Reboot_up(const Napi::CallbackInfo& info) {
1674
1678
  // clone a process like we do with multiprocessing
1675
1679
  // in Python.
1676
1680
  "in_process"_a = true,
1677
- "local_envoy"_a = local_envoy,
1681
+ "local_envoy"_a = py_local_envoy,
1678
1682
  "local_envoy_port"_a = local_envoy_port);
1679
1683
  },
1680
1684
  [](py::object py_revision) {
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const REBOOT_VERSION = "0.43.0";
1
+ export declare const REBOOT_VERSION = "0.44.0";
package/version.js CHANGED
@@ -1 +1 @@
1
- export const REBOOT_VERSION = "0.43.0";
1
+ export const REBOOT_VERSION = "0.44.0";
package/zod-to-proto.js CHANGED
@@ -114,7 +114,18 @@ const generate = (proto, { schema, path, name, state = false, }) => {
114
114
  console.error(chalk.stderr.bold.red(`Unexpected literal '${literal}' for property '${key}'; only 'string' literals are currently supported`));
115
115
  process.exit(-1);
116
116
  }
117
- proto.write(`${literal} = ${i++};`);
117
+ // According to Protobuf `enum` rules:
118
+ // `enum` values use C++ scoping rules, meaning that
119
+ // `enum` values are siblings of their type, not
120
+ // children of it.
121
+ // That means we need to prefix the `enum` values
122
+ // with the `enum` type name to avoid name conflicts.
123
+ // It is safe here, since we preserve the original
124
+ // order of the literals and during the conversion
125
+ // from Pydantic model to Protobuf and back we
126
+ // operate with the indexes of the literals, not
127
+ // their names.
128
+ proto.write(`${typeName}_${literal} = ${i++};`);
118
129
  }
119
130
  proto.write(`}`);
120
131
  proto.write(`optional ${typeName} ${field} = ${tag};`);