diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml
index 39dd8fbf..986fbc7f 100644
--- a/.github/workflows/format.yaml
+++ b/.github/workflows/format.yaml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: dart:3.0.0
+ image: dart:3.3.0
steps:
- uses: actions/checkout@v1
diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index 14e12131..53d31eff 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: dart:3.0.0
+ image: dart:3.3.0
steps:
- uses: actions/checkout@v1
diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml
index 31ef6887..cdfb062b 100644
--- a/.github/workflows/unit_tests.yaml
+++ b/.github/workflows/unit_tests.yaml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: dart:3.0.0
+ image: dart:3.3.0
steps:
- uses: actions/checkout@v1
@@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: dart:3.0.0
+ image: dart:3.3.0
steps:
- uses: actions/checkout@v1
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: dart:3.0.0
+ image: dart:3.3.0
steps:
- uses: actions/checkout@v1
diff --git a/sidekick/pubspec.lock b/sidekick/pubspec.lock
index 9ba98646..f2e5a9ec 100644
--- a/sidekick/pubspec.lock
+++ b/sidekick/pubspec.lock
@@ -49,14 +49,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
- basic_utils:
- dependency: transitive
- description:
- name: basic_utils
- sha256: "8815477fcf58499e42326bd858e391442425fa57db9a45e48e15224c62049262"
- url: "https://pub.dev"
- source: hosted
- version: "5.5.4"
boolean_selector:
dependency: transitive
description:
@@ -73,14 +65,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
- charcode:
- dependency: transitive
- description:
- name: charcode
- sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
- url: "https://pub.dev"
- source: hosted
- version: "1.3.1"
checked_yaml:
dependency: transitive
description:
@@ -113,14 +97,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.0"
- cli_util:
- dependency: transitive
- description:
- name: cli_util
- sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7
- url: "https://pub.dev"
- source: hosted
- version: "0.4.0"
clock:
dependency: transitive
description:
@@ -165,10 +141,18 @@ packages:
dependency: transitive
description:
name: csv
- sha256: "016b31a51a913744a0a1655c74ff13c9379e1200e246a03d96c81c5d9ed297b5"
+ sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c
url: "https://pub.dev"
source: hosted
- version: "5.0.2"
+ version: "6.0.0"
+ dart_console:
+ dependency: transitive
+ description:
+ name: dart_console
+ sha256: eae9ddd7bb69477a6e9821c75d575874e290887da09292732a35ab510d1de713
+ url: "https://pub.dev"
+ source: hosted
+ version: "4.1.0"
dart_console2:
dependency: transitive
description:
@@ -189,18 +173,34 @@ packages:
dependency: "direct main"
description:
name: dcli
- sha256: "1b4a960f39e60d177dadbfc57059e391b69ac914c76dc6b91e5ba76b0f92d294"
+ sha256: c076448cee6fe563e1964ade9d4653d855e69d204547791fff0d0fe96c7bd75a
url: "https://pub.dev"
source: hosted
- version: "2.2.3"
- dcli_core:
+ version: "4.0.1-beta.4"
+ dcli_common:
dependency: transitive
+ description:
+ name: dcli_common
+ sha256: c8af0ed248e67b7293cc7ca24a11cc6f3762009ce2a4d0d03c1368e6b0f15fb9
+ url: "https://pub.dev"
+ source: hosted
+ version: "4.0.1-beta.4"
+ dcli_core:
+ dependency: "direct dev"
description:
name: dcli_core
- sha256: "2d5281792dd2a4bf8b612335fd530e91d14f3829debde841720ed9a7552b3a27"
+ sha256: "915b6d7aa9cc039de4be263ecbdac0d372286059f5dba02a8b171748afb4883c"
+ url: "https://pub.dev"
+ source: hosted
+ version: "4.0.1-beta.4"
+ dcli_terminal:
+ dependency: transitive
+ description:
+ name: dcli_terminal
+ sha256: "5449d06b49966796237c5953abc8763dfbc3c29d180ba41f8e182d76c8379840"
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "4.0.1-beta.4"
equatable:
dependency: transitive
description:
@@ -213,18 +213,26 @@ packages:
dependency: transitive
description:
name: ffi
- sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
+ sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
- version: "2.1.0"
+ version: "2.1.2"
file:
dependency: transitive
description:
name: file
- sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
+ sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
- version: "6.1.4"
+ version: "7.0.0"
+ fixnum:
+ dependency: transitive
+ description:
+ name: fixnum
+ sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.1.0"
frontend_server_client:
dependency: transitive
description:
@@ -337,6 +345,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
+ lists:
+ dependency: transitive
+ description:
+ name: lists
+ sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.1"
logging:
dependency: transitive
description:
@@ -365,10 +381,10 @@ packages:
dependency: "direct main"
description:
name: meta
- sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
+ sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
- version: "1.11.0"
+ version: "1.15.0"
mime:
dependency: transitive
description:
@@ -385,6 +401,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.0"
+ native_synchronization:
+ dependency: transitive
+ description:
+ name: native_synchronization
+ sha256: ff200fe0a64d733ff7d4dde2005271c297db81007604c8cd21037959858133ab
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.2.0"
node_preamble:
dependency: transitive
description:
@@ -405,10 +429,10 @@ packages:
dependency: "direct main"
description:
name: path
- sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
+ sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
- version: "1.8.3"
+ version: "1.9.0"
platform:
dependency: transitive
description:
@@ -437,18 +461,18 @@ packages:
dependency: transitive
description:
name: posix
- sha256: "3ad26924254fd2354b0e2b95fc8b45ac392ad87434f8e64807b3a1ac077f2256"
+ sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
url: "https://pub.dev"
source: hosted
- version: "5.0.0"
+ version: "6.0.1"
process:
dependency: "direct main"
description:
name: process
- sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
+ sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32"
url: "https://pub.dev"
source: hosted
- version: "4.2.4"
+ version: "5.0.2"
pub_semver:
dependency: transitive
description:
@@ -473,30 +497,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.2"
- pubspec_parse:
+ pubspec_manager:
dependency: transitive
description:
- name: pubspec_parse
- sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
+ name: pubspec_manager
+ sha256: b2674161f3f69ed07bc164dc4172afc190d56f060a293a8eb6fa691e5ddf9b5c
url: "https://pub.dev"
source: hosted
- version: "1.2.3"
- quiver:
- dependency: transitive
- description:
- name: quiver
- sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47
- url: "https://pub.dev"
- source: hosted
- version: "3.2.1"
- random_string:
+ version: "1.0.0"
+ pubspec_parse:
dependency: transitive
description:
- name: random_string
- sha256: "03b52435aae8cbdd1056cf91bfc5bf845e9706724dd35ae2e99fa14a1ef79d02"
+ name: pubspec_parse
+ sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
url: "https://pub.dev"
source: hosted
- version: "2.3.1"
+ version: "1.2.3"
recase:
dependency: "direct main"
description:
@@ -509,18 +525,18 @@ packages:
dependency: transitive
description:
name: scope
- sha256: e0c880d8f0db2ffd2accd63eeb02396748f3b8a2f71bce4b7d3f8dab75fc8a74
+ sha256: "80cf1cb727791fdaaa4131817974a6084815ed59b9ab02ef352c3a1badea488b"
url: "https://pub.dev"
source: hosted
- version: "3.0.0"
+ version: "4.1.0"
settings_yaml:
dependency: transitive
description:
name: settings_yaml
- sha256: "7b24fabf8595da060cb98d72541d594c3d3c706272b4d7bec70b251473257909"
+ sha256: "415bc91cbcfe8b66b0945fdad8823b439ec9bd31591db6c1a4d2d07cab97899d"
url: "https://pub.dev"
source: hosted
- version: "6.0.0"
+ version: "8.1.0"
shelf:
dependency: transitive
description:
@@ -557,10 +573,10 @@ packages:
dependency: "direct main"
description:
name: sidekick_core
- sha256: "323611a8527b7094ffc4691d6a288de1d187dd017e18e62db7a6165fcc36db77"
+ sha256: "23a62a757d8afa0f5384d2867e6b8e966fc2d9ace1a5b99c48fc0da14bb44d91"
url: "https://pub.dev"
source: hosted
- version: "2.1.0"
+ version: "2.1.2"
sidekick_test:
dependency: "direct dev"
description:
@@ -592,6 +608,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.10.0"
+ sprintf:
+ dependency: transitive
+ description:
+ name: sprintf
+ sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
+ url: "https://pub.dev"
+ source: hosted
+ version: "7.0.0"
stack_trace:
dependency: transitive
description:
@@ -616,6 +640,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
+ strings:
+ dependency: transitive
+ description:
+ name: strings
+ sha256: b33f40c4dd3e597bf6d9e7f4f4dc282dad0f19b07d9f320cb5c2183859cbccf5
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.1.1"
sum_types:
dependency: transitive
description:
@@ -688,22 +720,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
- uri:
+ unicode:
dependency: transitive
description:
- name: uri
- sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a"
+ name: unicode
+ sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1"
url: "https://pub.dev"
source: hosted
- version: "1.0.0"
+ version: "0.3.1"
uuid:
dependency: transitive
description:
name: uuid
- sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
+ sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
url: "https://pub.dev"
source: hosted
- version: "3.0.7"
+ version: "4.4.0"
validators2:
dependency: transitive
description:
@@ -769,4 +801,4 @@ packages:
source: hosted
version: "2.1.1"
sdks:
- dart: ">=3.0.0 <3.999.0"
+ dart: ">=3.3.0 <3.999.0"
diff --git a/sidekick/pubspec.yaml b/sidekick/pubspec.yaml
index 68656e0f..273c5d0d 100644
--- a/sidekick/pubspec.yaml
+++ b/sidekick/pubspec.yaml
@@ -8,22 +8,23 @@ topics:
- cli
environment:
- sdk: '>=2.19.0 <3.999.0'
+ sdk: '>=3.3.0 <3.999.0'
dependencies:
acronym: ^0.5.1
args: ^2.3.2
cli_completion: ^0.3.0
dartx: ^1.0.0
- dcli: '>=2.2.0 <=2.2.3'
+ dcli: ^4.0.1-beta.4
http: '>=0.13.3 <=2.0.0'
meta: ^1.5.0
path: ^1.8.0
- process: ^4.2.4
+ process: ^5.0.2
recase: ^4.0.0
- sidekick_core: ^2.1.0
+ sidekick_core: ^2.1.2
dev_dependencies:
+ dcli_core: ^4.0.0
lint: ^2.0.0
sidekick_test:
path: ../sidekick_test
diff --git a/sidekick/sidekick-cli.iml b/sidekick/sidekick-cli.iml
index 38717d06..60f576f8 100644
--- a/sidekick/sidekick-cli.iml
+++ b/sidekick/sidekick-cli.iml
@@ -9,6 +9,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sidekick/test/init_test.dart b/sidekick/test/init_test.dart
index 054eb68c..9d179335 100644
--- a/sidekick/test/init_test.dart
+++ b/sidekick/test/init_test.dart
@@ -32,7 +32,7 @@ void main() {
final sidekickCoreVersion = versionRegExp
.firstMatch(sidekickCoreFile.readAsStringSync())!
.group(1)!;
- final process = await cachedGlobalSidekickCli
+ final process = await (await cachedGlobalSidekickCli)
.run(['--version'], workingDirectory: Directory.current);
final output = await process.stdoutStream().join('\n');
expect(output, 'sidekick: $version\nsidekick_core: $sidekickCoreVersion');
@@ -49,7 +49,7 @@ void main() {
final projectRoot =
setupTemplateProject('test/templates/minimal_dart_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
@@ -79,7 +79,7 @@ void main() {
final projectRoot =
setupTemplateProject('test/templates/minimal_dart_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
@@ -118,7 +118,7 @@ void main() {
final projectRoot =
setupTemplateProject('test/templates/minimal_dart_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
@@ -156,7 +156,7 @@ void main() {
final projectRoot =
setupTemplateProject('test/templates/minimal_dart_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
@@ -189,7 +189,7 @@ void main() {
test(
'throws error when cli name is invalid',
() async {
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
['init', '-n', '-42invalidName'],
workingDirectory: Directory.systemTemp.createTempSync(),
);
@@ -211,7 +211,7 @@ void main() {
test(
'throws error when cli name collides with an system executable',
() async {
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
['init', '-n', 'rm'],
workingDirectory: Directory.systemTemp.createTempSync(),
);
@@ -248,7 +248,7 @@ void main() {
() async {
final projectRoot =
setupTemplateProject('test/templates/minimal_flutter_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
['init', '-n', 'dashi'],
workingDirectory: projectRoot,
);
@@ -309,7 +309,7 @@ void main() {
addTearDown(() => cliDir.deleteSync(recursive: true));
final entrypointDir = cliDir.directory('foo/custom/projectRoot')
..createSync(recursive: true);
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
@@ -383,7 +383,7 @@ void main() {
() async {
final project =
setupTemplateProject('test/templates/root_with_packages');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
['init', '-n', 'dashi'],
workingDirectory: project,
);
@@ -445,7 +445,7 @@ void main() {
() async {
final projectRoot =
setupTemplateProject('test/templates/minimal_flutter_package');
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
[
'init',
'-n',
diff --git a/sidekick/test/plugins_test.dart b/sidekick/test/plugins_test.dart
index 400b2819..5717c509 100644
--- a/sidekick/test/plugins_test.dart
+++ b/sidekick/test/plugins_test.dart
@@ -1,4 +1,5 @@
import 'package:dcli/dcli.dart';
+import 'package:dcli_core/dcli_core.dart';
import 'package:recase/recase.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_core/src/commands/plugins/create_plugin_command.dart';
diff --git a/sidekick/test/templates/minimal_sidekick_plugin/pubspec.yaml b/sidekick/test/templates/minimal_sidekick_plugin/pubspec.yaml
index ca38159b..6c665a91 100644
--- a/sidekick/test/templates/minimal_sidekick_plugin/pubspec.yaml
+++ b/sidekick/test/templates/minimal_sidekick_plugin/pubspec.yaml
@@ -1,7 +1,7 @@
name: minimal_sidekick_plugin
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dev_dependencies:
sidekick_plugin_installer: ^1.1.0
\ No newline at end of file
diff --git a/sidekick/test/update_test.dart b/sidekick/test/update_test.dart
index 4dd6a435..5ad20d5b 100644
--- a/sidekick/test/update_test.dart
+++ b/sidekick/test/update_test.dart
@@ -49,7 +49,7 @@ void main() {
Future code() async {
when(() => mockProcessManager.runSync(any()))
- .thenAnswer((_) => FakeProcessResult());
+ .thenAnswer((_) => fakeProcessResult());
const latest = '13.12.1989';
fakeGetLatestDependencyVersion({'sidekick': Version.parse(latest)});
final runner =
@@ -86,7 +86,7 @@ void main() {
Future code() async {
when(() => mockProcessManager.runSync(any()))
- .thenAnswer((_) => FakeProcessResult(exitCode: 1, stderr: 'foo'));
+ .thenAnswer((_) => fakeProcessResult(exitCode: 1, stderr: 'foo'));
const latest = '13.12.1989';
fakeGetLatestDependencyVersion({'sidekick': Version.parse(latest)});
@@ -127,17 +127,12 @@ void main() {
class MockProcessManager extends Mock implements ProcessManager {}
-class FakeProcessResult extends Fake implements ProcessResult {
- FakeProcessResult({
- this.exitCode = 0,
- this.stderr,
- });
-
- @override
- final int exitCode;
-
- @override
- final String? stderr;
+ProcessResult fakeProcessResult({
+ int exitCode = 0,
+ String stdout = '',
+ String stderr = '',
+}) {
+ return ProcessResult(0, exitCode, stdout, stderr);
}
void fakeGetLatestDependencyVersion(Map latestVersions) {
diff --git a/sidekick/test/util/cli_runner.dart b/sidekick/test/util/cli_runner.dart
index 4d4b71ce..f1b04333 100644
--- a/sidekick/test/util/cli_runner.dart
+++ b/sidekick/test/util/cli_runner.dart
@@ -19,19 +19,21 @@ void tearDownSidekickCache() {
/// Executes [callback] with copy of cached sidekick CLI to speed up CI tests
///
/// sidekick_core dependency is linked to the local version
-R withSidekickCli(R Function(SidekickCli cli) callback) {
+Future withSidekickCli(
+ Future Function(SidekickCli cli) callback,
+) async {
final copy = Directory.systemTemp.createTempSync();
addTearDown(() => copy.deleteSync(recursive: true));
- waitForEx(_cachedSidekickCli.root.copyRecursively(copy));
+ await (await _cachedSidekickCli).root.copyRecursively(copy);
final cli = SidekickCli._(copy, 'dashi');
return callback(cli);
}
/// Cached sidekick CLI. Don't use directly, use [withSidekickCli] instead.
-final _cachedSidekickCli = waitForEx(() async {
+final _cachedSidekickCli = () async {
_cachedSidekickCliDir = Directory.systemTemp.createTempSync();
- final process = await cachedGlobalSidekickCli.run(
+ final process = await (await cachedGlobalSidekickCli).run(
['init', '-n', 'dashi'],
workingDirectory: _cachedSidekickCliDir!,
);
@@ -51,13 +53,13 @@ final _cachedSidekickCli = waitForEx(() async {
await cli.run([]);
return cli;
-}());
+}();
Directory? _cachedSidekickCliDir;
/// Cached global sidekick CLI to speed up tests on CI
-final cachedGlobalSidekickCli =
- waitForEx(_buildGlobalSidekickCli());
+final Future cachedGlobalSidekickCli =
+ _buildGlobalSidekickCli();
Directory? _cachedGlobalSidekickCliDir;
diff --git a/sidekick_core/lib/sidekick_core.dart b/sidekick_core/lib/sidekick_core.dart
index 224d1e39..3694a5fa 100644
--- a/sidekick_core/lib/sidekick_core.dart
+++ b/sidekick_core/lib/sidekick_core.dart
@@ -45,7 +45,7 @@ export 'package:sidekick_core/src/template/sidekick_package.template.dart';
/// This is used by the update command to determine if your sidekick cli
/// requires an update
// DO NOT MANUALLY EDIT THIS VERSION, instead run `sk bump-version sidekick_core`
-final Version version = Version.parse('2.1.2');
+final Version version = Version.parse('3.0.0-preview.0');
/// Initializes sidekick, call this at the very start of your CLI program
///
diff --git a/sidekick_core/lib/src/commands/bash_command.dart b/sidekick_core/lib/src/commands/bash_command.dart
index a8905ef8..15023bed 100644
--- a/sidekick_core/lib/src/commands/bash_command.dart
+++ b/sidekick_core/lib/src/commands/bash_command.dart
@@ -88,11 +88,18 @@ class BashCommand extends ForwardCommand {
terminal: withStdIn,
);
} catch (e, stack) {
+ final int exitCode;
+ if (e is dcli.RunException) {
+ exitCode = e.exitCode ?? 1;
+ } else {
+ exitCode = progress.exitCode ?? 1;
+ }
+
throw BashCommandException(
script: bashScript,
commandName: name,
arguments: argResults!.arguments,
- exitCode: progress.exitCode!,
+ exitCode: exitCode,
cause: e,
stack: stack,
);
diff --git a/sidekick_core/lib/src/commands/plugins/create_templates/install_only.dart b/sidekick_core/lib/src/commands/plugins/create_templates/install_only.dart
index c3148ae4..b0f17ab0 100644
--- a/sidekick_core/lib/src/commands/plugins/create_templates/install_only.dart
+++ b/sidekick_core/lib/src/commands/plugins/create_templates/install_only.dart
@@ -35,7 +35,7 @@ topics:
- sidekick-plugin
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dependencies:
sidekick_core: ^2.0.0
diff --git a/sidekick_core/lib/src/commands/plugins/create_templates/shared_code.dart b/sidekick_core/lib/src/commands/plugins/create_templates/shared_code.dart
index 65af70a1..52aaef6b 100644
--- a/sidekick_core/lib/src/commands/plugins/create_templates/shared_code.dart
+++ b/sidekick_core/lib/src/commands/plugins/create_templates/shared_code.dart
@@ -49,7 +49,7 @@ topics:
- sidekick-plugin
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dependencies:
sidekick_core: ^2.0.0
diff --git a/sidekick_core/lib/src/commands/plugins/create_templates/shared_command.dart b/sidekick_core/lib/src/commands/plugins/create_templates/shared_command.dart
index 5ee4f9ed..a0751907 100644
--- a/sidekick_core/lib/src/commands/plugins/create_templates/shared_command.dart
+++ b/sidekick_core/lib/src/commands/plugins/create_templates/shared_command.dart
@@ -49,7 +49,7 @@ topics:
- sidekick-plugin
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dependencies:
sidekick_core: ^2.0.0
diff --git a/sidekick_core/lib/src/commands/plugins/install_plugin_command.dart b/sidekick_core/lib/src/commands/plugins/install_plugin_command.dart
index a7d84baa..98c3dd50 100644
--- a/sidekick_core/lib/src/commands/plugins/install_plugin_command.dart
+++ b/sidekick_core/lib/src/commands/plugins/install_plugin_command.dart
@@ -254,7 +254,7 @@ Directory _getPackageRootDirForHostedOrGitSource(ArgResults args) {
final progress = dcli.Progress(
dcli.devNull,
// this parameter has a typo in dcli and actually is captureStdOut
- captureStdin: true,
+ captureStdout: true,
captureStderr: true,
);
try {
diff --git a/sidekick_core/lib/src/commands/update_command.dart b/sidekick_core/lib/src/commands/update_command.dart
index 0c7ecdd4..740c2526 100644
--- a/sidekick_core/lib/src/commands/update_command.dart
+++ b/sidekick_core/lib/src/commands/update_command.dart
@@ -43,12 +43,6 @@ class UpdateCommand extends Command {
.toList();
final futureDartSdkVersionWithLatestPatch = futureDartSdkVersions
- // Make the maximum compatible Dart SDK 3.2.x, because dcli is not
- // compatible with Dart SDK 3.3.0 anymore
- // Dart 3.3.0 waitFor requires --enable_deprecated_wait_for in the VM
- // Dart 3.4.0 waitFor was removed
- // Waiting for dcli 4.0.0 to be released https://github.com/onepub-dev/dcli/issues/229
- .filter((version) => version < Version(3, 3, 0))
.groupBy((v) => Version(v.major, v.minor, 0))
.mapEntries((versionGroup) => versionGroup.value.maxBy((v) => v.patch)!)
.toList();
diff --git a/sidekick_core/lib/src/dart.dart b/sidekick_core/lib/src/dart.dart
index 2497ef81..932e7124 100644
--- a/sidekick_core/lib/src/dart.dart
+++ b/sidekick_core/lib/src/dart.dart
@@ -90,17 +90,26 @@ int systemDart(
throw "Couldn't find dart executable on PATH.";
}
- final process = dcli.startFromArgs(
- systemDartExecutablePath,
- args,
- workingDirectory: workingDirectory?.path,
- progress: progress,
- terminal: progress == null,
- nothrow: nothrow || throwOnError != null,
- );
-
- final exitCode = process.exitCode ?? -1;
-
+ int exitCode = -1;
+ try {
+ final process = dcli.startFromArgs(
+ systemDartExecutablePath,
+ args,
+ workingDirectory: workingDirectory?.path,
+ progress: progress,
+ terminal: progress == null,
+ nothrow: nothrow || throwOnError != null,
+ );
+
+ exitCode = process.exitCode ?? -1;
+ } catch (e) {
+ if (e is dcli.RunException) {
+ exitCode = e.exitCode ?? 1;
+ }
+ if (throwOnError == null) {
+ rethrow;
+ }
+ }
if (exitCode != 0 && throwOnError != null) {
throw throwOnError();
}
@@ -112,7 +121,8 @@ String? systemDartExecutable() =>
// /opt/homebrew/bin/dart
dcli
.start('which dart', progress: Progress.capture(), nothrow: true)
- .firstLine;
+ .lines
+ .firstOrNull;
/// Returns the Dart SDK of the `dart` executable on `PATH`
Directory? systemDartSdk() {
diff --git a/sidekick_core/lib/src/flutter.dart b/sidekick_core/lib/src/flutter.dart
index e78f1580..8a61e399 100644
--- a/sidekick_core/lib/src/flutter.dart
+++ b/sidekick_core/lib/src/flutter.dart
@@ -1,5 +1,3 @@
-import 'dart:async';
-
import 'package:dcli/dcli.dart' as dcli;
import 'package:sidekick_core/sidekick_core.dart';
@@ -24,23 +22,34 @@ int flutter(
}
for (final initializer in _sdkInitializers) {
- final future = initializer(sdk);
- if (future is Future) {
- dcli.waitForEx(future);
- }
+ initializer(
+ FlutterInitializerContext(
+ sdk: sdk,
+ packagePath: workingDirectory,
+ ),
+ );
}
- final process = dcli.startFromArgs(
- Platform.isWindows ? 'bash' : sdk.file('bin/flutter').path,
- [if (Platform.isWindows) sdk.file('bin/flutter.exe').path, ...args],
- workingDirectory: workingDirectory?.absolute.path,
- nothrow: nothrow || throwOnError != null,
- progress: progress,
- terminal: progress == null,
- );
-
- final exitCode = process.exitCode ?? -1;
-
+ int exitCode = -1;
+ try {
+ final process = dcli.startFromArgs(
+ Platform.isWindows ? 'bash' : sdk.file('bin/flutter').path,
+ [if (Platform.isWindows) sdk.file('bin/flutter.exe').path, ...args],
+ workingDirectory: workingDirectory?.absolute.path,
+ nothrow: nothrow || throwOnError != null,
+ progress: progress,
+ terminal: progress == null,
+ );
+
+ exitCode = process.exitCode ?? -1;
+ } catch (e) {
+ if (e is dcli.RunException) {
+ exitCode = e.exitCode ?? 1;
+ }
+ if (throwOnError == null) {
+ rethrow;
+ }
+ }
if (exitCode != 0 && throwOnError != null) {
throw throwOnError();
}
@@ -64,7 +73,8 @@ Directory? systemFlutterSdk() {
// /opt/homebrew/bin/flutter
final path = dcli
.start('which flutter', progress: Progress.capture(), nothrow: true)
- .firstLine ??
+ .lines
+ .firstOrNull ??
env['FLUTTER_ROOT'];
if (path == null) {
// flutter not on path or env.FLUTTER_ROOT
@@ -85,7 +95,7 @@ String? systemFlutterSdkPath() => systemFlutterSdk()?.path;
/// Registers an initializer function that is called before executing the flutter command
/// to prepare the SDK, such as downloading it.
///
-/// This is a global function,
+/// Also this function will be called multiple times, once for each usage of the [flutter] method
Removable addFlutterSdkInitializer(FlutterInitializer initializer) {
if (!_sdkInitializers.contains(initializer)) {
_sdkInitializers.add(initializer);
@@ -97,7 +107,23 @@ Removable addFlutterSdkInitializer(FlutterInitializer initializer) {
typedef Removable = void Function();
/// Called by [flutter] before executing the flutter executable
-typedef FlutterInitializer = FutureOr Function(Directory sdkDir);
+typedef FlutterInitializer = Function(FlutterInitializerContext context);
/// Initializers that have to be executed before executing the flutter command
List _sdkInitializers = [];
+
+/// Called by [flutter] before executing the flutter executable
+class FlutterInitializerContext {
+ FlutterInitializerContext({
+ this.sdk,
+ this.packagePath,
+ });
+
+ /// The Flutter SDK directory, this directory is set by flutterSdkPath in [initializeSidekick]
+ /// Make sure the SDK will be initialized in this directory
+ /// You may want to use a symlink to the actual SDK directory
+ final Directory? sdk;
+
+ /// The package directory where the [flutter] and [dart] command is executed
+ final Directory? packagePath;
+}
diff --git a/sidekick_core/lib/src/template/sidekick_package.template.dart b/sidekick_core/lib/src/template/sidekick_package.template.dart
index e83968ab..b0291d39 100644
--- a/sidekick_core/lib/src/template/sidekick_package.template.dart
+++ b/sidekick_core/lib/src/template/sidekick_package.template.dart
@@ -188,7 +188,7 @@ version: 0.0.1
publish_to: none
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
executables:
main:
diff --git a/sidekick_core/lib/src/update/migration.dart b/sidekick_core/lib/src/update/migration.dart
index 3126f8cc..7a590bde 100644
--- a/sidekick_core/lib/src/update/migration.dart
+++ b/sidekick_core/lib/src/update/migration.dart
@@ -192,8 +192,8 @@ Future migrate({
printerr(e.toString());
printerr(s.toString());
}
- final handling =
- onMigrationStepError?.call(context) ?? MigrationErrorHandling.skip;
+ final handling = await onMigrationStepError?.call(context) ??
+ MigrationErrorHandling.skip;
switch (handling) {
case MigrationErrorHandling.skip:
continue;
diff --git a/sidekick_core/lib/src/update/patches/255_dcli_4.patch.dart b/sidekick_core/lib/src/update/patches/255_dcli_4.patch.dart
new file mode 100644
index 00000000..6e7904d3
--- /dev/null
+++ b/sidekick_core/lib/src/update/patches/255_dcli_4.patch.dart
@@ -0,0 +1,21 @@
+import 'package:pub_semver/pub_semver.dart';
+import 'package:pubspec_parse/pubspec_parse.dart';
+import 'package:sidekick_core/sidekick_core.dart';
+import 'package:sidekick_core/src/update/migration.dart';
+
+final migrateDcli4_255 = MigrationStep.inline(
+ (context) {
+ final pubspecFile = SidekickContext.sidekickPackage.pubspec;
+ final content = pubspecFile.readAsStringSync();
+
+ final pubspec = Pubspec.parse(content);
+
+ pubspec.dependencies.remove('dcli');
+ pubspec.dependencies['dcli'] = HostedDependency(
+ version: VersionConstraint.parse('^4.0.1-beta.4'),
+ );
+ },
+ name: 'Do not ignore sidekick pubspec.lock file',
+ pullRequestLink: 'https://github.com/phntmxyz/sidekick/pull/253',
+ targetVersion: Version(3, 0, 0, pre: 'preview.0'),
+);
diff --git a/sidekick_core/lib/src/update/patches/patch_migrations.dart b/sidekick_core/lib/src/update/patches/patch_migrations.dart
index c2d3c0e9..d98dc27c 100644
--- a/sidekick_core/lib/src/update/patches/patch_migrations.dart
+++ b/sidekick_core/lib/src/update/patches/patch_migrations.dart
@@ -3,6 +3,7 @@ import 'package:sidekick_core/src/update/patches/157_fix_usage_message.patch.dar
import 'package:sidekick_core/src/update/patches/192_add_format_command.patch.dart';
import 'package:sidekick_core/src/update/patches/208_remove_cli_name.patch.dart';
import 'package:sidekick_core/src/update/patches/253_add_lock_file.patch.dart';
+import 'package:sidekick_core/src/update/patches/255_dcli_4.patch.dart';
/// Migration steps from git patches
List patchMigrations = [
@@ -10,4 +11,5 @@ List patchMigrations = [
fixUsageMessage208,
addFormatCommand192,
forceAddPubspecLock253,
+ migrateDcli4_255,
];
diff --git a/sidekick_core/pubspec.yaml b/sidekick_core/pubspec.yaml
index 752fcb0c..6b45b329 100644
--- a/sidekick_core/pubspec.yaml
+++ b/sidekick_core/pubspec.yaml
@@ -1,6 +1,6 @@
name: sidekick_core
description: Shared sidekick commands, plugin engine, migrations, templates and utilities for sidekick CLIs
-version: 2.1.2
+version: 3.0.0-preview.0
repository: https://github.com/phntmxyz/sidekick/tree/main/sidekick_core
issue_tracker: https://github.com/phntmxyz/sidekick/labels/sidekick_core
topics:
@@ -8,14 +8,14 @@ topics:
- cli
environment:
- sdk: '>=2.19.0 <3.999.0'
+ sdk: '>=3.3.0 <3.999.0'
dependencies:
args: ^2.1.0
cli_completion: ^0.3.0
dart_console2: '>=3.0.0 <3.1.0'
dartx: ^1.1.0
- dcli: '>=2.2.0 <=2.2.3'
+ dcli: ^4.0.1-beta.4
glob: ^2.0.2
http: '>=0.13.5 <2.0.0'
meta: ^1.5.0
diff --git a/sidekick_core/test/analyzer_command_test.dart b/sidekick_core/test/analyzer_command_test.dart
index 1910d932..59f99a2e 100644
--- a/sidekick_core/test/analyzer_command_test.dart
+++ b/sidekick_core/test/analyzer_command_test.dart
@@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ tearDown(() => exitCode = 0);
test('analyze command sets exitCode 1 when command fails', () async {
await insideFakeProjectWithSidekick((dir) async {
dir.file('dash_sidekick.dart').writeAsStringSync('''
diff --git a/sidekick_core/test/bash_command_test.dart b/sidekick_core/test/bash_command_test.dart
index 0348023e..0611935f 100644
--- a/sidekick_core/test/bash_command_test.dart
+++ b/sidekick_core/test/bash_command_test.dart
@@ -4,6 +4,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ tearDown(() => exitCode = 0);
test('bash command receives arguments', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
@@ -87,7 +88,9 @@ void main() {
try {
await runner.run(['script']);
fail('should throw');
- } catch (e) {
+ } catch (e, stack) {
+ printOnFailure(e.toString());
+ printOnFailure(stack.toString());
expect(
e,
isA()
diff --git a/sidekick_core/test/dart_command_test.dart b/sidekick_core/test/dart_command_test.dart
index eb5e9e11..b6637f12 100644
--- a/sidekick_core/test/dart_command_test.dart
+++ b/sidekick_core/test/dart_command_test.dart
@@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ tearDown(() => exitCode = 0);
test('dart command works when dartSdkPath is set', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
diff --git a/sidekick_core/test/deps_command_test.dart b/sidekick_core/test/deps_command_test.dart
index f0e6045c..f5f7bbe5 100644
--- a/sidekick_core/test/deps_command_test.dart
+++ b/sidekick_core/test/deps_command_test.dart
@@ -5,6 +5,8 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ tearDown(() => exitCode = 0);
+
void setUpPackages(Directory tempDir) {
final packages = [
'foo/a',
diff --git a/sidekick_core/test/flutter_command_test.dart b/sidekick_core/test/flutter_command_test.dart
index ad3d36da..7d281ad2 100644
--- a/sidekick_core/test/flutter_command_test.dart
+++ b/sidekick_core/test/flutter_command_test.dart
@@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ tearDown(() => exitCode = 0);
test('flutter command works when flutterSdkPath is set', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
@@ -41,11 +42,9 @@ void main() {
runner.addCommand(FlutterCommand());
bool called = false;
- addFlutterSdkInitializer((sdkDir) {
+ addFlutterSdkInitializer((conf) {
fakeFlutterSdk(directory: tempDir);
- return Future.sync(() {
- called = true;
- });
+ called = true;
});
await runner.run(['flutter']);
expect(called, isTrue);
@@ -67,9 +66,7 @@ void main() {
addFlutterSdkInitializer((sdkDir) {
// async
fakeFlutterSdk(directory: tempDir);
- return Future.sync(() {
- called1 = true;
- });
+ called1 = true;
});
bool called2 = false;
@@ -94,7 +91,7 @@ void main() {
runner.addCommand(FlutterCommand());
int called = 0;
- void initializer(Directory path) {
+ void initializer(FlutterInitializerContext context) {
called++;
}
@@ -118,7 +115,7 @@ void main() {
runner.addCommand(FlutterCommand());
int called = 0;
- void initializer(Directory path) {
+ void initializer(FlutterInitializerContext context) {
called++;
}
diff --git a/sidekick_core/test/flutter_test.dart b/sidekick_core/test/flutter_test.dart
index c43bcb03..ed4b08f8 100644
--- a/sidekick_core/test/flutter_test.dart
+++ b/sidekick_core/test/flutter_test.dart
@@ -5,6 +5,8 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';
void main() {
+ final originalPATH = List.unmodifiable(PATH);
+
group('systemFlutterSdkPath', () {
final tempDir = Directory.systemTemp.createTempSync();
final fakeFlutter = tempDir.file('fake_flutter/bin/flutter')
@@ -15,15 +17,20 @@ void main() {
tempDir.deleteSync(recursive: true);
});
- final originalPATH = [...PATH];
setUp(() {
+ PATH.forEach(env.removeFromPATH);
+ originalPATH.forEach(env.appendToPATH);
final whichPath =
start('which which', progress: Progress.capture()).firstLine!;
PATH.where((p) => !whichPath.startsWith(p)).forEach(env.removeFromPATH);
- addTearDown(() {
- PATH.forEach(env.removeFromPATH);
- originalPATH.forEach(env.appendToPATH);
- });
+ env['FLUTTER_ROOT'] = null;
+ env.removeFromPATH('FLUTTER_ROOT');
+ });
+ tearDown(() {
+ PATH.forEach(env.removeFromPATH);
+ originalPATH.forEach(env.appendToPATH);
+ env.removeFromPATH('FLUTTER_ROOT');
+ env['FLUTTER_ROOT'] = null;
});
test('returns null when flutter is not on path or env.FLUTTER_ROOT', () {
diff --git a/sidekick_core/test/format_command_test.dart b/sidekick_core/test/format_command_test.dart
index 83ecb423..1e0a9c57 100644
--- a/sidekick_core/test/format_command_test.dart
+++ b/sidekick_core/test/format_command_test.dart
@@ -18,6 +18,8 @@ void main() {
mainFile.writeAsStringSync(mainContent);
}
+ tearDown(() => exitCode = 0);
+
group('getLineLength', () {
late File pubspecYamlFile;
late DartPackage package;
diff --git a/sidekick_core/test/update_command_test.dart b/sidekick_core/test/update_command_test.dart
index 17c708ca..a3555de9 100644
--- a/sidekick_core/test/update_command_test.dart
+++ b/sidekick_core/test/update_command_test.dart
@@ -15,7 +15,7 @@ void main() {
initialSidekickCliVersion: Version.parse('1.1.0'),
initialSidekickCoreVersion: Version.parse('1.1.0'),
sidekickCoreReleases: [
- _sidekick_core('1.2.0', sdk: '>=2.12.0 <3.0.0'),
+ _sidekick_core('2.0.0', sdk: '>=3.3.0 <4.0.0'),
],
);
await testCase.execute((command) async {
@@ -199,7 +199,7 @@ class _UpdateCommandTestCase {
required this.sidekickCoreReleases,
List? dartSdks,
this.dartSdkVersion,
- }) : dartSdks = dartSdks ?? [Version.parse('2.19.6')];
+ }) : dartSdks = dartSdks ?? [Version.parse('3.3.0')];
final printLog = [];
final command = UpdateCommand();
diff --git a/sidekick_plugin_installer/pubspec.yaml b/sidekick_plugin_installer/pubspec.yaml
index 2baa936c..fcf8239f 100644
--- a/sidekick_plugin_installer/pubspec.yaml
+++ b/sidekick_plugin_installer/pubspec.yaml
@@ -8,12 +8,12 @@ topics:
- cli
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dependencies:
analyzer: '>=4.0.0 <6.0.0'
- dcli: ^2.2.0
- sidekick_core: ^2.0.0
+ dcli: ^4.0.1-beta.4
+ sidekick_core: ^2.1.2
dev_dependencies:
lint: ^2.0.0
diff --git a/sidekick_plugin_installer/test/register_plugin_test.dart b/sidekick_plugin_installer/test/register_plugin_test.dart
index 2ea5bca3..24692e1d 100644
--- a/sidekick_plugin_installer/test/register_plugin_test.dart
+++ b/sidekick_plugin_installer/test/register_plugin_test.dart
@@ -5,8 +5,8 @@ import 'package:test/test.dart';
void main() {
group('Register plugin', () {
- test('A command gets added', () {
- insideFakeProjectWithSidekick((dir) async {
+ test('A command gets added', () async {
+ await insideFakeProjectWithSidekick((dir) async {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithoutImportAndCommand,
);
@@ -24,8 +24,8 @@ void main() {
test(
'A command does not get double added if the command is already present',
- () {
- insideFakeProjectWithSidekick((dir) async {
+ () async {
+ await insideFakeProjectWithSidekick((dir) async {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithMyCommand,
);
@@ -41,8 +41,8 @@ void main() {
});
});
- test('A import gets added', () {
- insideFakeProjectWithSidekick((dir) async {
+ test('A import gets added', () async {
+ await insideFakeProjectWithSidekick((dir) async {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithoutImportAndCommand,
);
@@ -59,8 +59,8 @@ void main() {
});
});
test('A import does not get double added if the command is already present',
- () {
- insideFakeProjectWithSidekick((dir) async {
+ () async {
+ await insideFakeProjectWithSidekick((dir) async {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithMyImport,
);
diff --git a/sidekick_test/lib/src/local_testing.dart b/sidekick_test/lib/src/local_testing.dart
index 06c9d75c..6fab7c93 100644
--- a/sidekick_test/lib/src/local_testing.dart
+++ b/sidekick_test/lib/src/local_testing.dart
@@ -5,6 +5,7 @@ import 'package:dartx/dartx_io.dart';
import 'package:dcli/dcli.dart';
import 'package:dcli/posix.dart';
import 'package:path/path.dart';
+import 'package:pubspec_manager/pubspec_manager.dart';
import 'package:sidekick_test/src/download_dart.sh.template.dart';
import 'package:sidekick_test/src/sidekick_config.sh.template.dart';
import 'package:test/test.dart';
@@ -215,12 +216,17 @@ void _overrideDependency({
required String path,
}) {
final pubspecPath = package.file('pubspec.yaml').path;
- final pubspec = PubSpec.fromFile(pubspecPath);
- pubspec.dependencyOverrides = {
- ...pubspec.dependencyOverrides,
- dependency: Dependency.fromPath(dependency, path),
- };
- pubspec.save(pubspecPath);
+ final pubspec = PubSpec.loadFromPath(pubspecPath);
+
+ if (pubspec.dependencyOverrides.list
+ .firstOrNullWhere((dep) => dep.name == dependency) !=
+ null) {
+ pubspec.dependencyOverrides.remove(dependency);
+ }
+
+ pubspec.dependencyOverrides
+ .add(DependencyBuilderPath(name: dependency, path: path));
+ pubspec.save();
}
/// Returns the Dart SDK of the `dart` executable on `PATH`
diff --git a/sidekick_test/pubspec.yaml b/sidekick_test/pubspec.yaml
index 186e152f..ecfc274f 100644
--- a/sidekick_test/pubspec.yaml
+++ b/sidekick_test/pubspec.yaml
@@ -4,15 +4,17 @@ version: 2.0.0
publish_to: none
environment:
- sdk: '>=2.19.0 <3.999.0'
+ sdk: '>=3.3.0 <3.999.0'
dependencies:
args: ^2.1.0
dartx: ^1.0.0
- dcli: ^2.2.0
+ dcli: ^4.0.1-beta.4
mocktail: ^0.3.0
path: ^1.8.1
+ pubspec_manager: ^1.0.0
test: ^1.17.0
dev_dependencies:
+ dcli_core: ^4.0.0
lint: ^2.0.0
diff --git a/sidekick_vault/pubspec.yaml b/sidekick_vault/pubspec.yaml
index f6860d35..09c5e72c 100644
--- a/sidekick_vault/pubspec.yaml
+++ b/sidekick_vault/pubspec.yaml
@@ -9,16 +9,16 @@ topics:
- sidekick-plugin
environment:
- sdk: '>=3.0.0 <4.0.0'
+ sdk: '>=3.3.0 <4.0.0'
dependencies:
actions_toolkit_dart: ^0.5.0
- dcli: ^2.2.0
- sidekick_core: ^2.0.0
+ dcli: ^4.0.1-beta.4
+ sidekick_core: ^2.1.2
dev_dependencies:
- dcli_core: ^2.2.0
+ dcli_core: ^4.0.0
lint: '>=1.5.0 <3.0.0'
prompts: ^2.0.0
- sidekick_plugin_installer: ^1.0.0
+ sidekick_plugin_installer: ^1.1.0
test: ^1.20.0
diff --git a/sidekick_vault/test/delete_test.dart b/sidekick_vault/test/delete_test.dart
index 59ac6524..cf72aed0 100644
--- a/sidekick_vault/test/delete_test.dart
+++ b/sidekick_vault/test/delete_test.dart
@@ -1,3 +1,4 @@
+import 'package:dcli_core/dcli_core.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
diff --git a/sidekick_vault/test/unlock_test.dart b/sidekick_vault/test/unlock_test.dart
index 3fabf5db..92ac6ea2 100644
--- a/sidekick_vault/test/unlock_test.dart
+++ b/sidekick_vault/test/unlock_test.dart
@@ -1,3 +1,4 @@
+import 'package:dcli_core/dcli_core.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
diff --git a/sidekick_vault/test/vault_command_test.dart b/sidekick_vault/test/vault_command_test.dart
index 90c3769b..5f5e90a9 100644
--- a/sidekick_vault/test/vault_command_test.dart
+++ b/sidekick_vault/test/vault_command_test.dart
@@ -1,11 +1,8 @@
-import 'package:sidekick_core/sidekick_core.dart' hide withEnvironment;
+import 'package:dcli_core/dcli_core.dart';
+import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
-// withEnvironment doesn't support async callbacks. core does. Fixed in dcli:2.0.0-beta.14
-// ignore: directives_ordering, depend_on_referenced_packages
-import 'package:dcli_core/dcli_core.dart' show withEnvironment;
-
void main() {
late CommandRunner runner;
late SidekickVault vault;
diff --git a/sk_sidekick/lib/src/commands/lock_dependencies_command.dart b/sk_sidekick/lib/src/commands/lock_dependencies_command.dart
index 910035ef..21dfd722 100644
--- a/sk_sidekick/lib/src/commands/lock_dependencies_command.dart
+++ b/sk_sidekick/lib/src/commands/lock_dependencies_command.dart
@@ -1,5 +1,5 @@
import 'package:pub_semver/pub_semver.dart';
-import 'package:sidekick_core/sidekick_core.dart' hide PubSpec, version;
+import 'package:sidekick_core/sidekick_core.dart' hide version;
// ignore: implementation_imports, sk_sidekick is not a published package and already depends on sidekick_core from path
import 'package:sidekick_core/src/version_checker.dart';
diff --git a/sk_sidekick/pubspec.lock b/sk_sidekick/pubspec.lock
index bc1596ea..b5cceae3 100644
--- a/sk_sidekick/pubspec.lock
+++ b/sk_sidekick/pubspec.lock
@@ -21,18 +21,18 @@ packages:
dependency: transitive
description:
name: archive
- sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a"
+ sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
url: "https://pub.dev"
source: hosted
- version: "3.3.7"
+ version: "3.6.1"
args:
dependency: transitive
description:
name: args
- sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
+ sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev"
source: hosted
- version: "2.4.2"
+ version: "2.5.0"
async:
dependency: transitive
description:
@@ -109,10 +109,10 @@ packages:
dependency: transitive
description:
name: cli_util
- sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7
+ sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
url: "https://pub.dev"
source: hosted
- version: "0.4.0"
+ version: "0.4.1"
clock:
dependency: transitive
description:
@@ -141,10 +141,10 @@ packages:
dependency: transitive
description:
name: coverage
- sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
+ sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb"
url: "https://pub.dev"
source: hosted
- version: "1.6.3"
+ version: "1.6.4"
crypto:
dependency: transitive
description:
@@ -157,10 +157,10 @@ packages:
dependency: transitive
description:
name: csv
- sha256: "016b31a51a913744a0a1655c74ff13c9379e1200e246a03d96c81c5d9ed297b5"
+ sha256: "63ed2871dd6471193dffc52c0e6c76fb86269c00244d244297abbb355c84a86e"
url: "https://pub.dev"
source: hosted
- version: "5.0.2"
+ version: "5.1.1"
dart_console2:
dependency: transitive
description:
@@ -317,18 +317,18 @@ packages:
dependency: transitive
description:
name: json_annotation
- sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
+ sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
- version: "4.8.1"
+ version: "4.9.0"
lint:
dependency: "direct dev"
description:
name: lint
- sha256: f4bd4dbaa39f4ae8836f2d1275f2f32bc68b3a8cce0a0735dd1f7a601f06682a
+ sha256: d758a5211fce7fd3f5e316f804daefecdc34c7e53559716125e6da7388ae8565
url: "https://pub.dev"
source: hosted
- version: "2.1.2"
+ version: "2.3.0"
logging:
dependency: transitive
description:
@@ -357,18 +357,18 @@ packages:
dependency: transitive
description:
name: meta
- sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
+ sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
- version: "1.9.1"
+ version: "1.15.0"
mime:
dependency: transitive
description:
name: mime
- sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
+ sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
url: "https://pub.dev"
source: hosted
- version: "1.0.4"
+ version: "1.0.5"
mocktail:
dependency: transitive
description:
@@ -397,18 +397,18 @@ packages:
dependency: transitive
description:
name: path
- sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
+ sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
- version: "1.8.3"
+ version: "1.9.0"
pointycastle:
dependency: transitive
description:
name: pointycastle
- sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
+ sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"
url: "https://pub.dev"
source: hosted
- version: "3.7.3"
+ version: "3.9.1"
pool:
dependency: transitive
description:
@@ -453,10 +453,10 @@ packages:
dependency: "direct main"
description:
name: pubspec_parse
- sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
+ sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8
url: "https://pub.dev"
source: hosted
- version: "1.2.3"
+ version: "1.3.0"
quiver:
dependency: transitive
description:
@@ -540,9 +540,11 @@ packages:
sidekick_test:
dependency: "direct dev"
description:
- path: "../sidekick_test"
- relative: true
- source: path
+ path: sidekick_test
+ ref: "sidekick_core-v2.1.2"
+ resolved-ref: "9f16b58c618d31c21b8050c5f16545c96feda5f3"
+ url: "https://github.com/phntmxyz/sidekick.git"
+ source: git
version: "2.0.0"
source_map_stack_trace:
dependency: transitive
@@ -644,10 +646,10 @@ packages:
dependency: transitive
description:
name: time
- sha256: "83427e11d9072e038364a5e4da559e85869b227cf699a541be0da74f14140124"
+ sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221
url: "https://pub.dev"
source: hosted
- version: "2.1.3"
+ version: "2.1.4"
typed_data:
dependency: transitive
description:
@@ -696,22 +698,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
+ web:
+ dependency: transitive
+ description:
+ name: web
+ sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.4.2"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
- sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
+ sha256: "939ab60734a4f8fa95feacb55804fa278de28bdeef38e616dc08e44a84adea23"
url: "https://pub.dev"
source: hosted
- version: "2.4.0"
+ version: "2.4.3"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
- sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d"
+ sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
- version: "1.2.0"
+ version: "1.2.1"
win32:
dependency: transitive
description:
@@ -732,9 +742,9 @@ packages:
dependency: transitive
description:
name: yaml_edit
- sha256: "1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd"
+ sha256: e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f
url: "https://pub.dev"
source: hosted
- version: "2.1.1"
+ version: "2.2.1"
sdks:
dart: ">=3.2.6 <3.999.0"
diff --git a/sk_sidekick/pubspec.yaml b/sk_sidekick/pubspec.yaml
index c28085fd..4784eaa6 100644
--- a/sk_sidekick/pubspec.yaml
+++ b/sk_sidekick/pubspec.yaml
@@ -19,7 +19,10 @@ dependencies:
dev_dependencies:
lint: ^2.0.0
sidekick_test:
- path: ../sidekick_test
+ git:
+ url: https://github.com/phntmxyz/sidekick.git
+ ref: sidekick_core-v2.1.2
+ path: sidekick_test
test: ^1.20.0
sidekick: