@tailor-platform/sdk-codemod 0.2.4 → 0.2.6
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,17 @@
|
|
|
1
1
|
# @tailor-platform/sdk-codemod
|
|
2
2
|
|
|
3
|
+
## 0.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1380](https://github.com/tailor-platform/sdk/pull/1380) [`2ed1344`](https://github.com/tailor-platform/sdk/commit/2ed1344e5ffff6e78d74ef3a0297fcff4a6201e7) Thanks [@dqn](https://github.com/dqn)! - Internal refactoring: replace mutating array methods (`sort`/`reverse`/`splice`) with non-mutating ES2023 equivalents (`toSorted`/`toReversed`/`toSpliced`). No user-facing behavior change.
|
|
8
|
+
|
|
9
|
+
## 0.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1353](https://github.com/tailor-platform/sdk/pull/1353) [`f0cfb61`](https://github.com/tailor-platform/sdk/commit/f0cfb61dcadb47819a8916da9bcf9b63a4ff5706) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency semver to v7.8.2
|
|
14
|
+
|
|
3
15
|
## 0.2.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -106,13 +106,13 @@ function transform(source) {
|
|
|
106
106
|
if (new RegExp(`import\\s*\\{[^}]*\\b${functionName}\\b[^}]*\\}`, "m").test(result)) continue;
|
|
107
107
|
importLines.push(line);
|
|
108
108
|
}
|
|
109
|
-
importLines.
|
|
110
|
-
if (
|
|
109
|
+
const sortedImportLines = importLines.toSorted();
|
|
110
|
+
if (sortedImportLines.length === 0) return result;
|
|
111
111
|
const match = /^(import\s+.*from\s+["']@tailor-platform\/sdk["'];?)$/m.exec(result);
|
|
112
112
|
if (match) {
|
|
113
113
|
const insertPos = (match.index ?? 0) + match[0].length;
|
|
114
|
-
result = result.slice(0, insertPos) + "\n" +
|
|
115
|
-
} else result =
|
|
114
|
+
result = result.slice(0, insertPos) + "\n" + sortedImportLines.join("\n") + result.slice(insertPos);
|
|
115
|
+
} else result = sortedImportLines.join("\n") + "\n" + result;
|
|
116
116
|
}
|
|
117
117
|
return result;
|
|
118
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/sdk-codemod",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Codemod runner for Tailor Platform SDK upgrades",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"pathe": "2.0.3",
|
|
23
23
|
"picomatch": "4.0.4",
|
|
24
24
|
"pkg-types": "2.3.1",
|
|
25
|
-
"politty": "0.5.
|
|
26
|
-
"semver": "7.8.
|
|
25
|
+
"politty": "0.5.1",
|
|
26
|
+
"semver": "7.8.2",
|
|
27
27
|
"zod": "4.4.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/node": "24.
|
|
30
|
+
"@types/node": "24.13.1",
|
|
31
31
|
"@types/picomatch": "4.0.3",
|
|
32
32
|
"@types/semver": "7.7.1",
|
|
33
|
-
"oxlint": "1.
|
|
34
|
-
"tsdown": "0.22.
|
|
33
|
+
"oxlint": "1.68.0",
|
|
34
|
+
"tsdown": "0.22.1",
|
|
35
35
|
"typescript": "5.9.3",
|
|
36
|
-
"vitest": "4.1.
|
|
36
|
+
"vitest": "4.1.8"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsdown",
|