Skip to content

Commit a98975e

Browse files
authored
chore(actions): Fixes for upcoming Dart changes (#3742)
- Ensures that JS interop methods use only interop values for inputs/outputs. - Prefers Dart primitives (String, bool, int) over JS primitives (JSString, etc.) since newer Dart enables automatic conversion.
1 parent 38be40f commit a98975e

File tree

20 files changed

+408
-600
lines changed

20 files changed

+408
-600
lines changed

.github/composite_actions/launch_android_emulator/dist/main.cjs

Lines changed: 166 additions & 273 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_android_emulator/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_ios_simulator/dist/main.cjs

Lines changed: 34 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_ios_simulator/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/setup_chromedriver/dist/main.cjs

Lines changed: 126 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/setup_chromedriver/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/actions.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup Dart
3333
uses: dart-lang/setup-dart@e58aeb62aef51dcc4d0ba8eada7c08092aad5314 # main
3434
with:
35-
sdk: 3.2.0-90.0.dev
35+
sdk: 3.2.0-150.0.dev
3636

3737
- name: Setup pnpm
3838
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # 2.4.0
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup Dart
5858
uses: dart-lang/setup-dart@e58aeb62aef51dcc4d0ba8eada7c08092aad5314 # main
5959
with:
60-
sdk: 3.2.0-90.0.dev
60+
sdk: 3.2.0-150.0.dev
6161

6262
- name: Get Packages
6363
working-directory: actions

actions/lib/src/node/actions/cache.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ external Cache get cache;
1010
///
1111
/// See: https://www.npmjs.com/package/@actions/cache
1212
@JS()
13-
extension type Cache(JSObject it) {
13+
@anonymous
14+
extension type Cache._(JSObject it) {
1415
/// Returns true if Actions cache service feature is available, otherwise false.
1516
external bool isFeatureAvailable();
1617

actions/lib/src/node/actions/core.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import 'package:actions/src/node/process.dart';
1010
external Core get core;
1111

1212
@JS()
13-
extension type Core(JSObject it) {
13+
@anonymous
14+
extension type Core._(JSObject it) {
1415
@JS('getInput')
1516
external String _getInput(String name);
1617

actions/lib/src/node/actions/exec.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import 'dart:js_util';
99
external Exec get exec;
1010

1111
@JS()
12-
extension type Exec(JSObject it) {
12+
@anonymous
13+
extension type Exec._(JSObject it) {
1314
@JS('exec')
1415
external JSPromise _exec(
1516
String commandLine, [
@@ -37,9 +38,9 @@ extension type Exec(JSObject it) {
3738
stderr: ((JSUint8Array buffer) =>
3839
stderr.write(utf8.decode(buffer.toDart))).toJS,
3940
),
40-
silent: (!echoOutput).toJS,
41-
cwd: workingDirectory?.toJS,
42-
ignoreReturnCode: (!failOnNonZeroExit).toJS,
41+
silent: !echoOutput,
42+
cwd: workingDirectory,
43+
ignoreReturnCode: !failOnNonZeroExit,
4344
);
4445
try {
4546
final exitCode = await promiseToFuture<int>(
@@ -64,20 +65,18 @@ extension type Exec(JSObject it) {
6465

6566
@JS()
6667
@anonymous
67-
@staticInterop
68-
class _ExecOptions {
68+
extension type _ExecOptions._(JSObject it) {
6969
external factory _ExecOptions({
7070
_ExecListeners? listeners,
71-
JSString? cwd,
72-
JSBoolean? silent,
73-
JSBoolean? ignoreReturnCode,
71+
String? cwd,
72+
bool? silent,
73+
bool? ignoreReturnCode,
7474
});
7575
}
7676

7777
@JS()
7878
@anonymous
79-
@staticInterop
80-
class _ExecListeners {
79+
extension type _ExecListeners._(JSObject it) {
8180
external factory _ExecListeners({
8281
JSFunction? stdout,
8382
JSFunction? stderr,

0 commit comments

Comments
 (0)