agent-flutter 0.1.5 → 0.1.7
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/README.md +2 -1
- package/package.json +1 -1
- package/src/cli.js +68 -4
- package/templates/shared/scripts/bootstrap_flutter_template.sh +3 -0
- package/templates/shared/spec/model-registry.md +60 -0
- package/templates/shared/spec/ui-workflow.md +731 -0
- package/templates/shared/tool/generate_model_registry.dart +111 -0
- package/templates/shared/tool/generate_ui_workflow_spec.dart +173 -0
- package/templates/shared/tool/update_specs.dart +40 -0
- package/templates/shared/tools/jsx2flutter/convert.mjs +318 -0
- package/templates/shared/tools/jsx2flutter/icons_map.json +16 -0
- package/templates/shared/tools/jsx2flutter/jsx2flutter.mjs +1997 -0
- package/templates/shared/tools/jsx2flutter/package-lock.json +288 -0
- package/templates/shared/tools/jsx2flutter/package.json +19 -0
- package/templates/shared/vscode/tasks.json +121 -0
package/README.md
CHANGED
|
@@ -70,8 +70,9 @@ npm run release:major
|
|
|
70
70
|
|
|
71
71
|
## Installed files
|
|
72
72
|
|
|
73
|
+
- Workspace utilities: `spec/`, `tool/`, `tools/`, `.vscode/tasks.json`
|
|
73
74
|
- Trae: `.trae/` (skills/rules/scripts)
|
|
74
|
-
- Codex: `.codex/` + `AGENTS.md`
|
|
75
|
+
- Codex: `.codex/` (skills/rules/scripts) + `AGENTS.md`
|
|
75
76
|
- Cursor: `.cursor/skills/`, `.cursor/rules/shared/`, `.cursor/scripts/`, `.cursor/rules/agent-flutter.mdc`
|
|
76
77
|
- Windsurf: `.windsurf/skills/`, `.windsurf/rules/shared/`, `.windsurf/scripts/`, `.windsurf/rules/agent-flutter.md`
|
|
77
78
|
- Cline: `.clinerules/skills/`, `.clinerules/rules/`, `.clinerules/scripts/`, `.clinerules/agent-flutter.md`
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -142,6 +142,7 @@ async function applyPack({
|
|
|
142
142
|
mode,
|
|
143
143
|
}) {
|
|
144
144
|
const verb = mode === 'sync' ? 'Synced' : 'Installed';
|
|
145
|
+
const sharedUtilityDirs = ['spec', 'tool', 'tools'];
|
|
145
146
|
const syncDirectory = async ({ sourceDir, destinationDir, label }) => {
|
|
146
147
|
if ((await exists(destinationDir)) && !force) {
|
|
147
148
|
console.log(`Skipped ${label} (exists): ${destinationDir}`);
|
|
@@ -155,13 +156,77 @@ async function applyPack({
|
|
|
155
156
|
});
|
|
156
157
|
console.log(`${verb} ${label}: ${destinationDir}`);
|
|
157
158
|
};
|
|
159
|
+
const syncTemplateFile = async ({ sourcePath, destinationPath, label }) => {
|
|
160
|
+
if ((await exists(destinationPath)) && !force) {
|
|
161
|
+
console.log(`Skipped ${label} (exists): ${destinationPath}`);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
await fs.mkdir(path.dirname(destinationPath), { recursive: true });
|
|
165
|
+
if (isTextFile(path.basename(sourcePath))) {
|
|
166
|
+
const raw = await fs.readFile(sourcePath, 'utf8');
|
|
167
|
+
const transformed = replaceProjectPlaceholders(raw, projectRoot);
|
|
168
|
+
await fs.writeFile(destinationPath, transformed, 'utf8');
|
|
169
|
+
} else {
|
|
170
|
+
await fs.copyFile(sourcePath, destinationPath);
|
|
171
|
+
}
|
|
172
|
+
await copyFileMode(sourcePath, destinationPath);
|
|
173
|
+
console.log(`${verb} ${label}: ${destinationPath}`);
|
|
174
|
+
};
|
|
175
|
+
const syncWorkspaceUtilities = async () => {
|
|
176
|
+
for (const dirName of sharedUtilityDirs) {
|
|
177
|
+
await syncDirectory({
|
|
178
|
+
sourceDir: path.join(templateRoot, dirName),
|
|
179
|
+
destinationDir: path.join(projectRoot, dirName),
|
|
180
|
+
label: `Workspace ${dirName}`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const syncWorkspaceVscodeTasks = async () => {
|
|
185
|
+
const sourcePath = path.join(templateRoot, 'vscode', 'tasks.json');
|
|
186
|
+
if (!(await exists(sourcePath))) return;
|
|
187
|
+
const raw = await fs.readFile(sourcePath, 'utf8');
|
|
188
|
+
const transformed = replaceProjectPlaceholders(raw, projectRoot);
|
|
189
|
+
const targetPath = path.join(projectRoot, '.vscode', 'tasks.json');
|
|
190
|
+
const written = await writeTextFile(
|
|
191
|
+
targetPath,
|
|
192
|
+
transformed,
|
|
193
|
+
{ force },
|
|
194
|
+
);
|
|
195
|
+
console.log(
|
|
196
|
+
written
|
|
197
|
+
? `${verb} Workspace VS Code tasks: ${targetPath}`
|
|
198
|
+
: `Skipped Workspace VS Code tasks (exists): ${targetPath}`,
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
await syncWorkspaceUtilities();
|
|
202
|
+
await syncWorkspaceVscodeTasks();
|
|
158
203
|
|
|
159
204
|
if (ideTargets.has('trae')) {
|
|
160
205
|
const traeTarget = path.join(projectRoot, '.trae');
|
|
161
206
|
await syncDirectory({
|
|
162
|
-
sourceDir: templateRoot,
|
|
163
|
-
destinationDir: traeTarget,
|
|
164
|
-
label: 'Trae
|
|
207
|
+
sourceDir: path.join(templateRoot, 'skills'),
|
|
208
|
+
destinationDir: path.join(traeTarget, 'skills'),
|
|
209
|
+
label: 'Trae skills',
|
|
210
|
+
});
|
|
211
|
+
await syncDirectory({
|
|
212
|
+
sourceDir: path.join(templateRoot, 'scripts'),
|
|
213
|
+
destinationDir: path.join(traeTarget, 'scripts'),
|
|
214
|
+
label: 'Trae scripts',
|
|
215
|
+
});
|
|
216
|
+
await syncDirectory({
|
|
217
|
+
sourceDir: path.join(templateRoot, 'rules'),
|
|
218
|
+
destinationDir: path.join(traeTarget, 'rules'),
|
|
219
|
+
label: 'Trae rules',
|
|
220
|
+
});
|
|
221
|
+
await syncTemplateFile({
|
|
222
|
+
sourcePath: path.join(templateRoot, '.ignore'),
|
|
223
|
+
destinationPath: path.join(traeTarget, '.ignore'),
|
|
224
|
+
label: 'Trae ignore',
|
|
225
|
+
});
|
|
226
|
+
await syncTemplateFile({
|
|
227
|
+
sourcePath: path.join(templateRoot, 'TEMPLATES.md'),
|
|
228
|
+
destinationPath: path.join(traeTarget, 'TEMPLATES.md'),
|
|
229
|
+
label: 'Trae templates',
|
|
165
230
|
});
|
|
166
231
|
}
|
|
167
232
|
|
|
@@ -334,7 +399,6 @@ async function applyPack({
|
|
|
334
399
|
});
|
|
335
400
|
console.log(`${verb} GitHub rules: ${githubRulesPath}`);
|
|
336
401
|
}
|
|
337
|
-
|
|
338
402
|
const githubPath = path.join(projectRoot, '.github', 'copilot-instructions.md');
|
|
339
403
|
const written = await writeTextFile(
|
|
340
404
|
githubPath,
|
|
@@ -288,6 +288,7 @@ cat >.vscode/settings.json <<'JSON'
|
|
|
288
288
|
JSON
|
|
289
289
|
|
|
290
290
|
run_fvm flutter pub add get flutter_bloc equatable dio retrofit json_annotation flutter_dotenv flutter_svg intl
|
|
291
|
+
run_fvm flutter pub add common_widget --git-url https://github.com/tuan-urani/common_widget --git-ref main
|
|
291
292
|
run_fvm flutter pub add --dev build_runner retrofit_generator json_serializable
|
|
292
293
|
|
|
293
294
|
mkdir -p \
|
|
@@ -575,6 +576,8 @@ ensure_line_in_file .gitignore ".env"
|
|
|
575
576
|
ensure_line_in_file .gitignore ".env.staging"
|
|
576
577
|
ensure_line_in_file .gitignore ".env.prod"
|
|
577
578
|
|
|
579
|
+
run_fvm dart run common_widget update
|
|
580
|
+
|
|
578
581
|
if [[ -n "$FVM_BIN" ]]; then
|
|
579
582
|
run_fvm dart format lib >/dev/null || true
|
|
580
583
|
fi
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Model Registry (AUTO-GENERATED)
|
|
2
|
+
|
|
3
|
+
> Do not edit manually. Run: dart run tool/generate_model_registry.dart
|
|
4
|
+
|
|
5
|
+
## UI/Domain Models
|
|
6
|
+
|
|
7
|
+
- enum CustomerProjectActivityType — lib/src/core/model/customer_project_activity_ui_model.dart
|
|
8
|
+
- class CustomerProjectActivityDetailUIModel — lib/src/core/model/customer_project_activity_ui_model.dart
|
|
9
|
+
- class CustomerProjectActivityUIModel — lib/src/core/model/customer_project_activity_ui_model.dart
|
|
10
|
+
- enum CalendarEventType — lib/src/core/model/calendar.dart
|
|
11
|
+
- Type for calendar events (affects UI colors/icons)
|
|
12
|
+
- class CalendarEventModel — lib/src/core/model/calendar.dart
|
|
13
|
+
- Calendar event data consumed by UI scheduling components
|
|
14
|
+
- class CalendarEventDataSource — lib/src/core/model/calendar.dart
|
|
15
|
+
- class InspectionHistory — lib/src/core/model/inspection_history.dart
|
|
16
|
+
- class DetailItem — lib/src/core/model/detail_item.dart
|
|
17
|
+
- enum StepStatus — lib/src/core/model/step_progress.dart
|
|
18
|
+
- class StepProgress — lib/src/core/model/step_progress.dart
|
|
19
|
+
- class CustomerCaseItem — lib/src/core/model/customer_case_item.dart
|
|
20
|
+
- enum PlaceStatus — lib/src/core/model/map_working_item.dart
|
|
21
|
+
- class PlacePoint — lib/src/core/model/map_working_item.dart
|
|
22
|
+
- class TodoItem — lib/src/core/model/todo_item.dart
|
|
23
|
+
- enum NotificationStatus — lib/src/core/model/notification.dart
|
|
24
|
+
- Notification read status
|
|
25
|
+
- enum NotificationFilter — lib/src/core/model/notification.dart
|
|
26
|
+
- Filter for notifications list
|
|
27
|
+
- enum NotificationType — lib/src/core/model/notification.dart
|
|
28
|
+
- Source/type of notification (system-wide or store-specific)
|
|
29
|
+
- class NotificationModel — lib/src/core/model/notification.dart
|
|
30
|
+
- Notification item used by UI lists and detail screens
|
|
31
|
+
- class NextSchedule — lib/src/core/model/next_schedule.dart
|
|
32
|
+
- enum CustomerMemberStatus — lib/src/core/model/customer_ui_model.dart
|
|
33
|
+
- enum CustomerActionStatus — lib/src/core/model/customer_ui_model.dart
|
|
34
|
+
- class CustomerUIModel — lib/src/core/model/customer_ui_model.dart
|
|
35
|
+
- enum WorkDetailResult — lib/src/core/model/work_detail.dart
|
|
36
|
+
- Result/outcome of a work detail visit (drives UI labels and summaries)
|
|
37
|
+
- class WorkDetailRecord — lib/src/core/model/work_detail.dart
|
|
38
|
+
- Work detail record shown in work detail UI pages
|
|
39
|
+
- class UserInfo — lib/src/core/model/user_info.dart
|
|
40
|
+
- class SearchResultItem — lib/src/core/model/map_search_result.dart
|
|
41
|
+
- class ImageItem — lib/src/core/model/image_item.dart
|
|
42
|
+
- enum LeafNodeType — lib/src/core/model/nested_menu_item.dart
|
|
43
|
+
- class NestedMenuItem — lib/src/core/model/nested_menu_item.dart
|
|
44
|
+
- class MenuLevelHistory — lib/src/core/model/nested_menu_item.dart
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Request Models
|
|
48
|
+
|
|
49
|
+
- (none)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Response Models
|
|
53
|
+
|
|
54
|
+
- class CustomerProjectInfo — lib/src/core/model/response/customer_project_info.dart
|
|
55
|
+
- Summary info for a customer's project used in list and header UIs
|
|
56
|
+
- class ProjectActivity — lib/src/core/model/response/project_activity.dart
|
|
57
|
+
- enum ProjectStatus — lib/src/core/model/response/project_activity.dart
|
|
58
|
+
- Project status enum
|
|
59
|
+
|
|
60
|
+
|