Skip to content

Commit 5a6ba0c

Browse files
authored
Merge pull request #236 from launchql/wrksp/pnpm
Wrksp/pnpm
2 parents 125bc36 + 9c6c4dd commit 5a6ba0c

Some content is hidden

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

49 files changed

+8203
-7453
lines changed

.github/workflows/run-tests.yaml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,36 @@ on:
77
jobs:
88
parser-tests:
99
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
package:
13+
- deparser
14+
- parser
15+
- pgsql-cli
16+
- proto-parser
17+
- transform
18+
- traverse
19+
- utils
1020
steps:
1121
- name: checkout
1222
uses: actions/checkout@v3
1323

14-
- name: deps
15-
run: yarn
24+
- name: setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 9
1628

17-
- name: build
18-
run: yarn build
19-
20-
- name: deparser
21-
run: cd ./packages/deparser && yarn test
29+
- name: setup node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
cache: 'pnpm'
2234

23-
- name: proto-parser
24-
run: cd ./packages/proto-parser && yarn test
35+
- name: install dependencies
36+
run: pnpm install
2537

26-
- name: utils
27-
run: cd ./packages/utils && yarn test
28-
29-
- name: transform
30-
run: cd ./packages/transform && yarn test
38+
- name: build
39+
run: pnpm build
3140

32-
- name: traverse
33-
run: cd ./packages/traverse && yarn test
41+
- name: test
42+
run: pnpm --filter ${{ matrix.package }} test

FOOTER.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Related
2+
3+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): The real PostgreSQL parser for Node.js, providing symmetric parsing and deparsing of SQL statements with actual PostgreSQL parser integration.
4+
* [pgsql-deparser](https://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`.
5+
* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package.
6+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs.
7+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications.
8+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): A comprehensive utility library for PostgreSQL, offering type-safe AST node creation and enum value conversions, simplifying the construction and manipulation of PostgreSQL ASTs.
9+
* [@pgsql/traverse](https://www.npmjs.com/package/@pgsql/traverse): PostgreSQL AST traversal utilities for pgsql-parser, providing a visitor pattern for traversing PostgreSQL Abstract Syntax Tree nodes, similar to Babel's traverse functionality but specifically designed for PostgreSQL AST structures.
10+
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): A TypeScript tool that parses PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
11+
* [libpg-query](https://github.com/launchql/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries.
12+
13+
## Disclaimer
14+
15+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
16+
17+
No developer or entity involved in creating Software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.

lerna.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2-
"lerna": "6",
3-
"conventionalCommits": true,
4-
"npmClient": "yarn",
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3+
"version": "independent",
4+
"npmClient": "pnpm",
55
"npmClientArgs": [
6-
"--no-lockfile"
6+
"--frozen-lockfile"
77
],
88
"packages": [
99
"packages/*"
1010
],
11-
"version": "independent",
1211
"registry": "https://registry.npmjs.org",
1312
"command": {
1413
"create": {
@@ -18,7 +17,8 @@
1817
},
1918
"publish": {
2019
"allowBranch": "main",
21-
"message": "chore(release): publish"
20+
"message": "chore(release): publish",
21+
"conventionalCommits": true
2222
}
2323
}
2424
}

package.json

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,33 @@
1515
"packages/*"
1616
],
1717
"scripts": {
18-
"clean": "lerna run clean",
19-
"build": "lerna run build --stream",
20-
"build:dev": "lerna run build:dev --stream; yarn symlink",
21-
"lint": "lerna run lint --parallel",
22-
"symlink": "symlink-workspace --logLevel error",
23-
"postinstall": "yarn symlink",
24-
"bump-versions": "ts-node scripts/bump-versions.ts"
18+
"build": "pnpm -r run build",
19+
"clean": "pnpm -r run clean",
20+
"test": "pnpm -r run test",
21+
"lint": "pnpm -r run lint",
22+
"deps": "pnpm up -r -i -L",
23+
"bump-versions": "ts-node scripts/bump-versions.ts",
24+
"update-workspace": "makage update-workspace"
2525
},
2626
"devDependencies": {
27-
"@types/jest": "^29.5.11",
27+
"@types/jest": "^30.0.0",
2828
"@types/node": "^20.12.7",
29-
"@typescript-eslint/eslint-plugin": "^7.10.0",
30-
"@typescript-eslint/parser": "^7.10.0",
31-
"copyfiles": "^2.4.1",
32-
"eslint-config-prettier": "^9.1.0",
29+
"@typescript-eslint/eslint-plugin": "^8.47.0",
30+
"@typescript-eslint/parser": "^8.47.0",
31+
"eslint": "^9.39.1",
32+
"eslint-config-prettier": "^10.1.8",
3333
"eslint-plugin-simple-import-sort": "^12.1.0",
3434
"eslint-plugin-unused-imports": "^4.0.0",
35-
"eslint": "^8.56.0",
3635
"glob": "^11.0.0",
37-
"jest": "^29.6.2",
38-
"jest-diff": "30.0.0",
39-
"lerna": "^6",
36+
"jest": "^30.2.0",
37+
"jest-diff": "30.2.0",
38+
"lerna": "^8.2.4",
39+
"makage": "^0.1.3",
4040
"prettier": "^3.0.2",
41-
"rimraf": "4.4.1",
42-
"strip-ansi": "^6",
4341
"semver": "^7.7.2",
44-
"symlink-workspace": "^1.10.0",
42+
"strip-ansi": "^6",
4543
"ts-jest": "^29.1.1",
4644
"ts-node": "^10.9.2",
4745
"typescript": "^5.1.6"
48-
},
49-
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
46+
}
5047
}

packages/deparser/README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,4 @@ Built on the excellent work of several contributors:
145145
* **[Lukas Fittl](https://github.com/lfittl)** for [libpg_query](https://github.com/pganalyze/libpg_query) — the core PostgreSQL parser that powers this project
146146
* **[Greg Richardson](https://github.com/gregnr)** for AST guidance and pushing the transition to WASM and multiple PG runtimes for better interoperability
147147
* **[Ethan Resnick](https://github.com/ethanresnick)** for the original Node.js N-API bindings
148-
* **[Zac McCormick](https://github.com/zhm)** for the foundational [node-pg-query-native](https://github.com/zhm/node-pg-query-native) parser
149-
150-
## Related
151-
152-
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): The real PostgreSQL parser for Node.js, providing symmetric parsing and deparsing of SQL statements with actual PostgreSQL parser integration.
153-
* [pgsql-deparser](https://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`.
154-
* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package.
155-
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs.
156-
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications.
157-
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): A comprehensive utility library for PostgreSQL, offering type-safe AST node creation and enum value conversions, simplifying the construction and manipulation of PostgreSQL ASTs.
158-
* [@pgsql/traverse](https://www.npmjs.com/package/@pgsql/traverse): PostgreSQL AST traversal utilities for pgsql-parser, providing a visitor pattern for traversing PostgreSQL Abstract Syntax Tree nodes, similar to Babel's traverse functionality but specifically designed for PostgreSQL AST structures.
159-
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): A TypeScript tool that parses PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
160-
* [libpg-query](https://github.com/launchql/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries.
161-
162-
## Disclaimer
163-
164-
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
165-
166-
No developer or entity involved in creating Software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
148+
* **[Zac McCormick](https://github.com/zhm)** for the foundational [node-pg-query-native](https://github.com/zhm/node-pg-query-native) parser
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`should format foreign key constraint with pretty option enabled 1`] = `"SELECT '123'::int;"`;

packages/deparser/__tests__/misc/__snapshots__/pg-catalog.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`should format pg_catalog.char with pretty option enabled 1`] = `
44
"CREATE TABLE dashboard_jobs.jobs (

packages/deparser/__tests__/pretty/__snapshots__/alter-table-column.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`non-pretty: original/alter/alter-table-column-1.sql 1`] = `"ALTER TABLE public.table1 ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY (SEQUENCE NAME public.table1 START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1)"`;
44

packages/deparser/__tests__/pretty/__snapshots__/casing-pretty.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`non-pretty: pretty/casing-1.sql 1`] = `"INSERT INTO users (name) VALUES ('John Doe')"`;
44

packages/deparser/__tests__/pretty/__snapshots__/constraints-pretty.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`non-pretty: pretty/constraints-1.sql 1`] = `"ALTER TABLE public.users ADD CONSTRAINT users_pkey PRIMARY KEY (id)"`;
44

0 commit comments

Comments
 (0)