@lowdefy/codemods 0.0.0-experimental-20260318092212
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/LICENSE +201 -0
- package/package.json +20 -0
- package/registry.json +111 -0
- package/v5-0-0/01-rename-areas-to-slots.md +56 -0
- package/v5-0-0/02-migrate-properties-style.md +103 -0
- package/v5-0-0/03-migrate-inline-style-props.md +109 -0
- package/v5-0-0/04-bordered-to-variant.md +73 -0
- package/v5-0-0/05-simple-prop-renames.md +127 -0
- package/v5-0-0/06-tabs-position-to-placement.md +85 -0
- package/v5-0-0/07-notification-message-to-title.md +83 -0
- package/v5-0-0/08-divider-dual-rename.md +108 -0
- package/v5-0-0/09-button-type-to-color-variant.md +131 -0
- package/v5-0-0/10-detect-styles-less.md +105 -0
- package/v5-0-0/11-detect-date-formats.md +78 -0
- package/v5-0-0/12-migrate-meta-styles.md +149 -0
- package/v5-0-0/13-rename-xxl-to-2xl.md +39 -0
- package/v5-0-0/14-rename-gutter-to-gap.md +78 -0
- package/v5-0-0/15-rename-content-prefix.md +67 -0
- package/v5-0-0/16-rename-align-to-selfAlign.md +44 -0
- package/v5-0-0/17-rename-moment-to-dayjs.md +41 -0
- package/v5-0-0/18-report-thresholds-usage.md +37 -0
- package/v5-0-0/19-responsive-style-breakpoints.md +121 -0
- package/v5-0-0/20-comment-block-removal.md +229 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lowdefy/codemods",
|
|
3
|
+
"version": "0.0.0-experimental-20260318092212",
|
|
4
|
+
"description": "Codemod scripts and migration prompts for Lowdefy version upgrades",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/lowdefy/lowdefy.git",
|
|
9
|
+
"directory": "packages/codemods"
|
|
10
|
+
},
|
|
11
|
+
"main": "registry.json",
|
|
12
|
+
"files": [
|
|
13
|
+
"registry.json",
|
|
14
|
+
"v*/"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {}
|
|
20
|
+
}
|
package/registry.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"versions": [
|
|
3
|
+
{
|
|
4
|
+
"version": "5.0.0",
|
|
5
|
+
"from": ">=4.0.0 <5.0.0",
|
|
6
|
+
"description": "Antd v6 upgrade, layout grid changes, dayjs migration",
|
|
7
|
+
"codemods": [
|
|
8
|
+
{
|
|
9
|
+
"id": "rename-areas-to-slots",
|
|
10
|
+
"description": "Rename areas to slots",
|
|
11
|
+
"path": "v5-0-0/01-rename-areas-to-slots.md"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "migrate-properties-style",
|
|
15
|
+
"description": "Move properties.style to style: { /element }",
|
|
16
|
+
"path": "v5-0-0/02-migrate-properties-style.md"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "migrate-inline-style-props",
|
|
20
|
+
"description": "Move inline style props to style: { /* } sub-slots",
|
|
21
|
+
"path": "v5-0-0/03-migrate-inline-style-props.md"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "bordered-to-variant",
|
|
25
|
+
"description": "Convert bordered: false to variant: borderless",
|
|
26
|
+
"path": "v5-0-0/04-bordered-to-variant.md"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "simple-prop-renames",
|
|
30
|
+
"description": "Rename deprecated properties and events (visible, dotPosition, etc.)",
|
|
31
|
+
"path": "v5-0-0/05-simple-prop-renames.md"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "tabs-position-to-placement",
|
|
35
|
+
"description": "Tabs tabPosition to tabPlacement with value mapping",
|
|
36
|
+
"path": "v5-0-0/06-tabs-position-to-placement.md"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "notification-message-to-title",
|
|
40
|
+
"description": "Notification message property renamed to title",
|
|
41
|
+
"path": "v5-0-0/07-notification-message-to-title.md"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "divider-dual-rename",
|
|
45
|
+
"description": "Divider type/orientation dual rename with value mapping",
|
|
46
|
+
"path": "v5-0-0/08-divider-dual-rename.md"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "button-type-to-color-variant",
|
|
50
|
+
"description": "Button type/danger to color + variant mapping",
|
|
51
|
+
"path": "v5-0-0/09-button-type-to-color-variant.md"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "detect-styles-less",
|
|
55
|
+
"description": "Detect public/styles.less and map Less variables to antd tokens",
|
|
56
|
+
"path": "v5-0-0/10-detect-styles-less.md"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "detect-date-formats",
|
|
60
|
+
"description": "Detect custom date format strings for dayjs compatibility",
|
|
61
|
+
"path": "v5-0-0/11-detect-date-formats.md"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "migrate-meta-styles",
|
|
65
|
+
"description": "Remove meta.styles from custom block plugins, add direct CSS imports",
|
|
66
|
+
"path": "v5-0-0/12-migrate-meta-styles.md"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "rename-xxl-to-2xl",
|
|
70
|
+
"description": "Rename xxl breakpoint key to 2xl",
|
|
71
|
+
"path": "v5-0-0/13-rename-xxl-to-2xl.md"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "rename-gutter-to-gap",
|
|
75
|
+
"description": "Rename gutter to gap and contentGutter to contentGap",
|
|
76
|
+
"path": "v5-0-0/14-rename-gutter-to-gap.md"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "rename-content-prefix",
|
|
80
|
+
"description": "Drop content* prefix from layout properties",
|
|
81
|
+
"path": "v5-0-0/15-rename-content-prefix.md"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "rename-align-to-selfAlign",
|
|
85
|
+
"description": "Rename layout.align to layout.selfAlign",
|
|
86
|
+
"path": "v5-0-0/16-rename-align-to-selfAlign.md"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "rename-moment-to-dayjs",
|
|
90
|
+
"description": "Rename _moment operator to _dayjs",
|
|
91
|
+
"path": "v5-0-0/17-rename-moment-to-dayjs.md"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "report-thresholds-usage",
|
|
95
|
+
"description": "Report thresholds usage in _dayjs.humanizeDuration",
|
|
96
|
+
"path": "v5-0-0/18-report-thresholds-usage.md"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "responsive-style-breakpoints",
|
|
100
|
+
"description": "Migrate responsive style breakpoints to Tailwind classes",
|
|
101
|
+
"path": "v5-0-0/19-responsive-style-breakpoints.md"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "comment-block-removal",
|
|
105
|
+
"description": "Replace removed Comment block with Flex + Avatar + Paragraph composition",
|
|
106
|
+
"path": "v5-0-0/20-comment-block-removal.md"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Migration: Rename `areas` → `slots`
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
The `areas` key on container blocks is renamed to `slots` in Lowdefy v4.8. Both names work during the deprecation period, but `slots` is the canonical name going forward.
|
|
6
|
+
|
|
7
|
+
## What to Do
|
|
8
|
+
|
|
9
|
+
In all YAML files, rename `areas:` keys on blocks to `slots:`. This is a direct key rename — the structure underneath stays identical.
|
|
10
|
+
|
|
11
|
+
## Files to Check
|
|
12
|
+
|
|
13
|
+
Glob: `**/*.{yaml,yml}`
|
|
14
|
+
Grep: `areas:`
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
### Before
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
- id: my_card
|
|
22
|
+
type: Card
|
|
23
|
+
areas:
|
|
24
|
+
content:
|
|
25
|
+
blocks:
|
|
26
|
+
- id: title
|
|
27
|
+
type: Title
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### After
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
- id: my_card
|
|
34
|
+
type: Card
|
|
35
|
+
slots:
|
|
36
|
+
content:
|
|
37
|
+
blocks:
|
|
38
|
+
- id: title
|
|
39
|
+
type: Title
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Edge Cases
|
|
43
|
+
|
|
44
|
+
- Only rename `areas:` that are direct children of a block (at the same indent level as `type:`, `properties:`, `events:`, etc.)
|
|
45
|
+
- Do not rename `areas` inside string values, operator expressions, `_ref` paths, or markdown/code blocks
|
|
46
|
+
- Do not rename `areas` that appear as a property value (e.g., `name: areas`) — only YAML keys
|
|
47
|
+
|
|
48
|
+
## Verification
|
|
49
|
+
|
|
50
|
+
After applying, grep for remaining `areas:` keys at block level:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
grep -rn '^\s*areas:' --include='*.yaml' --include='*.yml' .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
All matches should be zero (or only inside code blocks / string content).
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Migration: Move `properties.style` → `style: { /element }`
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
In the old system, inline styles on a block's root element lived under `properties.style`. In Lowdefy v4.8, all styling moves to a top-level `style:` block with `/`-prefixed slot keys. The root element slot is `/element`.
|
|
6
|
+
|
|
7
|
+
The build auto-normalizes `properties.style` with a deprecation warning, but migrating now produces cleaner configs.
|
|
8
|
+
|
|
9
|
+
## What to Do
|
|
10
|
+
|
|
11
|
+
For each block that has a `style:` key under `properties:`:
|
|
12
|
+
|
|
13
|
+
1. Remove the `style:` entry from `properties:`
|
|
14
|
+
2. Add a sibling `style:` block (at the same level as `properties:`) with the content nested under `/element:`
|
|
15
|
+
|
|
16
|
+
If the block already has a top-level `style:` block, merge the `/element` entry into it.
|
|
17
|
+
|
|
18
|
+
## Files to Check
|
|
19
|
+
|
|
20
|
+
Glob: `**/*.{yaml,yml}`
|
|
21
|
+
Grep: `properties:` then check for `style:` child
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
### Before — single-line style
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
- id: header
|
|
29
|
+
type: Box
|
|
30
|
+
properties:
|
|
31
|
+
style:
|
|
32
|
+
backgroundColor: '#f0f0f0'
|
|
33
|
+
padding: 16
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### After
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- id: header
|
|
40
|
+
type: Box
|
|
41
|
+
style:
|
|
42
|
+
/element:
|
|
43
|
+
backgroundColor: '#f0f0f0'
|
|
44
|
+
padding: 16
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Before — inline object style
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
- id: divider
|
|
51
|
+
type: Divider
|
|
52
|
+
properties:
|
|
53
|
+
style: { marginTop: 24, marginBottom: 24 }
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### After
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- id: divider
|
|
60
|
+
type: Divider
|
|
61
|
+
style:
|
|
62
|
+
/element: { marginTop: 24, marginBottom: 24 }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Before — block with other properties
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
- id: card
|
|
69
|
+
type: Card
|
|
70
|
+
properties:
|
|
71
|
+
title: My Card
|
|
72
|
+
style:
|
|
73
|
+
borderRadius: 8
|
|
74
|
+
bordered: true
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### After
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
- id: card
|
|
81
|
+
type: Card
|
|
82
|
+
properties:
|
|
83
|
+
title: My Card
|
|
84
|
+
bordered: true
|
|
85
|
+
style:
|
|
86
|
+
/element:
|
|
87
|
+
borderRadius: 8
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Edge Cases
|
|
91
|
+
|
|
92
|
+
- Do not move `style:` keys that are already at the block top level (not under `properties:`)
|
|
93
|
+
- If a block already has a top-level `style:` with other `/` slots, add `/element` to it rather than creating a duplicate `style:` block
|
|
94
|
+
- Do not touch `style:` inside markdown code blocks, string values, or `_ref` content
|
|
95
|
+
- Operator expressions inside `style:` (like `_if`, `_state`) should be moved as-is
|
|
96
|
+
|
|
97
|
+
## Verification
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
grep -rn 'properties:' --include='*.yaml' --include='*.yml' . -A 5 | grep 'style:'
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
No `style:` should appear as a child of `properties:` after migration.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Migration: Move Block-Specific Style Properties to `style: { /* }` Sub-Slots
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
Several blocks had dedicated style properties under `properties:` (like `headerStyle`, `bodyStyle`, `maskStyle`). These move to the unified `style:` block with `/`-prefixed slot keys.
|
|
6
|
+
|
|
7
|
+
## What to Do
|
|
8
|
+
|
|
9
|
+
For each block, find the old style property under `properties:` and move its value to the corresponding `style: { /slot }` entry. Remove the old property from `properties:`.
|
|
10
|
+
|
|
11
|
+
**Full mapping table:**
|
|
12
|
+
|
|
13
|
+
| Block | Old Property | New Location |
|
|
14
|
+
| ------------ | -------------------------------- | --------------------- |
|
|
15
|
+
| Card | `properties.headerStyle` | `style: { /header }` |
|
|
16
|
+
| Card | `properties.bodyStyle` | `style: { /body }` |
|
|
17
|
+
| Modal | `properties.bodyStyle` | `style: { /body }` |
|
|
18
|
+
| Modal | `properties.maskStyle` | `style: { /mask }` |
|
|
19
|
+
| Drawer | `properties.drawerStyle` | `style: { /wrapper }` |
|
|
20
|
+
| Drawer | `properties.headerStyle` | `style: { /header }` |
|
|
21
|
+
| Drawer | `properties.bodyStyle` | `style: { /body }` |
|
|
22
|
+
| Drawer | `properties.maskStyle` | `style: { /mask }` |
|
|
23
|
+
| Drawer | `properties.contentWrapperStyle` | `style: { /content }` |
|
|
24
|
+
| Tabs | `properties.tabBarStyle` | `style: { /tabBar }` |
|
|
25
|
+
| ConfirmModal | `properties.bodyStyle` | `style: { /body }` |
|
|
26
|
+
| Statistic | `properties.valueStyle` | `style: { /value }` |
|
|
27
|
+
| Descriptions | `properties.contentStyle` | `style: { /content }` |
|
|
28
|
+
| Descriptions | `properties.labelStyle` | `style: { /label }` |
|
|
29
|
+
| Tooltip | `properties.overlayStyle` | `style: { /inner }` |
|
|
30
|
+
|
|
31
|
+
## Files to Check
|
|
32
|
+
|
|
33
|
+
Glob: `**/*.{yaml,yml}`
|
|
34
|
+
Grep: `headerStyle:|bodyStyle:|maskStyle:|drawerStyle:|contentWrapperStyle:|tabBarStyle:|valueStyle:|contentStyle:|labelStyle:|overlayStyle:`
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
### Before
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
- id: my_card
|
|
42
|
+
type: Card
|
|
43
|
+
properties:
|
|
44
|
+
title: Details
|
|
45
|
+
headerStyle:
|
|
46
|
+
backgroundColor: '#fafafa'
|
|
47
|
+
bodyStyle:
|
|
48
|
+
padding: 24
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### After
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- id: my_card
|
|
55
|
+
type: Card
|
|
56
|
+
properties:
|
|
57
|
+
title: Details
|
|
58
|
+
style:
|
|
59
|
+
/header:
|
|
60
|
+
backgroundColor: '#fafafa'
|
|
61
|
+
/body:
|
|
62
|
+
padding: 24
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Before — Drawer with multiple style props
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
- id: settings_drawer
|
|
69
|
+
type: Drawer
|
|
70
|
+
properties:
|
|
71
|
+
title: Settings
|
|
72
|
+
drawerStyle:
|
|
73
|
+
backgroundColor: '#f5f5f5'
|
|
74
|
+
headerStyle:
|
|
75
|
+
borderBottom: '1px solid #e8e8e8'
|
|
76
|
+
bodyStyle:
|
|
77
|
+
padding: 16
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### After
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
- id: settings_drawer
|
|
84
|
+
type: Drawer
|
|
85
|
+
properties:
|
|
86
|
+
title: Settings
|
|
87
|
+
style:
|
|
88
|
+
/wrapper:
|
|
89
|
+
backgroundColor: '#f5f5f5'
|
|
90
|
+
/header:
|
|
91
|
+
borderBottom: '1px solid #e8e8e8'
|
|
92
|
+
/body:
|
|
93
|
+
padding: 16
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Edge Cases
|
|
97
|
+
|
|
98
|
+
- If the block already has a top-level `style:` block, merge the new `/slot` entries into it
|
|
99
|
+
- If a block already has `style: { /element }` from prompt 02, add the new slots alongside it
|
|
100
|
+
- These property names are unique to their respective blocks — `headerStyle` only appears on Card and Drawer, so block-type checking is optional but recommended for safety
|
|
101
|
+
- Operator expressions inside style values should be moved as-is
|
|
102
|
+
|
|
103
|
+
## Verification
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
grep -rn 'headerStyle:\|bodyStyle:\|maskStyle:\|drawerStyle:\|contentWrapperStyle:\|tabBarStyle:\|valueStyle:\|contentStyle:\|labelStyle:\|overlayStyle:' --include='*.yaml' --include='*.yml' .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
No matches should remain after migration (except inside code blocks or string content).
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Migration: Convert `bordered` → `variant`
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
The boolean `bordered` property on input blocks and containers is replaced by a `variant` enum in antd v6. `bordered: false` becomes `variant: borderless`. `bordered: true` is the default and can be removed.
|
|
6
|
+
|
|
7
|
+
**Affected blocks:** AutoComplete, Card, Collapse, DateRangeSelector, DateSelector, DateTimeSelector, Descriptions, MonthSelector, MultipleSelector, NumberInput, PasswordInput, PhoneNumberInput, Selector, TextArea, TextInput, WeekSelector.
|
|
8
|
+
|
|
9
|
+
## What to Do
|
|
10
|
+
|
|
11
|
+
1. Replace `bordered: false` with `variant: borderless`
|
|
12
|
+
2. Remove `bordered: true` entirely (it's the default)
|
|
13
|
+
|
|
14
|
+
## Files to Check
|
|
15
|
+
|
|
16
|
+
Glob: `**/*.{yaml,yml}`
|
|
17
|
+
Grep: `bordered:`
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### Before
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
- id: search_input
|
|
25
|
+
type: TextInput
|
|
26
|
+
properties:
|
|
27
|
+
bordered: false
|
|
28
|
+
placeholder: Search...
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### After
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
- id: search_input
|
|
35
|
+
type: TextInput
|
|
36
|
+
properties:
|
|
37
|
+
variant: borderless
|
|
38
|
+
placeholder: Search...
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Before — bordered: true (remove)
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
- id: details_card
|
|
45
|
+
type: Card
|
|
46
|
+
properties:
|
|
47
|
+
bordered: true
|
|
48
|
+
title: Details
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### After
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- id: details_card
|
|
55
|
+
type: Card
|
|
56
|
+
properties:
|
|
57
|
+
title: Details
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Edge Cases
|
|
61
|
+
|
|
62
|
+
- Match `bordered: false`, `bordered: "false"`, and `bordered: 'false'` — all become `variant: borderless`
|
|
63
|
+
- Match `bordered: true`, `bordered: "true"`, and `bordered: 'true'` — all are removed
|
|
64
|
+
- Do not change `bordered` that uses an operator expression (e.g., `bordered: { _state: showBorder }`) — flag these for manual review. The replacement would be `variant: { _if: { ... } }` mapping to `"borderless"` or `"outlined"`
|
|
65
|
+
- Do not modify `bordered` inside code blocks or string content
|
|
66
|
+
|
|
67
|
+
## Verification
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
grep -rn 'bordered:' --include='*.yaml' --include='*.yml' .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Only operator-expression uses should remain (flagged for manual review).
|