Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Compose schema from types #53

Merged
merged 50 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7fb5f11
wip: allow schema generation from types
codekeyz Mar 3, 2024
7b50eaf
compose schema from entity type
codekeyz Mar 3, 2024
a5b27b6
set dart sdk version in CI
codekeyz Mar 3, 2024
6d2db55
constrain dart sdk to 3.0.0 for yaroorm
codekeyz Mar 3, 2024
8731b86
tiny fix
codekeyz Mar 3, 2024
f1f36b2
tiny fix
codekeyz Mar 3, 2024
e012195
tiny fix
codekeyz Mar 5, 2024
2487484
tiny fix
codekeyz Mar 6, 2024
3413566
remove reflectable from yaroorm
codekeyz Mar 23, 2024
5234c50
rework orm cli
codekeyz Apr 5, 2024
78279d3
migrations finally working
codekeyz Apr 6, 2024
2eb035b
wip
codekeyz Apr 6, 2024
d2332d6
resolve yaroo cli issues
codekeyz Apr 6, 2024
5238039
don't ignore migration generated file
codekeyz Apr 6, 2024
f469cdb
add build runner package for yaroorm
codekeyz Apr 6, 2024
4f8719a
improvements
codekeyz Apr 7, 2024
df76b8b
handle foreign key auto generation in migration schema
codekeyz Apr 7, 2024
c3e23ee
tiny fix
codekeyz Apr 7, 2024
dd4da2b
more fixes
codekeyz Apr 7, 2024
25bb10a
more improvements towards type-safety
codekeyz Apr 12, 2024
bc43ffb
more codegen improvements
codekeyz Apr 12, 2024
b7cb29a
improve type safety
codekeyz Apr 12, 2024
5836b1d
tiny fix
codekeyz Apr 12, 2024
625da1d
update integration tests
codekeyz Apr 12, 2024
23326c3
wip
codekeyz Apr 12, 2024
8cbdcfe
tiny fix
codekeyz Apr 12, 2024
06ccfb8
tiny fix
codekeyz Apr 12, 2024
cc2e1f5
tiny fix
codekeyz Apr 12, 2024
c31001e
Tiny fix
codekeyz Apr 12, 2024
102b336
tiny fixes
codekeyz Apr 12, 2024
3dc8491
fix formatting
codekeyz Apr 12, 2024
ad7259e
tiny fixes
codekeyz Apr 12, 2024
d7ab8eb
tiny fix
codekeyz Apr 12, 2024
ccc2347
tiny fix
codekeyz Apr 12, 2024
739491a
tiny fix
codekeyz Apr 12, 2024
edc8278
tiny fix
codekeyz Apr 12, 2024
b4ce164
tiny fix
codekeyz Apr 12, 2024
88fd69e
update tests
codekeyz Apr 12, 2024
5246870
updates
codekeyz Apr 12, 2024
311a377
new structure working fine
codekeyz Apr 13, 2024
418831f
tiny improvements
codekeyz Apr 13, 2024
7bf3d8d
fix formatting
codekeyz Apr 13, 2024
e7eeaa2
fix mariadb tests
codekeyz Apr 14, 2024
c2e0e6c
tiny fix
codekeyz Apr 14, 2024
a637fe2
downgrade sqlite commong ffi due to dart version
codekeyz Apr 14, 2024
cb5f4d8
restore sqlite related versions
codekeyz Apr 14, 2024
b0e7ebb
pin sqlite version
codekeyz Apr 14, 2024
7bf67b3
_
codekeyz Apr 14, 2024
079f38e
tiny fix
codekeyz Apr 14, 2024
859e80a
improvements
codekeyz Apr 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: actions/checkout@v3

- uses: dart-lang/setup-dart@v1.3
with:
sdk: "3.0.0"
- uses: bluefireteam/melos-action@v3

- name: Bootstrap
Expand All @@ -32,7 +34,7 @@ jobs:

- name: Check linting
run: |
melos exec -- "dart run build_runner build"
melos builder
melos analyze

test:
Expand All @@ -42,23 +44,27 @@ jobs:
mariadb:
image: mariadb
env:
MYSQL_ROOT_PASSWORD: password
MARIADB_DATABASE: test_db
MARIADB_USER: tester
MARIADB_PASSWORD: password
MARIADB_ROOT_PASSWORD: password
ports:
- 3000:3306
mysql:
mysqldb:
image: mysql
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: 'tester'
MYSQL_DATABASE: test_db
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- 3001:3306
postgres:
postgresdb:
image: postgres:latest
env:
POSTGRES_DB: test_db
POSTGRES_PASSWORD: password
POSTGRES_USER: root
POSTGRES_USER: tester
ports:
- 3002:5432

Expand All @@ -67,27 +73,29 @@ jobs:
uses: actions/checkout@v3

- uses: dart-lang/setup-dart@v1.3
with:
sdk: "3.0.0"
- uses: bluefireteam/melos-action@v3

- name: Prepare Workspace
run: |
dart pub global activate melos
dart pub global activate coverage
melos bootstrap
melos exec -- "dart run build_runner build"
melos builder

- name: Run Unit Tests
run: melos tests:ci

- name: Run E2E Tests
run: cd packages/yaroorm && "./e2e_test.sh"
run: cd packages/orm && "./e2e_test.sh"

- name: Combine Coverage
run: melos coverage
# - name: Combine Coverage
# run: melos coverage

- name: Upload Coverage
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage/*_lcov.info
# - name: Upload Coverage
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# with:
# files: coverage/*_lcov.info
5 changes: 4 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ scripts:
tests:ci:
run: |
melos exec -c 1 -- "dart test --coverage=coverage" --fail-fast

builder:
run: melos exec --ignore="yaroorm_builder" -- "dart run build_runner build --delete-conflicting-outputs"

coverage:
run: |
melos exec -- "dart pub global run coverage:format_coverage --check-ignore --report-on=lib --lcov -o "$MELOS_ROOT_PATH/coverage/$(echo "\$MELOS_PACKAGE_NAME")_lcov.info" -i ./coverage"
find $MELOS_ROOT_PATH/coverage -type f -empty -print -delete

format: melos exec -- "dart format ."
format: melos exec -- "dart format . --line-length=120"

analyze: melos exec -- "dart analyze . --fatal-infos --no-fatal-warnings"
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions packages/generator/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
8 changes: 8 additions & 0 deletions packages/generator/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
builders:
yaroorm_generator:
import: "package:yaroorm_builder/builder.dart"
builder_factories: ["yaroormBuilder"]
build_extensions: { ".dart": [".g.part"] }
auto_apply: dependents
build_to: cache
applies_builders: ["source_gen|combining_builder"]
6 changes: 6 additions & 0 deletions packages/generator/lib/builder.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:build/build.dart';

import 'src/generator.dart';

/// Builds generators for `build_runner` to run
Builder yaroormBuilder(BuilderOptions options) => generatorFactoryBuilder(options);
Loading
Loading