Skip to content

Commit

Permalink
fix: Melos stuff (#199)
Browse files Browse the repository at this point in the history
* fix: Melos stuff
  • Loading branch information
j4qfrost committed May 24, 2023
1 parent f297843 commit 20bc466
Show file tree
Hide file tree
Showing 44 changed files with 61 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
smoke:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
Expand All @@ -36,7 +36,7 @@ jobs:
startsWith(github.head_ref, 'feature/')
|| startsWith(github.head_ref, 'fix/')
|| startsWith(github.head_ref, 'refactor/')
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
runner_args: [melos test-unit, dart tool/generated_test_runner.dart]
Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile
@@ -1,10 +1,12 @@
FROM dart:stable

COPY ci/ ci/
COPY packages/ packages/
COPY melos.yaml melos.yaml
COPY pubspec.yaml pubspec.yaml
RUN dart pub global activate -spath packages/cli
RUN dart pub global activate melos
ENV PUB_CACHE=/root/.pub-cache
ENV PATH=$PATH:$PUB_CACHE/bin
RUN melos cache-source
RUN dart --disable-analytics
RUN dart --disable-analytics
5 changes: 3 additions & 2 deletions melos.yaml
Expand Up @@ -5,6 +5,7 @@ packages:
ignore:
- packages/cli/templates/**
- packages/tmp/**
- packages/not_tests/**
- packages/runtime_test_packages/**
- packages/isolate_exec_test_packages/**
command:
Expand Down Expand Up @@ -32,7 +33,7 @@ scripts:
select-pacakge:
no-private: true
cache-source-win:
run: melos exec -- "mkdir %PUB_CACHE%\hosted\pub.dev\$MELOS_PACKAGE_NAME-$MELOS_PACKAGE_VERSION && xcopy $MELOS_PACKAGE_PATH %PUB_CACHE%\hosted\pub.dev\$MELOS_PACKAGE_NAME-$MELOS_PACKAGE_VERSION /Y /s /e"
run: melos exec -- "mkdir %PUB_CACHE%hosted\pub.dev\%MELOS_PACKAGE_NAME%-%MELOS_PACKAGE_VERSION% && xcopy %MELOS_PACKAGE_PATH% %PUB_CACHE%hosted\pub.dev\%MELOS_PACKAGE_NAME%-%MELOS_PACKAGE_VERSION% /Y /s /e"
select-pacakge:
no-private: true
hard-clean:
Expand All @@ -47,5 +48,5 @@ scripts:
select-pacakge:
no-private: true
environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"

2 changes: 1 addition & 1 deletion packages/cli/lib/src/mixins/database_connecting.dart
Expand Up @@ -7,7 +7,7 @@ import 'package:conduit/src/mixins/project.dart';
import 'package:conduit_core/conduit_core.dart';
import 'package:conduit_postgresql/conduit_postgresql.dart';

abstract class CLIDatabaseConnectingCommand implements CLICommand, CLIProject {
mixin CLIDatabaseConnectingCommand implements CLICommand, CLIProject {
static const String flavorPostgreSQL = "postgres";

late DatabaseConfiguration connectedDatabase;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/src/mixins/database_managing.dart
Expand Up @@ -9,7 +9,7 @@ import 'package:conduit/src/scripts/schema_builder.dart';
import 'package:conduit_core/conduit_core.dart';
import 'package:conduit_isolate_exec/conduit_isolate_exec.dart';

abstract class CLIDatabaseManagingCommand implements CLICommand, CLIProject {
mixin CLIDatabaseManagingCommand implements CLICommand, CLIProject {
@Option(
"migration-directory",
help:
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/src/mixins/openapi_options.dart
@@ -1,7 +1,7 @@
import 'package:conduit/src/command.dart';
import 'package:conduit/src/metadata.dart';

abstract class CLIDocumentOptions implements CLICommand {
mixin CLIDocumentOptions implements CLICommand {
@Flag(
"resolve-relative-urls",
defaultsTo: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/src/mixins/project.dart
Expand Up @@ -9,7 +9,7 @@ import 'package:path/path.dart' as path_lib;
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart';

abstract class CLIProject implements CLICommand {
mixin CLIProject implements CLICommand {
@Option(
"directory",
abbr: "d",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.9
homepage: https://github.com/conduit-dart/conduit
description: A modern HTTP server application framework, ORM and OAuth2 provider with OpenAPI 3.0 integration. Foundation for REST, RPC or GraphQL services.
environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"
dependencies:
analyzer: ^5.1.0
args: ^2.1.1
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/db/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ version: 0.0.1
publish_to: none

environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"

dependencies:
conduit: ^4.3.7
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/db_and_auth/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ version: 0.0.1
publish_to: none

environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"

dependencies:
conduit: ^4.3.7
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/default/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ version: 0.0.1
publish_to: none

environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"

dependencies:
conduit: ^4.3.7
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/test/create_test.dart
Expand Up @@ -187,6 +187,8 @@ void main() {
.toFilePath(windows: Platform.isWindows),
);

print(res.stdout);
print(res.stderr);
expect(res.exitCode, 0);

try {
Expand Down
2 changes: 1 addition & 1 deletion packages/codable/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
homepage: https://github.com/conduit-dart/conduit-codable
description: A serialization library for converting dynamic, structured data (JSON, YAML) into Dart types.
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
meta: ^1.3.0
dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion packages/common/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
description: Common classes shared by conduit projects.
repository: https://github.com/bsutton/conduit-orm
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
conduit_open_api: ^4.3.7
dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion packages/config/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
description: A safe and convenient way to read YAML configuration files.
repository: https://github.com/conduit-dart/conduit-config.git
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
conduit_runtime: ^4.3.7
meta: ^1.3.0
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/src/auth/validator.dart
Expand Up @@ -11,7 +11,7 @@ import 'package:conduit_open_api/v3.dart';
/// header of the [Request].
///
/// [AuthServer] implements this interface.
abstract class AuthValidator {
mixin AuthValidator {
/// Returns an [Authorization] if [authorizationData] is valid.
///
/// This method is invoked by [Authorizer] to validate the Authorization header of a request. [authorizationData]
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/src/db/query/mixin.dart
Expand Up @@ -5,7 +5,7 @@ import 'package:conduit_core/src/db/query/page.dart';
import 'package:conduit_core/src/db/query/query.dart';
import 'package:conduit_core/src/db/query/sort_descriptor.dart';

abstract class QueryMixin<InstanceType extends ManagedObject>
mixin QueryMixin<InstanceType extends ManagedObject>
implements Query<InstanceType> {
@override
int offset = 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/src/http/http_codec_repository.dart
Expand Up @@ -241,7 +241,7 @@ class _FormDecoder extends Converter<String, Map<String, dynamic>> {
}
}

class _FormSink extends ChunkedConversionSink<String> {
class _FormSink implements ChunkedConversionSink<String> {
_FormSink(this._outSink);

final _FormDecoder decoder = const _FormDecoder();
Expand Down
5 changes: 0 additions & 5 deletions packages/core/lib/src/runtime/compiler.dart
Expand Up @@ -109,11 +109,6 @@ class ConduitCompiler extends Compiler {
];
_overwritePackageDependency(context, 'conduit_runtime', runtimePackages);

final commonTestPackages = [
{'name': 'conduit_common', 'path': 'common'},
];
_overwritePackageDependency(context, 'common_test', commonTestPackages);

final commonPackages = [
{'name': 'conduit_open_api', 'path': 'open_api'},
];
Expand Down
Expand Up @@ -24,6 +24,7 @@ class ResourceControllerRuntimeImpl extends ResourceControllerRuntime {
final isRequired = allDeclarations[decl.simpleName]!
.metadata
.any((im) => im.reflectee is RequiredBinding);

return getParameterForVariable(decl, isRequired: isRequired);
}).toList();

Expand Down
2 changes: 1 addition & 1 deletion packages/core/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.8
homepage: https://github.com/conduit-dart/conduit
description: This is the core of the framework.
environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"
dependencies:
analyzer: ^5.1.0
args: ^2.1.1
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/db/data_model_type_search_test.dart
Expand Up @@ -50,7 +50,7 @@ class _Mixin {
int? id;
}

abstract class MixinEntity {
mixin MixinEntity {
@Serialize()
String? serialized;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/http/body_encoder_streaming_test.dart
Expand Up @@ -489,7 +489,7 @@ class CrashingEncoder extends Converter<String, List<int>> {
}
}

class CrashingSink extends ChunkedConversionSink<String> {
class CrashingSink implements ChunkedConversionSink<String> {
CrashingSink(this.sink);

Sink<List<int>> sink;
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/fs_test_agent/lib/dart_project_agent.dart
Expand Up @@ -121,7 +121,7 @@ description: desc
version: 0.0.1
environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"
dependencies:
${_asYaml(deps, indent: 1)}
Expand Down
2 changes: 1 addition & 1 deletion packages/fs_test_agent/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
homepage: https://stablekernel.com
description: Utilities for writing tests to validate file system and Dart project directory operations.
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
path: ^1.0.0
pubspec: ^2.0.1
Expand Down
2 changes: 1 addition & 1 deletion packages/isolate_exec/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
homepage: https://github.com/conduit-dart/isolate-exec
description: This library contains types that allow for executing code in a spawned isolate, perhaps with additional imports.
environment:
sdk: ">=2.19.2 <4.0.0"
sdk: ">=3.0.1 <4.0.0"
dependencies:
analyzer: ^5.1.0
glob: ^2.0.0
Expand Down
Expand Up @@ -4,6 +4,6 @@ description: test dependency
publish_to: none

environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'

dependencies:
2 changes: 1 addition & 1 deletion packages/open_api/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
homepage: https://github.com/conduit-dart/open-api-dart
description: Data structures for OpenAPI (Swagger) specification. Reads and writes JSON specifications.
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
conduit_codable: ^4.3.7
meta: ^1.1.5
Expand Down
2 changes: 1 addition & 1 deletion packages/password_hash/lib/pbkdf2.dart
Expand Up @@ -94,7 +94,7 @@ class PBKDF2Exception implements Exception {
String toString() => "PBKDF2Exception: $message";
}

class _XORDigestSink extends Sink<Digest> {
class _XORDigestSink implements Sink<Digest> {
_XORDigestSink(ByteData inputBuffer, Hmac hmac) {
lastDigest = hmac.convert(inputBuffer.buffer.asUint8List()).bytes;
bytes = ByteData(lastDigest.length)
Expand Down
2 changes: 1 addition & 1 deletion packages/password_hash/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
homepage: https://github.com/conduit/dart-password-hash
description: PBKDF2 password hashing utility
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
crypto: ^3.0.2
dev_dependencies:
Expand Down
@@ -1,6 +1,6 @@
import 'package:conduit_core/conduit_core.dart';

class PostgreSQLSchemaGenerator {
mixin PostgreSQLSchemaGenerator {
String get versionTableName => "_conduit_version_pgsql";

List<String> createTable(SchemaTable table, {bool isTemporary = false}) {
Expand Down
2 changes: 1 addition & 1 deletion packages/postgresql/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ version: 4.3.7
repository: https://github.com/conduit-dart/conduit

environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'

dependencies:
collection: ^1.17.1
Expand Down
8 changes: 8 additions & 0 deletions packages/runtime/lib/src/build_manager.dart
Expand Up @@ -4,6 +4,7 @@ import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:conduit_isolate_exec/conduit_isolate_exec.dart';
import 'package:conduit_runtime/runtime.dart';
import 'package:io/io.dart';

class BuildExecutable extends Executable {
BuildExecutable(Map<String, dynamic> message) : super(message) {
Expand Down Expand Up @@ -52,6 +53,13 @@ class BuildManager {
}

strippedScriptFile.writeAsStringSync(scriptSource);

try {
await copyPath(
context.sourceApplicationDirectory.uri.resolve('test/not_tests').path,
context.buildDirectoryUri.resolve('not_tests').path);
} catch (_) {}

await IsolateExecutor.run(
BuildExecutable(context.safeMap),
packageConfigURI:
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/lib/src/generator.dart
Expand Up @@ -45,7 +45,7 @@ description: A runtime generated by package:conduit_runtime
version: 1.0.0
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
""";

String get _loaderShell => """
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/pubspec.yaml
Expand Up @@ -3,7 +3,7 @@ version: 4.3.7
description: Provides behaviors and base types for packages that can use mirrors and be AOT compiled.
repository: https://github.com/conduit-dart/conduit-runtime
environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'
dependencies:
analyzer: ^5.1.0
args: ^2.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime_test_packages/application/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: none

environment:
sdk: '>=2.19.2 <4.0.0'
sdk: '>=3.0.1 <4.0.0'

dependencies:
dependency:
Expand Down

0 comments on commit 20bc466

Please sign in to comment.