Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

build_and_deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: test
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Test
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -58,6 +59,7 @@ jobs:

integration-test:
runs-on: ubuntu-latest
timeout-minutes: 20
name: Integration Tests
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -112,6 +114,7 @@ jobs:

web-smoke:
runs-on: ubuntu-latest
timeout-minutes: 20
name: Web Smoke (Playwright)
steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 10 additions & 0 deletions packages/core/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
global_options:
dart_mappable_builder:
options:
caseStyle: none
enumCaseStyle: none
generateMethods:
- decode
- copy
- stringify
- equals
33 changes: 4 additions & 29 deletions packages/core/lib/src/deck_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import 'dart:io';

import 'package:ack/ack.dart';
import 'package:ack_annotations/ack_annotations.dart';
import 'package:dart_mappable/dart_mappable.dart';
import 'package:path/path.dart' as p;

part 'deck_configuration.g.dart';
part 'deck_configuration.mapper.dart';

@AckModel()
final class DeckConfiguration {
@MappableClass()
final class DeckConfiguration with DeckConfigurationMappable {
final String? projectDir;
final String? slidesPath;
final String? outputDir;
Expand Down Expand Up @@ -84,20 +87,6 @@ final class DeckConfiguration {

File get pubspecFile => File(p.join(_baseDir, 'pubspec.yaml'));

DeckConfiguration copyWith({
String? projectDir,
String? slidesPath,
String? outputDir,
String? assetsPath,
}) {
return DeckConfiguration(
projectDir: projectDir ?? this.projectDir,
slidesPath: slidesPath ?? this.slidesPath,
outputDir: outputDir ?? this.outputDir,
assetsPath: assetsPath ?? this.assetsPath,
);
}

Map<String, Object?> toMap() {
return {
if (projectDir != null) 'projectDir': projectDir,
Expand Down Expand Up @@ -129,18 +118,4 @@ final class DeckConfiguration {
}).passthrough();

static File get defaultFile => File('superdeck.yaml');

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DeckConfiguration &&
runtimeType == other.runtimeType &&
projectDir == other.projectDir &&
slidesPath == other.slidesPath &&
outputDir == other.outputDir &&
assetsPath == other.assetsPath;

@override
int get hashCode =>
Object.hash(projectDir, slidesPath, outputDir, assetsPath);
}
2 changes: 0 additions & 2 deletions packages/core/lib/src/deck_configuration.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

174 changes: 174 additions & 0 deletions packages/core/lib/src/deck_configuration.mapper.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/lib/src/deck_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DeckService {
}
final content = await file.readAsString();
final data = jsonDecode(content) as Map<String, dynamic>;
return Deck.fromMap(data);
return Deck.parse(data);
} on Exception catch (e) {
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonDecode(content) as Map<String, dynamic> can throw a TypeError if the JSON isn’t an object, and TypeError won’t be caught by the current on Exception handler. To ensure loadDeck() reliably returns an error deck (instead of crashing), either broaden the catch to on Object or validate the decoded value’s type before casting/parse.

Suggested change
} on Exception catch (e) {
} on Object catch (e) {

Copilot uses AI. Check for mistakes.
return _createErrorDeck(
'Superdeck reference error',
Expand Down
Loading
Loading