Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎨 Release 7.0 #832

Merged
merged 13 commits into from Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions .eslintrc.js → .eslintrc.cjs
Expand Up @@ -21,14 +21,8 @@ module.exports = {
ignorePropertyModificationsFor: ["manifest", "previousValue"],
},
],
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
ts: "never",
},
],
"import/extensions": "off",
"import/no-unresolved": "off",
},
globals: {
browser: "readonly",
Expand Down
5 changes: 2 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -2,6 +2,5 @@

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device.
2. Install the dependencies: `npm install`
3. Run `npm link` to link the local repo to NPM
4. Then npm link this repo inside any example app with `npm link webextension-toolbox`
5. Then you can run your example app with the local version of webextension-toolbox
3. Go into your local extension and type `npx link <path-to-webextension-toolbox>` (note this is NOT `npm link`!!!)
4. Then you can run your example app with the local version of webextension-toolbox
12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

82 changes: 73 additions & 9 deletions .github/workflows/build.yml
@@ -1,29 +1,93 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
uses: ./.github/workflows/lint.yml
build:
runs-on: ${{ matrix.os }}
needs: [tests]
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 21.x]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4
- name: Checkout Toolbox
uses: actions/checkout@v4
with:
path: 'toolbox'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run build
cache: 'npm'
cache-dependency-path: |
./toolbox/package-lock.json
./js-extension-template/package-lock.json
- name: Install Toolbox dependencies
run: npm ci
working-directory: ./toolbox
- name: Build Toolbox binary
run: npm run build
working-directory: ./toolbox
- name: Checkout JS Extension Template
uses: actions/checkout@v4
with:
repository: webextension-toolbox/js-extension-template
ref: refs/heads/main
path: 'js-extension-template'
- name: Install JS Extension Template dependencies
run: npm install
working-directory: ./js-extension-template
- name: Install Additional deps for dev linking
run: npm install babel-loader swc-loader
working-directory: ./js-extension-template
- name: Link toolbox into JS Extension Template on unix
if: ${{ matrix.os != 'windows-latest' }}
run: npx link $GITHUB_WORKSPACE/toolbox
working-directory: ./js-extension-template
- name: Link toolbox into JS Extension Template on windows
if: ${{ matrix.os == 'windows-latest' }}
run: npx link $env:GITHUB_WORKSPACE/toolbox
working-directory: ./js-extension-template
- name: Build JS Extension Template
run: |
npm run build -- -o chrome.babel chrome
npm run build -- -o firefox.babel firefox
npm run build -- -o edge.babel edge
npm run build -- -o safari.babel safari
npm run build -- -o opera.babel opera
npm run build -- -o chrome.swc --swc chrome
npm run build -- -o firefox.swc --swc firefox
npm run build -- -o edge.swc --swc edge
npm run build -- -o safari.swc --swc safari
npm run build -- -o opera.swc --swc opera
working-directory: ./js-extension-template
- name: "Check package existence"
uses: andstor/file-existence-action@v2
with:
files: >-
./js-extension-template/packages/chrome.babel.*,
./js-extension-template/packages/firefox.babel.*,
./js-extension-template/packages/edge.babel.*,
./js-extension-template/packages/safari.babel.*,
./js-extension-template/packages/opera.babel.*,
./js-extension-template/packages/chrome.swc.*,
./js-extension-template/packages/firefox.swc.*,
./js-extension-template/packages/edge.swc.*,
./js-extension-template/packages/safari.swc.*,
./js-extension-template/packages/opera.swc.*
fail: true
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -20,6 +20,10 @@ on:
schedule:
- cron: "45 7 * * 1"

concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,24 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Lint

on:
workflow_call:

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run lint


18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
@@ -1,22 +1,26 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package
name: Registry Publish

on:
workflow_dispatch:
push:
tags:
- "*"

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
- run: npm ci
- run: npm run lint

Expand All @@ -25,9 +29,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand All @@ -40,9 +44,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npm run build
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Expand Up @@ -6,24 +6,21 @@ on:
tags:
- "*"

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm run lint
uses: ./.github/workflows/lint.yml
create-release:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- run: npm ci
- run: npm run build
- run: npm pack
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Expand Up @@ -3,7 +3,7 @@
"editor.formatOnSave": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"prettier.prettierPath": "node_modules/prettier"
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.0.0] - ????-??-??

### Changed

- Uses ESM instead of CJS
- Optimize code
- Provide support for SWC
- Add option to only copy files and not compile them (compileIgnore glob)
- Additional debugging
- yaml config file to use instead of or with command options
- Move examples into their own template repos and use those in testing

### Fixed

- web_accessible_resources ignore js file (#793)
- Setup with additional webextension-toolbox.config.js config seems to fail on windows 11 (#656)
- Request for Node.js 20 Support (#847)
- Chalk is an implicit dependency (should be explicit) (#835)

## [6.2.0] - 2023-10-28

### Changed
Expand Down
5 changes: 5 additions & 0 deletions Makefile
@@ -0,0 +1,5 @@
act-build:
act -j build -W .github/workflows/build.yml -s GITHUB_TOKEN="$(shell gh auth token)" --artifact-server-path /tmp/artifacts

act-lint:
act -j lint -W .github/workflows/lint.yml -s GITHUB_TOKEN="$(shell gh auth token)" --artifact-server-path /tmp/artifacts