Skip to content

Commit

Permalink
Fixes before publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Nov 21, 2023
1 parent 9742a4e commit b2bdfb0
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 21 deletions.
27 changes: 27 additions & 0 deletions pkgs/messages/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 2 additions & 3 deletions pkgs/messages/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: messages
description: A lightweight modular library for localization (l10n) functionality.
version: 0.1.0
publish_to: none
repository: https://github.com/dart-lang/i18n/tree/main/pkgs/messages

environment:
Expand All @@ -13,6 +12,6 @@ dependencies:
messages_deserializer: ^0.1.0

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
lints: ^2.0.0
dart_flutter_team_lints: ^2.1.1
lints: ^3.0.0
test: ^1.16.0
27 changes: 27 additions & 0 deletions pkgs/messages_builder/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion pkgs/messages_builder/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class BuildStepGenerator {
/// unpacked at runtime so that the messages can be read from it.
///
/// Returns the list of indices of the messages which are visible to the user.
Future<void> writeDataFile<T>(MessagesWithMetadata messages) async {
Future<void> writeDataFile(MessagesWithMetadata messages) async {
final serialization = serializer.serialize(
messages.hash,
messages.locale,
Expand Down
5 changes: 2 additions & 3 deletions pkgs/messages_builder/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: messages_builder
description: Build the messages for consumption by package:messages
version: 0.1.0
publish_to: none
repository: https://github.com/dart-lang/i18n/pkgs/messages_builder

environment:
Expand All @@ -23,7 +22,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.0
build_web_compilers: ^4.0.5
dart_flutter_team_lints: ^1.0.0
lints: ^2.0.0
dart_flutter_team_lints: ^2.1.1
lints: ^3.0.0
messages_deserializer: ^0.1.0
test: ^1.16.0
27 changes: 27 additions & 0 deletions pkgs/messages_deserializer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 1 addition & 2 deletions pkgs/messages_deserializer/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: messages_deserializer
description: Deserialization of messages for package:messages.
version: 0.1.0
publish_to: none
repository: https://github.com/dart-lang/i18n/tree/main/pkgs/messages_deserializer

environment:
Expand All @@ -14,5 +13,5 @@ dependencies:

dev_dependencies:
dart_flutter_team_lints: ^2.0.0
lints: ^2.0.0
lints: ^3.0.0
test: ^1.21.0
27 changes: 27 additions & 0 deletions pkgs/messages_serializer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 changes: 7 additions & 7 deletions pkgs/messages_serializer/lib/src/serializer_json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class JsonSerializer extends Serializer<String> {
if ((message.id == null || isVisible == false) && !containsArgs) {
return message.value;
}
final m = [];
final m = <Object>[];
addId(message, m, isVisible);
m.add(message.value);
if (containsArgs) {
Expand All @@ -106,7 +106,7 @@ class JsonSerializer extends Serializer<String> {
/// * Map\<String, int\> | the cases:
/// * MapEntry\<String, int\> | a case mapped to the message it represents
List encodeSelect(SelectMessage message, bool isVisible) {
final m = [];
final m = <Object>[];
m.add(SelectMessage.type);
addId(message, m, isVisible);
m.add(message.argIndex);
Expand All @@ -129,12 +129,12 @@ class JsonSerializer extends Serializer<String> {
/// * int | the case index as encoded by the constants in `Plural`
/// * int | the message index of the case
List encodePlural(PluralMessage message, bool isVisible) {
final m = [];
final m = <Object>[];
m.add(PluralMessage.type);
addId(message, m, isVisible);
m.add(message.argIndex);
m.add(encodeMessage(message.other));
final caseIndices = [];
final caseIndices = <Object>[];
if (message.few != null) {
caseIndices.add(Plural.few);
caseIndices.add(encodeMessage(message.few!));
Expand Down Expand Up @@ -178,7 +178,7 @@ class JsonSerializer extends Serializer<String> {
/// * List\<int\> | the submessage IDs
/// * int | the index of the submessage
List encodeCombined(CombinedMessage message, bool isVisible) {
final m = [];
final m = <Object>[];
m.add(CombinedMessage.type);
addId(message, m, isVisible);
for (var submessage in message.messages) {
Expand All @@ -197,12 +197,12 @@ class JsonSerializer extends Serializer<String> {
/// * int | the case index as encoded by the constants in `Gender`
/// * int | the message index of the case
List encodeGender(GenderMessage message, bool isVisible) {
final m = [];
final m = <Object>[];
m.add(GenderMessage.type);
addId(message, m, isVisible);
m.add(message.argIndex);
m.add(encodeMessage(message.other));
final caseIndices = [];
final caseIndices = <Object>[];
if (message.female != null) {
caseIndices.add(Gender.female);
caseIndices.add(encodeMessage(message.female!));
Expand Down
5 changes: 2 additions & 3 deletions pkgs/messages_serializer/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: messages_serializer
description: Serialization of messages for package:messages.
version: 0.1.0
publish_to: none
repository: https://github.com/dart-lang/i18n/tree/main/pkgs/messages_serializer

environment:
Expand All @@ -12,7 +11,7 @@ dependencies:
messages: ^0.1.0

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
lints: ^2.0.0
dart_flutter_team_lints: ^2.1.1
lints: ^3.0.0
messages_deserializer: ^0.1.0
test: ^1.21.0
27 changes: 27 additions & 0 deletions pkgs/messages_shrinker/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 1 addition & 2 deletions pkgs/messages_shrinker/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: messages_shrinker
description: A starting point for Dart libraries or applications.
version: 0.1.0
publish_to: none
repository: https://github.com/dart-lang/i18n/pkgs/messages_shrinker

environment:
Expand All @@ -19,5 +18,5 @@ dependencies:

dev_dependencies:
dart_flutter_team_lints: ^2.0.0
lints: ^2.0.0
lints: ^3.0.0
test: ^1.21.0

0 comments on commit b2bdfb0

Please sign in to comment.