Skip to content

Commit

Permalink
fix: make build work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Oct 11, 2020
1 parent 922b2e5 commit 3744277
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ jobs:
with:
node-version: 12.x

- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Restore .cache
uses: actions/cache@v2
id: cache
Expand All @@ -39,14 +32,17 @@ jobs:
${{ runner.os }}-${{ hashFiles('package*json', 'yarn.lock', '*config.js') }}
${{ runner.os }}-
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: npm run ci:install

- name: Run postinstall if cached
if: steps.yarn-cache.outputs.cache-hit == 'true'
run: npx yarn postinstall

- name: Build
run: npm run build

Expand Down
4 changes: 2 additions & 2 deletions DEVELOPER-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ To run your extension in [Firefox for Android](https://www.mozilla.org/en-US/fir

- [Set up your computer and Android emulator or device](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android#Set_up_your_computer_and_Android_emulator_or_device) (enable Developer Mode, USB debugging, etc.)

Build everything, and switch `add-on/manifest.json` to the Fennec profile:
Build everything, and switch `add-on/manifest.json` to the Firefox profile:

```
npm run dev-build
npm run bundle:fennec
npm run bundle:firefox
```

Then, with your device connected to your development computer, run:
Expand Down
20 changes: 8 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@
"build:js": "run-s build:js:*",
"build:js:webpack": "webpack --mode production",
"build:minimize-dist": "shx rm -rf add-on/dist/lib add-on/dist/contentScripts/ add-on/dist/bundles/ipfsProxyContentScriptPayload.bundle.js",
"build:bundle-all": "cross-env RELEASE_CHANNEL=${RELEASE_CHANNEL:=dev} run-s bundle:chromium bundle:brave:$RELEASE_CHANNEL bundle:firefox:$RELEASE_CHANNEL",
"build:bundle-all": "cross-env run-s bundle:chromium bundle:brave:$RELEASE_CHANNEL bundle:firefox:$RELEASE_CHANNEL",
"build:rename-artifacts": "./scripts/rename-artifacts.js",
"precache:clean": "shx rm -rf add-on/dist/precache",
"bundle": "run-s bundle:*",
"bundle:chromium": "shx cat add-on/manifest.common.json add-on/manifest.chromium.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/chromium && run-s build:rename-artifacts",
"bundle:firefox": "shx cat add-on/manifest.common.json add-on/manifest.firefox.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/firefox/ && run-s build:rename-artifacts",
"bundle:firefox:dev": "npm run bundle:firefox",
"bundle:firefox:": "npm run bundle:firefox",
"bundle:firefox:stable": "npm run bundle:firefox",
"bundle:firefox:beta": "shx cat add-on/manifest.common.json add-on/manifest.firefox.json add-on/manifest.firefox-beta.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/firefox/ && run-s build:rename-artifacts",
"bundle:fennec": "npm run bundle:firefox",
"bundle:fennec:dev": "npm run bundle:firefox:dev",
"bundle:fennec:stable": "npm run bundle:firefox:stable",
"bundle:fennec:beta": "npm run bundle:firefox:beta",
"bundle:brave": "shx cat add-on/manifest.common.json add-on/manifest.chromium.json add-on/manifest.brave.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/brave/ && run-s build:rename-artifacts",
"bundle:brave:dev": "npm run bundle:brave",
"bundle:brave:": "npm run bundle:brave",
"bundle:brave:stable": "npm run bundle:brave",
"bundle:brave:beta": "shx cat add-on/manifest.common.json add-on/manifest.chromium.json add-on/manifest.brave.json add-on/manifest.brave-beta.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/brave/ && run-s build:rename-artifacts",
"watch": "npm-run-all build:copy --parallel watch:*",
Expand All @@ -56,13 +52,13 @@
"get-firefox-nightly": "shx test -e ./firefox/firefox || get-firefox -b nightly -e",
"changelog": "npx conventional-changelog-cli -p angular -i CHANGELOG.md -s",
"ci": "run-s ci:*",
"ci:install": "npx yarn@1.22.4 install --frozen-lockfile --no-progress --non-interactive",
"ci:build": "./ci/update-manifest.sh && npx yarn@1.22.4 build",
"ci:test": "npx yarn@1.22.4 test",
"ci:lint": "npx yarn@1.22.4 lint",
"ci:install": "npx yarn@1.22.10 install --frozen-lockfile --no-progress --non-interactive",
"ci:build": "./ci/update-manifest.sh && npx yarn@1.22.10 build",
"ci:test": "npx yarn@1.22.10 test",
"ci:lint": "npx yarn@1.22.10 lint",
"beta-build": "docker rmi -f ipfs-companion-beta-build && docker build -t ipfs-companion-beta-build --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=$(id -g ${USER}) . && mkdir -p build && docker run --rm -it --net=host -e RELEASE_CHANNEL=beta -v $(pwd)/build:/home/node/app/build ipfs-companion-beta-build yarn ci:build",
"release-build": "docker rmi -f ipfs-companion-release-build && docker build -t ipfs-companion-release-build --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=$(id -g ${USER}) . && mkdir -p build && docker run --rm -it --net=host -e RELEASE_CHANNEL=stable -v $(pwd)/build:/home/node/app/build ipfs-companion-release-build yarn ci:build",
"dev-build": "npx yarn@1.22.4 && npx yarn@1.22.4 build",
"dev-build": "npx yarn@1.22.10 && npx yarn@1.22.10 build",
"yarn-build": "npm run dev-build"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const commonConfig = {
},
{
// hapijs is node-centric and needs additional handling
include: /node_modules\/(@hapi|joi)/,
include: /node_modules[/\\](@hapi|joi)/,
test: /\.js$/,
use: [
'remove-hashbag-loader',
Expand Down

0 comments on commit 3744277

Please sign in to comment.