From 54a07f0300ef8cc350f54b672783e9c87cc22c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20de=20=C3=81vila=20Martins?= Date: Wed, 18 Dec 2024 11:20:29 -0300 Subject: [PATCH] Undef coerce (#247) * Remove null and undefined coercion * fix ci --- e2e-tests/bug-rust-repro/src/generated/validators.js | 3 --- e2e-tests/standalone-parser/CHANGELOG.md | 8 ++++++++ e2e-tests/standalone-parser/package.json | 2 +- e2e-tests/standalone-parser/src/generated/validators.js | 3 --- packages/beff-cli/CHANGELOG.md | 6 ++++++ packages/beff-cli/package.json | 2 +- packages/beff-client/CHANGELOG.md | 8 ++++++++ packages/beff-client/package.json | 4 ++-- packages/beff-wasm/bundled-code/decoders.js | 3 --- .../export-decoder/bff-generated/validators.js | 3 --- packages/beff-wasm/package.json | 2 +- pnpm-lock.yaml | 4 ++-- 12 files changed, 29 insertions(+), 19 deletions(-) diff --git a/e2e-tests/bug-rust-repro/src/generated/validators.js b/e2e-tests/bug-rust-repro/src/generated/validators.js index 71eb7a1..12be8de 100644 --- a/e2e-tests/bug-rust-repro/src/generated/validators.js +++ b/e2e-tests/bug-rust-repro/src/generated/validators.js @@ -309,9 +309,6 @@ function decodeNull(ctx, input, required) { if (!required && input == null) { return input; } - if (input == "null" || input == "undefined") { - return null; - } if (input == null) { return null; } diff --git a/e2e-tests/standalone-parser/CHANGELOG.md b/e2e-tests/standalone-parser/CHANGELOG.md index fba1919..753d4fa 100644 --- a/e2e-tests/standalone-parser/CHANGELOG.md +++ b/e2e-tests/standalone-parser/CHANGELOG.md @@ -1,5 +1,13 @@ # node-server +## 1.0.63 + +### Patch Changes + +- Updated dependencies + - @beff/cli@0.0.66 + - @beff/client@0.0.66 + ## 1.0.62 ### Patch Changes diff --git a/e2e-tests/standalone-parser/package.json b/e2e-tests/standalone-parser/package.json index 6077a5a..1080193 100644 --- a/e2e-tests/standalone-parser/package.json +++ b/e2e-tests/standalone-parser/package.json @@ -1,6 +1,6 @@ { "name": "standalone-parser", - "version": "1.0.62", + "version": "1.0.63", "description": "", "main": "index.js", "scripts": { diff --git a/e2e-tests/standalone-parser/src/generated/validators.js b/e2e-tests/standalone-parser/src/generated/validators.js index f0e3ac5..2107741 100644 --- a/e2e-tests/standalone-parser/src/generated/validators.js +++ b/e2e-tests/standalone-parser/src/generated/validators.js @@ -309,9 +309,6 @@ function decodeNull(ctx, input, required) { if (!required && input == null) { return input; } - if (input == "null" || input == "undefined") { - return null; - } if (input == null) { return null; } diff --git a/packages/beff-cli/CHANGELOG.md b/packages/beff-cli/CHANGELOG.md index 89542fd..2586aa5 100644 --- a/packages/beff-cli/CHANGELOG.md +++ b/packages/beff-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @beff/cli +## 0.0.66 + +### Patch Changes + +- remove null and undefined string coercion + ## 0.0.64 ### Patch Changes diff --git a/packages/beff-cli/package.json b/packages/beff-cli/package.json index 0097f53..1237eec 100644 --- a/packages/beff-cli/package.json +++ b/packages/beff-cli/package.json @@ -1,6 +1,6 @@ { "name": "@beff/cli", - "version": "0.0.65", + "version": "0.0.66", "description": "", "bin": { "beff": "./bin/index.js" diff --git a/packages/beff-client/CHANGELOG.md b/packages/beff-client/CHANGELOG.md index f700f8d..13b08c2 100644 --- a/packages/beff-client/CHANGELOG.md +++ b/packages/beff-client/CHANGELOG.md @@ -1,5 +1,13 @@ # @beff/client +## 0.0.66 + +### Patch Changes + +- remove null and undefined string coercion +- Updated dependencies + - @beff/cli@0.0.66 + ## 0.0.65 ### Patch Changes diff --git a/packages/beff-client/package.json b/packages/beff-client/package.json index d31db13..6a0853a 100644 --- a/packages/beff-client/package.json +++ b/packages/beff-client/package.json @@ -1,6 +1,6 @@ { "name": "@beff/client", - "version": "0.0.65", + "version": "0.0.66", "description": "", "main": "dist/cjs/index.js", "scripts": { @@ -20,7 +20,7 @@ "author": "", "license": "ISC", "dependencies": { - "@beff/cli": "workspace:^0.0.65", + "@beff/cli": "workspace:^0.0.66", "zod": "^3.23.5" }, "devDependencies": { diff --git a/packages/beff-wasm/bundled-code/decoders.js b/packages/beff-wasm/bundled-code/decoders.js index 9c61a71..a926e06 100644 --- a/packages/beff-wasm/bundled-code/decoders.js +++ b/packages/beff-wasm/bundled-code/decoders.js @@ -306,9 +306,6 @@ function decodeNull(ctx, input, required) { if (!required && input == null) { return input; } - if (input == "null" || input == "undefined") { - return null; - } if (input == null) { return null; } diff --git a/packages/beff-wasm/fixtures/codegen-snaps/export-decoder/bff-generated/validators.js b/packages/beff-wasm/fixtures/codegen-snaps/export-decoder/bff-generated/validators.js index 19251ad..7111179 100644 --- a/packages/beff-wasm/fixtures/codegen-snaps/export-decoder/bff-generated/validators.js +++ b/packages/beff-wasm/fixtures/codegen-snaps/export-decoder/bff-generated/validators.js @@ -309,9 +309,6 @@ function decodeNull(ctx, input, required) { if (!required && input == null) { return input; } - if (input == "null" || input == "undefined") { - return null; - } if (input == null) { return null; } diff --git a/packages/beff-wasm/package.json b/packages/beff-wasm/package.json index 3b8ccb7..5cd6246 100644 --- a/packages/beff-wasm/package.json +++ b/packages/beff-wasm/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { "@babel/code-frame": "^7.22.13", - "@beff/cli": "workspace:^0.0.65", + "@beff/cli": "workspace:^0.0.66", "@types/babel__code-frame": "^7.0.4", "@types/node": "^20.6.2", "@types/vscode": "^1.73.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 615058a..6ff546b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,7 +55,7 @@ importers: packages/beff-client: dependencies: '@beff/cli': - specifier: workspace:^0.0.65 + specifier: workspace:^0.0.66 version: link:../beff-cli zod: specifier: ^3.23.5 @@ -89,7 +89,7 @@ importers: specifier: ^7.22.13 version: 7.22.13 '@beff/cli': - specifier: workspace:^0.0.65 + specifier: workspace:^0.0.66 version: link:../beff-cli '@types/babel__code-frame': specifier: ^7.0.4