Skip to content

Commit

Permalink
Add support for bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym committed Jun 15, 2024
1 parent 854e192 commit 3c3be9f
Show file tree
Hide file tree
Showing 21 changed files with 6,497 additions and 3,115 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/yellow-avocados-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"workers-qb": patch
---

Add support for bigint
15 changes: 0 additions & 15 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = tab
indent_size = 4

[*.py]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
indent_size = 4

[*.sln]
indent_style = tab

[*.{md,mdx}]
trim_trailing_whitespace = false
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

23 changes: 7 additions & 16 deletions .github/workflows/test.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
name: Test
name: CI

on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '.editorconfig'
branches:
- main
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '.editorconfig'
- "**"

jobs:
test:
Expand All @@ -23,15 +12,17 @@ jobs:
matrix:
os:
- ubuntu-latest
node: [18.x, 20.x]
node: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install modules
run: npm install
- name: Run build
run: npm run lint && npm run build
- name: Run tests
run: npm run test
46 changes: 25 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: Release & Publish

name: Publish
on:
push:
tags:
- 'v*'
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 22.x
cache: "npm"

- run: npm install
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Apply new version
run: node config/preparePublish.cjs
- name: Install modules
run: npm install
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
publish: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
125 changes: 3 additions & 122 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,124 +1,5 @@

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
node_modules
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


# Ide
.idea/

.idea
docs/site
.DS_Store
src/**/*.js
5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

8 changes: 0 additions & 8 deletions .husky/common.sh

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion commitlint.config.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions config/fileTransformer.cjs

This file was deleted.

18 changes: 0 additions & 18 deletions config/preparePublish.cjs

This file was deleted.

7 changes: 4 additions & 3 deletions docs/pages/databases/bring-your-own-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ For example here is the code that implements support for the node-postgres libra

```ts
// filename: src/interfaces.ts
import { DefaultObject } from 'workers-qb'

// other interfaces...

export interface PGResult {
command: string
lastRowId?: string | number
rowCount: number
results?: Array<Record<string, string | boolean | number | null>>
results?: Array<DefaultObject>
}

export interface PGResultOne {
command: string
lastRowId?: string | number
rowCount: number
results?: Record<string, string | boolean | number | null>
results?: DefaultObject
}
```

Expand Down Expand Up @@ -51,7 +52,7 @@ export class PGQB extends QueryBuilder<PGResult, PGResultOne> {

async execute(params: {
query: String
arguments?: (string | number | boolean | null | Raw)[]
arguments?: Primitive[]
fetchType?: FetchTypes
}): Promise<any> {
const query = params.query.replaceAll('?', '$')
Expand Down
10 changes: 3 additions & 7 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ module.exports = {
roots: ['<rootDir>/tests'],
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'./config/fileTransformer.cjs',
},
globals: {
'ts-jest': {
'^.+\\.(ts|tsx)$': ['ts-jest', {
tsconfig: 'tsconfig.json',
},
}],
},
}

Loading

0 comments on commit 3c3be9f

Please sign in to comment.