Skip to content
Closed
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
53 changes: 53 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# EditorConfig is awesome: https://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Matches multiple files with the same settings
[*.js]
indent_size = 2

[*.json]
indent_size = 2

[*.yml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
indent_size = 2

[*.sql]
indent_size = 2

# C/C++ files
[*.cc]
indent_size = 2
indent_style = tab
max_line_length = 100

[*.h]
indent_size = 2
indent_style = tab
max_line_length = 100

# Makefile and GYP files use tabs
[{Makefile,*.gyp}]
indent_style = tab

# Dockerfiles
[Dockerfile]
indent_size = 2

# YAML files
[*.yaml]
indent_size = 2
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module.exports = {
"extends": "eslint:recommended",
"env": {
"es2017": true,
"es2020": true,
"node": true
},
"rules": {
"indent": ["error", 4],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"no-cond-assign": ["error", "always"]
"no-cond-assign": ["error", "always"],
"no-inner-declarations": "off"
}
};
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Mark SQLite database files as binary to prevent line ending conversions
*.db binary
*.sqlite binary
*.sqlite3 binary
3 changes: 1 addition & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ General guidelines for contributing to node-sqlite3

## Install Help

If you've landed here due to a failed install of `node-sqlite3` then feel free to create a [new issue](https://github.com/tryghost/node-sqlite3/issues/new) to ask for help. The most likely problem is that we do not yet provide pre-built binaries for your particular platform and so the `node-sqlite3` install attempted a source compile but failed because you are missing the [dependencies for node-gyp](https://github.com/nodejs/node-gyp#installation). Provide as much detail on your problem as possible and we'll try to help. Include:
If you've landed here due to a failed install of `node-sqlite3` then feel free to create a [new issue](https://github.com/gms1/node-sqlite3/issues/new) to ask for help. The most likely problem is that we do not yet provide pre-built binaries for your particular platform and so the `node-sqlite3` install attempted a source compile but failed because you are missing the [dependencies for node-gyp](https://github.com/nodejs/node-gyp#installation). Provide as much detail on your problem as possible and we'll try to help. Include:

- Logs of failed install (preferably from running `npm install sqlite3 --loglevel=info`)
- Version of `node-sqlite3` you tried to install
- Node version you are running
- Operating system and architecture you are running, e.g. `Windows 7 64 bit`.

The release process is documented in the wiki: https://github.com/TryGhost/node-sqlite3/wiki/Release-process
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 📖 API documentation
url: https://github.com/TryGhost/node-sqlite3/wiki/API
url: https://github.com/gms1/node-sqlite3/wiki/API
about: Documentation for the `node-sqlite3` API
76 changes: 69 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,57 @@ on:
pull_request:
push:
branches:
- master
- main
tags:
- '*'
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
verify-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Verify tag version matches package.json
run: |
# Check if we're running on a tag
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
# Extract tag name from GITHUB_REF (e.g., refs/tags/v6.0.2 -> v6.0.2)
TAG_NAME="${GITHUB_REF#refs/tags/}"
# Remove 'v' prefix if present to get the version number
TAG_VERSION="${TAG_NAME#v}"

# Get version from package.json
PACKAGE_VERSION=$(node -p "require('./package.json').version")

echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"

if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "ERROR: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
echo "Please update package.json or create a new tag with the correct version"
echo "GitHub release will NOT be created."
exit 1
fi

echo "Version match verified!"
else
echo "Skipping version verification - not a tag event"
fi

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
- name: Run lint
run: yarn lint

build:
needs: [verify-version, lint]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -69,13 +110,13 @@ jobs:
architecture: ${{ matrix.host }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3
uses: microsoft/setup-msbuild@v2
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}

- name: Install dependencies
run: yarn install --ignore-scripts
run: yarn install --frozen-lockfile --ignore-scripts

- name: Check Node compatibility
run: node tools/semver-check.js
Expand Down Expand Up @@ -125,6 +166,7 @@ jobs:
if: matrix.node == 24 && startsWith(github.ref, 'refs/tags/')

build-musl:
needs: [verify-version]
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
Expand Down Expand Up @@ -161,5 +203,25 @@ jobs:
retention-days: 7

- name: Upload binaries to GitHub Release
run: yarn install --ignore-scripts && yarn upload --upload-all ${{ github.token }}
run: yarn install --frozen-lockfile --ignore-scripts && yarn upload --upload-all ${{ github.token }}
if: startsWith(github.ref, 'refs/tags/')

publish-npm:
needs: [build, build-musl]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts

- name: Publish to npm
run: npm publish
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI publish job likely missing npm authentication configuration

Medium Severity

The publish-npm job uses actions/setup-node with registry-url, which creates an .npmrc referencing ${NODE_AUTH_TOKEN}, but no NODE_AUTH_TOKEN environment variable is provided on the npm publish step. While id-token: write suggests OIDC trusted publishing was intended, the actions/setup-node registry-url option is known to interfere with OIDC by injecting an unresolved token reference. The npm publish call likely needs either a --provenance flag or NODE_AUTH_TOKEN set explicitly.

Fix in Cursor Fix in Web

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ setup.sh
*.tgz
package-lock.json
prebuilds
.vscode
.clinerules
.roomodes
Loading