diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9f48b7a..daa58bb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: fi build-and-test: - name: Test and Build ${{ needs.compute-matrix.outputs.name_suffix }} + name: Test and Build (${{ matrix.os }}, Node ${{ matrix.node }}) ${{ needs.compute-matrix.outputs.name_suffix }} needs: compute-matrix runs-on: ${{ matrix.os }} permissions: @@ -54,6 +54,13 @@ jobs: node-version: ${{ matrix.node }} cache: npm + - name: Set up Chrome + if: matrix.os == 'ubuntu-latest' + id: chrome + uses: browser-actions/setup-chrome@v2 + with: + chrome-version: stable + - name: Install dependencies run: npm ci @@ -61,7 +68,16 @@ jobs: run: npm run typecheck - name: Test + if: matrix.os == 'ubuntu-latest' run: npm run test:ci + env: + ADNBN_CHROME_BIN: ${{ steps.chrome.outputs.chrome-path }} + + # The CDP extension-loading scenario is verified on Chrome's Linux runner. + # The rest of the test suite remains part of the full OS x Node matrix. + - name: Test (non-browser) + if: matrix.os != 'ubuntu-latest' + run: npm run test:ci:non-browser - name: Build run: npm run build diff --git a/.gitignore b/.gitignore index 7cb22aac..fa7fb772 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,6 @@ TODOs.md stats.html .tool-versions .cache +/tests/integration/browser/offscreen-service/.adnbn/ *-stats.txt .npmrc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e2ee405..309caaa1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,7 @@ Releases and versioning: 3. Make changes and ensure commits follow Conventional Commits. 4. Before opening a PR, run local checks: - Formatting: `npm run format` - - Tests: `npm test` + - Tests: `npm test` (the full suite includes a Chrome MV3 integration test; use `ADNBN_CHROME_BIN=/path/to/chrome` to override automatic Chrome discovery) - By area (if needed): - `npm run test:relay` - `npm run test:service` diff --git a/README.md b/README.md index 38a058cd..6bf827d5 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,40 @@ -# adnbn +# Addon Bone -[![npm version](https://img.shields.io/npm/v/adnbn.svg)](https://www.npmjs.com/package/adnbn) -[![npm downloads](https://img.shields.io/npm/dm/adnbn.svg)](https://www.npmjs.com/package/adnbn) +> **🚧 Active development** — the public API and documentation may change between releases. Full guides and API reference are being prepared at [addonbone.com](https://addonbone.com). -## Addon Bone - Cross-Browser Web Extension Framework with shared code base +[![npm version](https://img.shields.io/npm/v/adnbn.svg?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/adnbn) +[![npm downloads](https://img.shields.io/npm/dm/adnbn.svg?style=for-the-badge&color=blue)](https://www.npmjs.com/package/adnbn) +[![CI](https://img.shields.io/github/actions/workflow/status/addon-stack/addon-bone/ci.yml?style=for-the-badge)](https://github.com/addon-stack/addon-bone/actions/workflows/ci.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE.md) -**Cross-browser framework** for developing extensions on a single code base. Enables creating multiple production-grade extensions with different localizations, icons, and designs while maintaining identical core functionality. +A TypeScript framework for building browser extensions from a shared codebase. +Define extension entrypoints in source files; Addon Bone discovers them and creates +the browser-specific build and manifest. -### Core Concept +## Install -- **Single code base**: maintain one set of source files for all extensions. -- **Flexibility**: supports both multi-package setups (multiple extensions in one repository) and standalone projects. -- **Modern workflow**: automatic merging of styles, scripts, content scripts, and background scripts. +```bash +npm i -D adnbn +``` -### Supported Platforms & Manifests +## Get started -- **Browsers**: Chrome, Firefox, Opera, Safari, Edge. -- **Manifest Versions**: Manifest V2 and V3. +Create a project, then build it for production: -### Entry Points +```bash +npx adnbn init +npx adnbn build +``` -- **Background Page** -- **Content Scripts** -- **Commands** -- **Localization** -- **Icons** -- **Messages** -- **Services** -- **Relay** -- **Offscreen** -- **Popup** -- **Sidebar** +For project structure, entrypoint guides, and the API reference, visit +[addonbone.com](https://addonbone.com). -### Plugins +## Links -- **Extensibility via Plugins**: write modules for background pages, content scripts, and any supported entry points. -- **Automatic Integration**: plugins are automatically included in the build process and update the manifest. +- [Documentation](https://addonbone.com) +- [Contributing](CONTRIBUTING.md) +- [Issues](https://github.com/addon-stack/addon-bone/issues) -### Services & Relay +## License -- **Services**: class-based layer for background interactions without boilerplate. Service methods are available across all extension layers via simple calls. -- **Relay**: similar mechanism for content pages, bypassing CSP and getUserGesture restrictions by leveraging scripting contexts. - -### Offscreen - -- **Manifest V2**: offscreen support via `