Skip to content

Commit 61464e6

Browse files
authored
Only complain about wasm support for web-enabled packages (#1511)
1 parent 10c3e60 commit 61464e6

21 files changed

+16
-115
lines changed

lib/src/report/multi_platform.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,20 @@ Future<ReportSection> multiPlatform(PackageContext context) async {
136136
basePath: context.packageDir,
137137
subsections: [
138138
subsection,
139-
wasmSubsection,
139+
?wasmSubsection,
140140
if (swiftPackageManagerSubsection != null) swiftPackageManagerSubsection,
141141
],
142142
maxIssues: 20,
143143
);
144144
}
145145

146-
Future<Subsection> _createWasmSubsection(PackageContext context) async {
146+
Future<Subsection?> _createWasmSubsection(PackageContext context) async {
147147
final tr = await context.staticAnalysis;
148148
final description = 'WASM compatibility';
149149
final explanation = tr.explanations
150150
.where((e) => e.tag == PanaTags.isWasmReady)
151151
.firstOrNull;
152+
if (!tr.tags.contains(PanaTags.platformWeb)) return null;
152153
if (explanation != null) {
153154
return Subsection(
154155
description,

test/goldens/end2end/_dummy_pkg-1.0.0-null-safety.1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"grantedPoints": 0,
4848
"maxPoints": 20,
4949
"status": "failed",
50-
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\nUnable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
50+
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n"
5151
},
5252
{
5353
"id": "analysis",

test/goldens/end2end/_dummy_pkg-1.0.0-null-safety.1.json_report.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ Could not determine supported platforms as package resolution failed.
7272
Run `dart pub get` for more information.
7373
</details>
7474

75-
### [x] 0/0 points: WASM compatibility
76-
77-
Unable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.
78-
79-
See https://dart.dev/web/wasm for details.
80-
8175

8276
## 0/50 Pass static analysis
8377

test/goldens/end2end/bulma_min-0.7.4.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"grantedPoints": 0,
4949
"maxPoints": 20,
5050
"status": "failed",
51-
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\nUnable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
51+
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n"
5252
},
5353
{
5454
"id": "analysis",

test/goldens/end2end/bulma_min-0.7.4.json_report.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ Could not determine supported platforms as package resolution failed.
3636
Run `dart pub get` for more information.
3737
</details>
3838

39-
### [x] 0/0 points: WASM compatibility
40-
41-
Unable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.
42-
43-
See https://dart.dev/web/wasm for details.
44-
4539

4640
## 0/50 Pass static analysis
4741

test/goldens/end2end/gg-1.0.12.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
"title": "Platform support",
137137
"grantedPoints": 20,
138138
"maxPoints": 20,
139-
"status": "failed",
140-
"summary": "### [*] 20/20 points: Supports 5 of 6 possible platforms (**iOS**, **Android**, Web, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ Windows\n\n* ✓ Linux\n\n* ✓ macOS\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage not compatible with platform Web\n</summary>\n\nBecause:\n* `package:gg/gg.dart` that imports:\n* `package:gg/src/tools/checks.dart` that imports:\n* `package:gg_publish/gg_publish.dart` that imports:\n* `package:gg_publish/src/commands/publish.dart` that imports:\n* `package:gg_version/gg_version.dart` that imports:\n* `package:gg_version/src/commands/published_version.dart` that imports:\n* `package:gg_args/gg_args.dart` that imports:\n* `package:gg_args/src/missing_sub_commands.dart` that imports:\n* `dart:io`\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\n<details>\n<summary>\nPackage not compatible with runtime wasm\n</summary>\n\nBecause:\n* `package:gg/gg.dart` that imports:\n* `package:gg/src/tools/checks.dart` that imports:\n* `package:gg_publish/gg_publish.dart` that imports:\n* `package:gg_publish/src/commands/publish.dart` that imports:\n* `package:gg_version/gg_version.dart` that imports:\n* `package:gg_version/src/commands/published_version.dart` that imports:\n* `package:gg_args/gg_args.dart` that imports:\n* `package:gg_args/src/missing_sub_commands.dart` that imports:\n* `dart:io`\n</details>\n\nThis package is not compatible with runtime `wasm`, and will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
139+
"status": "passed",
140+
"summary": "### [*] 20/20 points: Supports 5 of 6 possible platforms (**iOS**, **Android**, Web, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ Windows\n\n* ✓ Linux\n\n* ✓ macOS\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage not compatible with platform Web\n</summary>\n\nBecause:\n* `package:gg/gg.dart` that imports:\n* `package:gg/src/tools/checks.dart` that imports:\n* `package:gg_publish/gg_publish.dart` that imports:\n* `package:gg_publish/src/commands/publish.dart` that imports:\n* `package:gg_version/gg_version.dart` that imports:\n* `package:gg_version/src/commands/published_version.dart` that imports:\n* `package:gg_args/gg_args.dart` that imports:\n* `package:gg_args/src/missing_sub_commands.dart` that imports:\n* `dart:io`\n</details>\n"
141141
},
142142
{
143143
"id": "analysis",

test/goldens/end2end/gg-1.0.12.json_report.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,6 @@ Because:
5050
* `dart:io`
5151
</details>
5252

53-
### [x] 0/0 points: WASM compatibility
54-
55-
<details>
56-
<summary>
57-
Package not compatible with runtime wasm
58-
</summary>
59-
60-
Because:
61-
* `package:gg/gg.dart` that imports:
62-
* `package:gg/src/tools/checks.dart` that imports:
63-
* `package:gg_publish/gg_publish.dart` that imports:
64-
* `package:gg_publish/src/commands/publish.dart` that imports:
65-
* `package:gg_version/gg_version.dart` that imports:
66-
* `package:gg_version/src/commands/published_version.dart` that imports:
67-
* `package:gg_args/gg_args.dart` that imports:
68-
* `package:gg_args/src/missing_sub_commands.dart` that imports:
69-
* `dart:io`
70-
</details>
71-
72-
This package is not compatible with runtime `wasm`, and will not be rewarded full points in a future version of the scoring model.
73-
74-
See https://dart.dev/web/wasm for details.
75-
7653

7754
## 40/50 Pass static analysis
7855

test/goldens/end2end/mime_type-0.3.2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"grantedPoints": 0,
5151
"maxPoints": 20,
5252
"status": "failed",
53-
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\nUnable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
53+
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n"
5454
},
5555
{
5656
"id": "analysis",

test/goldens/end2end/mime_type-0.3.2.json_report.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ Could not determine supported platforms as package resolution failed.
5959
Run `dart pub get` for more information.
6060
</details>
6161

62-
### [x] 0/0 points: WASM compatibility
63-
64-
Unable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.
65-
66-
See https://dart.dev/web/wasm for details.
67-
6862

6963
## 0/50 Pass static analysis
7064

test/goldens/end2end/nsd_android-2.1.2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"grantedPoints": 20,
7777
"maxPoints": 20,
7878
"status": "passed",
79-
"summary": "### [*] 20/20 points: Supports 1 of 6 possible platforms (iOS, **Android**, Web, Windows, macOS, Linux)\n\n* ✓ Android\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage does not support platform `iOS`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Windows`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Linux`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `macOS`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Web`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n### [*] 0/0 points: WASM compatibility\n\nThis package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
79+
"summary": "### [*] 20/20 points: Supports 1 of 6 possible platforms (iOS, **Android**, Web, Windows, macOS, Linux)\n\n* ✓ Android\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage does not support platform `iOS`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Windows`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Linux`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `macOS`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Web`.\n</summary>\n\nBecause:\n* `nsd_android` that declares support for platforms: `Android`.\n</details>\n"
8080
},
8181
{
8282
"id": "analysis",

0 commit comments

Comments
 (0)