Skip to content

Commit

Permalink
chore(version): 1.0.0
Browse files Browse the repository at this point in the history
The first release of Celest V1!
  • Loading branch information
dnys1 committed Oct 14, 2024
1 parent 83e2240 commit beb260e
Show file tree
Hide file tree
Showing 53 changed files with 333 additions and 205 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/celest_cloud_auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: celest_cloud_auth
on:
pull_request:
paths:
- ".github/workflows/celest_cloud_auth.yaml"
- "services/celest_cloud_auth/**"

# Prevent duplicate runs due to Graphite
# https://graphite.dev/docs/troubleshooting#why-are-my-actions-running-twice
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
cancel-in-progress: true

jobs:
analyze_and_format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Git Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
- name: Setup Flutter
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
with:
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
run: melos bootstrap
- name: Analyze
working-directory: services/celest_cloud_auth
run: dart analyze
- name: Format
working-directory: services/celest_cloud_auth
run: dart format --set-exit-if-changed .
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Git Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
- name: Setup Flutter
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
with:
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
run: melos bootstrap
- name: Test
working-directory: services/celest_cloud_auth
run: dart test
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,17 @@ You have now set up your Celest project and integrated it into your Flutter app.
| Package | Description | Pub | Checks |
| -------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [celest](packages/celest/) | The main package for defining Celest backends. | <a href="https://pub.dev/packages/celest" target="_blank"> <img src="https://img.shields.io/pub/v/celest.svg"></a> | [![Celest](https://github.com/celest-dev/celest/actions/workflows/celest.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest.yaml) |
| [celest_ast](packages/celest_ast/) | A structured representation of Celest projects. | <a href="https://pub.dev/packages/celest_ast" target="_blank"> <img src="https://img.shields.io/pub/v/celest_ast.svg"></a> | [![Celest AST](https://github.com/celest-dev/celest/actions/workflows/celest_ast.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_ast.yaml) |
| [celest_ast](packages/celest_ast/) | A structured representation of Celest projects. | <a href="https://pub.dev/packages/celest_ast" target="_blank"> <img src="https://img.shields.io/pub/v/celest_ast.svg"></a> | [![Celest AST](https://github.com/celest-dev/celest/actions/workflows/celest_ast.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_ast.yaml) |
| [celest_auth](packages/celest_auth/) | The authentication and authorization runtimes for Celest. | <a href="https://pub.dev/packages/celest_auth" target="_blank"> <img src="https://img.shields.io/pub/v/celest_auth.svg"></a> | [![Celest Auth](https://github.com/celest-dev/celest/actions/workflows/celest_auth.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_auth.yaml) |
| [celest_cloud](packages/celest_cloud/) | API contracts and Dart clients for the Celest Cloud platform. | <a href="https://pub.dev/packages/celest_cloud" target="_blank"> <img src="https://img.shields.io/pub/v/celest_cloud.svg"></a> | [![Celest Cloud](https://github.com/celest-dev/celest/actions/workflows/celest_cloud.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_cloud.yaml) |
| [celest_core](packages/celest_core/) | Core types and utilities shared between Celest packages. | <a href="https://pub.dev/packages/celest_core" target="_blank"> <img src="https://img.shields.io/pub/v/celest_core.svg"></a> | [![Celest Core](https://github.com/celest-dev/celest/actions/workflows/celest_core.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_core.yaml) |

## Services

| Service | Description | Pub | Checks |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [celest_cloud_auth](packages/celest_cloud_auth/) | A Dart-native authentication and authorization solution built on [Cedar](https://github.com/celest-dev/cedar-dart) and Celest Data. | <a href="https://pub.dev/packages/celest_cloud_auth" target="_blank"> <img src="https://img.shields.io/pub/v/celest_cloud_auth.svg"></a> | [![Celest Cloud Auth](https://github.com/celest-dev/celest/actions/workflows/celest_cloud_auth.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/celest_cloud_auth.yaml) |

## License

This repo is licensed under the [BSD-2-Clause-Patent](https://spdx.org/licenses/BSD-2-Clause-Patent.html) license. See [LICENSE.md](LICENSE.md) for the full text.
Expand Down
Binary file added assets/analyzer-plugin.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/gemini/celest/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_backend:
path: ..
celest_core: ^1.0.0-0
celest_core: ^1.0.0
http: ^1.0.0
meta: ^1.12.0
native_storage: ^0.2.2
Expand Down
Empty file.
1 change: 0 additions & 1 deletion examples/gemini/celest/functions

This file was deleted.

1 change: 0 additions & 1 deletion examples/gemini/celest/project.dart

This file was deleted.

4 changes: 2 additions & 2 deletions examples/gemini/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_ast: ^0.1.0
celest_core: ^1.0.0-0
celest_core: ^1.0.0
google_generative_ai: ^0.2.0
http: '>=0.13.0 <2.0.0'
meta: ^1.12.0
Expand Down
4 changes: 2 additions & 2 deletions examples/openai/celest/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_backend:
path: ..
celest_core: ^1.0.0-0
celest_core: ^1.0.0
http: ^1.0.0
meta: ^1.12.0
native_storage: ^0.2.2
Expand Down
Empty file.
1 change: 0 additions & 1 deletion examples/openai/celest/functions

This file was deleted.

1 change: 0 additions & 1 deletion examples/openai/celest/project.dart

This file was deleted.

4 changes: 2 additions & 2 deletions examples/openai/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_ast: ^0.1.0
celest_core: ^1.0.0-0
celest_core: ^1.0.0
chat_gpt_sdk: ^2.2.8
http: '>=0.13.0 <2.0.0'
meta: ^1.12.0
Expand Down
4 changes: 2 additions & 2 deletions examples/tasks/celest/client/lib/tasks_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ enum CelestEnvironment {

Uri get baseUri => switch (this) {
local => _$celest.kIsWeb || !Platform.isAndroid
? Uri.parse('http://localhost:56902')
: Uri.parse('http://10.0.2.2:56902'),
? Uri.parse('http://localhost:56903')
: Uri.parse('http://10.0.2.2:56903'),
};
}

Expand Down
4 changes: 2 additions & 2 deletions examples/tasks/celest/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_backend:
path: ..
celest_core: ^1.0.0-0
celest_core: ^1.0.0
http: ^1.0.0
native_storage: ^0.2.2

Expand Down
44 changes: 2 additions & 42 deletions examples/tasks/celest/lib/src/generated/data.celest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ library;

import 'package:celest/celest.dart';
import 'package:celest/src/core/context.dart';
import 'package:celest/src/runtime/data/connect.dart';
import 'package:celest_backend/src/database/task_database.dart';
import 'package:drift/native.dart';
import 'package:drift/src/runtime/api/runtime_api.dart';
import 'package:drift/src/runtime/executor/executor.dart';
import 'package:drift_hrana/drift_hrana.dart';

/// The data services for the Celest backend.
///
Expand All @@ -23,7 +20,7 @@ class CelestData {
static Future<void> init(Context context) async {
context.put(
_tasksDatabaseKey,
await _connect(
await connect(
context,
name: 'TaskDatabase',
factory: TaskDatabase.new,
Expand All @@ -40,40 +37,3 @@ class CelestData {
static ContextKey<TaskDatabase> get _tasksDatabaseKey =>
const ContextKey('TaskDatabase');
}

/// Checks the connection to the database by running a simple query.
Future<Database> _checkConnection<Database extends GeneratedDatabase>(
Database db) async {
await db.transaction(() async {
await db.customSelect('SELECT 1').get();
});
return db;
}

/// Constructs a new [Database] and connects to it using the provided
/// [hostnameVariable] and [tokenSecret] configuration values.
Future<Database> _connect<Database extends GeneratedDatabase>(
Context context, {
required String name,
required Database Function(QueryExecutor) factory,
required env hostnameVariable,
required secret tokenSecret,
}) async {
if (context.environment == Environment.local) {
return _checkConnection(factory(NativeDatabase.memory()));
}
final host = context.get(hostnameVariable);
final token = context.get(tokenSecret);
if (host == null || token == null) {
throw StateError(
'Missing database hostname or token for $name. '
'Please set the `$hostnameVariable` and `$tokenSecret` values '
'in the environment or Celest configuration file.',
);
}
final connector = HranaDatabase(
Uri(scheme: 'libsql', host: host),
jwtToken: token,
);
return _checkConnection(factory(connector));
}
4 changes: 1 addition & 3 deletions examples/tasks/celest/lib/src/project.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:celest/celest.dart';
import 'package:celest_backend/src/database/task_database.dart';

const project = Project(
name: 'tasks',
);
const project = Project(name: 'tasks');

const tasksDatabase = Database(
schema: Schema.drift(TaskDatabase),
Expand Down
4 changes: 2 additions & 2 deletions examples/tasks/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest_core: ^1.0.0-0
celest: ^1.0.0
celest_core: ^1.0.0
drift: ^2.20.3
drift_hrana: ^1.0.2
meta: ^1.12.0
Expand Down
Binary file added examples/tasks/web/sqlite3.wasm
Binary file not shown.
72 changes: 71 additions & 1 deletion packages/celest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
## 1.0.0-dev.0
## 1.0.0

The first release of Celest V1! This release includes:

- **Celest Data**

Celest Data is a brand new database offering from Celest built off of SQLite and [Drift](https://pub.dev/packages/drift).

To get started with Celest Data, add a new `Database` component to your Celest project and point it at your Drift schema.

```dart
import 'package:celest/celest.dart';
import 'package:celest_backend/src/database/task_database.dart';
const project = Project(name: 'tasks');
const tasksDatabase = Database(
schema: Schema.drift(TaskDatabase),
);
```

When you run Celest locally, Celest Data will use SQLite to store your data. And when you deploy your Celest project, Celest Data
will automatically switch to using Celest Data backed by [Turso](https://turso.tech/).

- **Celest Cloud Auth**

[Celest Cloud Auth](https://pub.dev/packages/celest_cloud_auth) is an open-source backend service for authenticating users and authorizing access to resources. It is built on the [Cedar](https://www.cedarpolicy.com/en) policy engine and Celest Data.

Now, when adding [Auth]() to your Celest project, Celest will automatically generate the necessary code to integrate Celest Cloud
Auth into your project so you can start authenticating users and controlling the resources they can access.

```dart
import 'package:celest/celest.dart';
const project = Project(name: 'my-project');
const auth = Auth(
providers: [
AuthProvider.email(),
],
);
```

- **Self-Hosting**

Celest now supports self-hosting your Celest project. You can run your Celest project on your own server or cloud provider.
This allows you to have full control over your backend and data.

The new `celest build` command will automatically generate a `Dockerfile` which you can deploy to any server of your choice.

- **Improved Developer Experience**

We have made several improvements to the developer experience, including better error messages, improved documentation, and a
new Dart analyzer plugin which helps you more seamlessly navigate your code. Now, when using the `Go To Definition` feature in
your IDE, you will be taken directly from your frontend to your backend code.

<br />

![Go To Definition](https://github.com/celest-dev/celest/blob/master/assets/analyzer-plugin.gif)

<br />

- **...and much more on the Roadmap!**

We are excited to continue building out the Celest platform and have many more features planned for the future. Our initial release
of Celest V1 provides the foundation for many new features to come include server-side rendering of Flutter app, better integration
of your Data models and Auth policies, Web Hosting, Storage, and much more!

Stay tuned for more updates by following us on [X](https://x.com/Celest_Dev) and joining our [Discord](https://celest.dev/discord).

Flutter is the future! 🚀

## 0.4.2

Expand Down
4 changes: 2 additions & 2 deletions packages/celest/example/celest/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_backend:
path: ../
celest_core: ^1.0.0-0
celest_core: ^1.0.0
http: ^1.0.0
native_storage: ^0.2.2

Expand Down
1 change: 0 additions & 1 deletion packages/celest/example/celest/functions

This file was deleted.

1 change: 0 additions & 1 deletion packages/celest/example/celest/generated

This file was deleted.

1 change: 0 additions & 1 deletion packages/celest/example/celest/project.dart

This file was deleted.

4 changes: 2 additions & 2 deletions packages/celest/example/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest: ^1.0.0
celest_ast: ^0.1.0
celest_core: ^1.0.0-0
celest_core: ^1.0.0
http: '>=0.13.0 <2.0.0'
meta: ^1.12.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:celest_backend/exceptions/bad_name_exception.dart';
import 'package:celest_backend/models/person.dart';
import 'package:celest_backend/src/functions/greeting.dart';
import 'package:test/test.dart';

import '../../functions/greeting.dart';

void main() {
group('greeting', () {
test('sayHello', () async {
Expand Down
4 changes: 1 addition & 3 deletions packages/celest/lib/src/core/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf_router/shelf_router.dart';

/// The [Context] for the current request.
Context get context => Context._current ?? Context._(Zone.current).parent!;
Context get context => Context.current;

/// {@template celest.runtime.celest_context}
/// A per-request context object which propogates request information and common
Expand Down Expand Up @@ -65,8 +65,6 @@ final class Context {
/// The [Context] for the current execution scope.
static Context get current => Context.of(Zone.current);

static Context? get _current => _contexts[Zone.current];

/// Context-specific values.
final Map<ContextKey<Object>, Object> _values = {};

Expand Down
Loading

0 comments on commit beb260e

Please sign in to comment.