From 67de8807ba7cfbffc886f434c29cf30b507d3505 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 19:56:37 -0400 Subject: [PATCH 01/15] ci: share analysis between pushes and unreleased spec builds Pushes were downloading openapi-3.0.yaml from the latest stable release, which still publishes the legacy bundles. Specification builds already have the unreleased artifact, so generation stays on that called workflow. --- .github/workflows/analyze.yaml | 61 ++++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 48 +++----------------------- .github/workflows/generate.yml | 10 +++++- 3 files changed, 75 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/analyze.yaml diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml new file mode 100644 index 0000000..f7a329b --- /dev/null +++ b/.github/workflows/analyze.yaml @@ -0,0 +1,61 @@ +name: Analyze + +on: + push: + branches: + - '**' + pull_request: + workflow_call: + inputs: + artifact: + description: Artifact to analyze instead of checking out the repository. + required: false + type: string + default: '' + +jobs: + analyze: + runs-on: ubuntu-latest + steps: + - if: ${{ inputs.artifact }} + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.artifact }} + + - if: ${{ !inputs.artifact }} + uses: actions/checkout@v7 + + - uses: dart-lang/setup-dart@v1.8.0 + + - run: dart pub get + working-directory: vrchat_dart_generated + + - run: dart analyze + working-directory: vrchat_dart_generated + + pana: + runs-on: ubuntu-latest + strategy: + matrix: + package: [vrchat_dart, vrchat_dart_generated] + defaults: + run: + working-directory: ${{ matrix.package }} + steps: + - if: ${{ inputs.artifact }} + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.artifact }} + + - if: ${{ !inputs.artifact }} + uses: actions/checkout@v7 + + - uses: dart-lang/setup-dart@v1.8.0 + + - run: dart pub get + + - run: dart pub publish --dry-run + + - run: | + dart pub global activate pana + pana --no-warning --exit-code-threshold 0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f5cba36..d203d60 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,8 +1,6 @@ +name: CI + on: - push: - branches: - - '**' - pull_request: workflow_call: inputs: ref: @@ -11,8 +9,6 @@ on: type: string default: main -name: CI - jobs: generate: runs-on: ubuntu-latest @@ -46,40 +42,6 @@ jobs: analyze: needs: generate - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v8 - with: - name: dart-generated - - - uses: dart-lang/setup-dart@v1.8.0 - - - run: dart pub get - working-directory: vrchat_dart_generated - - - run: dart analyze - working-directory: vrchat_dart_generated - - pana: - needs: generate - runs-on: ubuntu-latest - strategy: - matrix: - package: [vrchat_dart, vrchat_dart_generated] - defaults: - run: - working-directory: ${{ matrix.package }} - steps: - - uses: actions/download-artifact@v8 - with: - name: dart-generated - - - uses: dart-lang/setup-dart@v1.8.0 - - - run: dart pub get - - - run: dart pub publish --dry-run - - - run: | - dart pub global activate pana - pana --no-warning --exit-code-threshold 0 + uses: vrchatapi/vrchatapi-dart/.github/workflows/analyze.yaml@main + with: + artifact: dart-generated diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index cc5c497..73bb3eb 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -25,8 +25,16 @@ jobs: - uses: vrchatapi/specification/.github/actions/setup-generator@main + - uses: vrchatapi/specification/.github/actions/download@main + with: + bundle: openapi-3.0.yaml + + - run: | + mkdir -p ../vrchatapi-specification/dist + mv openapi-3.0.yaml ../vrchatapi-specification/dist/ + - name: Generate - run: ./generate.sh + run: ./generate.sh local - name: Check for CHANGELOG changes id: changelog From cbde8089e79c10298d10a1ae9f91a1cd63206d16 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 19:58:36 -0400 Subject: [PATCH 02/15] ci: drop blank lines between workflow steps --- .github/workflows/analyze.yaml | 9 --------- .github/workflows/ci.yaml | 6 ------ .github/workflows/generate.yml | 3 --- 3 files changed, 18 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index f7a329b..ff34074 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -21,15 +21,11 @@ jobs: uses: actions/download-artifact@v8 with: name: ${{ inputs.artifact }} - - if: ${{ !inputs.artifact }} uses: actions/checkout@v7 - - uses: dart-lang/setup-dart@v1.8.0 - - run: dart pub get working-directory: vrchat_dart_generated - - run: dart analyze working-directory: vrchat_dart_generated @@ -46,16 +42,11 @@ jobs: uses: actions/download-artifact@v8 with: name: ${{ inputs.artifact }} - - if: ${{ !inputs.artifact }} uses: actions/checkout@v7 - - uses: dart-lang/setup-dart@v1.8.0 - - run: dart pub get - - run: dart pub publish --dry-run - - run: | dart pub global activate pana pana --no-warning --exit-code-threshold 0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d203d60..77a64da 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,21 +17,15 @@ jobs: with: repository: vrchatapi/vrchatapi-dart ref: ${{ inputs.ref || github.ref }} - - uses: dart-lang/setup-dart@v1.8.0 - - uses: vrchatapi/specification/.github/actions/setup-generator@main - - uses: vrchatapi/specification/.github/actions/download@main with: bundle: openapi-3.0.yaml - - run: | mkdir -p ../vrchatapi-specification/dist mv openapi-3.0.yaml ../vrchatapi-specification/dist/ - - run: ./generate.sh local - - uses: actions/upload-artifact@v7 with: name: dart-generated diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 73bb3eb..224ec85 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -24,15 +24,12 @@ jobs: restore-keys: ${{ env.cache-name }}- - uses: vrchatapi/specification/.github/actions/setup-generator@main - - uses: vrchatapi/specification/.github/actions/download@main with: bundle: openapi-3.0.yaml - - run: | mkdir -p ../vrchatapi-specification/dist mv openapi-3.0.yaml ../vrchatapi-specification/dist/ - - name: Generate run: ./generate.sh local From 8d7acaa091294c330a97ca13c2d216af9f654175 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:09:54 -0400 Subject: [PATCH 03/15] ci: analyze both packages --- .github/workflows/analyze.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index ff34074..9d87e0a 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -16,6 +16,12 @@ on: jobs: analyze: runs-on: ubuntu-latest + strategy: + matrix: + package: [vrchat_dart, vrchat_dart_generated] + defaults: + run: + working-directory: ${{ matrix.package }} steps: - if: ${{ inputs.artifact }} uses: actions/download-artifact@v8 @@ -25,9 +31,7 @@ jobs: uses: actions/checkout@v7 - uses: dart-lang/setup-dart@v1.8.0 - run: dart pub get - working-directory: vrchat_dart_generated - run: dart analyze - working-directory: vrchat_dart_generated pana: runs-on: ubuntu-latest From c889617d7380db309149f0f2ea914c124920bde0 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:11:08 -0400 Subject: [PATCH 04/15] ci: run analyze and pana in one job per package --- .github/workflows/analyze.yaml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 9d87e0a..2bb17c2 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -32,24 +32,6 @@ jobs: - uses: dart-lang/setup-dart@v1.8.0 - run: dart pub get - run: dart analyze - - pana: - runs-on: ubuntu-latest - strategy: - matrix: - package: [vrchat_dart, vrchat_dart_generated] - defaults: - run: - working-directory: ${{ matrix.package }} - steps: - - if: ${{ inputs.artifact }} - uses: actions/download-artifact@v8 - with: - name: ${{ inputs.artifact }} - - if: ${{ !inputs.artifact }} - uses: actions/checkout@v7 - - uses: dart-lang/setup-dart@v1.8.0 - - run: dart pub get - run: dart pub publish --dry-run - run: | dart pub global activate pana From b733b3fb5e45dc529876e38b567075c66afef57d Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:14:58 -0400 Subject: [PATCH 05/15] ci: restore pub cache and cancel stale analysis runs --- .github/workflows/analyze.yaml | 12 ++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 2bb17c2..31d442c 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -13,6 +13,10 @@ on: type: string default: '' +concurrency: + group: ${{ github.repository == 'vrchatapi/vrchatapi-dart' && format('{0}-{1}', github.workflow, github.ref) || format('analyze-{0}', github.run_id) }} + cancel-in-progress: true + jobs: analyze: runs-on: ubuntu-latest @@ -30,6 +34,14 @@ jobs: - if: ${{ !inputs.artifact }} uses: actions/checkout@v7 - uses: dart-lang/setup-dart@v1.8.0 + - name: Pub cache + uses: actions/cache@v6 + env: + cache-name: ${{ matrix.package }} + with: + path: ${{ env.PUB_CACHE }} + key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} + restore-keys: ${{ env.cache-name }}- - run: dart pub get - run: dart analyze - run: dart pub publish --dry-run diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8b22a9..190a1e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Test on: push: branches: - - '**' + - main pull_request: concurrency: From 271d4e372b47d4b7d3458b8eb4bbf12475d8d466 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:20:02 -0400 Subject: [PATCH 06/15] ci: limit analysis runs and fix manual generation --- .github/workflows/analyze.yaml | 2 +- .github/workflows/generate.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 31d442c..4dc3e6d 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -3,7 +3,7 @@ name: Analyze on: push: branches: - - '**' + - main pull_request: workflow_call: inputs: diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 224ec85..999682f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -4,6 +4,12 @@ on: repository_dispatch: types: [release] workflow_dispatch: + inputs: + url: + description: OpenAPI bundle URL. Release dispatches use the triggering release instead. + required: false + type: string + default: https://github.com/vrchatapi/specification/releases/download/nightly/openapi-3.0.yaml jobs: generate: @@ -27,6 +33,7 @@ jobs: - uses: vrchatapi/specification/.github/actions/download@main with: bundle: openapi-3.0.yaml + url: ${{ github.event_name == 'workflow_dispatch' && inputs.url || '' }} - run: | mkdir -p ../vrchatapi-specification/dist mv openapi-3.0.yaml ../vrchatapi-specification/dist/ From 008cffcad846bc13d59758068e2304002cf67081 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:22:41 -0400 Subject: [PATCH 07/15] ci: analyze package libraries instead of examples The example imports a gitignored credentials file, and the Flutter example is a separate app. --- .github/workflows/analyze.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 4dc3e6d..dda9ca0 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -43,7 +43,12 @@ jobs: key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - run: dart pub get - - run: dart analyze + - run: | + if [ -d tool ]; then + dart analyze lib tool + else + dart analyze lib + fi - run: dart pub publish --dry-run - run: | dart pub global activate pana From 40e3089c53069cc6b2197914e6ad1123e9d261ce Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:28:43 -0400 Subject: [PATCH 08/15] Read example credentials from JSON The analyzer no longer needs a credentials file to exist. --- .github/workflows/analyze.yaml | 15 ++++++++---- .github/workflows/test.yml | 2 +- vrchat_dart/.gitignore | 3 ++- vrchat_dart/example/bin/main.dart | 40 +++++++++++++++++++++++-------- 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index dda9ca0..a7ea8b1 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -42,13 +42,20 @@ jobs: path: ${{ env.PUB_CACHE }} key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - - run: dart pub get - run: | + dart pub get + if [ -f example/pubspec.yaml ]; then + dart pub get --directory example + fi + - run: | + set -- lib if [ -d tool ]; then - dart analyze lib tool - else - dart analyze lib + set -- "$@" tool + fi + if [ -d example ]; then + set -- "$@" example fi + dart analyze "$@" - run: dart pub publish --dry-run - run: | dart pub global activate pana diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 190a1e0..d9abaae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: env: SECRET_FILE_CONTENT: ${{ secrets.TEST_CREDENTIALS_FILE }} run: | - echo $SECRET_FILE_CONTENT | base64 -d > vrchat_dart/example/bin/credentials.dart + echo $SECRET_FILE_CONTENT | base64 -d > vrchat_dart/example/bin/credentials.json - name: Run example run: | cd vrchat_dart/example diff --git a/vrchat_dart/.gitignore b/vrchat_dart/.gitignore index a793e3e..24d4fd4 100644 --- a/vrchat_dart/.gitignore +++ b/vrchat_dart/.gitignore @@ -78,4 +78,5 @@ build/ .cookies/ # Credentials -credentials.dart \ No newline at end of file +credentials.dart +credentials.json \ No newline at end of file diff --git a/vrchat_dart/example/bin/main.dart b/vrchat_dart/example/bin/main.dart index ecccd08..796881b 100644 --- a/vrchat_dart/example/bin/main.dart +++ b/vrchat_dart/example/bin/main.dart @@ -1,27 +1,33 @@ import 'dart:convert'; -import 'dart:io'; +import 'dart:io' as io; import 'package:otp/otp.dart'; import 'package:vrchat_dart/vrchat_dart.dart'; -/// Create the file `lib/credentials.dart` with the fields required to make -/// this file happy -import 'credentials.dart'; - const tupperUid = 'usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469'; void main() async { + // Create `bin/credentials.json` with username, password, contactInfo, and + // otpSecret. + final credentials = _credentialsFromJson( + jsonDecode( + await io.File.fromUri( + io.Platform.script.resolve('credentials.json'), + ).readAsString(), + ) as Map, + ); + final api = VrchatDart( userAgent: VrchatUserAgent( applicationName: 'vrchat_dart_example', version: '0.0.0', - contactInfo: Credentials.contactInfo, + contactInfo: credentials.contactInfo, ), ); final (loginSuccess, loginFailure) = await api.auth.login( - username: Credentials.username, - password: Credentials.password, + username: credentials.username, + password: credentials.password, ); if (loginSuccess == null) { @@ -44,7 +50,7 @@ void main() async { // scripts. To get around this, enable 2FA on your account and generate // codes in your script. final code = OTP.generateTOTPCodeString( - Credentials.otpSecret, + credentials.otpSecret, DateTime.timestamp().millisecondsSinceEpoch, algorithm: Algorithm.SHA1, isGoogle: true, @@ -125,13 +131,27 @@ void main() async { print(worldSuccess.data.name); // Do not start websocket streaming if this code is running in CI - if (Platform.environment.containsKey('GITHUB_ACTIONS')) return; + if (io.Platform.environment.containsKey('GITHUB_ACTIONS')) return; // Listen for updates api.streaming.vrcEventStream.listen(handleVrcEvent); api.streaming.start(); } +({ + String username, + String password, + String contactInfo, + String otpSecret, +}) _credentialsFromJson(Map json) { + return ( + username: json['username'] as String, + password: json['password'] as String, + contactInfo: json['contactInfo'] as String, + otpSecret: json['otpSecret'] as String, + ); +} + void handleVrcEvent(VrcStreamingEvent event) { final String message; switch (event.type) { From 14c9a3a68f025733c6d3a9ef0176f97710a816e6 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:33:25 -0400 Subject: [PATCH 09/15] ci: pass analyze paths through the matrix --- .github/workflows/analyze.yaml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index a7ea8b1..92cc3b8 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -22,7 +22,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - package: [vrchat_dart, vrchat_dart_generated] + include: + - package: vrchat_dart + analyze: lib tool example + - package: vrchat_dart_generated + analyze: lib defaults: run: working-directory: ${{ matrix.package }} @@ -42,20 +46,10 @@ jobs: path: ${{ env.PUB_CACHE }} key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - - run: | - dart pub get - if [ -f example/pubspec.yaml ]; then - dart pub get --directory example - fi - - run: | - set -- lib - if [ -d tool ]; then - set -- "$@" tool - fi - if [ -d example ]; then - set -- "$@" example - fi - dart analyze "$@" + - run: dart pub get + - if: matrix.package == 'vrchat_dart' + run: dart pub get --directory example + - run: dart analyze ${{ matrix.analyze }} - run: dart pub publish --dry-run - run: | dart pub global activate pana From 30b621071cb25f70a3ba2e1a3d5e1429de2a4fe3 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:34:02 -0400 Subject: [PATCH 10/15] ci: drop the extra example pub get dart pub get already resolves example/ when it exists. --- .github/workflows/analyze.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 92cc3b8..6285d2b 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -47,8 +47,6 @@ jobs: key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - run: dart pub get - - if: matrix.package == 'vrchat_dart' - run: dart pub get --directory example - run: dart analyze ${{ matrix.analyze }} - run: dart pub publish --dry-run - run: | From 0d4065f9e4bcde0e31415f42c06d8231a4639146 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:36:55 -0400 Subject: [PATCH 11/15] ci: run dart analyze with no path filter --- .github/workflows/analyze.yaml | 8 ++------ vrchat_dart/analysis_options.yaml | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 6285d2b..4dc3e6d 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -22,11 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - include: - - package: vrchat_dart - analyze: lib tool example - - package: vrchat_dart_generated - analyze: lib + package: [vrchat_dart, vrchat_dart_generated] defaults: run: working-directory: ${{ matrix.package }} @@ -47,7 +43,7 @@ jobs: key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - run: dart pub get - - run: dart analyze ${{ matrix.analyze }} + - run: dart analyze - run: dart pub publish --dry-run - run: | dart pub global activate pana diff --git a/vrchat_dart/analysis_options.yaml b/vrchat_dart/analysis_options.yaml index 1b1aabe..b0ba769 100644 --- a/vrchat_dart/analysis_options.yaml +++ b/vrchat_dart/analysis_options.yaml @@ -1 +1,5 @@ include: package:rexios_lints/dart/package_extra.yaml + +analyzer: + exclude: + - example_flutter/** From 041156642f2163812123870f1433c3058f9134c5 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:37:22 -0400 Subject: [PATCH 12/15] ci: treat analyzer infos as failures --- .github/workflows/analyze.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 4dc3e6d..7c308e0 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -43,7 +43,7 @@ jobs: key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - run: dart pub get - - run: dart analyze + - run: dart analyze --fatal-infos - run: dart pub publish --dry-run - run: | dart pub global activate pana From bc299d7357bb1a9685df9f6f6fb3762d63b29d97 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:41:16 -0400 Subject: [PATCH 13/15] Move credential JSON parsing into credentials.dart --- vrchat_dart/.gitignore | 1 - vrchat_dart/example/bin/credentials.dart | 25 ++++++++++++++++++++++++ vrchat_dart/example/bin/main.dart | 18 +++-------------- vrchat_dart/example/pubspec.yaml | 1 + 4 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 vrchat_dart/example/bin/credentials.dart diff --git a/vrchat_dart/.gitignore b/vrchat_dart/.gitignore index 24d4fd4..821b90d 100644 --- a/vrchat_dart/.gitignore +++ b/vrchat_dart/.gitignore @@ -78,5 +78,4 @@ build/ .cookies/ # Credentials -credentials.dart credentials.json \ No newline at end of file diff --git a/vrchat_dart/example/bin/credentials.dart b/vrchat_dart/example/bin/credentials.dart new file mode 100644 index 0000000..fe26363 --- /dev/null +++ b/vrchat_dart/example/bin/credentials.dart @@ -0,0 +1,25 @@ +import 'package:meta/meta.dart'; + +@immutable +class Credentials { + const Credentials({ + required this.username, + required this.password, + required this.contactInfo, + required this.otpSecret, + }); + + factory Credentials.fromJson(Map json) { + return Credentials( + username: json['username'] as String, + password: json['password'] as String, + contactInfo: json['contactInfo'] as String, + otpSecret: json['otpSecret'] as String, + ); + } + + final String username; + final String password; + final String contactInfo; + final String otpSecret; +} diff --git a/vrchat_dart/example/bin/main.dart b/vrchat_dart/example/bin/main.dart index 796881b..0430979 100644 --- a/vrchat_dart/example/bin/main.dart +++ b/vrchat_dart/example/bin/main.dart @@ -4,12 +4,14 @@ import 'dart:io' as io; import 'package:otp/otp.dart'; import 'package:vrchat_dart/vrchat_dart.dart'; +import 'credentials.dart'; + const tupperUid = 'usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469'; void main() async { // Create `bin/credentials.json` with username, password, contactInfo, and // otpSecret. - final credentials = _credentialsFromJson( + final credentials = Credentials.fromJson( jsonDecode( await io.File.fromUri( io.Platform.script.resolve('credentials.json'), @@ -138,20 +140,6 @@ void main() async { api.streaming.start(); } -({ - String username, - String password, - String contactInfo, - String otpSecret, -}) _credentialsFromJson(Map json) { - return ( - username: json['username'] as String, - password: json['password'] as String, - contactInfo: json['contactInfo'] as String, - otpSecret: json['otpSecret'] as String, - ); -} - void handleVrcEvent(VrcStreamingEvent event) { final String message; switch (event.type) { diff --git a/vrchat_dart/example/pubspec.yaml b/vrchat_dart/example/pubspec.yaml index 3098bd3..e1ae50b 100644 --- a/vrchat_dart/example/pubspec.yaml +++ b/vrchat_dart/example/pubspec.yaml @@ -8,6 +8,7 @@ dependencies: vrchat_dart: path: ../ + meta: ^1.16.0 otp: ^3.1.3 dev_dependencies: From 9b92e34a688821de64e7bacc7c436a6e9156120e Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:47:39 -0400 Subject: [PATCH 14/15] Remove flutter dependency from example_flutter --- vrchat_dart/analysis_options.yaml | 4 -- vrchat_dart/example_flutter/.metadata | 45 ------------------- .../example_flutter/analysis_options.yaml | 4 -- vrchat_dart/example_flutter/pubspec.yaml | 3 -- 4 files changed, 56 deletions(-) delete mode 100644 vrchat_dart/example_flutter/.metadata diff --git a/vrchat_dart/analysis_options.yaml b/vrchat_dart/analysis_options.yaml index b0ba769..1b1aabe 100644 --- a/vrchat_dart/analysis_options.yaml +++ b/vrchat_dart/analysis_options.yaml @@ -1,5 +1 @@ include: package:rexios_lints/dart/package_extra.yaml - -analyzer: - exclude: - - example_flutter/** diff --git a/vrchat_dart/example_flutter/.metadata b/vrchat_dart/example_flutter/.metadata deleted file mode 100644 index e7c1001..0000000 --- a/vrchat_dart/example_flutter/.metadata +++ /dev/null @@ -1,45 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled. - -version: - revision: 85684f9300908116a78138ea4c6036c35c9a1236 - channel: stable - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: android - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: ios - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: linux - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: macos - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: web - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: windows - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/vrchat_dart/example_flutter/analysis_options.yaml b/vrchat_dart/example_flutter/analysis_options.yaml index 809fe36..37089f5 100644 --- a/vrchat_dart/example_flutter/analysis_options.yaml +++ b/vrchat_dart/example_flutter/analysis_options.yaml @@ -1,5 +1 @@ include: package:rexios_lints/flutter/core_extra.yaml - -analyzer: - exclude: - - build/** diff --git a/vrchat_dart/example_flutter/pubspec.yaml b/vrchat_dart/example_flutter/pubspec.yaml index 778996d..22ae7e4 100644 --- a/vrchat_dart/example_flutter/pubspec.yaml +++ b/vrchat_dart/example_flutter/pubspec.yaml @@ -5,9 +5,6 @@ environment: sdk: ^3.0.0 dependencies: - flutter: - sdk: flutter - vrchat_dart: path: ../ From 85658d5b0cee6707f6e798c83d1f4a2147e86527 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 6 Oct 2026 20:55:26 -0400 Subject: [PATCH 15/15] Stub Flutter plugins so analysis does not need the Flutter SDK. The example package has to be pub-gotten too, or its own libraries do not resolve. --- .github/workflows/analyze.yaml | 6 +++++- .../lib/vrc_api_container_impl_native.dart | 13 ++++++------- .../lib/vrc_api_container_impl_web.dart | 8 ++++---- vrchat_dart/example_flutter/pubspec.yaml | 3 --- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 7c308e0..51e9e8a 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -42,7 +42,11 @@ jobs: path: ${{ env.PUB_CACHE }} key: ${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }} restore-keys: ${{ env.cache-name }}- - - run: dart pub get + - run: | + dart pub get + if [ -d example_flutter ]; then + dart pub get --directory=example_flutter + fi - run: dart analyze --fatal-infos - run: dart pub publish --dry-run - run: | diff --git a/vrchat_dart/example_flutter/lib/vrc_api_container_impl_native.dart b/vrchat_dart/example_flutter/lib/vrc_api_container_impl_native.dart index 92ede96..9bbd323 100644 --- a/vrchat_dart/example_flutter/lib/vrc_api_container_impl_native.dart +++ b/vrchat_dart/example_flutter/lib/vrc_api_container_impl_native.dart @@ -1,5 +1,3 @@ -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:vrchat_dart/vrchat_dart.dart'; import 'package:vrchat_dart_example_flutter/vrc_api_container_impl_base.dart'; @@ -7,14 +5,15 @@ import 'package:vrchat_dart_example_flutter/vrc_api_container_impl_base.dart'; class VrcApiContainerImpl extends VrcApiContainerImplBase { @override Future create() async { - final packageInfo = await PackageInfo.fromPlatform(); - final appDocDir = await getApplicationDocumentsDirectory(); - final appDocPath = appDocDir.path; + // In a real app, use package_info_plus. + const version = '0.0.0'; + // In a real app, use path_provider. + const appDocPath = 'path/to/application/documents'; return VrchatDart( - userAgent: VrchatUserAgent( + userAgent: const VrchatUserAgent( applicationName: 'vrchat_dart_example', - version: packageInfo.version, + version: version, contactInfo: 'TODO', ), cookiePath: appDocPath, diff --git a/vrchat_dart/example_flutter/lib/vrc_api_container_impl_web.dart b/vrchat_dart/example_flutter/lib/vrc_api_container_impl_web.dart index 0d05a1d..afabd23 100644 --- a/vrchat_dart/example_flutter/lib/vrc_api_container_impl_web.dart +++ b/vrchat_dart/example_flutter/lib/vrc_api_container_impl_web.dart @@ -1,4 +1,3 @@ -import 'package:package_info_plus/package_info_plus.dart'; import 'package:vrchat_dart/vrchat_dart.dart'; import 'package:vrchat_dart_example_flutter/vrc_api_container_impl_base.dart'; @@ -6,11 +5,12 @@ import 'package:vrchat_dart_example_flutter/vrc_api_container_impl_base.dart'; class VrcApiContainerImpl extends VrcApiContainerImplBase { @override Future create() async { - final packageInfo = await PackageInfo.fromPlatform(); + // In a real app, use package_info_plus. + const version = '0.0.0'; return VrchatDart( - userAgent: VrchatUserAgent( + userAgent: const VrchatUserAgent( applicationName: 'vrchat_dart_example', - version: packageInfo.version, + version: version, contactInfo: 'TODO', ), // See nginx.conf for an example nginx configuration diff --git a/vrchat_dart/example_flutter/pubspec.yaml b/vrchat_dart/example_flutter/pubspec.yaml index 22ae7e4..e2ebc93 100644 --- a/vrchat_dart/example_flutter/pubspec.yaml +++ b/vrchat_dart/example_flutter/pubspec.yaml @@ -8,9 +8,6 @@ dependencies: vrchat_dart: path: ../ - path_provider: ^2.0.11 - package_info_plus: ^10.2.1 - dev_dependencies: rexios_lints: ^19.0.0