Skip to content
Merged

OSes #27

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
2 changes: 0 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
jobs:
parser-tests:
runs-on: ubuntu-latest
container: node:20.12.0-alpine

steps:
- name: checkout
uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ Our latest is built with `17-latest` branch from libpg_query
| PostgreSQL Major Version | libpg_query | Status | npm tag |
|--------------------------|-------------|---------------------|---------|
| 17 | 17-latest | Active Development | `latest` |
| 16 | (n/a) | Not supported |
| 15 | (n/a) | Not supported |
| 14 | (n/a) | Not supported |
| 13 | 13-latest | Only Critical Fixes | `13.16.0` |
| 12 | (n/a) | Not supported |
| 11 | (n/a) | Not supported |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"prettier": "^3.0.2",
"rimraf": "4.4.1",
"strip-ansi": "^6",
"symlink-workspace": "^1.9.0",
"symlink-workspace": "^1.10.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.1.6"
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"dev": "ts-node src/index",
"lint": "eslint . --fix",
"test": "jest",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/protogen/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default async (argv: CommandOptions): Promise<CommandOptions> => {
await replaceTextInProtoJS(argv.outFile, argv.originalPackageName, argv.newPackageName);
console.log('All operations completed successfully.');
} catch (error) {
// @ts-ignore
console.error('An error occurred:', error.message);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/deparser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"kitchen-sink": "npm run fixtures && npm run fixtures:kitchen-sink",
"fixtures:kitchen-sink": "ts-node scripts/make-kitchen-sink.ts",
"fixtures:ast": "ts-node scripts/make-fixtures-ast.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/deparser/scripts/make-fixtures-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ensureDir(dir: string) {

ensureDir(OUT_DIR);

const fixtures = globSync(`${FIXTURE_DIR}/**/*.sql`);
const fixtures = globSync(path.join(FIXTURE_DIR, '**/*.sql'));

async function main() {
for (const fixturePath of fixtures) {
Expand Down
2 changes: 1 addition & 1 deletion packages/deparser/scripts/make-fixtures-sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function ensureDir(dir: string) {

ensureDir(OUT_DIR);

const fixtures = globSync(`${FIXTURE_DIR}/**/*.sql`);
const fixtures = globSync(path.join(FIXTURE_DIR, '**/*.sql'));

async function main() {
for (const fixturePath of fixtures) {
Expand Down
2 changes: 1 addition & 1 deletion packages/deparser/scripts/make-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function ensureDir(dir: string) {

ensureDir(OUT_DIR);

const fixtures = globSync(`${FIXTURE_DIR}/**/*.sql`);
const fixtures = globSync(path.join(FIXTURE_DIR, '**/*.sql'));

async function main() {
// Collect deparsed SQL in a single JSON
Expand Down
2 changes: 1 addition & 1 deletion packages/deparser/scripts/make-kitchen-sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ it('${name}', async () => {
`
};

const fixtures = globSync(`${FIXTURE_DIR}/**/*.sql`);
const fixtures = globSync(path.join(FIXTURE_DIR, '**/*.sql'));

async function main() {
for (const fixturePath of fixtures) {
Expand Down
6 changes: 3 additions & 3 deletions packages/enums/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run build:proto && npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run build:proto && npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"build:proto": "ts-node scripts/pg-proto-parser",
"lint": "eslint . --fix",
"test": "jest",
Expand Down
3 changes: 3 additions & 0 deletions packages/parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ Our latest is built with `17-latest` branch from libpg_query
| PostgreSQL Major Version | libpg_query | Status | npm tag |
|--------------------------|-------------|---------------------|---------|
| 17 | 17-latest | Active Development | `latest` |
| 16 | (n/a) | Not supported |
| 15 | (n/a) | Not supported |
| 14 | (n/a) | Not supported |
| 13 | 13-latest | Only Critical Fixes | `13.16.0` |
| 12 | (n/a) | Not supported |
| 11 | (n/a) | Not supported |
Expand Down
6 changes: 3 additions & 3 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"lint": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
6 changes: 3 additions & 3 deletions packages/proto-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"lint": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
3 changes: 2 additions & 1 deletion packages/proto-parser/src/options/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import deepmerge from 'deepmerge';
import { join } from 'path';

import { PgProtoParserOptions } from "./types";

// Define default options outside of the class
export const defaultPgProtoParserOptions: PgProtoParserOptions = {
outDir: `${process.cwd()}/out`,
outDir: join(process.cwd(), 'out'),
includeHeader: true,
exclude: [],
utils: {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto-parser/test-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const expectAstsCodeToEqual = (testAst: any, expectAst: any) => {
}

export const readFilesFromDir = (outDir: string) =>
glob(outDir + '**/*').map(file => ({ file: basename(file), code: readFileSync(file, 'utf-8') }));
glob(join(outDir, '**/*')).map(file => ({ file: basename(file), code: readFileSync(file, 'utf-8') }));

export const FIXTURES_DIR = resolve(join(__dirname, '../../../__fixtures__/'));

Expand Down
6 changes: 3 additions & 3 deletions packages/transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run build:proto && npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run build:proto && npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"build:proto": "ts-node scripts/pg-proto-parser",
"lint": "eslint . --fix",
"test": "jest",
Expand Down
6 changes: 3 additions & 3 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run build:proto && npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run build:proto && npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"build:proto": "ts-node scripts/pg-proto-parser",
"lint": "eslint . --fix",
"test": "jest",
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"clean": "rimraf dist",
"prepare": "npm run build",
"build": "npm run build:proto && npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"build": "npm run build:proto && npm run clean && tsc && tsc -p tsconfig.esm.json && npm run copy",
"build:dev": "npm run clean && tsc --declarationMap && tsc -p tsconfig.esm.json && npm run copy",
"build:proto": "ts-node scripts/pg-proto-parser",
"lint": "eslint . --fix",
"test": "jest",
Expand Down