diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..edd451c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,14 @@ +name: Deploy + +on: + workflow_dispatch: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + +jobs: + deploy: + name: "Deploy to Pub.dev" + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a53a09c..887d7f2 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,70 +2,233 @@ "version": "2.0.0", "tasks": [ { - "label": "Dependencies", + "label": "flutter:pub:get", + "detail": "Get dependencies for the project", + "icon": { + "color": "terminal.ansiGreen", + "id": "cloud-download" + }, + "dependsOn": [], + "type": "shell", + "command": [ + "flutter pub get" + ], + "args": [], + "group": { + "kind": "none", + "isDefault": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + }, + "isBackground": false, + "presentation": { + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } + }, + { + "label": "dart:build_runner:all", + "detail": "Generate code for the project", + "icon": { + "color": "terminal.ansiGreen", + "id": "code" + }, + "type": "shell", + "command": [ + "dart run build_runner build --delete-conflicting-outputs", + "&& dart format --fix -l 80 lib test" + ], + "dependsOn": [ + "flutter:pub:get" + ], + "args": [], + "group": { + "kind": "none", + "isDefault": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + }, + "isBackground": false, + "presentation": { + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } + }, + { + "label": "dart:build_runner:dir", + "detail": "Generate code for the directory", + "type": "shell", + "icon": { + "color": "terminal.ansiGreen", + "id": "code" + }, + "command": [ + "dart run build_runner build --build-filter '${fileDirname}/*.dart'", + "&& dart format --fix -l 80 '${fileDirname}'" + ], + "group": { + "kind": "none", + "isDefault": true + }, + "problemMatcher": [], + "dependsOn": [ + "flutter:pub:get" + ], + "isBackground": false, + "presentation": { + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } + }, + { + "label": "dart:build_runner:watch", + "detail": "Watch for changes in the project", "type": "shell", + "icon": { + "color": "terminal.ansiGreen", + "id": "code" + }, "command": [ - "(flutter pub get)", - "&& (flutter pub get --directory=example)" + "dart run build_runner watch --build-filter \"${input:directory}/**/*.dart\"" ], "group": { "kind": "none", "isDefault": true }, - "problemMatcher": [] + "problemMatcher": [], + "dependsOn": [ + "flutter:pub:get" + ], + "isBackground": false, + "presentation": { + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } }, { - "label": "Format", + "label": "dart:format", + "detail": "Format all files in the project", + "icon": { + "color": "terminal.ansiGreen", + "id": "lightbulb-autofix" + }, "type": "shell", "command": [ - "dart format --fix -l 80" + "dart format --fix -l 80 lib test" ], + "dependsOn": [], + "args": [], "group": { "kind": "none", "isDefault": true }, - "problemMatcher": [] + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + }, + "isBackground": false, + "presentation": { + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } }, { - "label": "Clear example build", + "label": "flutter:test:all", + "detail": "Run all tests", + "icon": { + "color": "terminal.ansiGreen", + "id": "bug", + }, + "dependsOn": [ + "flutter:pub:get" + ], "type": "shell", - "command": "make clear-client", - "windows": { - "command": "powershell.exe", - "args": [ - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-Command", - "Remove-Item -Path '${workspaceFolder}\\example\\build' -Recurse -Force -ErrorAction Ignore" - ] - /* "options": { - "shell": { - "executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" - } - } */ - }, - "linux": { - "command": "rm -rf", - "args": [ - "${workspaceFolder}/example/build" - ] - }, - "osx": { - "command": "rm -rf", - "args": [ - "${workspaceFolder}/example/build" - ] + "command": [ + "flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s test/unit_test.dart test/widget_test.dart" + ], + "args": [], + "group": { + "kind": "test", + "isDefault": true }, "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + }, + "isBackground": false, "presentation": { "reveal": "always", - "panel": "shared" + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" + } + }, + { + "label": "flutter:test:feature", + "detail": "Run tests for a specific feature", + "icon": { + "color": "terminal.ansiGreen", + "id": "bug", }, + "dependsOn": [ + "flutter:pub:get" + ], + "type": "shell", + "command": [ + "flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s --tags=\"${input:featureName}\" test/unit_test.dart test/widget_test.dart" + ], + "args": [], "group": { - "kind": "build", + "kind": "test", "isDefault": true + }, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}" + }, + "isBackground": false, + "presentation": { + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": false, + "group": "dart" } } + ], + "inputs": [ + { + "id": "featureName", + "type": "promptString", + "description": "Enter the feature name (e.g., 'my_feature_name'):", + /* "default": "my_feature_name" */ + } ] } \ No newline at end of file