Skip to content

Commit f2e3d43

Browse files
committed
Merge branch 'main' into feat/new-code-excerpter
2 parents af78075 + d7cc5cc commit f2e3d43

File tree

15 files changed

+2592
-23
lines changed

15 files changed

+2592
-23
lines changed

.github/workflows/dart.yml

+32-6
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ jobs:
8686
if: "always() && steps.packages_code_excerpter_pub_upgrade.conclusion == 'success'"
8787
working-directory: packages/code_excerpter
8888
job_003:
89-
name: "analyzer_and_format; Dart 3.2.0; PKG: packages/excerpter; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
89+
name: "analyzer_and_format; Dart 3.2.0; PKGS: packages/excerpter, packages/inject_dartpad; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
9090
runs-on: ubuntu-latest
9191
steps:
9292
- name: Cache Pub hosted dependencies
9393
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
9494
with:
9595
path: "~/.pub-cache/hosted"
96-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:packages/excerpter;commands:format-analyze"
96+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:packages/excerpter-packages/inject_dartpad;commands:format-analyze"
9797
restore-keys: |
98-
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:packages/excerpter
98+
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:packages/excerpter-packages/inject_dartpad
9999
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0
100100
os:ubuntu-latest;pub-cache-hosted
101101
os:ubuntu-latest
@@ -119,17 +119,30 @@ jobs:
119119
run: dart analyze --fatal-infos .
120120
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
121121
working-directory: packages/excerpter
122+
- id: packages_inject_dartpad_pub_upgrade
123+
name: packages/inject_dartpad; dart pub upgrade
124+
run: dart pub upgrade
125+
if: "always() && steps.checkout.conclusion == 'success'"
126+
working-directory: packages/inject_dartpad
127+
- name: "packages/inject_dartpad; dart format --output=none --set-exit-if-changed ."
128+
run: "dart format --output=none --set-exit-if-changed ."
129+
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
130+
working-directory: packages/inject_dartpad
131+
- name: "packages/inject_dartpad; dart analyze --fatal-infos ."
132+
run: dart analyze --fatal-infos .
133+
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
134+
working-directory: packages/inject_dartpad
122135
job_004:
123-
name: "analyzer_and_format; Dart dev; PKGS: packages/code_excerpt_updater, packages/code_excerpter, packages/excerpter; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
136+
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 .`"
124137
runs-on: ubuntu-latest
125138
steps:
126139
- name: Cache Pub hosted dependencies
127140
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
128141
with:
129142
path: "~/.pub-cache/hosted"
130-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter;commands:format-analyze"
143+
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"
131144
restore-keys: |
132-
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter
145+
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:packages/code_excerpt_updater-packages/code_excerpter-packages/excerpter-packages/inject_dartpad
133146
os:ubuntu-latest;pub-cache-hosted;sdk:dev
134147
os:ubuntu-latest;pub-cache-hosted
135148
os:ubuntu-latest
@@ -179,6 +192,19 @@ jobs:
179192
run: dart analyze --fatal-infos .
180193
if: "always() && steps.packages_excerpter_pub_upgrade.conclusion == 'success'"
181194
working-directory: packages/excerpter
195+
- id: packages_inject_dartpad_pub_upgrade
196+
name: packages/inject_dartpad; dart pub upgrade
197+
run: dart pub upgrade
198+
if: "always() && steps.checkout.conclusion == 'success'"
199+
working-directory: packages/inject_dartpad
200+
- name: "packages/inject_dartpad; dart format --output=none --set-exit-if-changed ."
201+
run: "dart format --output=none --set-exit-if-changed ."
202+
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
203+
working-directory: packages/inject_dartpad
204+
- name: "packages/inject_dartpad; dart analyze --fatal-infos ."
205+
run: dart analyze --fatal-infos .
206+
if: "always() && steps.packages_inject_dartpad_pub_upgrade.conclusion == 'success'"
207+
working-directory: packages/inject_dartpad
182208
job_005:
183209
name: "unit_test; Dart 3.1.0; PKGS: packages/code_excerpt_updater, packages/code_excerpter; `dart test`"
184210
runs-on: ubuntu-latest
File renamed without changes.

cloud_build/firebase-ghcli/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Summary
2+
This directory contains a Dockerfile that provides access to firebase tools and
3+
the Github CLI. This image is used to deploy various Dart/Flutter websites to
4+
firebase in both production and staging, and is also used to comment on Github
5+
PRs.
6+
7+
8+
## Installed tools
9+
* Github CLI
10+
* Node/NPM
11+
* Firebase Tools
12+
13+
14+
## Additional information
15+
When the dockerfile or cloud build template in this directory is changed in a
16+
PR, the cloud build template is triggered and a new version of the image is
17+
deployed as the latest version in Container Registry under the `flutter-dev`
18+
project in GCP.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
steps:
2+
- name: 'gcr.io/cloud-builders/docker'
3+
args: ['build', '-t', 'gcr.io/$PROJECT_ID/firebase-ghcli', 'cloud_build/firebase-ghcli']
4+
images:
5+
- 'gcr.io/$PROJECT_ID/firebase-ghcli'
6+
tags: ['dash-firebase-ghcli']

cloud_build/staging_container/README.md

-11
This file was deleted.

cloud_build/staging_container/cloudbuild.yaml

-6
This file was deleted.

packages/inject_dartpad/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Dart-related files
2+
.dart_tool
3+
pubspec.lock
4+
5+
# IDE-related files
6+
*.iml
7+
.idea/
8+
.vscode/
9+
10+
# Platform-related files
11+
.DS_Store

packages/inject_dartpad/README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## DartPad injection
2+
3+
To embed a DartPad with arbitrary Dart in to your web page, add the
4+
JS file found at `lib/inject_dartpad.js` with a `<script>` tag,
5+
set up to run after the DOM is ready.
6+
7+
This might look something like the following, depending on where
8+
your version of the JS file is stored.
9+
10+
```html
11+
<script defer src="inject_dartpad.js"></script>
12+
```
13+
14+
### Declare code to inject
15+
16+
The script looks for each inline `<code>` element on the page
17+
that is the only child of a `<pre>` element and
18+
has the `data-dartpad="true"` property.
19+
20+
```html
21+
<pre>
22+
<code class="language-dart" data-dartpad="true">
23+
...Code here...
24+
</code>
25+
</pre>
26+
```
27+
28+
If the code is correctly formatted, the script will replace
29+
both elements with a DartPad iframe containing your specified code.
30+
31+
The DartPad defaults to the embed style and dark theme. To configure
32+
this and other behavior, add one or more of the following options:
33+
34+
- `data-embed="false"`
35+
To use the standalone UI version of DartPad.
36+
- `data-theme="light"`
37+
To use the light theme in the embed.
38+
- `data-run="true"`
39+
To run the included code once loaded.
40+
- `data-width="<CSS width>"`
41+
To specify the initial width of the injected iframe element.
42+
- `data-height="<CSS height>"`
43+
To specify the initial height of the injected iframe element.
44+
45+
### Developing script
46+
47+
To work on the script itself, modify the code within `/web/inject_dartpad.dart`.
48+
To compile the code to JavaScript, use the latest Dart SDK,
49+
verify you have the latest dependencies (`dart pub upgrade`), and then
50+
run `dart run tool/compile.dart`.
51+
The updated file will be written to `/lib/inject_dartpad.js`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:analysis_defaults/analysis.yaml

packages/inject_dartpad/build.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
targets:
2+
$default:
3+
builders:
4+
build_web_compilers|entrypoint:
5+
generate_for:
6+
- web/**.dart
7+
options:
8+
dart2js_args:
9+
- --no-frequency-based-minification
10+
- --no-source-maps
11+
- --show-package-warnings
12+
- -O4

0 commit comments

Comments
 (0)