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

Migrate to pub workspaces #7762

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/lib/fake/backend/fake_email_sender.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FakeEmailSender implements EmailSender {
sentMessages.add(message);
if (_outputDir != null) {
final uuid = message.localMessageId ?? Ulid().toCanonical();
final file = File(p.join(_outputDir!, '$uuid.json'));
final file = File(p.join(_outputDir, '$uuid.json'));
await file.parent.create(recursive: true);
await file.writeAsString(json.encode(message.toJson()));
}
Expand Down
4 changes: 2 additions & 2 deletions app/lib/frontend/dom/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1040,15 +1040,15 @@ class _StringElement extends _StringNode {
assert(_children == null ||
_children is _StringNode ||
(_children is Iterable<Node> &&
(_children as Iterable<Node>).every((c) => c is _StringNode)));
(_children).every((c) => c is _StringNode)));
}

@override
void writeHtml(StringSink sink) {
sink.write('<');
sink.write(_tag);
if (_attributes != null) {
for (final e in _attributes!.entries) {
for (final e in _attributes.entries) {
sink.write(' ');
sink.write(e.key);
sink.write('="');
Expand Down
6 changes: 3 additions & 3 deletions app/lib/package/model_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Pubspec {
return (minDartVersion != null &&
minDartVersion.value.compareTo(dartSdkVersion) > 0) ||
(_minFlutterSdkVersion != null &&
_minFlutterSdkVersion!.value.compareTo(flutterSdkVersion) > 0);
_minFlutterSdkVersion.value.compareTo(flutterSdkVersion) > 0);
}

/// True if either the Dart or the Flutter SDK constraint is higher than the
Expand All @@ -144,8 +144,8 @@ class Pubspec {
late final _dartSdkConstraint = _inner.environment?['sdk'];
late final _flutterSdkConstraint = _inner.environment?['flutter'];
late final _hasDartSdkConstraint = _dartSdkConstraint != null &&
!_dartSdkConstraint!.isAny &&
!_dartSdkConstraint!.isEmpty;
!_dartSdkConstraint.isAny &&
!_dartSdkConstraint.isEmpty;

SdkConstraintStatus get _sdkConstraintStatus =>
SdkConstraintStatus.fromSdkVersion(_dartSdkConstraint, name);
Expand Down
4 changes: 2 additions & 2 deletions app/lib/package/name_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class NameTracker {
await for (final p in _db!.query<Package>().run()) {
data.add(TrackedPackage.fromPackage(p));
}
await for (final p in _db!.query<ModeratedPackage>().run()) {
await for (final p in _db.query<ModeratedPackage>().run()) {
data.addModeratedName(p.name!);
}
_data = data;
Expand All @@ -185,7 +185,7 @@ class NameTracker {
_data.add(TrackedPackage.fromPackage(p));
}

final moderatedPkgQuery = _db!.query<ModeratedPackage>()
final moderatedPkgQuery = _db.query<ModeratedPackage>()
..order('moderated')
..filter('moderated >', ts);

Expand Down
2 changes: 1 addition & 1 deletion app/lib/tool/utils/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class _AuthenticatedClient extends http.BaseClient {
}
final currentCookies = request.headers['cookie'];
final providedCookies =
_cookieProvider == null ? null : await _cookieProvider!();
_cookieProvider == null ? null : await _cookieProvider();

final sessionId = await _sessionIdProvider();
request.headers['cookie'] = [
Expand Down
8 changes: 2 additions & 6 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: pub_dev
description: The pub.dartlang.org website.
environment:
sdk: '^3.0.0'
sdk: '^3.5.0'
resolution: workspace
dependencies:
_popularity:
path: ../pkg/_popularity
_pub_shared:
path: ../pkg/_pub_shared
appengine: ^0.13.8
args: '^2.0.0'
basics: ^0.10.0
Expand All @@ -25,7 +24,6 @@ dependencies:
http: ^1.0.0
http_parser: ^4.0.0
indexed_blob:
path: ../pkg/indexed_blob
intl: '^0.19.0'
json_annotation: '^4.3.0'
lints: ^4.0.0
Expand All @@ -39,7 +37,6 @@ dependencies:
pem: ^2.0.1
pool: '^1.5.0'
pub_package_reader:
path: ../pkg/pub_package_reader
pub_semver: '^2.0.0'
pubspec_parse: ^1.2.1
retry: ^3.1.0
Expand All @@ -57,7 +54,6 @@ dependencies:
ulid: '2.0.0'
tar: '2.0.0'
api_builder:
path: ../pkg/api_builder

dev_dependencies:
build_runner: '^2.0.0'
Expand Down
7 changes: 6 additions & 1 deletion app/test/shared/versions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:io';
import 'dart:isolate';

import 'package:_pub_shared/utils/flutter_archive.dart';
import 'package:collection/collection.dart' show IterableExtension;
import 'package:path/path.dart' as p;
import 'package:pub_dev/shared/versions.dart';
import 'package:test/test.dart';
import 'package:yaml/yaml.dart';
Expand Down Expand Up @@ -97,7 +99,10 @@ void main() {
});

test('analyzer version should match resolved pana version', () async {
final String lockContent = await File('pubspec.lock').readAsString();
final String lockContent = await File(p.join(
p.dirname(p.dirname(Isolate.packageConfigSync!.toFilePath())),
'pubspec.lock'))
.readAsString();
final lock = loadYaml(lockContent) as Map;
expect(lock['packages']['pana']['version'], panaVersion);
});
Expand Down
Loading
Loading