everydaydevops-luff 3.0.0__py3-none-any.whl
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.
- everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-audit/SKILL.md +30 -0
- everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-create/SKILL.md +27 -0
- everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-feature/SKILL.md +30 -0
- everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-migrate/SKILL.md +30 -0
- everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-verify/SKILL.md +12 -0
- everydaydevops_luff-3.0.0.dist-info/METADATA +50 -0
- everydaydevops_luff-3.0.0.dist-info/RECORD +40 -0
- everydaydevops_luff-3.0.0.dist-info/WHEEL +5 -0
- everydaydevops_luff-3.0.0.dist-info/entry_points.txt +3 -0
- everydaydevops_luff-3.0.0.dist-info/licenses/LICENSE +21 -0
- everydaydevops_luff-3.0.0.dist-info/top_level.txt +1 -0
- flutter_setup/__init__.py +0 -0
- flutter_setup/appender.py +46 -0
- flutter_setup/bootstrap.py +1655 -0
- flutter_setup/cicd_generator.py +885 -0
- flutter_setup/cli.py +1193 -0
- flutter_setup/config.py +156 -0
- flutter_setup/config_manager.py +160 -0
- flutter_setup/core.py +204 -0
- flutter_setup/exceptions.py +37 -0
- flutter_setup/flutter_manager.py +579 -0
- flutter_setup/platform.py +15 -0
- flutter_setup/prerequisites.py +39 -0
- flutter_setup/prerequisites_linux.py +140 -0
- flutter_setup/prerequisites_macos.py +226 -0
- flutter_setup/project_cli.py +397 -0
- flutter_setup/project_creator.py +91 -0
- flutter_setup/standards.py +99 -0
- flutter_setup/standards_data/everyday-devops-flutter-1.0.0.json +97 -0
- flutter_setup/standards_data/manifest-v1.schema.json +209 -0
- flutter_setup/templates/everyday/AGENTS.md +5 -0
- flutter_setup/templates/everyday/app_log.dart +6 -0
- flutter_setup/templates/everyday/home_content.dart +9 -0
- flutter_setup/templates/everyday/home_repository.dart +8 -0
- flutter_setup/templates/everyday/home_screen.dart +60 -0
- flutter_setup/templates/everyday/offline_store.dart +5 -0
- flutter_setup/templates/everyday/sentry_startup.dart +16 -0
- flutter_setup/templates/everyday/theme.dart +12 -0
- flutter_setup/templates.py +73 -0
- flutter_setup/verification.py +160 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-audit
|
|
3
|
+
description: Use to assess an existing Flutter app against a pinned profile.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flutter audit
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
Use to assess an existing Flutter app against a pinned profile.
|
|
11
|
+
|
|
12
|
+
## Required inputs
|
|
13
|
+
|
|
14
|
+
Authorized Flutter workspace, manifest or profile version, platform list if known, and existing exceptions.
|
|
15
|
+
|
|
16
|
+
## Supported operations and commands
|
|
17
|
+
|
|
18
|
+
Read the pubspec, manifest, tests, CI and platform configuration and compare them with the profile. Automated inspection and audit are planned.
|
|
19
|
+
|
|
20
|
+
## Expected outputs
|
|
21
|
+
|
|
22
|
+
A report with rule IDs, severity, evidence paths, applicable exceptions, and proposed remedies. Mark unsupported and unknown checks.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
Capture repository status before and after reading. Verify every reported finding against a file or check.
|
|
27
|
+
|
|
28
|
+
## Safety
|
|
29
|
+
|
|
30
|
+
Keep the audit read-only and redact signing details and credentials. `luff --help` lists available commands.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-create
|
|
3
|
+
description: Generate a new Flutter app from versioned Luff standards in an empty destination.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create a Flutter application
|
|
7
|
+
|
|
8
|
+
Ask for the app name, target platforms, bundle prefix, expected features, optional services, and the installed Flutter version. Translate them into a YAML manifest. Start with the Everyday DevOps profile and enable optional capabilities only when requested.
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
schema_version: 1
|
|
12
|
+
profile:
|
|
13
|
+
id: everyday-devops-flutter
|
|
14
|
+
version: 1.0.0
|
|
15
|
+
project:
|
|
16
|
+
name: field_notes
|
|
17
|
+
org: io.example
|
|
18
|
+
platforms: [ios]
|
|
19
|
+
capabilities:
|
|
20
|
+
persistence: true
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Preview with `luff create --config project.yaml --dry-run --format json`. Review the destination, settings, and capability choices in the JSON. A successful preview is read-only and does not prove the SDK is installed.
|
|
24
|
+
|
|
25
|
+
Create with `luff create --config project.yaml --non-interactive --format json`. An existing target is an error. Provide `--flutter-sdk` when the approved installed SDK is outside PATH. Never install or upgrade a machine tool implicitly. Read the generated `.luff.yaml` and `AGENTS.md`, then verify with `luff verify --dir "$DESTINATION" --format json` using the creation result’s `destination` as `$DESTINATION`. Carry the same `--flutter-sdk` value into verification if you selected a specific SDK. Summarize the generated files, verification results, and any skipped or unsupported checks.
|
|
26
|
+
|
|
27
|
+
Implement application behavior inside its feature boundaries. Keep Riverpod state, GoRouter, existing identity and services, and the profile choices consistent. Use real service configuration supplied by the developer. Keep credentials out of the manifest.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-feature
|
|
3
|
+
description: Use when adding a feature to an existing Flutter app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flutter feature
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
Use when adding a feature to an existing Flutter app.
|
|
11
|
+
|
|
12
|
+
## Required inputs
|
|
13
|
+
|
|
14
|
+
Feature requirements, target platforms, repository instructions, existing architecture and applicable profile.
|
|
15
|
+
|
|
16
|
+
## Supported operations and commands
|
|
17
|
+
|
|
18
|
+
Review neighboring features, follow project conventions and design focused changes. Automated feature generation is planned. Use `luff --help` for the current CLI.
|
|
19
|
+
|
|
20
|
+
## Expected outputs
|
|
21
|
+
|
|
22
|
+
A focused patch with tests, evidence and a list of deviations from the profile.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
Review domain, data and presentation boundaries. Run targeted tests, analysis, formatting and relevant platform verification.
|
|
27
|
+
|
|
28
|
+
## Safety
|
|
29
|
+
|
|
30
|
+
Avoid broad rewrites and new optional services without agreement. Preserve existing routing, data and platform configuration.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-migrate
|
|
3
|
+
description: Use to prepare changes needed to adopt a profile in an existing Flutter app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flutter migrate
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
Use to prepare changes needed to adopt a profile in an existing Flutter app.
|
|
11
|
+
|
|
12
|
+
## Required inputs
|
|
13
|
+
|
|
14
|
+
Authorized workspace, current and target profile versions, audit findings, and approval boundaries.
|
|
15
|
+
|
|
16
|
+
## Supported operations and commands
|
|
17
|
+
|
|
18
|
+
Prepare a reviewable plan and identify conflicts. Automated adoption, planning, apply and upgrade are planned. `luff append --help` describes the separate legacy tooling operation.
|
|
19
|
+
|
|
20
|
+
## Expected outputs
|
|
21
|
+
|
|
22
|
+
A plan with evidence, affected paths, file hashes, expected diffs, verification and rollback.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
Check the starting tree and preserve known failures. Immediately before the first approved edit, verify that the worktree and file hashes match the approved baseline. Before each subsequent edit, compare affected files with the expected state after the preceding approved edits. If a file differs from that expected state, stop writing, report any edits already applied, and prepare a fresh plan for approval. After applying an approved plan, rerun checks and confirm a repeat run produces no changes.
|
|
27
|
+
|
|
28
|
+
## Safety
|
|
29
|
+
|
|
30
|
+
Never regenerate an existing app. Preserve behavior, IDs, signing, tests, database schemas, data, native settings and custom workflows. Obtain approval before applying a plan.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-verify
|
|
3
|
+
description: Verify a generated Flutter app with the SDK and platforms recorded in its Luff manifest.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify a Flutter application
|
|
7
|
+
|
|
8
|
+
Use the authorized project path, its resolved `.luff.yaml`, and the installed matching SDK. Run `luff verify --dir "$PROJECT_DIR" --format json`, with `$PROJECT_DIR` set to the authorized project directory. The command checks the manifest and SDK, installs packages from the existing lockfile, checks Dart formatting and static analysis, runs unit and widget tests, and builds declared platforms when the host supports them.
|
|
9
|
+
|
|
10
|
+
Pass `--device DEVICE_ID` to run device integration tests. Patrol also needs the Patrol CLI installed. Pass `--skip-builds` only when the user accepts an explicit skip. Use `--flutter-sdk` to select an existing SDK.
|
|
11
|
+
|
|
12
|
+
Report each check as passed, failed, skipped, unsupported, or blocked. A successful result can contain skipped and unsupported checks. Record their reasons. An SDK mismatch, required gate failure, or blocked required check returns a nonzero exit status. Keep signing, deployment, and machine provisioning separate from verification.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: everydaydevops-luff
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: Engineering tooling for Flutter applications
|
|
5
|
+
Author-email: Mark C Allen <mark@markcallen.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/everydaydevopsio/luff
|
|
8
|
+
Project-URL: Documentation, https://github.com/everydaydevopsio/luff#readme
|
|
9
|
+
Project-URL: Issues, https://github.com/everydaydevopsio/luff/issues
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click>=8.3.2
|
|
14
|
+
Requires-Dist: jsonschema>=4.23
|
|
15
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
16
|
+
Requires-Dist: rich>=15.0.0
|
|
17
|
+
Requires-Dist: requests>=2.33.1
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: black>=26.3.1; extra == "dev"
|
|
20
|
+
Requires-Dist: mypy>=1.20.1; extra == "dev"
|
|
21
|
+
Requires-Dist: pre-commit>=4.0.0; extra == "dev"
|
|
22
|
+
Requires-Dist: ruff>=0.15.10; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest>=9.0.3; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-mock>=3.15.1; extra == "dev"
|
|
26
|
+
Requires-Dist: types-jsonschema; extra == "dev"
|
|
27
|
+
Requires-Dist: types-pyyaml>=6.0.12.20250915; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# Luff
|
|
31
|
+
|
|
32
|
+
**Build better Flutter applications.**
|
|
33
|
+
|
|
34
|
+
[](https://github.com/everydaydevopsio/luff/actions/workflows/quality.yaml) [](LICENSE)
|
|
35
|
+
|
|
36
|
+
Luff is an open-source Everyday DevOps tool for Flutter. Its aim is to give developers and AI agents the same standards for creating, inspecting, migrating, extending, and maintaining Flutter applications.
|
|
37
|
+
|
|
38
|
+
Use a versioned profile to create a Flutter app, preview the scaffold as JSON, or run verification. Luff uses an installed Flutter SDK. Inspection, standards audit, migration and MCP remain on the roadmap.
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
git clone https://github.com/everydaydevopsio/luff.git
|
|
42
|
+
cd luff
|
|
43
|
+
make dev
|
|
44
|
+
uv run --locked luff create field_notes --platforms ios --dry-run --format json
|
|
45
|
+
uv run --locked flutter-setup --help
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `flutter-setup` entry point retains legacy provisioning and command behavior. The distribution is named `everydaydevops-luff` and the import package remains `flutter_setup`. Existing users should install Luff in a separate environment or uninstall the old distribution first to avoid both packages owning the compatibility command.
|
|
49
|
+
|
|
50
|
+
See [installation](docs/installation.md), [agent workflows](docs/agents.md), the [reference application](docs/reference-app.md), [product requirements](PRD.md), [architecture](ARCHITECTURE.md), [roadmap](ROADMAP.md), and [contributor setup](CONTRIBUTING.md). The original [Flutter Setup repository](https://github.com/markcallen/flutter-setup) contains its historical releases and documentation.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-audit/SKILL.md,sha256=bsOurEJHcBX3cp4gHiqOi3xZbCuMb-eiFvfD59qW20E,914
|
|
2
|
+
everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-create/SKILL.md,sha256=Cw6NzRW72JEWpKVAvuKHEPVl5050HXf-74kT8lXCh84,1676
|
|
3
|
+
everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-feature/SKILL.md,sha256=b5zhA1cWokwEeL49WvV0B2QH-4ABhaFTokI1p4DE9HE,904
|
|
4
|
+
everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-migrate/SKILL.md,sha256=omfTdPtqyvyg7av0iFb2kUuB1chhwV0xvZsRpDVKGsA,1396
|
|
5
|
+
everydaydevops_luff-3.0.0.data/data/share/luff/skills/flutter-verify/SKILL.md,sha256=WFCI9_zl_ShmLykm36J73PI7X2ZpQ0MdLtt63EeZGKA,1140
|
|
6
|
+
everydaydevops_luff-3.0.0.dist-info/licenses/LICENSE,sha256=dwcdo6BcRlgLd_6ejgcIIp3IUFMrCkT7fiRBMBPeulw,1068
|
|
7
|
+
flutter_setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
flutter_setup/appender.py,sha256=DjgTg6P52CBjCMdmECHBWpb0RF044lAu3gAvztg1UB8,1273
|
|
9
|
+
flutter_setup/bootstrap.py,sha256=dIrk3Xb-qCBrQorXZUvH6apyH1tDe_HxTdn99HrnOCs,62816
|
|
10
|
+
flutter_setup/cicd_generator.py,sha256=0ZVhxJt146p7XolCD4QTh5ewVfVOcn4T3hfjhOpZf7U,29638
|
|
11
|
+
flutter_setup/cli.py,sha256=9EYh6-kYKldPvJ95Q0MOto9ZjLIjp6Vr9toGR9Gq9rI,39081
|
|
12
|
+
flutter_setup/config.py,sha256=q1q1qvoUvPRtCG9AhtDfv4jdmrnxzuigOeX3Qy-eQmM,5418
|
|
13
|
+
flutter_setup/config_manager.py,sha256=ByoEG8RIr-bmmMMo-wh0vehQzcr7CNRzkJQMSreH8I8,5693
|
|
14
|
+
flutter_setup/core.py,sha256=XrtBZZCsbOY5ONZkT8HT1k-SHDre089t1S5qjKtYh4w,7719
|
|
15
|
+
flutter_setup/exceptions.py,sha256=6ZpFrshGLNjMQPqUcj_hPtyBAob0qf8_eN9LDKc0vvM,673
|
|
16
|
+
flutter_setup/flutter_manager.py,sha256=LDxsQxx6MPDK9Cexv23MgTteDlAt8FI6sbmXosDALAc,21958
|
|
17
|
+
flutter_setup/platform.py,sha256=Q3irgLn6dCBBSCFDo2wHqPlGdua7ha-Qda7ycBJkaPQ,394
|
|
18
|
+
flutter_setup/prerequisites.py,sha256=Otr79zlZa3DXcs3c31F1liKLhecN_A_bW0Fgs958lrQ,1352
|
|
19
|
+
flutter_setup/prerequisites_linux.py,sha256=XEn3WI6UrR8E4-LEKzsa3DzmidN5ST7dIkn-HCs0HrQ,4676
|
|
20
|
+
flutter_setup/prerequisites_macos.py,sha256=REZaz8NAACJcKyY60CwnHDFsJe9h6R1xIS6HFdBbaw4,8561
|
|
21
|
+
flutter_setup/project_cli.py,sha256=rqdKJnKkUd5pCc1WpilXu8NE0hqrOf92I8xBYrTnTCs,16274
|
|
22
|
+
flutter_setup/project_creator.py,sha256=i8WgroWY4JvXwh6S13tTxB7y3PtpkkePjN2Bw644H_k,2948
|
|
23
|
+
flutter_setup/standards.py,sha256=so0wMciZrxnx1AOPQIb3Hx3wJWq_4F6KVJZDZLVSPo8,3828
|
|
24
|
+
flutter_setup/templates.py,sha256=xUqEvK5_zlFlzvnj2RoI2ozhSK8GJQjKmjGCzSd7Dpk,2995
|
|
25
|
+
flutter_setup/verification.py,sha256=yJtK3uyQiin9bLcpAvMSAY4wqDVVri2-bhiKGnsfKY8,5919
|
|
26
|
+
flutter_setup/standards_data/everyday-devops-flutter-1.0.0.json,sha256=TiP-y3NmwXPIPMtlfj4IxlY4hTz5O8MWHz9WsBLJb5g,3181
|
|
27
|
+
flutter_setup/standards_data/manifest-v1.schema.json,sha256=K4eOHA1wCUzKi5UL5jvVQvIDGwGgkKdIafhKzoMklM0,4587
|
|
28
|
+
flutter_setup/templates/everyday/AGENTS.md,sha256=rA8om55o6b43-Av-eUnVxbutU3Rng_7qdWo0VLJMrJE,556
|
|
29
|
+
flutter_setup/templates/everyday/app_log.dart,sha256=LywxIhWK5IbMqFOH6NRKtkxncu_ijVKiSzJlYn5x2KE,217
|
|
30
|
+
flutter_setup/templates/everyday/home_content.dart,sha256=NU8Apq-q3T-if1vv4L2KsqKcXyBGjtdLsPJkGDdlDmo,157
|
|
31
|
+
flutter_setup/templates/everyday/home_repository.dart,sha256=d0X9ANmvFwR8R0lkd9yzeo9WJlQ6nxPkS5ojjQAuSBU,214
|
|
32
|
+
flutter_setup/templates/everyday/home_screen.dart,sha256=x8seJBXDRzrxlFZbtJoEzlEreoGqDWeQKCWJuUl1UBQ,2154
|
|
33
|
+
flutter_setup/templates/everyday/offline_store.dart,sha256=lWoW25hEsHIEI5xTae55xZ3vuXdEEp7LmDmAmI2NzZ8,197
|
|
34
|
+
flutter_setup/templates/everyday/sentry_startup.dart,sha256=C7FqhxSL3qtIFdS6RHMymAwLhdDGm2sEwWRwdfhQPbY,372
|
|
35
|
+
flutter_setup/templates/everyday/theme.dart,sha256=LvePJN-HbThR4Zp05XWJOnZi2V0zy2K4I5Vj5XLTF3Q,320
|
|
36
|
+
everydaydevops_luff-3.0.0.dist-info/METADATA,sha256=RbARjxuGkqnkUwIxVuWTCH1ShBD0ukxzcBkW48AQWYg,2765
|
|
37
|
+
everydaydevops_luff-3.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
38
|
+
everydaydevops_luff-3.0.0.dist-info/entry_points.txt,sha256=Sgn6Pf7LhVHOfebp4_N0zpHEm73b8qiu6sJ7DTzS3ys,95
|
|
39
|
+
everydaydevops_luff-3.0.0.dist-info/top_level.txt,sha256=BjDhT4IHIUpiQNvx9wT1LxUraEqJNpp1OlJ7F_LVI9o,14
|
|
40
|
+
everydaydevops_luff-3.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mark Callen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flutter_setup
|
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Detection utilities for the append command."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import yaml
|
|
6
|
+
|
|
7
|
+
PLATFORM_DIRS = {
|
|
8
|
+
"ios": "ios",
|
|
9
|
+
"android": "android",
|
|
10
|
+
"web": "web",
|
|
11
|
+
"macos": "macos",
|
|
12
|
+
"linux": "linux",
|
|
13
|
+
"windows": "windows",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def detect_flutter_project(path: Path) -> bool:
|
|
18
|
+
"""Return True if path contains a Flutter project (pubspec.yaml with flutter key)."""
|
|
19
|
+
pubspec = path / "pubspec.yaml"
|
|
20
|
+
if not pubspec.exists():
|
|
21
|
+
return False
|
|
22
|
+
try:
|
|
23
|
+
data = yaml.safe_load(pubspec.read_text())
|
|
24
|
+
return isinstance(data, dict) and "flutter" in data
|
|
25
|
+
except Exception:
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def detect_platforms(path: Path) -> list[str]:
|
|
30
|
+
"""Detect enabled platforms from existing platform directories."""
|
|
31
|
+
platforms = [p for p, d in PLATFORM_DIRS.items() if (path / d).is_dir()]
|
|
32
|
+
return platforms if platforms else ["ios", "android", "web"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_pubspec_name(path: Path) -> str | None:
|
|
36
|
+
"""Read name from pubspec.yaml, return None on failure."""
|
|
37
|
+
pubspec = path / "pubspec.yaml"
|
|
38
|
+
if not pubspec.exists():
|
|
39
|
+
return None
|
|
40
|
+
try:
|
|
41
|
+
data = yaml.safe_load(pubspec.read_text())
|
|
42
|
+
if isinstance(data, dict):
|
|
43
|
+
return data.get("name")
|
|
44
|
+
except Exception:
|
|
45
|
+
pass
|
|
46
|
+
return None
|