Skip to content

Commit 62dca3b

Browse files
committed
docs(ci): align README API summary and workflow metadata
1 parent 21eba18 commit 62dca3b

4 files changed

Lines changed: 72 additions & 19 deletions

File tree

.github/workflows/build-all-platforms.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
outputs:
4444
release_tag: ${{ steps.tag.outputs.tag }}
4545
release_name: ${{ steps.tag.outputs.name }}
46+
project_version: ${{ steps.version.outputs.project_version }}
4647
steps:
4748
- name: Checkout
4849
uses: actions/checkout@v4
@@ -57,6 +58,12 @@ jobs:
5758
echo "tag=$DATE-$SHORT_REF" >> $GITHUB_OUTPUT
5859
echo "name=Release $DATE-$SHORT_REF" >> $GITHUB_OUTPUT
5960
61+
- name: Read project version
62+
id: version
63+
run: |
64+
VERSION=$(grep '^version:' ${{ env.EXAMPLE_DIR }}/pubspec.yaml | head -n1 | awk '{print $2}' | cut -d'+' -f1)
65+
echo "project_version=$VERSION" >> $GITHUB_OUTPUT
66+
6067
#####################################
6168
# Android build (multi-architecture)
6269
#####################################
@@ -251,7 +258,7 @@ jobs:
251258
$script = @"
252259
[Setup]
253260
AppName=${{ env.PROJECT_NAME }}
254-
AppVersion=1.0.0
261+
AppVersion=${{ needs.prepare.outputs.project_version }}
255262
DefaultDirName={pf}\${{ env.PROJECT_NAME }}
256263
DefaultGroupName=${{ env.PROJECT_NAME }}
257264
OutputBaseFilename=${{ env.PROJECT_SLUG }}-windows-setup

.github/workflows/precompile-binaries.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ jobs:
7474
run: |
7575
export IPHONEOS_DEPLOYMENT_TARGET=12.0
7676
export MACOSX_DEPLOYMENT_TARGET=12.0
77-
# Set environment variables that work for both iOS device and simulator builds
78-
export BINDGEN_EXTRA_CLANG_ARGS="-target aarch64-apple-ios12.0"
7977
dart run cargokit/build_tool/bin/build_tool.dart precompile-binaries -v --manifest-dir=${{ env.RUST_CRATE_DIR }} --repository=${{ env.GITHUB_REPOSITORY }}
8078
env:
8179
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ abstract class JsRuntime {
520520
bool isJobPending();
521521
bool executePendingJob();
522522
MemoryUsage memoryUsage();
523+
void setDumpFlags({required BigInt flags});
523524
void setMemoryLimit({required BigInt limit});
524525
void setGcThreshold({required BigInt threshold});
525526
void setMaxStackSize({required BigInt limit});
@@ -541,7 +542,7 @@ abstract class JsContext {
541542
### JsEngine
542543

543544
```dart
544-
class JsEngine {
545+
abstract class JsEngine {
545546
static Future<JsEngine> create({
546547
JsBuiltinOptions? builtins,
547548
List<JsModule>? modules,
@@ -568,21 +569,43 @@ class JsEngine {
568569
Future<JsValue> evaluateBytecodeModule({required JsModuleBytecode module});
569570
Future<JsValue> evaluateScriptBytecode({required JsScriptBytecode script});
570571
572+
Future<bool> executePendingJob();
573+
Future<void> idle();
574+
Future<bool> isJobPending();
575+
Future<MemoryUsage> memoryUsage();
576+
Future<void> runGc();
577+
Future<void> setGcThreshold({required BigInt threshold});
578+
Future<void> setInfo({required String info});
579+
Future<void> setMaxStackSize({required BigInt limit});
580+
Future<void> setMemoryLimit({required BigInt limit});
571581
Future<void> close(); // drains pending runtime work, then runs GC
572582
bool get running;
573583
bool get closed;
574584
}
575585
```
576586

587+
### JsEngineRuntimeOptions
588+
589+
```dart
590+
sealed class JsEngineRuntimeOptions {
591+
const factory JsEngineRuntimeOptions({
592+
BigInt? memoryLimit,
593+
BigInt? gcThreshold,
594+
BigInt? maxStackSize,
595+
String? info,
596+
});
597+
}
598+
```
599+
577600
### MemoryUsage
578601

579602
```dart
580603
abstract class MemoryUsage {
581-
int get totalMemory;
582-
int get totalAllocations;
583-
int get mallocSize;
584-
int get objCount;
585-
int get strCount;
604+
PlatformInt64 get totalMemory;
605+
PlatformInt64 get totalAllocations;
606+
PlatformInt64 get mallocSize;
607+
PlatformInt64 get objCount;
608+
PlatformInt64 get strCount;
586609
String summary();
587610
}
588611
```
@@ -615,6 +638,7 @@ sealed class JsValue {
615638
```dart
616639
sealed class JsBuiltinOptions {
617640
const factory JsBuiltinOptions({
641+
bool? assert_,
618642
bool? console,
619643
bool? fetch,
620644
bool? timers,
@@ -680,7 +704,7 @@ sealed class JsScriptBytecode {
680704
factory JsScriptBytecode({required String name, required List<int> bytes});
681705
}
682706
683-
class JsBytecode {
707+
abstract class JsBytecode {
684708
static JsModuleBytecode compileSync({
685709
required JsModule module,
686710
JsModuleBytecodeOptions? options,
@@ -801,7 +825,7 @@ Some builtin options expose importable modules, and some install globals directl
801825
| Option | Description |
802826
|--------|-------------|
803827
| `abort` | `AbortController` and abort-related globals |
804-
| `assert` | Assertion helpers |
828+
| `assert_` | Assertion helpers |
805829
| `asyncHooks` | Async lifecycle tracking |
806830
| `buffer` | Buffer utilities for binary data |
807831
| `childProcess` | Child process spawning |

README_zh.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ abstract class JsRuntime {
520520
bool isJobPending();
521521
bool executePendingJob();
522522
MemoryUsage memoryUsage();
523+
void setDumpFlags({required BigInt flags});
523524
void setMemoryLimit({required BigInt limit});
524525
void setGcThreshold({required BigInt threshold});
525526
void setMaxStackSize({required BigInt limit});
@@ -541,7 +542,7 @@ abstract class JsContext {
541542
### JsEngine
542543

543544
```dart
544-
class JsEngine {
545+
abstract class JsEngine {
545546
static Future<JsEngine> create({
546547
JsBuiltinOptions? builtins,
547548
List<JsModule>? modules,
@@ -568,21 +569,43 @@ class JsEngine {
568569
Future<JsValue> evaluateBytecodeModule({required JsModuleBytecode module});
569570
Future<JsValue> evaluateScriptBytecode({required JsScriptBytecode script});
570571
572+
Future<bool> executePendingJob();
573+
Future<void> idle();
574+
Future<bool> isJobPending();
575+
Future<MemoryUsage> memoryUsage();
576+
Future<void> runGc();
577+
Future<void> setGcThreshold({required BigInt threshold});
578+
Future<void> setInfo({required String info});
579+
Future<void> setMaxStackSize({required BigInt limit});
580+
Future<void> setMemoryLimit({required BigInt limit});
571581
Future<void> close(); // 会推进待处理的 runtime 工作,然后执行 GC
572582
bool get running;
573583
bool get closed;
574584
}
575585
```
576586

587+
### JsEngineRuntimeOptions
588+
589+
```dart
590+
sealed class JsEngineRuntimeOptions {
591+
const factory JsEngineRuntimeOptions({
592+
BigInt? memoryLimit,
593+
BigInt? gcThreshold,
594+
BigInt? maxStackSize,
595+
String? info,
596+
});
597+
}
598+
```
599+
577600
### MemoryUsage
578601

579602
```dart
580603
abstract class MemoryUsage {
581-
int get totalMemory;
582-
int get totalAllocations;
583-
int get mallocSize;
584-
int get objCount;
585-
int get strCount;
604+
PlatformInt64 get totalMemory;
605+
PlatformInt64 get totalAllocations;
606+
PlatformInt64 get mallocSize;
607+
PlatformInt64 get objCount;
608+
PlatformInt64 get strCount;
586609
String summary();
587610
}
588611
```
@@ -615,6 +638,7 @@ sealed class JsValue {
615638
```dart
616639
sealed class JsBuiltinOptions {
617640
const factory JsBuiltinOptions({
641+
bool? assert_,
618642
bool? console,
619643
bool? fetch,
620644
bool? timers,
@@ -680,7 +704,7 @@ sealed class JsScriptBytecode {
680704
factory JsScriptBytecode({required String name, required List<int> bytes});
681705
}
682706
683-
class JsBytecode {
707+
abstract class JsBytecode {
684708
static JsModuleBytecode compileSync({
685709
required JsModule module,
686710
JsModuleBytecodeOptions? options,
@@ -801,7 +825,7 @@ sealed class JsError {
801825
| 选项 | 描述 |
802826
|------|------|
803827
| `abort` | `AbortController` 及相关全局对象 |
804-
| `assert` | 断言辅助 |
828+
| `assert_` | 断言辅助 |
805829
| `asyncHooks` | 异步生命周期追踪 |
806830
| `buffer` | Buffer 二进制数据处理 |
807831
| `childProcess` | 子进程派生 |

0 commit comments

Comments
 (0)