Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Update Dependencies and Improve Compatibility for Build Process #593

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16', '18']
node-version: ['18', '20']
name: Test (node ${{ matrix.node-version }}.x)
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
packages/example
packages/query/src/loader/*/parser/
packages/query/src/loader/*/parser/
packages/runtime/lib/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The `packages/example` project is an end-to-end test suite for pgTyped. It conta
The packages `npm test` runs the following command:

```bash
docker-compose run build && docker-compose run test && docker-compose run test-cjs
docker compose run build && docker compose run test && docker compose run test-cjs
```

As you can see it runs the `build` target, then runs the `test` target twice, once with the `esm` module format and once with the `cjs` module format:
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
},
"dependencies": {
"io-ts": "^2.1.2"
},
"engines": {
"node": ">=18"
}
}
4 changes: 2 additions & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AsyncQueue } from '@pgtyped/wire';
import chokidar from 'chokidar';
import nun from 'nunjucks';

import PiscinaPool from 'piscina';
import { Piscina as PiscinaPool } from 'piscina';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { parseConfig, ParsedConfig, TransformConfig } from './config.js';
Expand Down Expand Up @@ -149,7 +149,7 @@ if (isWatchMode && fileOverride) {
}

try {
chokidar.watch(configPath).on('change', () => {
chokidar.watch(configPath, {}).on('change', () => {
console.log('Config file changed. Exiting.');
process.exit();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/typedSqlTagTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class TypedSqlTagTransformer {
chokidar
.watch(this.includePattern, {
persistent: true,
ignored: [this.localFileName],
ignored: this.localFileName,
})
.on('add', cb)
.on('change', cb)
Expand Down
2 changes: 1 addition & 1 deletion packages/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Try starting PgTyped and editing them to see live query type generation.
2. `cd pgtyped/packages/example`
3. `npm install`
4. `npm run build`
5. `docker-compose run watch`
5. `docker compose run watch`
6. Try editing queries in the SQL and TS files and see how PgTyped handles it.

The dockerized setup isn't required and is included for convenience.
Expand Down
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"node": ">=14.16"
},
"scripts": {
"test": "docker-compose run build && docker-compose run test && docker-compose run test-cjs",
"test": "docker compose run build && docker compose run test && docker compose run test-cjs",
"typegen": "pgtyped -c config.json",
"build": "echo 'No build step required. Use npm test instead'",
"watch": "echo 'No build step required. Use npm test instead'",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */

/* Source Map Options */
Expand All @@ -56,5 +56,6 @@
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"resolveJsonModule": true /* Include modules imported with '.json' extension */,
}
}