@tailor-platform/sdk-codemod 0.8.7 → 0.8.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @tailor-platform/sdk-codemod
2
2
 
3
+ ## 0.8.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2274](https://github.com/tailor-platform/sdk/pull/2274) [`5168d35`](https://github.com/tailor-platform/sdk/commit/5168d35b49e9e3d691c0f2f79041b333f327ce43) Thanks [@toiroakr](https://github.com/toiroakr)! - Add explicit `utf8` and `base64` encoding options to `file.upload` and generated `uploadFile` helpers. String uploads without encoding retain their existing text behavior but are deprecated ahead of v3; byte uploads remain unchanged and are not deprecated. Include migration guidance for existing string uploads.
8
+
9
+ - [#2295](https://github.com/tailor-platform/sdk/pull/2295) [`e9ca76d`](https://github.com/tailor-platform/sdk/commit/e9ca76d8e18670ae71d1203cb930cf14f8c6e816) Thanks [@renovate](https://github.com/apps/renovate)! - Depend on `@politty/zod` directly instead of the `politty` wrapper package. `politty` re-exported everything from `@politty/zod` unchanged, so this is an internal dependency swap with no effect on CLI behavior.
10
+
11
+ ## 0.8.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [#2273](https://github.com/tailor-platform/sdk/pull/2273) [`656714a`](https://github.com/tailor-platform/sdk/commit/656714a8215a03458b2a2a5b084faafb805b3b59) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @inquirer
16
+
17
+ - [#2277](https://github.com/tailor-platform/sdk/pull/2277) [`7926310`](https://github.com/tailor-platform/sdk/commit/7926310a7d5154e5bace9be7f66760a264df1151) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency pkg-types to v2.3.2
18
+
3
19
  ## 0.8.7
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import * as url from "node:url";
3
3
  import { fileURLToPath } from "node:url";
4
+ import { arg, defineCommand, runMain } from "@politty/zod";
4
5
  import * as path from "pathe";
5
6
  import { readPackageJSON } from "pkg-types";
6
- import { arg, defineCommand, runMain } from "politty";
7
7
  import { z } from "zod";
8
8
  import { gte, lt, parse, valid } from "semver";
9
9
  import * as fs from "node:fs";
@@ -1647,6 +1647,32 @@ const allCodemods = [
1647
1647
  "property, which is the relation's cardinality (e.g. \"n-1\", \"1-1\",",
1648
1648
  "\"keyOnly\") and keeps its name."
1649
1649
  ].join("\n")
1650
+ },
1651
+ {
1652
+ id: "v3/file-upload-encoding",
1653
+ name: "String file uploads → explicit encoding",
1654
+ description: "String inputs to the SDK `file.upload` and generated `uploadFile` require an explicit `encoding` in v3. Add `encoding: \"utf8\"` to preserve the previous behavior; use `\"base64\"` only when decoding the input is intended. Byte inputs are unchanged. This migration requires checking the input type and regenerating file helpers, so it provides review guidance instead of rewriting calls automatically.",
1655
+ since: "1.51.0",
1656
+ until: "3.0.0",
1657
+ suspiciousPatterns: [/\bupload\b/, "uploadFile"],
1658
+ examples: [{
1659
+ before: "await file.upload(ns, table, field, id, text, { contentType: \"text/plain\" });",
1660
+ after: "await file.upload(ns, table, field, id, text, { contentType: \"text/plain\", encoding: \"utf8\" });"
1661
+ }],
1662
+ prompt: [
1663
+ "Inspect calls to the imported SDK file.upload (including aliases and destructured upload)",
1664
+ "and generated uploadFile helpers, including shared wrappers and option objects.",
1665
+ "For string inputs, add encoding: utf8 to preserve existing text storage behavior.",
1666
+ "Choose encoding: base64 only if decoding is explicitly intended; never infer it from",
1667
+ "the string contents or contentType. Preserve all existing upload options.",
1668
+ "Leave byte-only inputs unchanged. For string | byte unions, supplying encoding: utf8",
1669
+ "preserves behavior because byte input ignores encoding. Narrow shared options types",
1670
+ "so TypeScript can see that encoding is present for strings.",
1671
+ "Run tailor generate to regenerate uploadFile helpers instead of editing generated files.",
1672
+ "The global tailordb.file.upload does not support this encoding option; switch to the",
1673
+ "file import from @tailor-platform/sdk/runtime before using it.",
1674
+ "Do not change unrelated upload APIs or already explicit encodings."
1675
+ ].join("\n")
1650
1676
  }
1651
1677
  ];
1652
1678
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk-codemod",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "description": "Codemod runner for Tailor Platform SDK upgrades",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,11 +17,11 @@
17
17
  "type": "module",
18
18
  "dependencies": {
19
19
  "@ast-grep/napi": "0.45.3",
20
+ "@politty/zod": "0.2.1",
20
21
  "diff": "9.0.0",
21
22
  "pathe": "2.0.3",
22
23
  "picomatch": "4.0.7",
23
- "pkg-types": "2.3.1",
24
- "politty": "0.11.9",
24
+ "pkg-types": "2.3.2",
25
25
  "semver": "7.8.5",
26
26
  "zod": "4.5.4"
27
27
  },
@@ -33,9 +33,9 @@
33
33
  "eslint-plugin-zod": "4.12.0",
34
34
  "oxlint": "1.81.0",
35
35
  "oxlint-tsgolint": "7.0.2001",
36
- "tsdown": "0.22.14",
36
+ "tsdown": "0.23.0",
37
37
  "typescript": "6.0.3",
38
- "vitest": "4.1.11"
38
+ "vitest": "5.0.0"
39
39
  },
40
40
  "engines": {
41
41
  "bun": ">=1.2.0",