Skip to content

Commit 80f090a

Browse files
authored
Initial implementation of new code excerpter (#201)
1 parent a20dc83 commit 80f090a

31 files changed

+2332
-14
lines changed

.github/workflows/dart.yml

+56-12
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ jobs:
3939
- name: mono_repo self validate
4040
run: dart pub global run mono_repo generate --validate
4141
job_002:
42-
name: "analyzer_and_format; Dart 3.3.0; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
42+
name: "analyzer_and_format; Dart 3.3.0; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/excerpter, packages/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: Cache Pub hosted dependencies
4646
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
4747
with:
4848
path: "~/.pub-cache/hosted"
49-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/inject_dartpad;commands:format-analyze"
49+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter-packages/inject_dartpad;commands:format-analyze"
5050
restore-keys: |
51-
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/inject_dartpad
51+
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter-packages/inject_dartpad
5252
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
5353
os:ubuntu-latest;pub-cache-hosted
5454
os:ubuntu-latest
@@ -85,6 +85,19 @@ jobs:
8585
run: dart analyze --fatal-infos .
8686
if: "always() && steps.packages_code_excerpter_pub_upgrade.conclusion == 'success'"
8787
working-directory: packages/code_excerpter
88+
- id: packages_excerpter_pub_upgrade
89+
name: packages/excerpter; dart pub upgrade
90+
run: dart pub upgrade
91+
if: "always() && steps.checkout.conclusion == 'success'"
92+
working-directory: packages/excerpter
93+
- name: "packages/excerpter; dart format --output=none --set-exit-if-changed ."
94+
run: "dart format --output=none --set-exit-if-changed ."
95+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
96+
working-directory: packages/excerpter
97+
- name: "packages/excerpter; dart analyze --fatal-infos ."
98+
run: dart analyze --fatal-infos .
99+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
100+
working-directory: packages/excerpter
88101
- id: packages_inject_dartpad_pub_upgrade
89102
name: packages/inject_dartpad; dart pub upgrade
90103
run: dart pub upgrade
@@ -99,16 +112,16 @@ jobs:
99112
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
100113
working-directory: packages/inject_dartpad
101114
job_003:
102-
name: "analyzer_and_format; Dart dev; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
115+
name: "analyzer_and_format; Dart dev; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/excerpter, packages/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
103116
runs-on: ubuntu-latest
104117
steps:
105118
- name: Cache Pub hosted dependencies
106119
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
107120
with:
108121
path: "~/.pub-cache/hosted"
109-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/inject_dartpad;commands:format-analyze"
122+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter-packages/inject_dartpad;commands:format-analyze"
110123
restore-keys: |
111-
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/inject_dartpad
124+
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter-packages/inject_dartpad
112125
os:ubuntu-latest;pub-cache-hosted;sdk:dev
113126
os:ubuntu-latest;pub-cache-hosted
114127
os:ubuntu-latest
@@ -145,6 +158,19 @@ jobs:
145158
run: dart analyze --fatal-infos .
146159
if: "always() && steps.packages_code_excerpter_pub_upgrade.conclusion == 'success'"
147160
working-directory: packages/code_excerpter
161+
- id: packages_excerpter_pub_upgrade
162+
name: packages/excerpter; dart pub upgrade
163+
run: dart pub upgrade
164+
if: "always() && steps.checkout.conclusion == 'success'"
165+
working-directory: packages/excerpter
166+
- name: "packages/excerpter; dart format --output=none --set-exit-if-changed ."
167+
run: "dart format --output=none --set-exit-if-changed ."
168+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
169+
working-directory: packages/excerpter
170+
- name: "packages/excerpter; dart analyze --fatal-infos ."
171+
run: dart analyze --fatal-infos .
172+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
173+
working-directory: packages/excerpter
148174
- id: packages_inject_dartpad_pub_upgrade
149175
name: packages/inject_dartpad; dart pub upgrade
150176
run: dart pub upgrade
@@ -159,16 +185,16 @@ jobs:
159185
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
160186
working-directory: packages/inject_dartpad
161187
job_004:
162-
name: "unit_test; Dart 3.3.0; PKGS: packages/code_excerpt_updater, packages/code_excerpter; `dart test`"
188+
name: "unit_test; Dart 3.3.0; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/excerpter; `dart test`"
163189
runs-on: ubuntu-latest
164190
steps:
165191
- name: Cache Pub hosted dependencies
166192
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
167193
with:
168194
path: "~/.pub-cache/hosted"
169-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter;commands:test"
195+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter;commands:test"
170196
restore-keys: |
171-
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter
197+
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter
172198
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
173199
os:ubuntu-latest;pub-cache-hosted
174200
os:ubuntu-latest
@@ -197,21 +223,30 @@ jobs:
197223
run: dart test
198224
if: "always() && steps.packages_code_excerpter_pub_upgrade.conclusion == 'success'"
199225
working-directory: packages/code_excerpter
226+
- id: packages_excerpter_pub_upgrade
227+
name: packages/excerpter; dart pub upgrade
228+
run: dart pub upgrade
229+
if: "always() && steps.checkout.conclusion == 'success'"
230+
working-directory: packages/excerpter
231+
- name: packages/excerpter; dart test
232+
run: dart test
233+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
234+
working-directory: packages/excerpter
200235
needs:
201236
- job_001
202237
- job_002
203238
- job_003
204239
job_005:
205-
name: "unit_test; Dart dev; PKGS: packages/code_excerpt_updater, packages/code_excerpter; `dart test`"
240+
name: "unit_test; Dart dev; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/excerpter; `dart test`"
206241
runs-on: ubuntu-latest
207242
steps:
208243
- name: Cache Pub hosted dependencies
209244
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
210245
with:
211246
path: "~/.pub-cache/hosted"
212-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter;commands:test"
247+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter;commands:test"
213248
restore-keys: |
214-
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter
249+
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter
215250
os:ubuntu-latest;pub-cache-hosted;sdk:dev
216251
os:ubuntu-latest;pub-cache-hosted
217252
os:ubuntu-latest
@@ -240,6 +275,15 @@ jobs:
240275
run: dart test
241276
if: "always() && steps.packages_code_excerpter_pub_upgrade.conclusion == 'success'"
242277
working-directory: packages/code_excerpter
278+
- id: packages_excerpter_pub_upgrade
279+
name: packages/excerpter; dart pub upgrade
280+
run: dart pub upgrade
281+
if: "always() && steps.checkout.conclusion == 'success'"
282+
working-directory: packages/excerpter
283+
- name: packages/excerpter; dart test
284+
run: dart test
285+
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
286+
working-directory: packages/excerpter
243287
needs:
244288
- job_001
245289
- job_002

mono_repo.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ github:
1111
- cron: "0 0 * * 0"
1212

1313
merge_stages:
14-
- analyzer_and_format
15-
- unit_test
14+
- analyzer_and_format
15+
- unit_test

packages/excerpter/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.dart_tool/
2+
pubspec.lock

packages/excerpter/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
- Initial experimental version for testing on dart.dev.

packages/excerpter/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2017 Dart Project Authors <https://dart.dev>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)