@coze-arch/cli 0.0.1-alpha.ef0249 → 0.0.1-alpha.f11735

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.
@@ -1,4 +1,6 @@
1
1
  const names = require('./names')
2
+ const v5OnlyNames = require('./v5-only-names')
3
+ const v5OnlyNamesSet = new Set(v5OnlyNames)
2
4
 
3
5
  const DEFAULTS = {
4
6
  whitelist: names,
@@ -49,6 +51,10 @@ function getStringLiteralValue(attribute) {
49
51
  return null;
50
52
  }
51
53
 
54
+ const replacements = {
55
+ 'plus-circle': 'circle-plus',
56
+ }
57
+
52
58
  module.exports = {
53
59
  meta: {
54
60
  type: 'problem',
@@ -84,7 +90,7 @@ module.exports = {
84
90
  ],
85
91
  messages: {
86
92
  invalidName:
87
- '{{componentName}} 中不存在图标 {{name}},请更换为其他图标',
93
+ '{{componentName}} 中不存在图标 {{name}},{{suggestion}}',
88
94
  },
89
95
  },
90
96
 
@@ -146,6 +152,7 @@ module.exports = {
146
152
  data: {
147
153
  componentName,
148
154
  name: literal,
155
+ suggestion: getSuggestion(normalized, literal),
149
156
  },
150
157
  });
151
158
  }
@@ -153,3 +160,15 @@ module.exports = {
153
160
  };
154
161
  },
155
162
  };
163
+
164
+ function getSuggestion(name, originalName) {
165
+ if (replacements[name]) {
166
+ return `请更换为 ${replacements[name]}`
167
+ }
168
+
169
+ if (v5OnlyNamesSet.has(name)) {
170
+ return `${originalName} 只能和 FontAwesome5 组件一起使用`
171
+ }
172
+
173
+ return '请更换为其他图标'
174
+ }
@@ -0,0 +1,388 @@
1
+ const v5names = [
2
+ "acquisitions-incorporated",
3
+ "behance-square",
4
+ "dribbble-square",
5
+ "facebook-square",
6
+ "font-awesome-alt",
7
+ "font-awesome-flag",
8
+ "font-awesome-logo-full",
9
+ "git-square",
10
+ "github-square",
11
+ "google-plus-square",
12
+ "hacker-news-square",
13
+ "innosoft",
14
+ "instagram-square",
15
+ "js-square",
16
+ "lastfm-square",
17
+ "medium-m",
18
+ "odnoklassniki-square",
19
+ "penny-arcade",
20
+ "pied-piper-square",
21
+ "pinterest-square",
22
+ "reddit-square",
23
+ "slack-hash",
24
+ "snapchat-ghost",
25
+ "snapchat-square",
26
+ "steam-square",
27
+ "telegram-plane",
28
+ "tripadvisor",
29
+ "tumblr-square",
30
+ "twitter-square",
31
+ "viadeo-square",
32
+ "vimeo-square",
33
+ "whatsapp-square",
34
+ "xing-square",
35
+ "youtube-square",
36
+ "angry",
37
+ "arrow-alt-circle-down",
38
+ "arrow-alt-circle-left",
39
+ "arrow-alt-circle-right",
40
+ "arrow-alt-circle-up",
41
+ "calendar-alt",
42
+ "calendar-times",
43
+ "caret-square-down",
44
+ "caret-square-left",
45
+ "caret-square-right",
46
+ "caret-square-up",
47
+ "check-circle",
48
+ "check-square",
49
+ "comment-alt",
50
+ "dizzy",
51
+ "dot-circle",
52
+ "edit",
53
+ "file-alt",
54
+ "file-archive",
55
+ "flushed",
56
+ "frown-open",
57
+ "frown",
58
+ "grimace",
59
+ "grin-alt",
60
+ "grin-beam-sweat",
61
+ "grin-beam",
62
+ "grin-hearts",
63
+ "grin-squint-tears",
64
+ "grin-squint",
65
+ "grin-stars",
66
+ "grin-tears",
67
+ "grin-tongue-squint",
68
+ "grin-tongue-wink",
69
+ "grin-tongue",
70
+ "grin-wink",
71
+ "grin",
72
+ "hand-paper",
73
+ "hand-rock",
74
+ "hdd",
75
+ "kiss-beam",
76
+ "kiss-wink-heart",
77
+ "kiss",
78
+ "laugh-beam",
79
+ "laugh-squint",
80
+ "laugh-wink",
81
+ "laugh",
82
+ "list-alt",
83
+ "meh-blank",
84
+ "meh-rolling-eyes",
85
+ "meh",
86
+ "minus-square",
87
+ "money-bill-alt",
88
+ "pause-circle",
89
+ "play-circle",
90
+ "plus-square",
91
+ "question-circle",
92
+ "sad-cry",
93
+ "sad-tear",
94
+ "save",
95
+ "share-square",
96
+ "smile-beam",
97
+ "smile-wink",
98
+ "smile",
99
+ "sticky-note",
100
+ "stop-circle",
101
+ "surprise",
102
+ "times-circle",
103
+ "tired",
104
+ "trash-alt",
105
+ "user-circle",
106
+ "window-close",
107
+ "ad",
108
+ "adjust",
109
+ "air-freshener",
110
+ "allergies",
111
+ "ambulance",
112
+ "american-sign-language-interpreting",
113
+ "angle-double-down",
114
+ "angle-double-left",
115
+ "angle-double-right",
116
+ "angle-double-up",
117
+ "apple-alt",
118
+ "archive",
119
+ "arrow-circle-down",
120
+ "arrow-circle-left",
121
+ "arrow-circle-right",
122
+ "arrow-circle-up",
123
+ "arrows-alt-h",
124
+ "arrows-alt-v",
125
+ "arrows-alt",
126
+ "assistive-listening-systems",
127
+ "atlas",
128
+ "backspace",
129
+ "balance-scale-left",
130
+ "balance-scale-right",
131
+ "balance-scale",
132
+ "band-aid",
133
+ "baseball-ball",
134
+ "basketball-ball",
135
+ "beer",
136
+ "bible",
137
+ "biking",
138
+ "birthday-cake",
139
+ "blind",
140
+ "book-dead",
141
+ "book-reader",
142
+ "border-style",
143
+ "boxes",
144
+ "broadcast-tower",
145
+ "burn",
146
+ "bus-alt",
147
+ "car-alt",
148
+ "car-crash",
149
+ "chalkboard-teacher",
150
+ "chevron-circle-down",
151
+ "chevron-circle-left",
152
+ "chevron-circle-right",
153
+ "chevron-circle-up",
154
+ "clinic-medical",
155
+ "cloud-download-alt",
156
+ "cloud-upload-alt",
157
+ "cocktail",
158
+ "coffee",
159
+ "cog",
160
+ "cogs",
161
+ "columns",
162
+ "compress-alt",
163
+ "compress-arrows-alt",
164
+ "concierge-bell",
165
+ "crop-alt",
166
+ "cut",
167
+ "deaf",
168
+ "diagnoses",
169
+ "digital-tachograph",
170
+ "directions",
171
+ "dolly-flatbed",
172
+ "donate",
173
+ "drafting-compass",
174
+ "ellipsis-h",
175
+ "ellipsis-v",
176
+ "envelope-square",
177
+ "exchange-alt",
178
+ "exclamation-circle",
179
+ "exclamation-triangle",
180
+ "expand-alt",
181
+ "expand-arrows-alt",
182
+ "external-link-alt",
183
+ "external-link-square-alt",
184
+ "fast-backward",
185
+ "fast-forward",
186
+ "feather-alt",
187
+ "female",
188
+ "fighter-jet",
189
+ "file-download",
190
+ "file-medical-alt",
191
+ "file-upload",
192
+ "fire-alt",
193
+ "first-aid",
194
+ "fist-raised",
195
+ "football-ball",
196
+ "funnel-dollar",
197
+ "glass-cheers",
198
+ "glass-martini-alt",
199
+ "glass-martini",
200
+ "glass-whiskey",
201
+ "globe-africa",
202
+ "globe-americas",
203
+ "globe-asia",
204
+ "globe-europe",
205
+ "golf-ball",
206
+ "grip-horizontal",
207
+ "h-square",
208
+ "hamburger",
209
+ "hand-holding-usd",
210
+ "hand-holding-water",
211
+ "hands-helping",
212
+ "hands-wash",
213
+ "handshake-alt-slash",
214
+ "hard-hat",
215
+ "headphones-alt",
216
+ "heart-broken",
217
+ "heartbeat",
218
+ "hiking",
219
+ "history",
220
+ "home",
221
+ "hospital-alt",
222
+ "hospital-symbol",
223
+ "hot-tub",
224
+ "house-damage",
225
+ "hryvnia",
226
+ "id-card-alt",
227
+ "info-circle",
228
+ "journal-whills",
229
+ "laptop-house",
230
+ "level-down-alt",
231
+ "level-up-alt",
232
+ "long-arrow-alt-down",
233
+ "long-arrow-alt-left",
234
+ "long-arrow-alt-right",
235
+ "long-arrow-alt-up",
236
+ "low-vision",
237
+ "luggage-cart",
238
+ "magic",
239
+ "mail-bulk",
240
+ "male",
241
+ "map-marked-alt",
242
+ "map-marked",
243
+ "map-marker-alt",
244
+ "map-marker",
245
+ "map-signs",
246
+ "mars-stroke-h",
247
+ "mars-stroke-v",
248
+ "medkit",
249
+ "microphone-alt-slash",
250
+ "microphone-alt",
251
+ "minus-circle",
252
+ "mobile-alt",
253
+ "money-bill-wave-alt",
254
+ "money-check-alt",
255
+ "mouse-pointer",
256
+ "mouse",
257
+ "paint-brush",
258
+ "parking",
259
+ "pastafarianism",
260
+ "pen-alt",
261
+ "pen-square",
262
+ "pencil-alt",
263
+ "pencil-ruler",
264
+ "people-carry",
265
+ "percentage",
266
+ "phone-alt",
267
+ "phone-square-alt",
268
+ "phone-square",
269
+ "photo-video",
270
+ "plus-circle",
271
+ "poll-h",
272
+ "poll",
273
+ "portrait",
274
+ "pound-sign",
275
+ "pray",
276
+ "praying-hands",
277
+ "prescription-bottle-alt",
278
+ "procedures",
279
+ "project-diagram",
280
+ "quidditch",
281
+ "quran",
282
+ "radiation-alt",
283
+ "random",
284
+ "redo-alt",
285
+ "redo",
286
+ "remove-format",
287
+ "rss-square",
288
+ "running",
289
+ "search-dollar",
290
+ "search-location",
291
+ "search-minus",
292
+ "search-plus",
293
+ "search",
294
+ "share-alt-square",
295
+ "share-alt",
296
+ "shield-alt",
297
+ "shipping-fast",
298
+ "shopping-bag",
299
+ "shopping-basket",
300
+ "shopping-cart",
301
+ "shuttle-van",
302
+ "sign-in-alt",
303
+ "sign-language",
304
+ "sign-out-alt",
305
+ "sign",
306
+ "skating",
307
+ "skiing-nordic",
308
+ "skiing",
309
+ "sliders-h",
310
+ "smoking-ban",
311
+ "sms",
312
+ "snowboarding",
313
+ "sort-alpha-down-alt",
314
+ "sort-alpha-down",
315
+ "sort-alpha-up-alt",
316
+ "sort-alpha-up",
317
+ "sort-amount-down-alt",
318
+ "sort-amount-down",
319
+ "sort-amount-up-alt",
320
+ "sort-amount-up",
321
+ "sort-numeric-down-alt",
322
+ "sort-numeric-down",
323
+ "sort-numeric-up-alt",
324
+ "sort-numeric-up",
325
+ "space-shuttle",
326
+ "square-root-alt",
327
+ "star-half-alt",
328
+ "step-backward",
329
+ "step-forward",
330
+ "store-alt-slash",
331
+ "store-alt",
332
+ "stream",
333
+ "subway",
334
+ "swimmer",
335
+ "swimming-pool",
336
+ "sync-alt",
337
+ "sync",
338
+ "table-tennis",
339
+ "tablet-alt",
340
+ "tachometer-alt",
341
+ "tasks",
342
+ "tenge",
343
+ "th-large",
344
+ "th-list",
345
+ "th",
346
+ "theater-masks",
347
+ "thermometer-empty",
348
+ "thermometer-full",
349
+ "thermometer-half",
350
+ "thermometer-quarter",
351
+ "thermometer-three-quarters",
352
+ "ticket-alt",
353
+ "times",
354
+ "tint-slash",
355
+ "tint",
356
+ "tools",
357
+ "torah",
358
+ "tram",
359
+ "transgender-alt",
360
+ "trash-restore-alt",
361
+ "trash-restore",
362
+ "truck-loading",
363
+ "tshirt",
364
+ "undo-alt",
365
+ "undo",
366
+ "university",
367
+ "unlink",
368
+ "unlock-alt",
369
+ "user-alt-slash",
370
+ "user-alt",
371
+ "user-cog",
372
+ "user-edit",
373
+ "user-friends",
374
+ "user-md",
375
+ "user-times",
376
+ "users-cog",
377
+ "utensil-spoon",
378
+ "volleyball-ball",
379
+ "volume-down",
380
+ "volume-mute",
381
+ "volume-up",
382
+ "vote-yea",
383
+ "walking",
384
+ "weight",
385
+ "wine-glass-alt"
386
+ ]
387
+
388
+ module.exports = v5names
@@ -0,0 +1,9 @@
1
+ const banMixUse = require('./rule')
2
+
3
+ const plugin = {
4
+ rules: {
5
+ 'ban-mix-use': banMixUse,
6
+ },
7
+ };
8
+
9
+ module.exports = plugin
@@ -0,0 +1,88 @@
1
+ module.exports = {
2
+ meta: {
3
+ type: 'problem',
4
+ docs: {
5
+ description:
6
+ 'Disallow passing useAnimatedScrollHandler return value to ScrollView',
7
+ recommended: 'error',
8
+ },
9
+ schema: [],
10
+ messages: {
11
+ noUseAnimatedScrollHandlerOnScroll:
12
+ 'Do not pass useAnimatedScrollHandler return value to ScrollView, pass to Animated.ScrollView instead.',
13
+ },
14
+ },
15
+
16
+ create(context) {
17
+ // 记录 useAnimatedScrollHandler 的本地名字
18
+ let useAnimatedScrollHandlerImportName = null;
19
+ // 记录 ScrollView 的本地名字
20
+ let scrollViewImportName = null;
21
+ // 记录调用 useAnimatedScrollHandler 返回值的变量名
22
+ const animatedScrollHandlerVars = new Set();
23
+
24
+ return {
25
+ ImportDeclaration(node) {
26
+ if (node.source.value === 'react-native-reanimated') {
27
+ for (const specifier of node.specifiers) {
28
+ if (
29
+ specifier.type === 'ImportSpecifier' &&
30
+ specifier.imported.name === 'useAnimatedScrollHandler'
31
+ ) {
32
+ useAnimatedScrollHandlerImportName = specifier.local.name;
33
+ }
34
+ }
35
+ }
36
+
37
+ if (node.source.value === 'react-native') {
38
+ for (const specifier of node.specifiers) {
39
+ if (
40
+ specifier.type === 'ImportSpecifier' &&
41
+ specifier.imported.name === 'ScrollView'
42
+ ) {
43
+ scrollViewImportName = specifier.local.name;
44
+ }
45
+ }
46
+ }
47
+ },
48
+
49
+ VariableDeclarator(node) {
50
+ if (
51
+ node.init &&
52
+ node.init.type === 'CallExpression' &&
53
+ node.init.callee.type === 'Identifier' &&
54
+ node.init.callee.name === useAnimatedScrollHandlerImportName
55
+ ) {
56
+ if (node.id.type === 'Identifier') {
57
+ animatedScrollHandlerVars.add(node.id.name);
58
+ }
59
+ }
60
+ },
61
+
62
+ JSXOpeningElement(node) {
63
+ if (
64
+ node.name.type === 'JSXIdentifier' &&
65
+ node.name.name === scrollViewImportName
66
+ ) {
67
+ for (const attr of node.attributes) {
68
+ if (
69
+ attr.type === 'JSXAttribute' &&
70
+ attr.name.name === 'onScroll' &&
71
+ attr.value &&
72
+ attr.value.type === 'JSXExpressionContainer' &&
73
+ attr.value.expression.type === 'Identifier'
74
+ ) {
75
+ const varName = attr.value.expression.name;
76
+ if (animatedScrollHandlerVars.has(varName)) {
77
+ context.report({
78
+ node: attr,
79
+ messageId: 'noUseAnimatedScrollHandlerOnScroll',
80
+ });
81
+ }
82
+ }
83
+ }
84
+ }
85
+ },
86
+ };
87
+ },
88
+ };
@@ -0,0 +1,15 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "next/babel",
5
+ {
6
+ "preset-react": {
7
+ "development": true
8
+ }
9
+ }
10
+ ]
11
+ ],
12
+ "plugins": [
13
+ "@react-dev-inspector/babel-plugin"
14
+ ]
15
+ }
@@ -67,6 +67,8 @@
67
67
  "zod": "^4.3.5"
68
68
  },
69
69
  "devDependencies": {
70
+ "@react-dev-inspector/babel-plugin": "^2.0.1",
71
+ "@react-dev-inspector/middleware": "^2.0.1",
70
72
  "@tailwindcss/postcss": "^4",
71
73
  "@types/node": "^20",
72
74
  "@types/pg": "^8.16.0",
@@ -75,6 +77,7 @@
75
77
  "eslint": "^9",
76
78
  "eslint-config-next": "16.1.1",
77
79
  "only-allow": "^1.2.2",
80
+ "react-dev-inspector": "^2.0.1",
78
81
  "shadcn": "latest",
79
82
  "tailwindcss": "^4",
80
83
  "typescript": "^5"