Skip to content

Commit

Permalink
Merge pull request #589 from dart-lang/removeIntlDep
Browse files Browse the repository at this point in the history
Remove dependency on `package:intl`
  • Loading branch information
mosuem committed Sep 23, 2024
2 parents 23567be + de9ca3a commit e1d8dbe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 4 additions & 0 deletions pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.1.4-wip

- Fix formatting and remove dependency on `package:intl`.

## 6.1.3

- Require Dart 3.4.
Expand Down
5 changes: 0 additions & 5 deletions pkgs/unified_analytics/lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:file/memory.dart';
import 'package:http/http.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;

Expand Down Expand Up @@ -436,10 +435,6 @@ class AnalyticsImpl implements Analytics {
kLogFileName,
)),
) {
// Initialize date formatting for `package:intl` within constructor
// so clients using this package won't need to
initializeDateFormatting();

// This initializer class will let the instance know
// if it was the first run; if it is, nothing will be sent
// on the first run
Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/config_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import 'dart:convert';

import 'package:clock/clock.dart';
import 'package:convert/convert.dart';
import 'package:file/file.dart';
import 'package:intl/intl.dart';
import 'package:path/path.dart' as p;

import 'constants.dart';
Expand Down Expand Up @@ -226,7 +226,7 @@ class ToolInfo {
@override
String toString() {
return json.encode(<String, Object?>{
'lastRun': DateFormat('yyyy-MM-dd').format(lastRun),
'lastRun': FixedDateTimeFormatter('YYYY-MM-DD').encode(lastRun),
'versionNumber': versionNumber,
});
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20);
const String kLogFileName = 'dart-flutter-telemetry.log';

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

/// The minimum length for a session.
const int kSessionDurationMinutes = 30;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'dart:io' as io;
import 'dart:math' show Random;

import 'package:clock/clock.dart';
import 'package:convert/convert.dart';
import 'package:file/file.dart';
import 'package:intl/intl.dart';
import 'package:path/path.dart' as p;

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

/// Reads in a directory and returns `true` if write permissions are enabled.
Expand Down
6 changes: 4 additions & 2 deletions pkgs/unified_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ name: unified_analytics
description: >-
A package for logging analytics for all Dart and Flutter related tooling
to Google Analytics.
# LINT.IfChange
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
version: 6.1.3
version: 6.1.4-wip
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics

environment:
sdk: ^3.4.0

dependencies:
clock: ^1.1.1
convert: ^3.1.1
file: '>=6.1.4 <8.0.0'
http: '>=0.13.5 <2.0.0'
intl: '>=0.18.0 <0.20.0'
meta: ^1.9.0
path: ^1.8.0

Expand Down

0 comments on commit e1d8dbe

Please sign in to comment.