diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 8b9dbae0..78206e99 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -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 diff --git a/README.md b/README.md index 3e1d7c90..21c7df23 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/package.json b/package.json index 707a5476..637609f3 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/packages/cli/package.json b/packages/cli/package.json index 8a7d8e1e..4b0e4d29 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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", diff --git a/packages/cli/src/commands/protogen/cli.ts b/packages/cli/src/commands/protogen/cli.ts index ce0d7567..a6f0f687 100644 --- a/packages/cli/src/commands/protogen/cli.ts +++ b/packages/cli/src/commands/protogen/cli.ts @@ -44,6 +44,7 @@ export default async (argv: CommandOptions): Promise => { 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); } diff --git a/packages/deparser/package.json b/packages/deparser/package.json index 1af8adb4..8bec37da 100644 --- a/packages/deparser/package.json +++ b/packages/deparser/package.json @@ -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", diff --git a/packages/deparser/scripts/make-fixtures-ast.ts b/packages/deparser/scripts/make-fixtures-ast.ts index 4e1d481b..4ac8fd9a 100644 --- a/packages/deparser/scripts/make-fixtures-ast.ts +++ b/packages/deparser/scripts/make-fixtures-ast.ts @@ -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) { diff --git a/packages/deparser/scripts/make-fixtures-sql.ts b/packages/deparser/scripts/make-fixtures-sql.ts index 02642608..eb8c0eb4 100644 --- a/packages/deparser/scripts/make-fixtures-sql.ts +++ b/packages/deparser/scripts/make-fixtures-sql.ts @@ -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) { diff --git a/packages/deparser/scripts/make-fixtures.ts b/packages/deparser/scripts/make-fixtures.ts index 7ee65a6c..78c26d57 100644 --- a/packages/deparser/scripts/make-fixtures.ts +++ b/packages/deparser/scripts/make-fixtures.ts @@ -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 diff --git a/packages/deparser/scripts/make-kitchen-sink.ts b/packages/deparser/scripts/make-kitchen-sink.ts index 78cb3094..92918052 100644 --- a/packages/deparser/scripts/make-kitchen-sink.ts +++ b/packages/deparser/scripts/make-kitchen-sink.ts @@ -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) { diff --git a/packages/enums/package.json b/packages/enums/package.json index 7fe8c707..6c99b2f8 100644 --- a/packages/enums/package.json +++ b/packages/enums/package.json @@ -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", diff --git a/packages/parser/README.md b/packages/parser/README.md index 3e1d7c90..21c7df23 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -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 | diff --git a/packages/parser/package.json b/packages/parser/package.json index a8d3a680..04543551 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -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" diff --git a/packages/proto-parser/package.json b/packages/proto-parser/package.json index 9208e979..d2473683 100644 --- a/packages/proto-parser/package.json +++ b/packages/proto-parser/package.json @@ -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", diff --git a/packages/proto-parser/src/options/defaults.ts b/packages/proto-parser/src/options/defaults.ts index 5cd0e472..b4f0802a 100644 --- a/packages/proto-parser/src/options/defaults.ts +++ b/packages/proto-parser/src/options/defaults.ts @@ -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: { diff --git a/packages/proto-parser/test-utils/index.ts b/packages/proto-parser/test-utils/index.ts index d967a1ae..e68a9b59 100644 --- a/packages/proto-parser/test-utils/index.ts +++ b/packages/proto-parser/test-utils/index.ts @@ -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__/')); diff --git a/packages/transform/package.json b/packages/transform/package.json index 05f31a86..b98d727b 100644 --- a/packages/transform/package.json +++ b/packages/transform/package.json @@ -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", diff --git a/packages/types/package.json b/packages/types/package.json index bdbc73f7..42fc6861 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -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", diff --git a/packages/utils/package.json b/packages/utils/package.json index c027da6c..27651043 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -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",