Skip to content

Commit

Permalink
Link @mozilla/glean in samples just like in benchmarks
Browse files Browse the repository at this point in the history
We use --prefix a lot on the CI and that makes link behave differently.
Using the same strategy as in benchmarks, we make sure both linking
steps happen with the same prefix and thus the linking works as
expected. This will fix Bug 1707626.
  • Loading branch information
brizental committed Jun 25, 2021
1 parent 8f64c18 commit 31fa6c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,12 @@ jobs:
- run:
name: Install JavaScript dependencies for Glean
command: npm --prefix ./glean install
- run:
name: Build & link Glean.js to use it in the samples
command: |
npm --prefix ./glean run build:webext
npm --prefix ./glean run build:cli
npm --prefix ./glean link
# JS sample related jobs
- run:
name: Install JavaScript dependencies for the JS sample
command: |
npm --prefix ./samples/web-extension/javascript install
npm --prefix ./samples/web-extension/javascript link @mozilla/glean
npm --prefix ./samples/web-extension/javascript install
npm --prefix ./samples/web-extension/javascript run link:glean
- run:
name: Build the JS sample
command: |
Expand All @@ -88,8 +82,8 @@ jobs:
- run:
name: Install Typescript dependencies for the TS sample
command: |
npm --prefix ./samples/web-extension/typescript install
npm --prefix ./samples/web-extension/typescript link @mozilla/glean
npm --prefix ./samples/web-extension/typescript install
npm --prefix ./samples/web-extension/typescript run link:glean
- run:
name: Build the TS sample
command: |
Expand Down
1 change: 1 addition & 0 deletions samples/web-extension/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "A sample web extension using Glean.js",
"main": "dist/bundle.js",
"scripts": {
"link:glean": "cd ../../../glean && npm i && npm run build && npm link && cd ../samples/web-extension/javascript && npm link @mozilla/glean",
"glean": "glean translate src/metrics.yaml src/pings.yaml -f javascript -o src/generated",
"build": "npm run glean && webpack --config webpack.config.js --mode production",
"dev": "npm run glean && webpack --watch --config webpack.config.js --mode development",
Expand Down
1 change: 1 addition & 0 deletions samples/web-extension/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/bundle.js",
"type": "module",
"scripts": {
"link:glean": "cd ../../../glean && npm i && npm run build && npm link && cd ../samples/web-extension/typescript && npm link @mozilla/glean",
"glean": "glean translate src/metrics.yaml src/pings.yaml -f typescript -o src/generated",
"build": "npm run glean && webpack --config webpack.config.js --mode production",
"dev": "npm run glean && webpack --watch --config webpack.config.js --mode development",
Expand Down

0 comments on commit 31fa6c5

Please sign in to comment.