diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6e8340e..cf853625 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.27.2 + flutter-version: 3.32.5 - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: diff --git a/.gitignore b/.gitignore index 929c9301..384c7ac9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ target/ node_modules/ +# Dart workspace artifacts +.dart_tool + # macOS-specific files .DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8dd6d53..11b14daf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,20 +25,18 @@ repos: - id: cargofmt name: Cargo Format entry: cargo fmt -- --check - pass_filenames: false - # NOTE: language refers to the language in which the hook is implemented - # in, rather than the inputs. In this case we rely on cargo being - # installed on the system + # NOTE: `system` refers to the `entry` above, which is shell. language: system - # NOTE: types/files/exclude narrow the inputs the hook should run on. + # NOTE: types are based on `identify-cli `, e.g. ["file", "python", "text"]. types: [rust] exclude: '^vendor/' + pass_filenames: false - id: cargoclippy name: Cargo Clippy # Be verbose to at least still see warnings scroll by. verbose: true - entry: sh -c 'pnpm i && cargo clippy --workspace --no-deps' + entry: sh -c 'pnpm i --frozen-lockfile --prefer-offline && cargo clippy --workspace --no-deps' language: system types: [rust] exclude: '^vendor/' @@ -46,7 +44,7 @@ repos: - id: cargotest name: Cargo Test - entry: sh -c 'pnpm i && cargo test --workspace -- --show-output' + entry: sh -c 'pnpm i --frozen-lockfile --prefer-offline && cargo test --workspace -- --show-output' language: system types: [rust] exclude: '^(vendor|bindings)/' @@ -57,57 +55,54 @@ repos: name: Prettier entry: pnpm -r format --check language: system - types: [file] - files: .*\.(js|mjs|cjs|ts|jsx|tsx|astro|md|mdx)$ + types_or: [javascript, jsx, ts, tsx, astro, markdown, mdx] + # NOTE: We're relying on pnpm workspaces instead. pass_filenames: false - - id: typescript_check - name: Typescript Check + - id: pnpm_check + name: PNPM Check entry: pnpm -r check language: system - types: [file] - files: .*\.(js|mjs|cjs|ts|jsx|tsx|astro|mdx)$ + types_or: [javascript, jsx, ts, tsx, astro] + # NOTE: We're relying on pnpm workspaces instead. pass_filenames: false - - id: javascript_test - name: JavaScript Test + - id: pnpm_test + name: PNPM Test entry: pnpm -r test language: system - types: [file] - files: .*\.(js|mjs|cjs|ts|jsx|tsx|astro)$ + types_or: [javascript, jsx, ts, tsx, astro] + # NOTE: We're relying on pnpm workspaces instead. pass_filenames: false - id: build_website name: Build Website - entry: sh -c 'cd docs && pnpm build' + entry: sh -c 'pnpm i --frozen-lockfile --prefer-offline && pnpm -C docs build' language: system - types: [file] - files: .*\.(js|mjs|cjs|ts|jsx|tsx|astro)$ + types_or: [javascript, jsx, ts, tsx, astro, markdown, mdx] pass_filenames: false ### Dart: client and example - - id: dart_format - name: Dart format - entry: dart format -o none --set-exit-if-changed client/trailbase-dart examples/blog/flutter - language: system - types: [file] - files: .*\.dart$ - pass_filenames: false - - id: dart_analyze name: Dart analyze - entry: sh -c 'dart pub -C client/trailbase-dart get && dart pub -C examples/blog/flutter get && dart analyze -- client/trailbase-dart examples/blog/flutter' + entry: sh -c 'dart pub get && dart analyze' language: system - types: [file] - files: .*\.dart$ + types: [dart] + # Unlike formatting, analyzing & testing require a project rather than a list of files. pass_filenames: false + - id: dart_format + name: Dart format + entry: dart format -o none --show all --set-exit-if-changed + language: system + types: [dart] + - id: dart_test name: Dart test - entry: sh -c 'cd client/trailbase-dart && dart pub get && dart test' + entry: sh -c 'dart pub get && cd client/trailbase-dart && dart test' language: system - types: [file] - files: .*\.dart$ + types: [dart] + # Unlike formatting, analyzing & testing require a project rather than a list of files. pass_filenames: false ### Dotnet client @@ -115,16 +110,14 @@ repos: name: Dotnet format entry: sh -c 'dotnet format client/trailbase-dotnet/src --verify-no-changes && dotnet format client/trailbase-dotnet/test --verify-no-changes' language: system - types: [file] - files: .*\.(cs|csproj)$ + types: [c#, csproj] pass_filenames: false - id: dotnet_test name: Dotnet test entry: dotnet test client/trailbase-dotnet/test language: system - types: [file] - files: .*\.(cs|csproj)$ + types: [c#, csproj] pass_filenames: false ### Python client @@ -132,24 +125,21 @@ repos: name: Python format entry: poetry -C client/trailbase-py run black --config pyproject.toml --check . language: system - types: [file] - files: .*\.(py)$ + types: [python] pass_filenames: false - id: python_check name: Python check entry: poetry -C client/trailbase-py run pyright --outputjson language: system - types: [file] - files: .*\.(py)$ + types: [python] pass_filenames: false - id: python_test name: Python test entry: poetry -C client/trailbase-py run pytest language: system - types: [file] - files: .*\.(py)$ + types: [python] pass_filenames: false ### Swift client @@ -160,16 +150,14 @@ repos: # if files were altered. entry: swift format -r --in-place client/trailbase-swift/**/*.swift language: system - types: [file] - files: .*\.(swift)$ + types: [swift] pass_filenames: false - id: swift_test name: Swift test entry: swift test --package-path client/trailbase-swift language: system - types: [file] - files: .*\.(swift)$ + types: [swift] pass_filenames: false ### Go client @@ -178,7 +166,7 @@ repos: # gofmt always returns zero exit code :sigh: entry: sh -c 'DIFF=$(gofmt -d -e client/go/trailbase/) && echo "${DIFF}" && test -z "${DIFF}"' language: system - types: [file] + types: [go] files: .*\.(go)$ pass_filenames: false diff --git a/Makefile b/Makefile index 4b0ec395..1dde5bab 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ static: format: pnpm -r format; \ cargo +nightly fmt; \ - dart format client/trailbase-dart/ examples/blog/flutter/; \ + dart format client/trailbase-dart docs/examples/record_api_dart examples/blog/flutter; \ # Don't mess with TrailBase writing config.textproto txtpbfmt `find . -regex ".*.textproto" | grep -v config.textproto`; \ dotnet format client/trailbase-dotnet/src; \ @@ -18,7 +18,7 @@ format: check: pnpm -r check; \ cargo clippy --workspace --no-deps; \ - dart analyze client/trailbase-dart examples/blog/flutter; \ + dart analyze; \ dotnet format client/trailbase-dotnet/src --verify-no-changes; \ dotnet format client/trailbase-dotnet/test --verify-no-changes; \ poetry -C client/trailbase-py run pyright diff --git a/client/trailbase-dart/pubspec.yaml b/client/trailbase-dart/pubspec.yaml index 86afcc76..aaffad7e 100644 --- a/client/trailbase-dart/pubspec.yaml +++ b/client/trailbase-dart/pubspec.yaml @@ -5,7 +5,8 @@ repository: https://github.com/trailbaseio/trailbase version: 0.4.0 environment: - sdk: ^3.5.3 + sdk: ^3.6.1 +resolution: workspace dependencies: crypto: ^3.0.6 @@ -15,4 +16,4 @@ dependencies: dev_dependencies: lints: ^5.1.1 - test: ^1.25.15 + test: ^1.25.0 diff --git a/docs/examples/record_api_dart/pubspec.lock b/docs/examples/record_api_dart/pubspec.lock deleted file mode 100644 index ba5622ad..00000000 --- a/docs/examples/record_api_dart/pubspec.lock +++ /dev/null @@ -1,433 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c" - url: "https://pub.dev" - source: hosted - version: "79.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643 - url: "https://pub.dev" - source: hosted - version: "7.2.0" - args: - dependency: transitive - description: - name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 - url: "https://pub.dev" - source: hosted - version: "2.6.0" - async: - dependency: transitive - description: - name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 - url: "https://pub.dev" - source: hosted - version: "2.12.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - collection: - dependency: transitive - description: - name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.dev" - source: hosted - version: "1.19.1" - convert: - dependency: transitive - description: - name: convert - sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 - url: "https://pub.dev" - source: hosted - version: "3.1.2" - coverage: - dependency: transitive - description: - name: coverage - sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 - url: "https://pub.dev" - source: hosted - version: "1.11.1" - crypto: - dependency: transitive - description: - name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.dev" - source: hosted - version: "3.0.6" - dio: - dependency: transitive - description: - name: dio - sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" - url: "https://pub.dev" - source: hosted - version: "5.8.0+1" - dio_web_adapter: - dependency: transitive - description: - name: dio_web_adapter - sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.dev" - source: hosted - version: "7.0.1" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.dev" - source: hosted - version: "4.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 - url: "https://pub.dev" - source: hosted - version: "3.2.2" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.dev" - source: hosted - version: "4.1.2" - io: - dependency: transitive - description: - name: io - sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b - url: "https://pub.dev" - source: hosted - version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" - jwt_decoder: - dependency: transitive - description: - name: jwt_decoder - sha256: "54774aebf83f2923b99e6416b4ea915d47af3bde56884eb622de85feabbc559f" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - lints: - dependency: "direct dev" - description: - name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 - url: "https://pub.dev" - source: hosted - version: "5.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" - url: "https://pub.dev" - source: hosted - version: "0.1.3-main.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://pub.dev" - source: hosted - version: "0.12.17" - meta: - dependency: transitive - description: - name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c - url: "https://pub.dev" - source: hosted - version: "1.16.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - path: - dependency: transitive - description: - name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - shelf: - dependency: transitive - description: - name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 - url: "https://pub.dev" - source: hosted - version: "1.4.2" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 - url: "https://pub.dev" - source: hosted - version: "1.1.3" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b - url: "https://pub.dev" - source: hosted - version: "2.1.2" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" - url: "https://pub.dev" - source: hosted - version: "0.10.13" - source_span: - dependency: transitive - description: - name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" - url: "https://pub.dev" - source: hosted - version: "1.10.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.dev" - source: hosted - version: "1.12.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.dev" - source: hosted - version: "1.4.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.dev" - source: hosted - version: "1.2.2" - test: - dependency: "direct dev" - description: - name: test - sha256: "8391fbe68d520daf2314121764d38e37f934c02fd7301ad18307bd93bd6b725d" - url: "https://pub.dev" - source: hosted - version: "1.25.14" - test_api: - dependency: transitive - description: - name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://pub.dev" - source: hosted - version: "0.7.4" - test_core: - dependency: transitive - description: - name: test_core - sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa" - url: "https://pub.dev" - source: hosted - version: "0.6.8" - trailbase: - dependency: "direct main" - description: - path: "../../../client/trailbase-dart" - relative: true - source: path - version: "0.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 - url: "https://pub.dev" - source: hosted - version: "15.0.0" - watcher: - dependency: transitive - description: - name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - web: - dependency: transitive - description: - name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" - url: "https://pub.dev" - source: hosted - version: "0.1.6" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - yaml: - dependency: transitive - description: - name: yaml - sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.dev" - source: hosted - version: "3.1.3" -sdks: - dart: ">=3.6.1 <4.0.0" diff --git a/docs/examples/record_api_dart/pubspec.yaml b/docs/examples/record_api_dart/pubspec.yaml index 51255693..50331596 100644 --- a/docs/examples/record_api_dart/pubspec.yaml +++ b/docs/examples/record_api_dart/pubspec.yaml @@ -5,11 +5,12 @@ publish_to: none environment: sdk: ^3.6.1 +resolution: workspace dependencies: trailbase: path: ../../../client/trailbase-dart dev_dependencies: - lints: ^5.0.0 - test: ^1.24.0 + lints: ^5.1.1 + test: ^1.25.0 diff --git a/docs/examples/record_api_dart/test/record_api_test.dart b/docs/examples/record_api_dart/test/record_api_test.dart index 718c68a9..bc43c40c 100644 --- a/docs/examples/record_api_dart/test/record_api_test.dart +++ b/docs/examples/record_api_dart/test/record_api_test.dart @@ -39,44 +39,44 @@ Future connect() async { void main() { test('Test code examples', () async { - final client = await connect(); + final client = await connect(); - final tableStream = await subscribeAll(client); + final tableStream = await subscribeAll(client); - final id = await create(client); + final id = await create(client); - final recordStream = await subscribe(client, id); + final recordStream = await subscribe(client, id); - { - final json = await read(client, id); - final record = SimpleStrict.fromJson(json); - expect(record.textNotNull, equals('test')); - } + { + final json = await read(client, id); + final record = SimpleStrict.fromJson(json); + expect(record.textNotNull, equals('test')); + } - { - await update(client, id); - final json = await read(client, id); - final record = SimpleStrict.fromJson(json); - expect(record.textNotNull, equals('updated')); - } + { + await update(client, id); + final json = await read(client, id); + final record = SimpleStrict.fromJson(json); + expect(record.textNotNull, equals('updated')); + } - await delete(client, id); + await delete(client, id); - expect(await recordStream.length, equals(2)); + expect(await recordStream.length, equals(2)); - final tableEventList = - await tableStream.timeout(Duration(seconds: 5), onTimeout: (sink) { - print('Stream timeout'); - sink.close(); - }).toList(); - expect(tableEventList.length, equals(3)); + final tableEventList = + await tableStream.timeout(Duration(seconds: 5), onTimeout: (sink) { + print('Stream timeout'); + sink.close(); + }).toList(); + expect(tableEventList.length, equals(3)); }); test('Test code listing example', () async { - final client = await connect(); - final results = await list(client); + final client = await connect(); + final results = await list(client); - expect(results.records.length, 3); - expect(results.records[0]['name'], 'Casablanca'); + expect(results.records.length, 3); + expect(results.records[0]['name'], 'Casablanca'); }); } diff --git a/examples/blog/Makefile b/examples/blog/Makefile index de897ee2..5bb093c0 100644 --- a/examples/blog/Makefile +++ b/examples/blog/Makefile @@ -11,28 +11,28 @@ types: $(outputs) schema/article.json: cargo run -- schema articles_view --mode select > $@ web/types/article.ts: schema/article.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ flutter/lib/types/article.dart: schema/article.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ schema/new_article.json: cargo run -- schema articles_view --mode insert > $@ web/types/new_article.ts: schema/new_article.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ schema/profile.json: cargo run -- schema profiles_view --mode select > $@ web/types/profile.ts: schema/profile.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ flutter/lib/types/profile.dart: schema/profile.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ schema/new_profile.json: cargo run -- schema profiles --mode insert > $@ web/types/new_profile.ts: schema/new_profile.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ flutter/lib/types/new_profile.dart: schema/new_profile.json - pnpm quicktype -s schema $< -o $@ + pnpx quicktype -s schema $< -o $@ clean_data: rm -f traildepot/data/* diff --git a/examples/blog/flutter/analysis_options.yaml b/examples/blog/flutter/analysis_options.yaml index efcadb79..4dab9271 100644 --- a/examples/blog/flutter/analysis_options.yaml +++ b/examples/blog/flutter/analysis_options.yaml @@ -11,6 +11,7 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: + # Quicktype prefers double quotes. - lib/types/** linter: diff --git a/examples/blog/flutter/lib/types/article.dart b/examples/blog/flutter/lib/types/article.dart index 20e25ed6..e1270029 100644 --- a/examples/blog/flutter/lib/types/article.dart +++ b/examples/blog/flutter/lib/types/article.dart @@ -63,6 +63,8 @@ class FileUpload { ///The file's original file name. String? filename; + + ///The file's unique id from which the objectstore path is derived. String id; ///The file's inferred mime type. Not user provided. diff --git a/examples/blog/flutter/pubspec.yaml b/examples/blog/flutter/pubspec.yaml index 9392ade9..51d6d8d4 100644 --- a/examples/blog/flutter/pubspec.yaml +++ b/examples/blog/flutter/pubspec.yaml @@ -4,7 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.0.1+1 environment: - sdk: ^3.5.3 + sdk: ^3.6.1 +resolution: workspace dependencies: cupertino_icons: ^1.0.8 diff --git a/examples/coffee-vector-search/README.md b/examples/coffee-vector-search/README.md index 350c7fd9..bf2751fd 100644 --- a/examples/coffee-vector-search/README.md +++ b/examples/coffee-vector-search/README.md @@ -25,4 +25,4 @@ $ docker build . -t coffee && docker run -p 4001:4000 coffee ## Reference -* Coffee data [source](https://github.com/jldbc/coffee-quality-database/blob/master/data/arabica_data_cleaned.csv) +- Coffee data [source](https://github.com/jldbc/coffee-quality-database/blob/master/data/arabica_data_cleaned.csv) diff --git a/examples/blog/flutter/pubspec.lock b/pubspec.lock similarity index 60% rename from examples/blog/flutter/pubspec.lock rename to pubspec.lock index 8bd67b8d..4964ad59 100644 --- a/examples/blog/flutter/pubspec.lock +++ b/pubspec.lock @@ -1,46 +1,94 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" crypto: dependency: transitive description: @@ -50,7 +98,7 @@ packages: source: hosted version: "3.0.6" cupertino_icons: - dependency: "direct main" + dependency: transitive description: name: cupertino_icons sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 @@ -85,18 +133,18 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" ffi: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" file: dependency: transitive description: @@ -106,12 +154,12 @@ packages: source: hosted version: "7.0.1" flutter: - dependency: "direct main" + dependency: transitive description: flutter source: sdk version: "0.0.0" flutter_lints: - dependency: "direct dev" + dependency: transitive description: name: flutter_lints sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" @@ -119,12 +167,12 @@ packages: source: hosted version: "5.0.0" flutter_test: - dependency: "direct dev" + dependency: transitive description: flutter source: sdk version: "0.0.0" flutter_web_auth_2: - dependency: "direct main" + dependency: transitive description: name: flutter_web_auth_2 sha256: "3c14babeaa066c371f3a743f204dd0d348b7d42ffa6fae7a9847a521aff33696" @@ -144,6 +192,30 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" http_parser: dependency: transitive description: @@ -152,6 +224,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" jwt_decoder: dependency: transitive description: @@ -164,18 +252,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -193,7 +281,7 @@ packages: source: hosted version: "5.1.1" logging: - dependency: "direct main" + dependency: transitive description: name: logging sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 @@ -204,10 +292,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -220,18 +308,42 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_provider: dependency: transitive description: @@ -296,8 +408,24 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" shared_preferences: - dependency: "direct main" + dependency: transitive description: name: shared_preferences sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" @@ -352,66 +480,123 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" source_span: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e" + url: "https://pub.dev" + source: hosted + version: "1.25.15" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.3" - trailbase: - dependency: "direct main" + version: "0.7.4" + test_core: + dependency: transitive description: - path: "../../../client/trailbase-dart" - relative: true - source: path - version: "0.4.0" + name: test_core + sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa" + url: "https://pub.dev" + source: hosted + version: "0.6.8" typed_data: dependency: transitive description: @@ -424,10 +609,10 @@ packages: dependency: transitive description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: @@ -496,10 +681,18 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "15.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" web: dependency: transitive description: @@ -508,6 +701,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" window_to_front: dependency: transitive description: @@ -524,6 +741,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" sdks: - dart: ">=3.6.0 <4.0.0" + dart: ">=3.7.0 <4.0.0" flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 00000000..5f85b100 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,8 @@ +name: _ +publish_to: none +environment: + sdk: ^3.6.1 +workspace: + - client/trailbase-dart + - examples/blog/flutter + - docs/examples/record_api_dart