Skip to content

Commit a266943

Browse files
committed
Revert "Hide features support behind a ENABLE_PUB_FEATURES environment variable (#1694)"
This reverts commit 43336bd. We're ready to release this feature.
1 parent cde958f commit a266943

File tree

5 files changed

+0
-31
lines changed

5 files changed

+0
-31
lines changed

lib/src/pubspec.dart

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
4-
import 'dart:io';
54

65
import 'package:collection/collection.dart';
76
import 'package:path/path.dart' as path;
@@ -63,13 +62,6 @@ Using a default value of `true`.
6362
/// Whether or not to warn about pre-release SDK overrides.
6463
bool get warnAboutPreReleaseSdkOverrides => allowPreReleaseSdkValue != 'quiet';
6564

66-
/// Whether or not `features` are enabled.
67-
///
68-
/// This can be overridden manually or by setting the ENABLE_PUB_FEATURES
69-
/// environment variable to "true".
70-
bool featuresEnabled =
71-
Platform.environment["ENABLE_PUB_FEATURES"]?.toLowerCase() != "true";
72-
7365
/// The parsed contents of a pubspec file.
7466
///
7567
/// The fields of a pubspec are, for the most part, validated when they're first
@@ -203,21 +195,12 @@ class Pubspec {
203195

204196
Map<String, Feature> get features {
205197
if (_features != null) return _features;
206-
207198
var features = fields['features'];
208199
if (features == null) {
209200
_features = const {};
210201
return _features;
211202
}
212203

213-
// Disable features support unless we have this environment variable set.
214-
if (!featuresEnabled) {
215-
_error(
216-
'Pub `features` support is not enabled but found a pubspec that '
217-
'uses it:\n$fields',
218-
fields.nodes['features'].span);
219-
}
220-
221204
if (features is! Map) {
222205
_error('"features" field must be a map.', fields.nodes['features'].span);
223206
}

test/global/activate/feature_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44

55
import 'package:test/test.dart';
66

7-
import 'package:pub/src/pubspec.dart';
87
import '../../test_pub.dart';
98

109
main() {
11-
// Explicitly enable `features` support.
12-
featuresEnabled = true;
13-
1410
test('enables default-on features by default', () async {
1511
await servePackages((builder) {
1612
builder.serve("foo", "1.0.0", pubspec: {

test/pubspec_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class MockSource extends Source {
3535
}
3636

3737
main() {
38-
// Explicitly enable `features` support.
39-
featuresEnabled = true;
40-
4138
group('parse()', () {
4239
var sources = new SourceRegistry();
4340
sources.register(new MockSource());

test/validator/dependency_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:path/path.dart' as path;
1111
import 'package:test/test.dart';
1212

1313
import 'package:pub/src/entrypoint.dart';
14-
import 'package:pub/src/pubspec.dart';
1514
import 'package:pub/src/validator.dart';
1615
import 'package:pub/src/validator/dependency.dart';
1716

@@ -61,9 +60,6 @@ Future setUpDependency(Map dep, {List<String> hostedVersions}) {
6160
}
6261

6362
main() {
64-
// Explicitly enable `features` support.
65-
featuresEnabled = true;
66-
6763
group('should consider a package valid if it', () {
6864
test('looks normal', () async {
6965
await d.validPackage.create();

test/version_solver_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import 'descriptor.dart' as d;
1616
import 'test_pub.dart';
1717

1818
main() {
19-
// Explicitly enable `features` support.
20-
featuresEnabled = true;
21-
2219
group('basic graph', basicGraph);
2320
group('with lockfile', withLockFile);
2421
group('root dependency', rootDependency);

0 commit comments

Comments
 (0)