Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
always-auth: true

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci
Expand All @@ -63,8 +64,6 @@ jobs:
DEBUG: release-it:*,@release-it/*
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION_ARG=""
if [ -n "${{ inputs.version }}" ]; then
Expand All @@ -83,7 +82,7 @@ jobs:
fi
NPM_TAG_ARG="--npm.tag=${NPM_TAG}"

npm run release -- --ci $PREID_ARG $NPM_TAG_ARG $VERSION_ARG
npx release-it --ci $PREID_ARG $NPM_TAG_ARG $VERSION_ARG

- name: Sync main → develop
uses: devmasx/merge-branch@v1.4.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ stats.html
.tool-versions
.cache
*-stats.txt
.npmrc
6 changes: 2 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env sh

# Husky pre-commit hook: format and run related tests on staged files

# Husky pre-commit hook: run tests and check linting/formatting
npm run test:related
npm run lint:fix:unsafe
npm run format
npm run lint
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Husky pre-push hook: typecheck, run full tests, and build

npm run typecheck || exit 1
#npm run test:ci || exit 1
npm run test || exit 1
npm run build || exit 1
4 changes: 3 additions & 1 deletion .release-it.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ module.exports = () => {

npm: {
publish: true,
skipChecks: true,
provenance: true,
access: "public",
versionArgs: ["--no-git-tag-version"],
publishArgs: ["--provenance", "--access", "public"],
},

plugins: {
Expand Down
1 change: 0 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"files": {
"includes": [
"src/**/*.{ts,tsx,js,jsx}",
"!src/**/*.test.{ts,tsx,js,jsx}",
"**/*.{json,jsonc,md,mdx,cjs,mjs}",
"!dist/**/*"
]
Expand Down
14 changes: 14 additions & 0 deletions docs/contextMenus.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A promise-based wrapper for the Chrome `contextMenus` API.
- [removeContextMenus(menuItemId)](#removeContextMenus)
- [removeAllContextMenus()](#removeAllContextMenus)
- [updateContextMenus(id, updateProperties?)](#updateContextMenus)
- [createOrUpdateContextMenu(id, properties)](#createOrUpdateContextMenu)

## Events

Expand Down Expand Up @@ -60,6 +61,19 @@ updateContextMenus(

Updates the specified context menu item with new properties.

<a name="createOrUpdateContextMenu"></a>

### createOrUpdateContextMenu

```
createOrUpdateContextMenu(
id: string | number,
properties: Omit<chrome.contextMenus.CreateProperties, "id">
): Promise<void>
```

Tries to create a context menu item. If it already exists (e.g., after service worker wake up), it updates the existing item instead.

<a name="onContextMenusClicked"></a>

### onContextMenusClicked
Expand Down
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
moduleNameMapper: {
'^(\\.\\.?/.*)\\.js$': '$1',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: 'tsconfig.json',
},
],
},
};
Loading