Skip to content

Commit 6942283

Browse files
committed
feat(full): version @libpg-query/parser per PG major β€” full/17 (pg17) + full/18 (pg18)
1 parent 5b0e5cc commit 6942283

50 files changed

Lines changed: 3596 additions & 52 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.github/workflows/build-wasm-no-docker.yamlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ jobs:
4242
./emsdk install 3.1.59
4343
./emsdk activate 3.1.59
4444
source ./emsdk_env.sh
45-
working-directory: full
45+
working-directory: full/18
4646
- name: Build with Emscripten πŸ—
4747
run: |
4848
source ./emsdk/emsdk_env.sh
4949
emmake make
5050
emmake make build
51-
working-directory: full
51+
working-directory: full/18
5252
- name: Archive production artifacts πŸ›
5353
uses: actions/upload-artifact@v4
5454
with:
5555
name: wasm-artifacts
56-
path: full/wasm
56+
path: full/18/wasm

β€Ž.github/workflows/build-wasm.ymlβ€Ž

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,24 @@ jobs:
3636
- name: Install Dependencies 🧢
3737
run: pnpm install
3838

39-
- name: Build WASM πŸ—
39+
- name: Build WASM (PG17) πŸ—
4040
run: pnpm run build
41-
working-directory: full
41+
working-directory: full/17
4242

43-
- name: Archive production artifacts πŸ›
43+
- name: Build WASM (PG18) πŸ—
44+
run: pnpm run build
45+
working-directory: full/18
46+
47+
- name: Archive PG17 artifacts πŸ›
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: wasm-artifacts-pg17
51+
path: full/17/wasm/
52+
retention-days: 7
53+
54+
- name: Archive PG18 artifacts πŸ›
4455
uses: actions/upload-artifact@v4
4556
with:
46-
name: wasm-artifacts
47-
path: full/wasm/
57+
name: wasm-artifacts-pg18
58+
path: full/18/wasm/
4859
retention-days: 7

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
strategy:
1414
matrix:
1515
package:
16-
- { name: 'full', path: 'full', version: '18' }
16+
- { name: 'full17', path: 'full/17', version: '17' }
17+
- { name: 'full18', path: 'full/18', version: '18' }
1718
- { name: 'v13', path: 'versions/13', version: '13' }
1819
- { name: 'v14', path: 'versions/14', version: '14' }
1920
- { name: 'v15', path: 'versions/15', version: '15' }
@@ -78,7 +79,8 @@ jobs:
7879
matrix:
7980
os: [ubuntu-latest, macos-latest, windows-latest]
8081
package:
81-
- { name: 'full', path: 'full', version: '18' }
82+
- { name: 'full17', path: 'full/17', version: '17' }
83+
- { name: 'full18', path: 'full/18', version: '18' }
8284
- { name: 'v13', path: 'versions/13', version: '13' }
8385
- { name: 'v14', path: 'versions/14', version: '14' }
8486
- { name: 'v15', path: 'versions/15', version: '15' }

β€ŽPUBLISH.mdβ€Ž

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pnpm run publish:versions
1010
This interactive script will:
1111
- Check for uncommitted changes (will error if any exist)
1212
- Let you select which versions to publish (or all)
13-
- Also includes the full package (@libpg-query/parser)
13+
- Also includes the full package versions (@libpg-query/parser, full/17 and full/18)
1414
- Ask for version bump type (patch or minor only)
1515
- Ask if you want to skip the build step (useful if already built)
1616
- Always run tests (even if build is skipped)
@@ -165,28 +165,35 @@ npm install libpg-query # Latest/default version
165165

166166
## Full Package (@libpg-query/parser)
167167

168-
### Quick Publish
168+
The full package is versioned per PostgreSQL major version, mirroring `versions/`:
169+
- `full/17` β€” built from `17-constructive`, published as `@libpg-query/parser` with tag `pg17`
170+
- `full/18` β€” built from `18-constructive`, published as `@libpg-query/parser` with tag `pg18`
171+
172+
### Quick Publish (per version)
169173
```bash
170-
cd full
174+
cd full/17 # or full/18
171175
pnpm version patch
172176
git add . && git commit -m "release: bump @libpg-query/parser version"
173177
pnpm build
174178
pnpm test
175-
pnpm publish --tag pg17
179+
pnpm run publish:pkg
176180
```
177181

182+
`publish:pkg` uses `x-publish.publishName` (`@libpg-query/parser`) and `x-publish.distTag`
183+
(`pg17` / `pg18`) from each package.json, temporarily renaming the package during publish.
184+
178185
### Promote to latest (optional)
179186
```bash
180187
npm dist-tag add @libpg-query/parser@pg17 latest
181188
```
182189

183190
### What it does
184-
- Publishes `@libpg-query/parser` with tag `pg17`
185-
- Currently based on PostgreSQL 17
186-
- Includes full parser with all features
191+
- Publishes `@libpg-query/parser` with tag `pg17` (from `full/17`) or `pg18` (from `full/18`)
192+
- Includes full parser with all features (parse, parsePlPgSQL, scan, fingerprint, normalize + sync variants)
187193

188194
### Install published package
189195
```bash
196+
npm install @libpg-query/parser@pg18 # PostgreSQL 18 specific
190197
npm install @libpg-query/parser@pg17 # PostgreSQL 17 specific
191198
npm install @libpg-query/parser # Latest version
192199
```

β€ŽREADME.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This repository contains multiple packages to support different PostgreSQL versi
7777
| **[@pgsql/parser](https://github.com/constructive-io/libpg-query-node/tree/main/parser)** | Multi-version parser (runtime selection) | 15, 16, 17, 18 | [`@pgsql/parser`](https://www.npmjs.com/package/@pgsql/parser) |
7878
| **[@pgsql/types](https://github.com/constructive-io/libpg-query-node/tree/main/types)** | TypeScript type definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/types`](https://www.npmjs.com/package/@pgsql/types) |
7979
| **[@pgsql/enums](https://github.com/constructive-io/libpg-query-node/tree/main/enums)** | TypeScript enum definitions | 13, 14, 15, 16, 17, 18 | [`@pgsql/enums`](https://www.npmjs.com/package/@pgsql/enums) |
80-
| **[@libpg-query/parser](https://github.com/constructive-io/libpg-query-node/tree/main/full)** | Full parser with all features | 17 only | [`@libpg-query/parser`](https://www.npmjs.com/package/@libpg-query/parser) |
80+
| **[@libpg-query/parser](https://github.com/constructive-io/libpg-query-node/tree/main/full)** | Full parser with all features | 17, 18 | [`@libpg-query/parser`](https://www.npmjs.com/package/@libpg-query/parser) |
8181

8282
### Version Tags
8383

@@ -102,7 +102,7 @@ npm install @pgsql/enums
102102
- **Just need to parse SQL?** β†’ Use `libpg-query` (lightweight, all PG versions)
103103
- **Need multiple versions at runtime?** β†’ Use `@pgsql/parser` (dynamic version selection)
104104
- **Need TypeScript types?** β†’ Add `@pgsql/types` and/or `@pgsql/enums`
105-
- **Need fingerprint, normalize, scan, or PL/pgSQL parsing?** β†’ Use `@libpg-query/parser` (PG 18)
105+
- **Need fingerprint, normalize, scan, or PL/pgSQL parsing?** β†’ Use `@libpg-query/parser` (PG 17 & 18 via `pg17`/`pg18` dist-tags)
106106

107107

108108
## API Documentation
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="https://www.npmjs.com/package/libpg-query"><img height="20" src="https://img.shields.io/npm/dt/libpg-query"></a>
99
<a href="https://www.npmjs.com/package/libpg-query"><img height="20" src="https://img.shields.io/npm/dw/libpg-query"/></a>
1010
<a href="https://github.com/constructive-io/libpg-query/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
11-
<a href="https://www.npmjs.com/package/libpg-query"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/libpg-query-node?filename=full%2Fpackage.json"/></a><br />
11+
<a href="https://www.npmjs.com/package/libpg-query"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/libpg-query-node?filename=full%2F17%2Fpackage.json"/></a><br />
1212
<a href="https://github.com/constructive-io/libpg-query-node/actions/workflows/ci.yml"><img height="20" src="https://github.com/constructive-io/libpg-query-node/actions/workflows/ci.yml/badge.svg" /></a>
1313
<a href="https://github.com/constructive-io/libpg-query-node/actions/workflows/ci.yml"><img height="20" src="https://img.shields.io/badge/macOS-available-333333?logo=apple&logoColor=white" /></a>
1414
<a href="https://github.com/constructive-io/libpg-query-node/actions/workflows/ci.yml"><img height="20" src="https://img.shields.io/badge/Windows-available-333333?logo=windows&logoColor=white" /></a>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)