Skip to content

Commit

Permalink
Released 3.0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutton committed Jul 2, 2023
1 parent 588ca06 commit 0d8dcb5
Show file tree
Hide file tree
Showing 100 changed files with 3,241 additions and 3,353 deletions.
5 changes: 5 additions & 0 deletions dcli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.0.3
- upgraded to pubspec2 2.5
- Fixed a bug in dcli_core where you couldn't access the parent scope in
withEnvironment.

# 3.0.2
- second attempt at a 3.x release

Expand Down
8 changes: 4 additions & 4 deletions dcli/bin/dcli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import 'package:dcli/src/script/entry_point.dart';
import 'package:dcli/src/util/exit.dart';

void main(List<String> arguments) {
DCli().run(arguments);
void main(List<String> arguments) async {
await DCli().run(arguments);
}

class DCli {
void run(List<String> arguments) {
final exitCode = EntryPoint().process(arguments);
Future<void> run(List<String> arguments) async {
final exitCode = await EntryPoint().process(arguments);

dcliExit(exitCode);
}
Expand Down
8 changes: 4 additions & 4 deletions dcli/bin/dcli_install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import 'package:dcli/src/script/entry_point.dart';

void main(List<String> arguments) {
DCliInstall().run(arguments);
void main(List<String> arguments) async {
await DCliInstall().run(arguments);
}

class DCliInstall {
void run(List<String> arguments) {
Future<void> run(List<String> arguments) async {
final mutableArgs = <String>[...arguments];

if (!mutableArgs.contains('doctor')) {
Expand All @@ -22,6 +22,6 @@ class DCliInstall {
// switches such as -v
mutableArgs.add('install');
}
EntryPoint().process(mutableArgs);
await EntryPoint().process(mutableArgs);
}
}
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/clean.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CleanCommand extends Command {

/// [arguments] contains path to clean
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
String targetPath;

if (arguments.isEmpty) {
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ abstract class Command {
/// Returns the exitCode of the script that is run
/// If a script isn't run then return 0 for success
/// or thrown an exception on any error.
int? run(List<Flag> selectedFlags, List<String> subarguments);
Future<int> run(List<Flag> selectedFlags, List<String> subarguments);

/// name of the command
String get name => _name;
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CompileCommand extends Command {
Flags flagSet = Flags();

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
const exitCode = 0;

var scriptIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CreateCommand extends Command {
Flags flagSet = Flags();

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
var scriptIndex = 0;
TemplateFlag? templateFlag;

Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/doctor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DoctorCommand extends Command {
static const String _commandName = 'doctor';

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
var showScriptDetails = false;

late DartScript script;
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/help.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HelpCommand extends Command {
static const String _commandName = 'help';

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
if (subarguments.isNotEmpty) {
final command = Commands.findCommand(
subarguments[0],
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class InstallCommand extends Command {
bool _requirePrivileges = false;

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
var scriptIndex = 0;

final shell = Shell.current;
Expand Down
13 changes: 7 additions & 6 deletions dcli/lib/src/commands/lock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LockCommand extends Command {

/// [arguments] contains path to prepare
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
String targetPath;

if (arguments.isEmpty) {
Expand All @@ -45,11 +45,11 @@ class LockCommand extends Command {
targetPath = arguments[0];
}

_lock(targetPath);
await _lock(targetPath);
return 0;
}

void _lock(String targetPath) {
Future<void> _lock(String targetPath) async {
if (!exists(targetPath)) {
throw InvalidArgumentException(
'The project path $targetPath does not exists.');
Expand All @@ -67,7 +67,7 @@ class LockCommand extends Command {

final projectDir = Directory(pathToProjectRoot);
// ignore: discarded_futures
var pubspec = PubSpec.load(projectDir);
var pubspec = await PubSpec.load(projectDir);

final file = File(join(pathToProjectRoot, 'pubspec.lock'));
final pubspecLock = file.readAsStringSync().loadPubspecLockFromYaml();
Expand Down Expand Up @@ -119,8 +119,9 @@ class LockCommand extends Command {
return {hosted.package: HostedReference(constrainedVersion)};
} else {
return {
hosted.package:
ExternalHostedReference(hosted.package, hosted.url, version, false)
hosted.package: ExternalHostedReference(
hosted.package, hosted.url, version,
verboseFormat: false)
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/pack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class PackCommand extends Command {

/// [arguments] contains path to clean
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
if (!exists(Resources().resourceRoot) &&
!exists(Resources.pathToPackYaml)) {
throw InvalidArgumentException(
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RunCommand extends Command {
/// [arguments] - the arguments passed directly to the run command.
/// Returns the called processes exitcode;
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
if (arguments.isEmpty) {
throw InvalidArgumentException(
'Expected a script or command. No arguments were found.',
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/upgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UpgradeCommand extends Command {
/// The upgrade command takes no arguments.
/// current directory are upgradeed.
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
if (arguments.isNotEmpty) {
throw InvalidArgumentException(
'dcli upgrade does not take any arguments.');
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class VersionCommand extends Command {
static const String _commandName = 'version';

@override
int run(List<Flag> selectedFlags, List<String> subarguments) {
Future<int> run(List<Flag> selectedFlags, List<String> subarguments) async {
if (subarguments.isNotEmpty) {
throw InvalidArgumentException(
"'dcli version' does not take any arguments. Found $subarguments",
Expand Down
2 changes: 1 addition & 1 deletion dcli/lib/src/commands/warmup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WarmupCommand extends Command {

/// [arguments] contains path to prepare
@override
int run(List<Flag> selectedFlags, List<String> arguments) {
Future<int> run(List<Flag> selectedFlags, List<String> arguments) async {
String targetPath;

if (arguments.isEmpty) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import 'package:dcli/dcli.dart';
///
/// GENERATED - GENERATED
class Ad0e99e6092cc22dd23b09dcab3530c42 extends PackedResource {
/// PackedResource - ..\..\template\project\find\pubspec.yaml
const Ad0e99e6092cc22dd23b09dcab3530c42();
class A06d49b67b870c49c422343065070f397 extends PackedResource {
/// PackedResource - ../../template/project/find/pubspec.yaml
const A06d49b67b870c49c422343065070f397();

/// A hash of the resource (pre packed) calculated by
/// [calculateHash].
Expand All @@ -25,17 +25,19 @@ class Ad0e99e6092cc22dd23b09dcab3530c42 extends PackedResource {
/// this checksum
@override
String get checksum =>
'5963c8eb856536f12623b9cb424c059dce8fc680136419846d094a4fa8fe6d50';
'f8cb5c73ab2544fd02e851b8f6e75d58f93a14d8d60ea6cbca2ab597936e6a10';

/// <package>/resources relative path to the original resource.
@override
String get originalPath => 'template/project/find/pubspec.yaml';

@override
String get content => '''
bmFtZTogc2NyaXB0bmFtZQp2ZXJzaW9uOiAwLjAuMQpkZXNjcmlwdGlvbjogQSBzY3JpcHQgZ2VuZXJh
dGVkIGJ5IGRjbGkuCmVudmlyb25tZW50OiAKICBzZGs6ICc+PTMuMC4wIDw0LjAuMCcKZGVwZW5kZW5j
aWVzOiAKICBhcmdzOiBeMi4zLjEKICBkY2xpOiBeMy4wLjIKICBkY2xpX2NvcmU6IF4zLjAuMgogIHBh
dGg6IF4xLjAuMApkZXZfZGVwZW5kZW5jaWVzOiAKICBsaW50X2hhcmQ6IF40LjAuMAo=
e25hbWU6IHNjcmlwdG5hbWUsIHZlcnNpb246IDAuMC4xLCBlbnZpcm9ubWVudDoge3NkazogPj0zLjAu
MCA8NC4wLjB9LCBkZXNjcmlwdGlvbjogQSBzY3JpcHQgZ2VuZXJhdGVkIGJ5IGRjbGkuLCBkZXBlbmRl
bmNpZXM6IHthcmdzOiB7dmVyc2lvbjogXjIuMy4xfSwgZGNsaToge3ZlcnNpb246IF4zLjAuM30sIGRj
bGlfY29yZToge3ZlcnNpb246IF4zLjAuM30sIHBhdGg6IHt2ZXJzaW9uOiBeMS4wLjB9fSwgZGV2X2Rl
cGVuZGVuY2llczoge2xpbnRfaGFyZDoge3ZlcnNpb246IF40LjAuMH19LCBkZXBlbmRlbmN5X292ZXJy
aWRlczogbnVsbCwgZXhlY3V0YWJsZXM6IG51bGwsIHBsYXRmb3JtczogbnVsbH0K
''';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// ignore: prefer_relative_imports
import 'package:dcli/dcli.dart';

/// GENERATED -- GENERATED
///
/// DO NOT MODIFIY
///
/// This script is generated via [Resource.pack()].
///
/// GENERATED - GENERATED
class A07aa86cf4c4246ad598cd362ee228bc4 extends PackedResource {
/// PackedResource - ../../template/project/full/lib/src/exceptions/app_exception.dart
const A07aa86cf4c4246ad598cd362ee228bc4();

/// A hash of the resource (pre packed) calculated by
/// [calculateHash].
/// This hash can be used to check if the resource needs to
/// be updated on the target system.
/// Use :
/// ```dart
/// calculateHash(pathToResource).hexEncode() == packResource.checksum
/// ```
/// to compare the checksum of the local file with
/// this checksum
@override
String get checksum =>
'a6b4892aad8ae4ac48a62effd9c9cf80539b7d30f2256f0aa97c09d5726182ee';

/// <package>/resources relative path to the original resource.
@override
String get originalPath =>
'template/project/full/lib/src/exceptions/app_exception.dart';

@override
String get content => '''
Ly8vIEFsbCBleGNlcHRpb25zIHRocm93biBzaG91bGQgJ2V4dGVuZHMnIGZyb20gdGhpcyBiYXNlIGNs
YXNzCi8vLyBhcyBpdCBtYWtlcyBpdCBlYXNpZXIgdG8gY2F0Y2ggYW5kIHByb2Nlc3MgZXhjZXB0aW9u
cwovLy8gaW4gYSBjb25zaXN0ZW50IGZhc2hpb24uCi8vLyBJbiBsYXJnZSBhcHBsaWNhdGlvbnMgaXQg
Y2FuIGJlIHVzZWZ1bCB0byBoYXZlIGEgJ2NsYXNzJyBwZXIKLy8vIHRocm93biBleGNlcHRpb24gYXMg
aXQgYWxsb3dzIGZvciAndGFyZ2V0ZWQnIGNhdGNoIGJsb2Nrcy4KY2xhc3MgQXBwRXhjZXB0aW9uIGlt
cGxlbWVudHMgRXhjZXB0aW9uIHsKICBBcHBFeGNlcHRpb24odGhpcy5tZXNzYWdlLCB7cmVxdWlyZWQg
dGhpcy5zaG93VXNhZ2V9KTsKCiAgU3RyaW5nIG1lc3NhZ2U7CiAgYm9vbCBzaG93VXNhZ2U7Cn0KCi8v
LyBUaHJvdyB0aGlzIGV4Y2VwdGlvbiBvciBvbmUgZGVyaXZlZCBmcm9tIGl0IHdoZW4geW91IHdhbnQK
Ly8vIHRoZSBleGVjZXB0aW9uIGNhdXNlIHRoZSBhcHBsaWNhaXRvbiB0byBleGl0IHdpdGggdGhlCi8v
LyBnaXZlbiBbZXhpdENvZGVdLgovLy8gVGhlIFtleGl0Q29kZV0gc2hvdWxkIGJlIGEgcG9zaXRpdmUg
bm9uLXplcm8gdmFsdWUgKHplcm8gaXMgcmVzZXJ2ZWQKLy8vIGZvciBhIHN1Y2Nlc3NmdWwgcnVuKS4K
Y2xhc3MgRXhpdEV4Y2VwdGlvbiBleHRlbmRzIEFwcEV4Y2VwdGlvbiB7CiAgRXhpdEV4Y2VwdGlvbih0
aGlzLmV4aXRDb2RlLCBzdXBlci5tZXNzYWdlLCB7cmVxdWlyZWQgc3VwZXIuc2hvd1VzYWdlfSkKICAg
ICAgOiBhc3NlcnQoZXhpdENvZGUgIT0gMCwgJzAgaXMgcmVzZXJ2ZWQgZm9yIGEgc3VjY2Vzc2Z1bCBm
b3IgcnVuLicpOwogIGludCBleGl0Q29kZTsKfQo=
''';
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import 'package:dcli/dcli.dart';
///
/// GENERATED - GENERATED
class Acafb26c33554a81f6f4f88dac2287b41 extends PackedResource {
/// PackedResource - ..\..\template\project\simple\pubspec.yaml
const Acafb26c33554a81f6f4f88dac2287b41();
class A117670ecffdae99646ec89b9fac5f34f extends PackedResource {
/// PackedResource - ../../template/project/simple/pubspec.yaml
const A117670ecffdae99646ec89b9fac5f34f();

/// A hash of the resource (pre packed) calculated by
/// [calculateHash].
Expand All @@ -25,17 +25,19 @@ class Acafb26c33554a81f6f4f88dac2287b41 extends PackedResource {
/// this checksum
@override
String get checksum =>
'd0f0505c7bc0d2dbd67ac9454c4e8f294a0debef5d795838b5e84ab02f454d04';
'b55c99604b8a23dd04bece7f5103db6fde1ee5597921dd0536e2885083eb5ed0';

/// <package>/resources relative path to the original resource.
@override
String get originalPath => 'template/project/simple/pubspec.yaml';

@override
String get content => '''
bmFtZTogY29uc29sZV9zaW1wbGUKdmVyc2lvbjogMC4wLjEKZGVzY3JpcHRpb246IEEgc2ltcGxlIGNv
bW1hbmQtbGluZSBhcHBsaWNhdGlvbiBjcmVhdGVkIGJ5IGRjbGkKZW52aXJvbm1lbnQ6IAogIHNkazog
Jz49My4wLjAgPDQuMC4wJwpkZXBlbmRlbmNpZXM6IAogIGRjbGk6IF4zLjAuMgogIGRjbGlfY29yZTog
XjMuMC4yCmRldl9kZXBlbmRlbmNpZXM6IAogIGxpbnRfaGFyZDogXjMuMC4wCg==
e25hbWU6IGNvbnNvbGVfc2ltcGxlLCB2ZXJzaW9uOiAwLjAuMSwgZW52aXJvbm1lbnQ6IHtzZGs6ID49
My4wLjAgPDQuMC4wfSwgZGVzY3JpcHRpb246IEEgc2ltcGxlIGNvbW1hbmQtbGluZSBhcHBsaWNhdGlv
biBjcmVhdGVkIGJ5IGRjbGksIGRlcGVuZGVuY2llczoge2RjbGk6IHt2ZXJzaW9uOiBeMy4wLjN9LCBk
Y2xpX2NvcmU6IHt2ZXJzaW9uOiBeMy4wLjN9fSwgZGV2X2RlcGVuZGVuY2llczoge2xpbnRfaGFyZDog
e3ZlcnNpb246IF4zLjAuMH19LCBkZXBlbmRlbmN5X292ZXJyaWRlczogbnVsbCwgZXhlY3V0YWJsZXM6
IG51bGwsIHBsYXRmb3JtczogbnVsbH0K
''';
}
Loading

0 comments on commit 0d8dcb5

Please sign in to comment.