Ver código fonte

Update README.md

Update CHANGELOG.md

Update main.yml

up

up
blueloveTH 3 anos atrás
pai
commit
54b91857bb

+ 3 - 0
.github/workflows/main.yml

@@ -34,6 +34,9 @@ jobs:
         build_dir: web
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+    - uses: actions/upload-artifact@v3
+      with:
+        path: output
   build_test_linux:
     runs-on: ubuntu-latest
     steps:

+ 5 - 0
plugins/flutter/CHANGELOG.md

@@ -1,3 +1,8 @@
+## 0.5.2+3
+
++ Add web support
++ Add `re` module
+
 ## 0.5.1+3
 
 + Fix a bug of parsing large `list/dict/set`

+ 26 - 0
plugins/flutter/README.md

@@ -59,6 +59,32 @@ android {
 
 It should work without any setup.
 
+#### For Web
+
+Download an artifact from https://github.com/blueloveTH/pocketpy/releases/latest.
+
+Unzip it and copy `web/lib` into your root folder where `index.html` locates.
+
+```
+...
+lib/pocketpy.js
+lib/pocketpy.wasm
+index.html
+...
+```
+
+Then open `index.html` and add this line before `flutter.js` tag.
+
+```
+...
+  <!-- This script initializes WASM of pocketpy -->
+  <script src="./lib/pocketpy.js"></script>
+
+  <!-- This script adds the flutter initialization JS code -->
+  <script src="flutter.js" defer></script>
+...
+```
+
 
 #### For Windows
 

+ 1 - 0
plugins/flutter/lib/pocketpy.dart

@@ -1,4 +1,5 @@
 library pocketpy;
 
 export 'jsonrpc.dart';
+export 'common.dart';
 export 'no_web.dart' if (dart.library.html) 'web.dart';

+ 2 - 2
plugins/flutter/pubspec.yaml

@@ -1,6 +1,6 @@
 name: pocketpy
 description: A lightweight Python interpreter for game engines.
-version: 0.5.2+1
+version: 0.5.2+3
 homepage: https://pocketpy.dev
 repository: https://github.com/blueloveth/pocketpy
 
@@ -12,7 +12,7 @@ dependencies:
   flutter:
     sdk: flutter
   ffi: ^2.0.1
-  js: ^0.6.5
+  js: ^0.6.4
 
 dev_dependencies:
   flutter_test: