Skip to content

Commit

Permalink
chore: Use parsing logic from arb_generator (#64)
Browse files Browse the repository at this point in the history
* Use parsing logic from arb_generator: POC
* Update excel dependency to 3.0.0
* Add step to CI to ensure package works correctly
  • Loading branch information
defuncart authored Oct 20, 2024
1 parent 4cd30a9 commit 0ff7ef9
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 668 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ jobs:
run: dart format --set-exit-if-changed .
- name: Unit tests
run: dart test
- name: Ensure flappy_translator works
run: |
cd example
dart run flappy_translator
5 changes: 5 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
include: package:lints/recommended.yaml

analyzer:
errors:
# do not warn when importing implementations from arb_generator
implementation_imports: ignore
12 changes: 10 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.10.0"
arb_generator:
dependency: transitive
description:
name: arb_generator
sha256: db689425994fc20d2a3c6a852d8a827daea3608ac3c374753cb0ebb56d1d6ca9
url: "https://pub.dev"
source: hosted
version: "0.0.4"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -117,10 +125,10 @@ packages:
dependency: transitive
description:
name: excel
sha256: "3b0751b14128f10e7bfde4e13cefb82e7c020006d1270efa82e138cb80605a99"
sha256: f7cde34ffdbb397edeb4566621433bb820517cc0d8676c20d6122a85f749ee49
url: "https://pub.dev"
source: hosted
version: "2.0.4"
version: "3.0.0"
file:
dependency: transitive
description:
Expand Down
21 changes: 0 additions & 21 deletions lib/src/extensions/file_extensions.dart

This file was deleted.

14 changes: 0 additions & 14 deletions lib/src/extensions/string_extensions.dart

This file was deleted.

20 changes: 0 additions & 20 deletions lib/src/services/file_writer/file_writer.dart

This file was deleted.

11 changes: 6 additions & 5 deletions lib/src/services/flappy_translator.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import 'dart:io';

import 'package:arb_generator/src/services/file_writer/file_writer.dart';
import 'package:arb_generator/src/services/parsing/csv_parser.dart';
import 'package:arb_generator/src/services/validation/validator.dart';

import '../configs/default_settings.dart';
import '../extensions/file_extensions.dart';
import '../utils/flappy_logger.dart';
import 'code_generation/code_generator.dart';
import 'file_writer/file_writer.dart';
import 'parsing/csv_parser.dart';
import 'parsing/excel_parser.dart';
import 'validation/validator.dart';
import 'validation/validator.dart' as internal_validator;

class FlappyTranslator {
void generate(
Expand All @@ -27,7 +28,7 @@ class FlappyTranslator {
List<String>? commentLanguages,
}) {
final file = File(inputFilePath);
Validator.validateFile(file);
internal_validator.Validator.validateFile(file);

// File is valid, state progress
FlappyLogger.logProgress('Loading file $inputFilePath...');
Expand Down
33 changes: 0 additions & 33 deletions lib/src/services/parsing/csv_parser.dart

This file was deleted.

3 changes: 1 addition & 2 deletions lib/src/services/parsing/excel_parser.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'dart:io';

import 'package:arb_generator/src/services/parsing/file_parser.dart';
import 'package:excel/excel.dart';

import 'file_parser.dart';

/// An extension of [FileParser] for files of type xlsx
class ExcelParser extends FileParser {
ExcelParser({
Expand Down
154 changes: 0 additions & 154 deletions lib/src/services/parsing/file_parser.dart

This file was deleted.

Loading

0 comments on commit 0ff7ef9

Please sign in to comment.