Skip to content

Commit e1d8dbe

Browse files
authored
Merge pull request #589 from dart-lang/removeIntlDep
Remove dependency on `package:intl`
2 parents 23567be + de9ca3a commit e1d8dbe

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

pkgs/unified_analytics/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.1.4-wip
2+
3+
- Fix formatting and remove dependency on `package:intl`.
4+
15
## 6.1.3
26

37
- Require Dart 3.4.

pkgs/unified_analytics/lib/src/analytics.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:file/file.dart';
88
import 'package:file/local.dart';
99
import 'package:file/memory.dart';
1010
import 'package:http/http.dart';
11-
import 'package:intl/date_symbol_data_local.dart';
1211
import 'package:meta/meta.dart';
1312
import 'package:path/path.dart' as p;
1413

@@ -436,10 +435,6 @@ class AnalyticsImpl implements Analytics {
436435
kLogFileName,
437436
)),
438437
) {
439-
// Initialize date formatting for `package:intl` within constructor
440-
// so clients using this package won't need to
441-
initializeDateFormatting();
442-
443438
// This initializer class will let the instance know
444439
// if it was the first run; if it is, nothing will be sent
445440
// on the first run

pkgs/unified_analytics/lib/src/config_handler.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import 'dart:convert';
66

77
import 'package:clock/clock.dart';
8+
import 'package:convert/convert.dart';
89
import 'package:file/file.dart';
9-
import 'package:intl/intl.dart';
1010
import 'package:path/path.dart' as p;
1111

1212
import 'constants.dart';
@@ -226,7 +226,7 @@ class ToolInfo {
226226
@override
227227
String toString() {
228228
return json.encode(<String, Object?>{
229-
'lastRun': DateFormat('yyyy-MM-dd').format(lastRun),
229+
'lastRun': FixedDateTimeFormatter('YYYY-MM-DD').encode(lastRun),
230230
'versionNumber': versionNumber,
231231
});
232232
}

pkgs/unified_analytics/lib/src/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20);
8787
const String kLogFileName = 'dart-flutter-telemetry.log';
8888

8989
/// The current version of the package, should be in line with pubspec version.
90-
const String kPackageVersion = '6.1.3';
90+
const String kPackageVersion = '6.1.4-wip';
9191

9292
/// The minimum length for a session.
9393
const int kSessionDurationMinutes = 30;

pkgs/unified_analytics/lib/src/utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'dart:io' as io;
77
import 'dart:math' show Random;
88

99
import 'package:clock/clock.dart';
10+
import 'package:convert/convert.dart';
1011
import 'package:file/file.dart';
11-
import 'package:intl/intl.dart';
1212
import 'package:path/path.dart' as p;
1313

1414
import 'enums.dart';
@@ -21,7 +21,7 @@ import 'user_property.dart';
2121
/// yyyy-MM-dd (2023-01-09)
2222
/// ```
2323
String get dateStamp {
24-
return DateFormat('yyyy-MM-dd').format(clock.now());
24+
return FixedDateTimeFormatter('YYYY-MM-DD').encode(clock.now());
2525
}
2626

2727
/// Reads in a directory and returns `true` if write permissions are enabled.

pkgs/unified_analytics/pubspec.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ name: unified_analytics
22
description: >-
33
A package for logging analytics for all Dart and Flutter related tooling
44
to Google Analytics.
5+
# LINT.IfChange
56
# When updating this, keep the version consistent with the changelog and the
67
# value in lib/src/constants.dart.
7-
version: 6.1.3
8+
version: 6.1.4-wip
9+
# LINT.ThenChange(lib/src/constants.dart)
810
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
911

1012
environment:
1113
sdk: ^3.4.0
1214

1315
dependencies:
1416
clock: ^1.1.1
17+
convert: ^3.1.1
1518
file: '>=6.1.4 <8.0.0'
1619
http: '>=0.13.5 <2.0.0'
17-
intl: '>=0.18.0 <0.20.0'
1820
meta: ^1.9.0
1921
path: ^1.8.0
2022

0 commit comments

Comments
 (0)