Skip to content

Commit f1d2ecf

Browse files
jwfingclaude
andcommitted
refactor: consolidate SDK into insforge (pure Dart) + insforge_flutter
Merge the six pure-Dart feature packages (insforge_core, insforge_auth, insforge_database, insforge_storage, insforge_functions, insforge_ai) and the unified InsforgeClient into a single pure-Dart `insforge` package, organized under src/{core,auth,database,storage,functions,ai}. InsforgeClient now defaults sessionStorage to InMemorySessionStorage. Extract the Flutter-only pieces (SecureSessionStorage, Insforge singleton) into a new `insforge_flutter` package that re-exports `insforge` and supplies a SecureSessionStorage by default in initialize(). Update the workspace, integration_tests, sample app, and CI to the new layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 07553e5 commit f1d2ecf

154 files changed

Lines changed: 660 additions & 412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ on:
77
pull_request:
88

99
jobs:
10-
# The workspace now contains a Flutter package (packages/insforge), so the
10+
# The workspace contains a Flutter package (packages/insforge_flutter), so the
1111
# whole workspace must be resolved with the Flutter toolchain (which bundles
12-
# Dart). The pure-Dart feature packages are still tested with `dart test`.
12+
# Dart). The pure-Dart `insforge` package is tested with `dart test`.
1313
analyze-and-test:
1414
runs-on: ubuntu-latest
1515
steps:
@@ -21,27 +21,12 @@ jobs:
2121
run: flutter pub get
2222
- name: Analyze
2323
run: dart analyze .
24-
- name: Test insforge_core
25-
working-directory: packages/insforge_core
26-
run: dart test
27-
- name: Test insforge_auth
28-
working-directory: packages/insforge_auth
29-
run: dart test
30-
- name: Test insforge_database
31-
working-directory: packages/insforge_database
32-
run: dart test
33-
- name: Test insforge_storage
34-
working-directory: packages/insforge_storage
35-
run: dart test
36-
- name: Test insforge_functions
37-
working-directory: packages/insforge_functions
38-
run: dart test
39-
- name: Test insforge_ai
40-
working-directory: packages/insforge_ai
41-
run: dart test
42-
- name: Analyze insforge (umbrella)
24+
- name: Test insforge (pure Dart)
4325
working-directory: packages/insforge
26+
run: dart test
27+
- name: Analyze insforge_flutter
28+
working-directory: packages/insforge_flutter
4429
run: flutter analyze
45-
- name: Test insforge (umbrella)
46-
working-directory: packages/insforge
30+
- name: Test insforge_flutter
31+
working-directory: packages/insforge_flutter
4732
run: flutter test

integration_tests/pubspec.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,7 @@ environment:
99

1010
dependencies:
1111
dio: ^5.7.0
12-
insforge_core:
13-
path: ../packages/insforge_core
14-
insforge_auth:
15-
path: ../packages/insforge_auth
16-
insforge_database:
17-
path: ../packages/insforge_database
18-
insforge_storage:
19-
path: ../packages/insforge_storage
20-
insforge_functions:
21-
path: ../packages/insforge_functions
22-
insforge_ai:
23-
path: ../packages/insforge_ai
12+
insforge: ^0.1.0
2413

2514
dev_dependencies:
2615
lints: ^4.0.0

integration_tests/test/ai_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// When a model is unavailable/disabled the API throws; those errors are
88
// caught (mirroring the JS `isModelUnavailable`) and the test is marked
99
// skipped rather than masking a real assertion failure.
10-
import 'package:insforge_ai/insforge_ai.dart';
11-
import 'package:insforge_core/insforge_core.dart';
10+
import 'package:insforge/insforge.dart';
1211
import 'package:test/test.dart';
1312

1413
import 'support/test_env.dart';

integration_tests/test/auth_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
// Signup-flow tests only need core config (base URL + anon key). The
77
// authenticated tests (sign in with the fixed account, profile, signOut) need
88
// a pre-verified account (authConfigured).
9-
import 'package:insforge_auth/insforge_auth.dart';
10-
import 'package:insforge_core/insforge_core.dart';
9+
import 'package:insforge/insforge.dart';
1110
import 'package:test/test.dart';
1211

1312
import 'support/test_env.dart';

integration_tests/test/connectivity_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Basic unauthenticated reachability check. Confirms the configured project
44
// answers HTTP at all — a 2xx or a structured 4xx both prove reachability;
55
// only a network/transport failure is a hard error.
6-
import 'package:insforge_core/insforge_core.dart';
6+
import 'package:insforge/insforge.dart';
77
import 'package:test/test.dart';
88

99
import 'support/test_env.dart';

integration_tests/test/database_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
//
1717
// When the table is absent the suite degrades to asserting that the SDK
1818
// surfaces an InsforgeHttpException, rather than failing.
19-
import 'package:insforge_core/insforge_core.dart';
20-
import 'package:insforge_database/insforge_database.dart';
19+
import 'package:insforge/insforge.dart';
2120
import 'package:test/test.dart';
2221

2322
import 'support/test_env.dart';

integration_tests/test/functions_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
// Prerequisite (optional): a `hello-world` function deployed on the project.
66
// Both a 2xx response and a structured InsforgeHttpException are acceptable
77
// outcomes for an existing slug; a clearly non-existent slug must throw.
8-
import 'package:insforge_core/insforge_core.dart';
9-
import 'package:insforge_functions/insforge_functions.dart';
8+
import 'package:insforge/insforge.dart';
109
import 'package:test/test.dart';
1110

1211
import 'support/test_env.dart';

integration_tests/test/storage_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
import 'dart:convert';
1010
import 'dart:typed_data';
1111

12-
import 'package:insforge_core/insforge_core.dart';
13-
import 'package:insforge_storage/insforge_storage.dart';
12+
import 'package:insforge/insforge.dart';
1413
import 'package:test/test.dart';
1514

1615
import 'support/test_env.dart';

integration_tests/test/support/test_env.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
// NO env vars set every integration test SKIPS (safe for normal CI).
66
import 'dart:io';
77

8-
import 'package:insforge_auth/insforge_auth.dart';
9-
import 'package:insforge_core/insforge_core.dart';
8+
import 'package:insforge/insforge.dart';
109

1110
/// Fallback password used for freshly created (self-registered) users.
1211
const String testPassword = 'Test_P@ssword_123!';

packages/insforge/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
Initial release.

0 commit comments

Comments
 (0)