Commit 50e9338 1 parent 49a64e5 commit 50e9338 Copy full SHA for 50e9338
File tree 3 files changed +13
-18
lines changed
samples/web-extension/javascript
3 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -121,3 +121,6 @@ web-ext-artifacts/
121
121
122
122
# This is the name of the folder we will add the glean generated files in for our samples.
123
123
generated /
124
+
125
+ # This is the name of the Glean virtual environment
126
+ .venv
Original file line number Diff line number Diff line change @@ -10,36 +10,28 @@ Whenever this web extensions popup is opened it will trigger Glean.js events.
10
10
11
11
## How to run this sample
12
12
13
- 1 . Generate metrics and pings files.
14
-
15
- ``` bash
16
- npm run glean_parser
17
- ```
18
-
19
- > This command requires that you have [ ` glean_parser ` ] ( https://pypi.org/project/glean-parser/ ) available.
20
- > glean_parser is a Python package. To install it run ` pip install glean_parser ` .
21
- > Javascript support was added to glean_parser on version 2.1.0, make sure your version is up to date.
22
-
23
- 2 . Link the ` @mozilla/glean ` package. On the glean/ folder run:
13
+ 1 . Link the ` @mozilla/glean ` package. On the glean/ folder run:
24
14
25
15
``` bash
26
16
npm link
27
17
```
28
18
29
- 3 . Link the ` @mozilla/glean ` package to this sample web extension. On this ` web-extension ` folder run:
19
+ 2 . Link the ` @mozilla/glean ` package to this sample web extension. On this ` web-extension ` folder run:
30
20
31
21
``` bash
22
+ npm install
32
23
npm link @mozilla/glean
33
24
```
34
25
35
- 4 . Build this sample. On this ` web-extension ` folder run:
26
+ 3 . Build this sample. On this ` web-extension ` folder run:
36
27
37
28
``` bash
38
- npm install
39
29
npm run build
40
30
```
41
31
42
- 5 . Load the web extension on your browser of choice.
32
+ > ** Note** This operation will take some time on the first run, because it will create a virtual environment for running the glean-parser.
33
+
34
+ 4 . Load the web extension on your browser of choice.
43
35
44
36
- ** Firefox**
45
37
1 . Go to [ about: debugging #/runtime/this-firefox] ( about:debugging#/runtime/this-firefox ) ;
Original file line number Diff line number Diff line change 4
4
"description" : " A sample web extension using Glean.js" ,
5
5
"main" : " dist/bundle.js" ,
6
6
"scripts" : {
7
- "glean_parser " : " glean_parser translate src/metrics.yaml src/pings.yaml -f javascript -o src/generated" ,
8
- "build" : " webpack --watch --config webpack.config.js --mode production" ,
9
- "dev" : " webpack --watch --config webpack.config.js --mode development"
7
+ "glean " : " glean translate src/metrics.yaml src/pings.yaml -f javascript -o src/generated" ,
8
+ "build" : " npm run glean && webpack --watch --config webpack.config.js --mode production" ,
9
+ "dev" : " npm run glean && webpack --watch --config webpack.config.js --mode development"
10
10
},
11
11
"author" :
" The Glean Team <[email protected] >" ,
12
12
"license" : " MPL-2.0" ,
You can’t perform that action at this time.
0 commit comments