@planningcenter/tapestry-migration-cli 2.8.0-rc.1 → 2.8.0-rc.3
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-migration-cli",
|
|
3
|
-
"version": "2.8.0-rc.
|
|
3
|
+
"version": "2.8.0-rc.3",
|
|
4
4
|
"description": "CLI tool for Tapestry migrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@emotion/react": "^11.14.0",
|
|
35
|
+
"@planningcenter/tapestry": "^2.7.0",
|
|
35
36
|
"@planningcenter/tapestry-react": "^4.11.5",
|
|
36
37
|
"@types/jscodeshift": "^17.3.0",
|
|
37
38
|
"@types/node": "^20.0.0",
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e9dadfc60d6d0b0de13e5b4e531c022746f23833"
|
|
55
56
|
}
|
|
@@ -51,7 +51,7 @@ function Test() {
|
|
|
51
51
|
)
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
it("should
|
|
54
|
+
it("should transform xs to sm", () => {
|
|
55
55
|
const input = `
|
|
56
56
|
import { Checkbox } from "@planningcenter/tapestry-react"
|
|
57
57
|
|
|
@@ -61,8 +61,11 @@ function Test() {
|
|
|
61
61
|
`.trim()
|
|
62
62
|
|
|
63
63
|
const result = applyTransform(input)
|
|
64
|
-
expect(result).toContain('size="
|
|
65
|
-
expect(result).not.toContain("
|
|
64
|
+
expect(result).toContain('size="sm"')
|
|
65
|
+
expect(result).not.toContain('size="xs"')
|
|
66
|
+
expect(result).toContain(
|
|
67
|
+
'TODO: tapestry-migration (size): Size "xs" was mapped to "sm"'
|
|
68
|
+
)
|
|
66
69
|
})
|
|
67
70
|
|
|
68
71
|
it("should not transform supported sizes", () => {
|
|
@@ -74,7 +77,6 @@ function Test() {
|
|
|
74
77
|
<div>
|
|
75
78
|
<Checkbox size="md" label="Medium checkbox" />
|
|
76
79
|
<Checkbox size="sm" label="Small checkbox" />
|
|
77
|
-
<Checkbox size="xs" label="Extra small checkbox" />
|
|
78
80
|
</div>
|
|
79
81
|
)
|
|
80
82
|
}
|
|
@@ -83,7 +85,6 @@ function Test() {
|
|
|
83
85
|
const result = applyTransform(input)
|
|
84
86
|
expect(result).toContain('size="md"')
|
|
85
87
|
expect(result).toContain('size="sm"')
|
|
86
|
-
expect(result).toContain('size="xs"')
|
|
87
88
|
expect(result).not.toContain("TODO: tapestry-migration")
|
|
88
89
|
})
|
|
89
90
|
})
|
|
@@ -139,12 +140,13 @@ function Test() {
|
|
|
139
140
|
|
|
140
141
|
const result = applyTransform(input)
|
|
141
142
|
expect(result).toContain('size="md"')
|
|
142
|
-
expect(result).toContain('size="
|
|
143
|
+
expect(result).toContain('size="sm"')
|
|
143
144
|
expect(result).not.toContain('size="lg"')
|
|
144
145
|
expect(result).not.toContain('size="xl"')
|
|
145
|
-
|
|
146
|
+
expect(result).not.toContain('size="xs"')
|
|
147
|
+
// Should have 3 TODO comments (one for lg->md, one for xl->md, one for xs->sm)
|
|
146
148
|
const todoMatches = result.match(/TODO: tapestry-migration \(size\)/g)
|
|
147
|
-
expect(todoMatches).toHaveLength(
|
|
149
|
+
expect(todoMatches).toHaveLength(3)
|
|
148
150
|
})
|
|
149
151
|
|
|
150
152
|
it("should preserve other props", () => {
|