Skip to content

Commit

Permalink
introduce a common package:dartpad_shared package
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Oct 11, 2023
1 parent 15bf0af commit 53bf014
Show file tree
Hide file tree
Showing 30 changed files with 582 additions and 875 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pkgs/dart_pad/lib/src/api_model.dart linguist-generated=true
pkgs/dart_pad/lib/src/protos/** linguist-generated=true
pkgs/sketch_pad/lib/src/api_model.dart linguist-generated=true
pkgs/sketch_pad/lib/src/protos/** linguist-generated=true
pkgs/sketch_pad/web/codemirror/** linguist-generated=true
40 changes: 40 additions & 0 deletions .github/workflows/dartpad_shared.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: package:dartpad_shared

permissions: read-all

on:
push:
branches: [ main ]
paths:
- '.github/workflows/dartpad_shared.yml'
- 'pkgs/dartpad_shared/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/dartpad_shared.yml'
- 'pkgs/dartpad_shared/**'
schedule:
- cron: '0 0 * * 0' # weekly

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/dartpad_shared/

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f

- name: Install dart dependencies
run: dart pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Regenerate model classes
run: dart run build_runner build --delete-conflicting-outputs

- name: Analyze project source
run: dart analyze --fatal-infos
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and Flutter. You can access it at [dartpad.dev](http://dartpad.dev).
| --- | --- | --- |
| [dart_pad](pkgs/dart_pad/) | The front end of DartPad. | [![dart_pad](https://github.com/dart-lang/dart-pad/actions/workflows/dart_pad.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dart_pad.yml) |
| [dart_services](pkgs/dart_services/) | The backend service for DartPad. | [![dart_services](https://github.com/dart-lang/dart-pad/actions/workflows/dart_services.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dart_services.yml) |
| [dartpad_shared](pkgs/dartpad_shared/) | Common code shared between the DartPad frontend and backend. | [![dartpad_shared](https://github.com/dart-lang/dart-pad/actions/workflows/dartpad_shared.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dartpad_shared.yml) |
| [samples](pkgs/samples/) | Sample code snippets for DartPad. | [![samples](https://github.com/dart-lang/dart-pad/actions/workflows/samples.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/samples.yml) |
| [sketch_pad](pkgs/sketch_pad/) | An experimental redux of the DartPad UI. | [![sketch_pad](https://github.com/dart-lang/dart-pad/actions/workflows/sketch_pad.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/sketch_pad.yml) |

Expand Down
171 changes: 0 additions & 171 deletions pkgs/dart_pad/lib/src/api_model.g.dart

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/dart_services/lib/src/analysis_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import 'dart:convert';

import 'package:analysis_server_lib/analysis_server_lib.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:dartpad_shared/model.dart' as api;
import 'package:logging/logging.dart';
import 'package:path/path.dart' as path;

import 'api_model.dart' as api;
import 'common.dart';
import 'project.dart';
import 'protos/dart_services.pb.dart' as proto;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/dart_services/lib/src/analyzer_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import 'dart:async';
import 'dart:io';

import 'package:analyzer/dart/ast/ast.dart';
import 'package:dartpad_shared/model.dart' as api;
import 'package:logging/logging.dart';

import 'analysis_server.dart';
import 'api_model.dart' as api;
import 'common.dart';
import 'common_server_impl.dart' show BadRequest;
import 'project.dart' as project;
Expand Down
Loading

0 comments on commit 53bf014

Please sign in to comment.