Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e09e67e
Sync files from GitLab (#1)
MartinGroscheTT Apr 1, 2025
a260f2b
Add GitHub Actions workflow for building extension (#1)
MartinGroscheTT Apr 1, 2025
2aca24d
Disable ESLint and TSLint rules in test setup for chrome API mocking …
MartinGroscheTT Apr 1, 2025
8661cd2
Update import statement to use .js extension for types (#1)
MartinGroscheTT Apr 1, 2025
43dad4f
Upgrade dependencies and clean project (#1)
MartinGroscheTT Apr 2, 2025
e0dc993
Fix zip file creation path in GitHub Actions workflow (#1)
MartinGroscheTT Apr 2, 2025
07a84ca
Update GitHub Actions workflow to upload built extension files direct…
MartinGroscheTT Apr 2, 2025
b8c3313
Update review notes (#1)
MartinGroscheTT Apr 3, 2025
f7ce39d
Sync internal GitLab repo (#1)
MartinGroscheTT Apr 7, 2025
27b899b
Refactor GitHub Actions workflow to separate testing into its own fil…
MartinGroscheTT Apr 7, 2025
0fa7196
Remove workflow_dispatch trigger from test workflow configuration (#1)
MartinGroscheTT Apr 7, 2025
9c90212
Refactor build workflow to use separate test workflow file (#1)
MartinGroscheTT Apr 7, 2025
1d7e1de
Enhance test workflow to support multiple Node.js versions (#1)
MartinGroscheTT Apr 7, 2025
4c2025b
Update documentation structure and add CI information (#1)
MartinGroscheTT Apr 8, 2025
06b6e64
Provide REUSE compliance check workflow (#1)
MartinGroscheTT Apr 8, 2025
f6f6de8
Add SPDX SBOM generation and upload to REUSE workflow (#1)
MartinGroscheTT Apr 8, 2025
df1115c
Update Developer Guide to clarify SBOM output location in REUSE workf…
MartinGroscheTT Apr 8, 2025
e410125
Rename workflow (#1)
MartinGroscheTT Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
20 changes: 20 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"browser": true,
"node": true,
"mocha": true
},
"rules": {
"@typescript-eslint/no-var-requires": 0
}
}
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Chrome Extension

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install dependencies
run: npm ci

- name: Lint code
run: npm run lint

- name: Run tests
run: npm test
build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install dependencies
run: npm ci

- name: Build extension for ${{ matrix.browser }}
run: npm run build-${{ matrix.browser }}

- name: Upload extension zip
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}-extension
path: dist/*
if-no-files-found: error
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
coverage
node_modules
.DS_Store
.env
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"required": ["ts-node/register", "tsconfig-paths/register"],
"extension": ["ts", "js"],
"loader": "ts-node/esm",
"spec": ["./test/setup.ts", "./test/**/*.ts"]
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"endOfLine": "auto",
"tabWidth": 2
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 tracetronic GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
123 changes: 121 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,122 @@
# ecu.test-diff
<!--
SPDX-FileCopyrightText: 2025 tracetronic GmbH

SPDX-License-Identifier: MIT
-->

![ecu.test Diff Extension](https://blubb.png)

Browser plugin to open the diff viewer of tracetronic products ecu.test and trace.check from browser.

## Announcements

*Nothing to see here yet.*

## Features

ecu.test Diff Extension is a bridge between the current browser tab and an installed ecu.test. It allows you to diff packages (`.pkg`) and other artifacts
from an open commit or merge request with only a few simple clicks.

SCM platforms:
- Github
- Gitlab

Supported entry points
- Single commits
- Merges

Detected file extensions
- `.pkg`
- `.prj`
- `.trf` (view only, no diff)

## Getting started

### Installing and running

TODO: The extention is not yet released on chrome or firefox app stores!

Use the extention in development mode (this mode is probably forbidden via company IT rules!):

**Firefox**

1. Download the relevant .xpi file from releases.
2. Go to `about:debugging#/runtime/this-firefox`
3. Click on load temporary addon select the .xpi file.
**Chrome/Edge**

1. Download the relevant .crx file from releases.
2. Go to `chrome://extensions/`
3. Enable development mode
4. Drag .crx into the window (if it is not working, reload window once)

You are good to go! You can also pin the extension to the toolbar for easy access.

### Usage
- Open a commit or merge request on your SCM platform. Open the extention popup dialog.
- Select the correct platform type and add the host.
- Go to the options. E.g., via click on the cog wheel icon.
- Now enter you API token. Don't give the token all permissions! Only reading repository and API access. So create fine-grained tokens!
- Save the settings
- Go back to the commit page and open the popup again.
- The supported files of the changes will be listed.
- Click on a file and click on "Show diff".
- ecu.test Diff-Viewer will be opened. This needs ecu.test installed and a valid license available!

### Developer Guide
#### Install node.js
First you have to install [node.js](https://nodejs.org/en/download) to have access to the package manager npm for building the browser extension.
#### Install dependencies
Open the ecu.test diff project in your IDE of choice and run the following terminal command to install the dependencies including typescript:

```npm install -g typescript```

#### Build process
If you want to build the ecu.test diff extension locally for development purpose or for production use, you have access to different scripts:

**<u>Note:</u>** All of these scripts can be found and modified within the './package.json' of the project.

**Firefox:**
```
npm run start-firefox
npm run build-firefox
```
**Chrome/Edge:**
```
npm run start-chrome
npm run build-chrome
```
Your compiles files are available inside the './dist' folder after the build process.
For integration and testing into you browser you have to note some differences:

In Chrome/Edge you can just select the './dist' folder inside you browser windows for importing the extension.

In Firefox you can test the extension only in debug-mode. You have to klick on 'debug add-ons' and can afterwards select a .zip file for the import. You can create the .zip file on your own or use the tool web-ext (from mozilla).
```
npm install web-ext
cd ./dist
web-ext build
```
This tooling also provide a help in the ['signing' process](https://extensionworkshop.com/documentation/develop/extensions-and-the-add-on-id/) which is required for the use of add-ons without debug-mode in firefox.

#### Testing / Linting / Code formatting
For these purposes there are three additional scripts which execute the local tests, start the linter in the source code and do some code formatting:

```
npm run test
npm run lint
npm run prettier
```

#### Open-Source Software compliance
To ensure open-source complience with our provided software at tracetronic GmbH we use the tool [reuse](https://reuse.readthedocs.io/en/stable/readme.html). After installing the tooling in your local environment you can check for open-source compliance with:

```reuse lint```

If you want to add the SPDX-Headers automatically - in case there are a lot of files - you can do this with the following:

```reuse annotate --copyright="tracetronic GmbH" --license=MIT -r <your_folder>/ ./<your_file>.ts```

### Licensing
This work is licensed under MIT license. This project is based on the boilerplate [Chrome Extension Webpack](https://github.com/sszczep/chrome-extension-webpack).

placeholder
16 changes: 16 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version = 1
SPDX-PackageName = "ecu.test diff plugin"
SPDX-PackageSupplier = "2025 tracetronic GmbH <[email protected]>"
SPDX-PackageDownloadLocation = "https://hq-vcs-3.ad.tracetronic.de/TTS/browserplugins/diffplugin"

[[annotations]]
path = ["README.md", "webpack.prod.cjs", "webpack.common.cjs", "webpack.dev.cjs"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 tracetronic GmbH"
SPDX-License-Identifier = "MIT"

[[annotations]]
path = ["static/fonts/**", "static/icons/**", "**.json", ".eslint*", ".gitignore", ".prettier*"]
precedence = "aggregate"
SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "MIT"
7 changes: 7 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}
Loading