Skip to content

Commit ed80c94

Browse files
authored
[MV3] Prepare extension for release (#1886)
1 parent be616cd commit ed80c94

File tree

3 files changed

+109
-2
lines changed

3 files changed

+109
-2
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## Building
2+
3+
> Note: First make the script executable: `chmod +x tool/build_extension.sh`
4+
5+
- For development: `./tool/build_extension.sh`
6+
- For release: `./tool/build_extension.sh prod`
7+
8+
The dart2js-compiled extension will be located in the `/compiled` directory.
9+
10+
## Local Development
11+
12+
### \[For Googlers\] Create an `extension_key.txt` file:
13+
14+
- Create a `extension_key.txt` file at the root of `/debug_extension`. Paste in
15+
the value of one of the whitelisted developer keys into this txt file.
16+
IMPORTANT: DO NOT COMMIT THE KEY. It will be copied into the `manifest.json`
17+
when you build the extension.
18+
19+
### Build and upload your local extension
20+
21+
- Build the extension following the instructions above
22+
- Visit chrome://extensions
23+
- Toggle "Developer mode" on
24+
- Click the "Load unpacked" button
25+
- Select the extension directory: `/compiled`
26+
27+
### Debug your local extension
28+
29+
- Click the Extensions puzzle piece, and pin the Dart Debug Extension with the
30+
dev icon (unpin the published version so you don't confuse them)
31+
- You can now use the extension normally by clicking it when a local Dart web
32+
application has loaded in a Chrome tab
33+
- To debug, visit chrome://extensions and click "Inspect view on background
34+
page" to open Chrome DevTools for the extension
35+
- More debugging information can be found in the
36+
[Chrome Developers documentation](https://developer.chrome.com/docs/extensions/mv3/devguide/)
37+
38+
## Release process
39+
40+
- Update the version in `web/manifest.json`, `pubspec.yaml`, and in the
41+
`CHANGELOG`.
42+
- Follow the instructions above to build the release version of the extension.
43+
44+
> \*At this point, you should manually verify that everything is working by
45+
> following the steps in [Local Development](#local-development), except load
46+
> the extension from the `compiled` directory. You will need to add an extension
47+
> key to the `manifest.json` file in `compiled` to test locally.
48+
49+
- Open a PR to submit the version change.
50+
- Once submitted, pull the changes down to your local branch, and create a zip
51+
of the `compiled` directory. **Remove the Googler extension key that was added
52+
by the builder to the `manifest.json` file.**
53+
- Rename the zip `version_XX.XX.XX.zip` (eg, `version_1.24.0.zip`) and add it to
54+
the go/dart-debug-extension-zips folder
55+
56+
> *You must be a Googler to do this. Ask for help if not.*
57+
58+
- Go to the
59+
[Chrome Web Store Developer Dashboard](https://chrome.google.com/webstore/devconsole).
60+
- At the top-right, under Publisher, select dart-bat.
61+
62+
> *If you don’t see dart-bat as an option, you will need someone on the Dart
63+
> team to add you to the dart-bat Google group.*
64+
65+
- Under Items, select the "Dart Debug Extension".
66+
- Go to “Package” then select “Upload new package”.
67+
68+
> *The first time you do this, you will be asked to pay a $5 registration fee.
69+
> The registration fee can be expensed.*
70+
71+
- Upload the zip file you created in step 4.
72+
- Save as draft, and verify that the new version is correct.
73+
- Publish. The extension will be published immediately after going through the
74+
review process.
75+
76+
## Rollback process
77+
78+
> The Chrome Web Store Developer Dashboard does not support rollbacks. Instead
79+
> you must re-publish an earlier version. This means that the extension will
80+
> still have to go through the review process, which can take anywhere from a
81+
> few hours (most common) to a few days.
82+
83+
- Find the previous version you want to rollback to in the
84+
go/dart-debug-extension-zips folder.
85+
86+
> *You must be a Googler to do this. Ask for help if not.*
87+
88+
- Unzip the version you have chosen, and in `manifest.json` edit the version
89+
number to be the next sequential version after the current "bad" version (eg,
90+
the bad version is `1.28.0` and you are rolling back to version `1.27.0`.
91+
Therefore you change `1.27.0` to `1.29.0`).
92+
- Re-zip the directory and rename it to the new version number. Add it to the
93+
go/dart-debug-extension-zips folder.
94+
- Now, follow steps 6 - 11 in [Release process](#release-process).

dwds/debug_extension_mv3/tool/build_extension.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@
99
# Builds the unminifed dart2js app (see DDC issue: https://github.com/dart-lang/sdk/issues/49869):
1010
# ./tool/build_extension.sh
1111

12+
13+
prod="false"
14+
15+
case "$1" in
16+
prod)
17+
prod="true"
18+
shift;;
19+
esac
20+
1221
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1322
echo "Building dart2js-compiled extension to /compiled directory."
1423
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1524
dart run build_runner build web --output build --release
1625

26+
if [ $prod == true ]; then
27+
exit 1
28+
fi
29+
1730
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1831
echo "Updating manifest.json in /compiled directory."
1932
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

dwds/debug_extension_mv3/web/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "MV3 Dart Debug Extension",
3-
"version": "1.0",
2+
"name": "Dart Debug Extension",
3+
"version": "1.31",
44
"manifest_version": 3,
55
"devtools_page": "static_assets/devtools.html",
66
"action": {

0 commit comments

Comments
 (0)