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
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"baseBranch": "master",
"access": "public",
"privatePackages": {
"version": false
},
"updateInternalDependencies": "patch",
"fixed": [],
"linked": [],
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/stack-upgrade-node-24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@toruslabs/ffjavascript": major
---

Require Node.js 26 and npm 12. Publish the Vite+ build from the existing CommonJS and ESM entry points.
26 changes: 26 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Lines starting with '#' are comments.
#
# GUIDELINES:
# Each line is a file pattern followed by one or more owners.
# Owners bear a responsibility to the organization and the users of this
# application. Repository administrators have the ability to merge pull
# requests that have not yet received the requisite reviews as outlined
# in this file. Do not force merge any PR without confidence that it
# follows all policies or without full understanding of the impact of
# those changes on build, release and publishing outcomes.
#
# The CODEOWNERS file constitutes an agreement amongst organisation
# admins and maintainers to restrict approval capabilities to a subset
# of contributors. Modifications to this file result in a modification of
# that agreement and can only be approved by those with the knowledge
# and responsibility to publish libraries under the MetaMask name.

# Fallback for all other files
* @MetaMask/Web3Auth-Admins

# Product code
src/ @MetaMask/Web3Auth-Product
test/ @MetaMask/Web3Auth-Product

# Most restrictive — last match wins
.github/CODEOWNERS @MetaMask/Web3Auth-Admins
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
on:
pull_request:
push:
branches-ignore:
branches:
- "master"

name: Run Tests

jobs:
test:
name: run tests
permissions:
contents: read
strategy:
matrix:
node: ["24.x"]
node: ["24.22", "26.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Install npm 12
run: npm install --global npm@12.2.0

- name: Install dependencies
run: npm install
run: npm ci

- name: Check dependency hardening
run: npx --no-install harden check --package-manager npm --level moderate

- name: Install playwright webkit
run: npx playwright install-deps webkit
Expand All @@ -35,3 +46,11 @@ jobs:

- name: Run tests
run: npm run test

- name: Check release notes
if: github.event_name == 'pull_request' && !startsWith(github.head_ref, 'changeset-release/')
env:
BASE_REF: ${{ github.base_ref }}
run: |
git fetch --no-tags origin "${BASE_REF}:refs/remotes/origin/${BASE_REF}"
npm exec -- changeset status --since="origin/${BASE_REF}"
39 changes: 39 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create release pull request

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: release-pr
cancel-in-progress: false

jobs:
release-pr:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "26"
- name: Install npm 12
run: npm install --global npm@12.2.0
- name: Install dependencies
run: npm ci
# The GitHub API commit mode signs the release commit, which `master` requires.
- name: Create or update the release pull request
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
version-script: npm run version-packages
commit-message: "chore: release packages"
pr-title: "chore: release packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Security code scanner

on:
pull_request:
push:
branches: [master]
schedule:
- cron: "17 4 * * 1"

permissions:
contents: read

jobs:
# GitHub CodeQL default setup is the CodeQL scan for this repository.
# A second CodeQL workflow would duplicate it.
semgrep:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- name: Install Semgrep OSS
run: python -m pip install 'setuptools<81' semgrep==1.136.0
- name: Scan JavaScript and TypeScript
run: semgrep scan --error --config p/javascript --config p/typescript --exclude '**/node_modules/**' --exclude '**/dist/**' --exclude '**/build/**' --exclude '**/coverage/**' .
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Avoid installing packages published in last 3 days.
min-release-age=3

## Don't install packages from git urls.
allow-git=none

## Disable installing dependencies from remote URLs.
allow-remote=none

## Pin allowed scripts to exact versions of dependencies to prevent unexpected script execution.
allow-scripts-pin=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
>=24.x
26
54 changes: 23 additions & 31 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Test BN128",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"${workspaceFolder}/test/bn128.js"
]
},
{
"type": "pwa-node",
"request": "launch",
"name": "Test Algebra",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"${workspaceFolder}/test/algebra.js"
]
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Test BN128",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceFolder}/test/bn128.js"]
},
{
"type": "pwa-node",
"request": "launch",
"name": "Test Algebra",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceFolder}/test/algebra.js"]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ffjavascript

Finite Field Library in Javascript

## License

ffjavascript is part of the iden3 project copyright 2020 0KIMS association and published with GPL-3 license. Please check the COPYING file for more details.

10 changes: 0 additions & 10 deletions build/lib.cjs/main.js

This file was deleted.

Loading
Loading