Skip to content
Merged

Rc #97

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
d8bb577
fix/added retries directly to vitest config file
NickRMD Sep 29, 2025
ea2e6cd
fix/configured better the typing on orderby
NickRMD Sep 29, 2025
52d7c57
feat/added subqueries and a function to detect if it's a subquery or …
NickRMD Sep 29, 2025
e9284a6
fix/removed deprecated retries from here
NickRMD Sep 29, 2025
591704e
feat/fix/fixed how ctes managed with joins and also added subquery joins
NickRMD Sep 29, 2025
422a4ab
feat/fix/fixed how ctes managed with queries and also added subquery …
NickRMD Sep 29, 2025
cc7cc96
Mark issue #70 as complete
NickRMD Sep 29, 2025
6ef8f3e
Merge pull request #71 from NickRMD/feat/fix/add-subquery-to-join-and…
NickRMD Sep 29, 2025
88c03ae
bump up version to 0.7.0
NickRMD Sep 29, 2025
807fcc4
Merge pull request #72 from NickRMD/feat/fix/add-subquery-to-join-and…
NickRMD Sep 29, 2025
b4a01c9
feat/added selecting specific fields from union selects also added te…
NickRMD Sep 30, 2025
ef4dd3d
fix/refact/select and addSelect methods from the select query now use…
NickRMD Sep 30, 2025
98f18b8
Merge pull request #73 from NickRMD/feat/add-select-fields-to-union
NickRMD Sep 30, 2025
b9cdce6
Fixed issue #64
NickRMD Sep 30, 2025
85da5b8
docs/add docs for creating unions
NickRMD Sep 30, 2025
4332722
refact/moved queryKind files to queryKind/dml since they were all dml…
NickRMD Sep 30, 2025
8901862
refact/renamed QueryDefinition to DmlQueryDefinition
NickRMD Sep 30, 2025
7ac671c
refact/change query.ts to dmlQueryDefinition.ts
NickRMD Sep 30, 2025
fc1d68b
fix/change query.js to dmlQueryDefinition.js
NickRMD Sep 30, 2025
632adad
ongoing/feat/started adding ddl queries
NickRMD Sep 30, 2025
5a1e034
feat/added exports for lots of things like dml queries for example
NickRMD Sep 30, 2025
938bfc3
feat/added other entries for exporting and also added all index.ts to…
NickRMD Sep 30, 2025
e5fbfe0
Started adding more query kinds/types as from the issue #65
NickRMD Sep 30, 2025
9189b9c
fix/added default export to CteMaker
NickRMD Sep 30, 2025
fca7c38
Fixed some bugs in PR #71 that already presented some bugs found on
NickRMD Sep 30, 2025
53bd070
Merge branch 'dev' of https://github.com/NickRMD/queryMaker into feat…
NickRMD Sep 30, 2025
b04c5c7
feat/added error handling from when select queries in unions have dif…
NickRMD Sep 30, 2025
06c1f70
fix/updated package-lock.json after version bump
NickRMD Oct 1, 2025
f7f8157
Test commit for NPM publishing
NickRMD Oct 1, 2025
d6f7809
Merge branch 'dev' of https://github.com/NickRMD/queryMaker into feat…
NickRMD Oct 1, 2025
2b5e5ff
feat/updated publish-npm.yml from npm to pnpm, begin testing in dev b…
NickRMD Oct 1, 2025
d4fca1a
Merge pull request #75 from NickRMD/feat/move-from-npm-to-pnpm
NickRMD Oct 1, 2025
273d392
fix/removed git checks on publish
NickRMD Oct 1, 2025
44935ac
Merge pull request #76 from NickRMD/feat/move-from-npm-to-pnpm
NickRMD Oct 1, 2025
add8923
test/test pnpm cache
NickRMD Oct 1, 2025
1864d7e
Merge pull request #77 from NickRMD/feat/move-from-npm-to-pnpm
NickRMD Oct 1, 2025
bc0e837
feat/added artifacts to releases
NickRMD Oct 1, 2025
178b642
Merge pull request #78 from NickRMD/feat/move-from-npm-to-pnpm
NickRMD Oct 1, 2025
6300f46
Merge branch 'dev' of https://github.com/NickRMD/queryMaker into feat…
NickRMD Oct 1, 2025
b213fff
feat/updated workflow from dev to next
NickRMD Oct 1, 2025
23df106
feat/updated name dev to next
NickRMD Oct 1, 2025
a9c4c84
Merge pull request #79 from NickRMD/feat/rename-dev-to-next
NickRMD Oct 1, 2025
4b98931
Merge branch 'next' of https://github.com/NickRMD/queryMaker into fea…
NickRMD Oct 1, 2025
cac5da9
fix/fix git url
NickRMD Oct 2, 2025
5dd7fe4
feat/added columnTypes, columnType class and columns class with a lot…
NickRMD Oct 2, 2025
bfb0fa1
feat/fix/changed how DdlQueryDefinition works to adapt to how other c…
NickRMD Oct 2, 2025
9f1454e
feat/introduced tables as the first ddl queries to exist in this pack…
NickRMD Oct 2, 2025
029414d
feat/added tables to the queryMaker
NickRMD Oct 2, 2025
1438da1
Merge pull request #80 from NickRMD/feat/add-new-query-types
NickRMD Oct 2, 2025
e3fbd1f
fix/configured exports correctly
NickRMD Oct 2, 2025
9bfb0f3
Merge pull request #81 from NickRMD/fix/exports-need-fixing
NickRMD Oct 2, 2025
c2ffb5f
feat/added some more commands for development and updated typescript …
NickRMD Oct 5, 2025
bc260b6
fix/disabled not so helpful option so I couldn't compare optional par…
NickRMD Oct 5, 2025
8337b97
feat/refact/refactored Column to a new folder called queryUtils and a…
NickRMD Oct 5, 2025
ba85f4e
feat/refact/updated path name from types to queryUtils for Column and…
NickRMD Oct 5, 2025
68d9f9b
feat/refact/made validate method better and added getMany and getOne
NickRMD Oct 5, 2025
3753c4b
feat/added src/queryUtils/index.ts to tsup entry points
NickRMD Oct 5, 2025
3093a5d
ongoing/feat/started adding testing to CreateTableQuery class
NickRMD Oct 5, 2025
850e38a
feat/added scripts folder for storing some useful scripts especially …
NickRMD Oct 6, 2025
f92b2f8
feat/added jsr support
NickRMD Oct 6, 2025
2f0b60e
feat/fix/added support for QuickJS and removed node as target since t…
NickRMD Oct 6, 2025
2798678
fix/added some configs to remove errors from when overriding or retur…
NickRMD Oct 6, 2025
b950e03
refact/passed biome check and removed slow types
NickRMD Oct 6, 2025
8566fd7
feat/need-testing/added jsr support
NickRMD Oct 6, 2025
82c86d8
Removed ts-pattern as dependency
NickRMD Oct 6, 2025
085d6a9
Merge pull request #82 from NickRMD/feat/add-test-and-add-better-supp…
NickRMD Oct 6, 2025
d4d9bca
fix/added forgotten archives into releases
NickRMD Oct 6, 2025
8895290
Merge pull request #83 from NickRMD/feat/add-test-and-add-better-supp…
NickRMD Oct 6, 2025
c31dc06
feat/added safety guard so publishing the same version number doesn't…
NickRMD Oct 6, 2025
021c384
Merge pull request #84 from NickRMD/feat/add-test-and-add-better-supp…
NickRMD Oct 6, 2025
e8e4739
feat/added the rest of the tests needed for CreateTableQuery
NickRMD Oct 7, 2025
af8caac
feat/added tests for DropTableQuery
NickRMD Oct 7, 2025
44634ed
ongoing/feat/started adding tests for AlterTableQuery
NickRMD Oct 7, 2025
31f8328
feat/added return all and returningRaw to all queries that support th…
NickRMD Oct 7, 2025
de259c1
fix/remove all returning fields when returnAllFields is called
NickRMD Oct 7, 2025
ec0bc3a
Merge branch 'next' into feat/add-return-all-and-returningRaw-to-all-…
NickRMD Oct 7, 2025
e206709
refact/biome refact
NickRMD Oct 7, 2025
dcdf075
Merge pull request #85 from NickRMD/feat/add-return-all-and-returning…
NickRMD Oct 7, 2025
b03ce79
feat/added void back to unions
NickRMD Oct 7, 2025
2a93077
Merge pull request #86 from NickRMD/feat/add-test-and-add-better-supp…
NickRMD Oct 7, 2025
410d983
fix/added void back to unions on update
NickRMD Oct 7, 2025
b478436
bumped up version because of tag error
NickRMD Oct 7, 2025
f141859
Merge pull request #87 from NickRMD/feat/add-return-all-and-returning…
NickRMD Oct 7, 2025
ac14563
fix/fixed validation with wrong type in environments without zod
NickRMD Oct 13, 2025
8b49dc5
feat/changed input for withQuery
NickRMD Oct 27, 2025
6773f5d
Merge pull request #88 from NickRMD/feat/add-more-query-types-to-cte
NickRMD Oct 27, 2025
47c3c4f
bookkeeping/updated dependencies
NickRMD Oct 27, 2025
8cc1102
Merge pull request #89 from NickRMD/bookkeeping/update-dependencies
NickRMD Oct 27, 2025
1468f99
feat/added better support for unions in CTEs
NickRMD Oct 28, 2025
9ac589c
Merge pull request #90 from NickRMD/feat/better-support-for-unions-in…
NickRMD Oct 28, 2025
7a9b1bf
fix/removed wrong draft code
NickRMD Oct 28, 2025
1429a34
Merge pull request #91 from NickRMD/feat/better-support-for-unions-in…
NickRMD Oct 28, 2025
21cce8c
fix/fixed how unions and selects work in CTEs, disable analysis
NickRMD Oct 28, 2025
018e48b
Merge pull request #92 from NickRMD/feat/better-support-for-unions-in…
NickRMD Oct 28, 2025
028caae
fix/fixed naming
NickRMD Oct 28, 2025
c2fd2a7
Merge pull request #93 from NickRMD/feat/better-support-for-unions-in…
NickRMD Oct 28, 2025
2c70c2f
bookkeeping/updated dependencies
NickRMD Oct 30, 2025
babfdb5
feat/added tests for columntypes
NickRMD Oct 30, 2025
6bad81a
feat/added tests and fixed some issues in the ColumnDefinition and Co…
NickRMD Oct 30, 2025
391eaa9
feat/completed tests for AlterTableQuery class
NickRMD Oct 30, 2025
dea3ea7
feat/added tests for DdlQueryDefinition specific functions
NickRMD Oct 30, 2025
dbcfb63
Merge pull request #94 from NickRMD/feat/add-test-and-add-better-supp…
NickRMD Oct 30, 2025
dfd8903
Merge pull request #95 from NickRMD/next
NickRMD Oct 30, 2025
2ef7405
Merge pull request #96 from NickRMD/beta
NickRMD Oct 30, 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
77 changes: 69 additions & 8 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- rc
- beta
- dev
- next
workflow_dispatch:

jobs:
Expand All @@ -25,14 +25,32 @@ jobs:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

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

- name: Run tests
run: npm test
run: pnpm test

- name: Build project
run: npm run build:prod
run: pnpm build:prod

- name: Determine version and tag
id: version
Expand All @@ -45,8 +63,15 @@ jobs:
"main")
NPM_TAG="latest"
VERSION=$PACKAGE_VERSION

# Find the latest tag matching this package and error if it already exists
LAST_TAG=$(git tag --list "v${PACKAGE_VERSION}" | sort -V | tail -n1)
if [ "$LAST_TAG" == "v${PACKAGE_VERSION}" ]; then
echo "Version $PACKAGE_VERSION already exists. Please update the version in package.json and jsr.json before publishing."
exit 1
fi
;;
"rc"|"beta"|"dev")
"rc"|"beta"|"next")
IDENTIFIER=$BRANCH_NAME
NPM_TAG=$BRANCH_NAME

Expand Down Expand Up @@ -77,21 +102,44 @@ jobs:

- name: Update package version
run: |
npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
./scripts/update-jsr-version.sh ${{ steps.version.outputs.version }}

- name: Create distribution archive
run: |
# Create a compressed archive of the dist directory
tar -czf dist-${{ steps.version.outputs.version }}.tar.gz dist/

# Create a zip archive as well for Windows users
zip -r dist-${{ steps.version.outputs.version }}.zip dist/

# Create a compressed archive of the dist-qjs directory
tar -czf dist-qjs-${{ steps.version.outputs.version }}.tar.gz dist-qjs/

# Create a zip archive of the dist-qjs directory for Windows users
zip -r dist-qjs-${{ steps.version.outputs.version }}.zip dist-qjs

- name: Publish to NPM
run: |
npm publish --tag ${{ steps.version.outputs.npm_tag }}
pnpm publish --tag ${{ steps.version.outputs.npm_tag }} --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to JSR
run: pnpx jsr publish --allow-dirty

- name: Create GitHub Release (main branch only)
if: github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
commit: ${{ github.sha }}
artifacts: |
dist-${{ steps.version.outputs.version }}.tar.gz
dist-${{ steps.version.outputs.version }}.zip
dist-qjs-${{ steps.version.outputs.version }}.tar.gz
dist-qjs-${{ steps.version.outputs.version }}.zip
body: |
## Changes

Expand All @@ -102,18 +150,27 @@ jobs:
npm install sqm@latest
```

Download the distribution archives:
- dist-${{ steps.version.outputs.version }}.tar.gz `compressed tar.gz archive`
- dist-${{ steps.version.outputs.version }}.zip `zip archive`

For full changelog, see the commit history.
draft: false
prerelease: false
generateReleaseNotes: true

- name: Create Pre-release (rc, beta, dev branches)
- name: Create Pre-release (rc, beta, next branches)
if: github.ref != 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.branch }} v${{ steps.version.outputs.version }}
commit: ${{ github.sha }}
artifacts: |
dist-${{ steps.version.outputs.version }}.tar.gz
dist-${{ steps.version.outputs.version }}.zip
dist-qjs-${{ steps.version.outputs.version }}.tar.gz
dist-qjs-${{ steps.version.outputs.version }}.zip
body: |
## ${{ steps.version.outputs.branch }} Release

Expand All @@ -124,6 +181,10 @@ jobs:
npm install sqm@${{ steps.version.outputs.npm_tag }}
```

Download the distribution archives:
- dist-${{ steps.version.outputs.version }}.tar.gz `compressed tar.gz archive`
- dist-${{ steps.version.outputs.version }}.zip `zip archive`

**⚠️ Warning**: This is a pre-release version and may contain bugs or incomplete features.
draft: false
prerelease: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
dist*
coverage
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ package-lock.json
.vscode
.idea
.DS_Store
scripts
UPDATE-STRATEGY.md
14 changes: 7 additions & 7 deletions UPDATE-STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ Fisrt I'll clarify branch names:
- `main` is the production branch, it should always be stable and deployable.
- `rc` is the release candidate branch, it is used for testing new features before they are merged into `main`.
- `beta` is the beta branch, it is used for testing new features before they are merged into `rc`.
- `dev` is the development branch, it is used for active development and may be unstable
- `next` is the development branch, it is used for active development and may be unstable

## Update Strategy
1. **Development Phase**:
- All new features and bug fixes are developed in the `dev` branch.
- Regular commits and pushes to `dev` to ensure changes are tracked.
- All new features and bug fixes are developed in the `next` branch.
- Regular commits and pushes to `next` to ensure changes are tracked.
- Once a feature or fix is complete, it is merged into the `beta` branch for initial testing.
2. **Beta Testing Phase**:
- The `beta` branch is published into npm with the `beta` tag.
- Beta testers and early adopters can install the beta version using `npm install sqm@beta`.
- Feedback from beta testers is collected and any issues are addressed in the `dev` branch.
- Feedback from beta testers is collected and any issues are addressed in the `next` branch.
- Once the beta version is stable and all critical issues are resolved, it is merged into the `rc` branch.
3. **Release Candidate Phase**:
- The `rc` branch is published into npm with the `rc` tag.
- Further testing is conducted to ensure stability and performance.
- Any final bugs or issues are fixed in the `dev` branch and merged into `rc`.
- Any final bugs or issues are fixed in the `next` branch and merged into `rc`.
- Once the release candidate is deemed stable, it is merged into the `main` branch.
4. **Production Release Phase**:
- The `main` branch is published into npm with the `latest` tag.
- Users can install the stable version using `npm install sqm`.
- Post-release monitoring is conducted to ensure the release is functioning as expected.
- Any critical issues found in production are addressed in the `dev` branch and the cycle repeats.
- Any critical issues found in production are addressed in the `next` branch and the cycle repeats.

## Hotfixes
In case of critical bugs in the `main` branch:
1. Create a hotfix branch from `main`.
2. Implement the fix and test it thoroughly.
3. Merge the hotfix branch back into `main`, `rc`, and `dev` branches.
3. Merge the hotfix branch back into `main`, `rc`, and `next` branches.
4. Publish the updated `main` branch and other branches as necessary.
5. Communicate the hotfix to users if necessary.

Expand Down
49 changes: 49 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"includes": ["**/*.ts", "!**/*.test.ts", "!**/*.spec.ts"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"useIterableCallbackReturn": "off",
"noConfusingVoidType": "off"
},
"style": {
"noNonNullAssertion": "off"
},
"complexity": {
"noBannedTypes": "off",
"noStaticOnlyClass": "off",
"useLiteralKeys": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
36 changes: 36 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@fragmenta/sqm",
"version": "0.7.0",
"description": "A lightweight and flexible query maker library for building raw SQL queries in JavaScript.",
"license": "Apache-2.0",
"exports": {
".": "./src/index.ts",
"./queryUtils": "./src/queryUtils/index.ts",
"./types": "./src/types/index.ts",
"./ddl": "./src/queryKinds/ddl/index.ts",
"./dml": "./src/queryKinds/dml/index.ts",
"./ddl/table": "./src/queryKinds/ddl/table/index.ts"
},
"publish": {
"include": [
"src",
"README.md",
"LICENSE.md"
],
"exclude": [
"node_modules",
"dist",
"dist-qjs",
"**/*.test.ts",
"**/*.spec.ts",
"scripts",
"tsup.config.ts",
"tsup.config.qjs.ts",
"vitest.config.ts",
".gitignore",
".npmignore",
"package-lock.json",
"pnpm-lock.yaml"
]
}
}
Loading