forked from ricardoemerson/dart-data-class-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.json
331 lines (331 loc) · 9.4 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
{
"name": "dart-safe-data-class",
"displayName": "Dart Safe Data Class Generator",
"description": "Create dart data classes easily, with type safety and no boilerplate or code generation.",
"publisher": "ArthurMiranda",
"version": "0.12.0",
"engines": {
"vscode": "^1.65.0"
},
"repository": {
"type": "git",
"url": "https://github.com/arthurbcd/dart-data-class-tools.git"
},
"icon": "assets/icon.png",
"keywords": [
"dart safe data class generator",
"dart data class generator",
"dart safe data class",
"dart data class",
"dart safe data",
"dart data",
"dart safe",
"dart",
"data safe class generator",
"data class generator"
],
"author": {
"name": "arthurbcd"
},
"categories": [
"Programming Languages",
"Other"
],
"activationEvents": [
"onLanguage:dart",
"onCommand:dart_data_class.generate.from_props",
"onCommand:dart_data_class.generate.from_json"
],
"main": "./src/extension.js",
"contributes": {
"commands": [
{
"title": "Dart Safe Data Class Generator: Generate from class properties",
"command": "dart_data_class.generate.from_props"
},
{
"title": "Dart Safe Data Class Generator: Generate from JSON",
"command": "dart_data_class.generate.from_json"
}
],
"configuration": [
{
"title": "Dart Safe Data Class Generator configuration",
"properties": {
"dart-data-class-generator.custom.argumentError": {
"type": "string",
"default": "throw ArgumentError.value(map[k], k, '$T ← ${map[k].runtimeType}');",
"description": "The error that is thrown on `cast<T>()` invalid argument. Use `k` for key, `map[k]` for value and T for argument Type."
},
"dart-data-class-generator.custom.headerLines": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"// Generated by Dart Safe Data Class Generator. * Change this header on extension settings *",
"// ignore_for_file: type=lint"
],
"description": "Custom header lines to be added at the top of the generated file."
},
"dart-data-class-generator.custom.types": {
"type": "array",
"description": "Custom directives for specific types. Define each type with `type` for the type name, `fromMap` for the fromMap function, and `toMap` for the toMap function.",
"default": [
{
"type": "DateTime",
"fromMap": "DateTime.parse(String)",
"toMap": "toIso8601String()"
},
{
"type": "Color",
"fromMap": "Color(int)",
"toMap": "value"
},
{
"type": "IconData",
"fromMap": "IconData(int)",
"toMap": "codePoint"
},
{
"type": "Timestamp",
"fromMap": "",
"toMap": ""
}
],
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The data type name."
},
"fromMap": {
"type": "string",
"description": "How to convert in fromMap. Ex: DateTime.parse(String)"
},
"toMap": {
"type": "string",
"description": "How to convert in toMap. Ex: toIso8601String()"
}
},
"required": [
"type",
"fromMap",
"toMap"
]
}
},
"dart-data-class-generator.json.enum_format": {
"type": "string",
"enum": [
"byName",
"byIndex"
],
"default": "byName",
"description": "Whether to use parse using Enum.values.byName or Enum.values[index]."
},
"dart-data-class-generator.json.key_format": {
"type": "string",
"enum": [
"variable",
"camelCase",
"snake_case"
],
"default": "variable",
"description": "Whether to use snake_case or camelCase for the json keys."
},
"dart-data-class-generator.json.separate": {
"type": "string",
"enum": [
"ask",
"separate",
"current_file"
],
"default": "ask",
"description": "Whether to separate a JSON into multiple files, when the JSON contains nested objects. ask: choose manually every time, separate: always separate into multiple files, current_file: always insert all classes into the current file."
},
"dart-data-class-generator.strict_numbers": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, `int` and `double` will use isA<int>(...) instead of isA<num>(...).toInt() sintax."
},
"dart-data-class-generator.quick_fixes": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, enables quick fixes to quickly generate data classes or specific methods only."
},
"dart-data-class-generator.fromMap.default_values": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, checks if a field is null when deserializing and provides a non-null default value."
},
"dart-data-class-generator.constructor.default_values": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, generates default values for the constructor."
},
"dart-data-class-generator.constructor.immutable": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, adds @immutable annotation on the generated class. Note: This forces all fields to be final, and all constructor to be const."
},
"dart-data-class-generator.constructor.required": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, generates the required annotation to every constructor parameter. Note: The generator wont generate default values for the constructor if enabled!"
},
"dart-data-class-generator.override.manual": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, asks, when overriding a class (running the command on an existing class), for every single function/constructor that needs to be changed whether the generator should override the function or not. This allows you to preserve custom changes you made to the function/constructor that would be otherwise overwritten by the generator."
},
"dart-data-class-generator.constructor.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a constructor for a data class."
},
"dart-data-class-generator.copyWith.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a copyWith function for a data class."
},
"dart-data-class-generator.toMap.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a toMap function for a data class."
},
"dart-data-class-generator.fromMap.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a fromMap function for a data class."
},
"dart-data-class-generator.toJson.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a toJson function for a data class."
},
"dart-data-class-generator.fromJson.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a fromJson function for a data class."
},
"dart-data-class-generator.toString.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a toString function for a data class."
},
"dart-data-class-generator.equality.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates an override of the == (equals) operator for a data class."
},
"dart-data-class-generator.hashCode.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": true,
"description": "If true, generates a hashCode function for a data class."
},
"dart-data-class-generator.hashCode.use_jenkins": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, uses the Jenkins SMI hash function instead of bitwise operator from dart:ui."
},
"dart-data-class-generator.useEquatable": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, uses equatable for value equality and hashcode."
}
}
}
]
},
"scripts": {
"test": "node ./test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.6",
"@types/node": "^10.12.21",
"@types/vscode": "^1.37.0",
"eslint": "^5.13.0",
"glob": "^7.1.4",
"mocha": "^6.1.4",
"typescript": "^3.3.1",
"vscode-test": "^1.0.2"
},
"dependencies": {
"vsce": "^2.5.1"
}
}