diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..e2d42ced --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +packages/example +packages/query/src/loader/*/parser/ \ No newline at end of file diff --git a/.prettierrc.yaml b/.prettierrc.yaml index a25fde32..f5da5ad7 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,3 +1,2 @@ -trailingComma: "all" +trailingComma: 'all' singleQuote: true -allowParens: avoid diff --git a/README.md b/README.md index 6ba3059c..94a29712 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ No need to map or translate your DB schema to TypeScript, PgTyped automatically --- ## Features: + 1. Automatically generates TS types for parameters/results of SQL queries of any complexity. 2. Supports extracting and typing queries from both SQL and TS files. 3. Generate query types as you write them, using watch mode. @@ -18,7 +19,6 @@ No need to map or translate your DB schema to TypeScript, PgTyped automatically 5. No need to define your DB schema in TypeScript, your running DB is the live source of type data. 6. Prevents SQL injections by not doing explicit parameter substitution. Instead, queries and parameters are sent separately to the DB driver, allowing parameter substitution to be safely done by the PostgreSQL server. - ### Documentation Visit our new documentation page at [https://pgtyped.now.sh/](https://pgtyped.now.sh/) @@ -29,11 +29,12 @@ Visit our new documentation page at [https://pgtyped.now.sh/](https://pgtyped.no 2. Create a PgTyped `config.json` file. 3. Run `npx pgtyped -w -c config.json` to start PgTyped in watch mode. -Refer to the [example app](./packages/example/README.md) for a preconfigured example. +Refer to the [example app](./packages/example/README.md) for a preconfigured example. ### Example Lets save some queries in `books.sql`: + ```sql /* @name FindBookById */ SELECT * FROM books WHERE id = :bookId; @@ -103,8 +104,8 @@ main(); 1. [Configuring Pgtyped](https://pgtyped.now.sh/docs/cli) 2. [Writing queries in SQL files](https://pgtyped.now.sh/docs/sql-file-intro) 3. [Advanced queries and parameter expansions in SQL files](https://pgtyped.now.sh/docs/sql-file) -3. [Writing queries in TS files](https://pgtyped.now.sh/docs/ts-file-intro) -3. [Advanced queries and parameter expansions in TS files](https://pgtyped.now.sh/docs/ts-file) +4. [Writing queries in TS files](https://pgtyped.now.sh/docs/ts-file-intro) +5. [Advanced queries and parameter expansions in TS files](https://pgtyped.now.sh/docs/ts-file) ### Project state: diff --git a/docs-new/docs/cli.md b/docs-new/docs/cli.md index 2b490175..e216fae4 100644 --- a/docs-new/docs/cli.md +++ b/docs-new/docs/cli.md @@ -6,13 +6,14 @@ sidebar_label: CLI config `pgtyped` CLI can be launched in build or watch mode. Watch mode is most useful for a local development workflow, - while build mode can be used for generating types when running CI. +while build mode can be used for generating types when running CI. ### Flags The CLI supports two flags: -* `-c config_file_path.json` to pass the config file path. -* `-w` to start in watch mode. + +- `-c config_file_path.json` to pass the config file path. +- `-w` to start in watch mode. ```shell script title="Example:" npx pgtyped -w -c config.json @@ -20,12 +21,13 @@ npx pgtyped -w -c config.json ### Environment variables -PgTyped supports common PostgreSQL environment variables: -* `PGHOST` -* `PGUSER` -* `PGPASSWORD` -* `PGDATABASE` -* `PGPORT` +PgTyped supports common PostgreSQL environment variables: + +- `PGHOST` +- `PGUSER` +- `PGPASSWORD` +- `PGDATABASE` +- `PGPORT` These variables will override values provided in `config.json`. @@ -65,6 +67,7 @@ By default, PgTyped saves generated files in the same folder as the source files This behavior can be customized using the `emitTemplate` config parameter. In that template, four parameters are available for interpolation: `root`, `dir`, `base`, `name` and `ext`. For example, when parsing source/query file `/home/user/dir/file.sql`, these parameters are assigned the following values: + ``` ┌─────────────────────┬────────────┐ │ dir │ base │ diff --git a/docs-new/docs/dynamic-queries.md b/docs-new/docs/dynamic-queries.md index 2c560b40..ef5a6cc8 100644 --- a/docs-new/docs/dynamic-queries.md +++ b/docs-new/docs/dynamic-queries.md @@ -38,7 +38,7 @@ SELECT * FROM users ORDER BY (CASE WHEN :asc = true THEN :sort_column END) ASC, :sort_column DESC; ``` -### Advanced dynamic queries +### Advanced dynamic queries More complicated dynamic queries can be built similarly to the above two. Note that highly dynamic SQL queries can lead to worse DB execution times, so sometimes it is worth to split a complex query into multiple independent ones. diff --git a/docs-new/docs/features.md b/docs-new/docs/features.md index 4edcddd6..08cb8b4c 100644 --- a/docs-new/docs/features.md +++ b/docs-new/docs/features.md @@ -1,6 +1,6 @@ --- id: features -title: Features +title: Features sidebar_label: Features --- diff --git a/docs-new/docs/getting-started.md b/docs-new/docs/getting-started.md index f13345cb..5ce0f538 100644 --- a/docs-new/docs/getting-started.md +++ b/docs-new/docs/getting-started.md @@ -1,6 +1,6 @@ --- id: getting-started -title: Getting Started +title: Getting Started sidebar_label: Getting Started --- @@ -13,6 +13,7 @@ sidebar_label: Getting Started ### Configuration PgTyped requires a `config.json` file to run, a basic config file looks like this: + ```json title="config.json" { "transforms": [ @@ -39,5 +40,3 @@ Refer to the [CLI page](cli) for more info on the config file, available CLI fla :::note If you are having trouble configuring PgTyped, you can refer to the [example app](https://github.com/adelsz/pgtyped/tree/master/packages/example) for a preconfigured example. ::: - - diff --git a/docs-new/docs/intro.md b/docs-new/docs/intro.md index 1b2c6aff..13fe42c2 100644 --- a/docs-new/docs/intro.md +++ b/docs-new/docs/intro.md @@ -1,14 +1,14 @@ --- id: intro -title: Overview +title: Overview sidebar_label: Overview --- PgTyped makes it possible to use raw SQL in TypeScript with guaranteed type-safety. No need to map or translate your DB schema to TypeScript, PgTyped automatically generates types and interfaces for your SQL queries by using your running Postgres database as the source of type information. - ## Project goals -* **Smooth dev experience** - Provide a smooth and reliable development experience for engineers that want to use raw SQL queries. -* **Static typing** - SQL queries are validated and fully usable by the typechecker. -* **No magic** - PgTyped is not a query builder or an ORM. + +- **Smooth dev experience** - Provide a smooth and reliable development experience for engineers that want to use raw SQL queries. +- **Static typing** - SQL queries are validated and fully usable by the typechecker. +- **No magic** - PgTyped is not a query builder or an ORM. diff --git a/docs-new/docs/sql-file-intro.md b/docs-new/docs/sql-file-intro.md index 26eb510f..1264efb9 100644 --- a/docs-new/docs/sql-file-intro.md +++ b/docs-new/docs/sql-file-intro.md @@ -1,12 +1,13 @@ --- id: sql-file-intro -title: Queries in SQL files +title: Queries in SQL files sidebar_label: Queries in SQL files --- -Having installed and configured PgTyped it is now time to write some queries. +Having installed and configured PgTyped it is now time to write some queries. Lets create our first query in `books/queries.sql`: + ```sql title="books/queries.sql" /* @name FindBookById */ SELECT * FROM books WHERE id = :bookId; diff --git a/docs-new/docs/sql-file.md b/docs-new/docs/sql-file.md index 09d027f5..33f20f24 100644 --- a/docs-new/docs/sql-file.md +++ b/docs-new/docs/sql-file.md @@ -1,11 +1,11 @@ --- id: sql-file -title: Annotated SQL files +title: Annotated SQL files sidebar_label: Annotated SQL files --- PgTyped supports parsing queries from SQL files, allowing developers to write DB queries in their favourite database IDE. -To help PgTyped generate executable queries from these SQL files, they need to be annotated with special comments. +To help PgTyped generate executable queries from these SQL files, they need to be annotated with special comments. ```sql title="example.sql" /* @name getAllComments */ @@ -21,6 +21,7 @@ SELECT FROM users WHERE age in :ages; ## Annotation format PgTyped has a number of requirements for SQL file contents: + 1. Each query must be preceded with an annotation (comment). 2. An annotation must specify the query name using the `@name` tag. 3. Each query must be a single SQL statement that ends with a semicolon. @@ -46,6 +47,7 @@ VALUES :comments; Here `comments -> ((userId, commentBody)...)` is a parameter expansion that instructs pgtyped to expand `comments` into an array of objects with each object having a `userId` and `commentBody` field. A query can also contain multiple expansions if needed: + ```sql /* @name selectSomeUsers @@ -59,13 +61,16 @@ At the moment, PgTyped supports three expansion types: ### Array spread -The array spread expansion allows to pass an array of scalars as parameter. +The array spread expansion allows to pass an array of scalars as parameter. + #### Syntax: + ``` @param paramName -> (...) ``` #### Example: + ```sql title="Query definition:" /* @name selectSomeUsers @@ -73,10 +78,12 @@ The array spread expansion allows to pass an array of scalars as parameter. */ SELECT FROM users WHERE age in :ages; ``` + ```ts title="Execution:" const parameters = { ages: [25, 30, 35] }; selectSomeUsers.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Parameters: [25, 30, 35] SELECT FROM users WHERE age in ($1, $2, $3); @@ -84,13 +91,16 @@ SELECT FROM users WHERE age in ($1, $2, $3); ### Object pick -The object pick expansion allows to pass an object as a parameter. +The object pick expansion allows to pass an object as a parameter. + #### Syntax: + ``` @param paramName -> (name, age) ``` #### Example: + ```sql title="Query definition:" /* @name insertUsers @@ -98,10 +108,12 @@ The object pick expansion allows to pass an object as a parameter. */ INSERT INTO users (name, age) VALUES :user RETURNING id; ``` + ```ts title="Execution:" -const parameters = { user: {name: 'Rob', age: 56} }; +const parameters = { user: { name: 'Rob', age: 56 } }; insertUsers.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Bindings: ['Rob', 56] INSERT INTO users (name, age) VALUES ($1, $2) RETURNING id; @@ -109,13 +121,16 @@ INSERT INTO users (name, age) VALUES ($1, $2) RETURNING id; ### Array spread and pick -The array spread-and-pick expansion allows to pass an array of objects as a parameter. +The array spread-and-pick expansion allows to pass an array of objects as a parameter. + #### Syntax: + ``` @param paramName -> ((name, age)...) ``` #### Example: + ```sql title="Query definition:" /* @name insertUsers @@ -123,15 +138,17 @@ The array spread-and-pick expansion allows to pass an array of objects as a para */ INSERT INTO users (name, age) VALUES :users RETURNING id;`; ``` + ```ts title="Execution:" const parameters = { users: [ - {name: 'Rob', age: 56}, - {name: 'Tom', age: 45}, - ] + { name: 'Rob', age: 56 }, + { name: 'Tom', age: 45 }, + ], }; insertUsers.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Bindings: ['Rob', 56, 'Tom', 45] INSERT INTO users (name, age) VALUES ($1, $2), ($3, $4) RETURNING id; diff --git a/docs-new/docs/ts-file-intro.md b/docs-new/docs/ts-file-intro.md index 28f093df..149a0a97 100644 --- a/docs-new/docs/ts-file-intro.md +++ b/docs-new/docs/ts-file-intro.md @@ -1,21 +1,24 @@ --- id: ts-file-intro title: SQL-in-TS -sidebar_label: Queries in TS files +sidebar_label: Queries in TS files --- It sometimes makes sense to inline your queries instead of collecting them in separate SQL files. PgTyped supports inlined queries using the `sql` template literal. To see how that works lets write some queries in `users/queries.ts`: + ```ts title="users/queries.ts" -import { sql } from "@pgtyped/query"; -import { ISelectUserIdsQuery } from "./queries.types.ts"; +import { sql } from '@pgtyped/query'; +import { ISelectUserIdsQuery } from './queries.types.ts'; -export const selectUserIds = - sql`select id from users where id = $id and age = $age`; +export const selectUserIds = sql< + ISelectUserIdsQuery +>`select id from users where id = $id and age = $age`; ``` PgTyped parses your TS files, scanning them for `sql` queries and generating corresponding TS interfaces in `users/queries.types.ts`: + ```ts title="users/queries.types.ts" /** Types generated for queries found in "users/queries.ts" */ @@ -38,20 +41,24 @@ export interface ISelectUserIdsResult { ``` We can now pass the `ISelectUserIdsQuery` as a generic parameter to our query in `users/queries.ts`: + ```ts title="users/queries.ts" -import { sql } from "@pgtyped/query"; -import { ISelectUserIdsQuery } from "./queries.types.ts"; +import { sql } from '@pgtyped/query'; +import { ISelectUserIdsQuery } from './queries.types.ts'; -export const selectUserIds = - sql`select id from users where id = $id and age = $age`; +export const selectUserIds = sql< + ISelectUserIdsQuery +>`select id from users where id = $id and age = $age`; - const users = await selectUserIds.run({ - id: "some-user-id", +const users = await selectUserIds.run( + { + id: 'some-user-id', age: 34, - }, connection); + }, + connection, +); - console.log(users[0]); +console.log(users[0]); ``` For more information on writing queries in TS files checkout the [SQL-in-TS](ts-file) guide. - diff --git a/docs-new/docs/ts-file.md b/docs-new/docs/ts-file.md index 88e47f00..dc06e962 100644 --- a/docs-new/docs/ts-file.md +++ b/docs-new/docs/ts-file.md @@ -1,11 +1,11 @@ --- id: ts-file -title: Typescript files +title: Typescript files sidebar_label: Typescript files --- PgTyped also supports parsing queries from TS files. -Such queries must be tagged with an `sql` template literal, like this: +Such queries must be tagged with an `sql` template literal, like this: ```ts import { sql } from '@pgtyped/query'; @@ -18,7 +18,7 @@ const getUsersWithComments = sql` ``` PgTyped will then scan your project for such `sql` tags and generate types for each query, saving the types in a `filename.types.ts` file. -Once the type files have been generated you can import them to type your query: +Once the type files have been generated you can import them to type your query: ```ts import { sql } from '@pgtyped/query'; @@ -39,8 +39,7 @@ Template literals also support parameter expansions. Here is how a typical insert query looks like using SQL-in-TS syntax: ```ts -const query = - sql`INSERT INTO users (name, age) VALUES $$users(name, age) RETURNING id`; +const query = sql`INSERT INTO users (name, age) VALUES $$users(name, age) RETURNING id`; ``` Here `$$users(name, age)` is a parameter expansion. @@ -49,13 +48,16 @@ Here `$$users(name, age)` is a parameter expansion. ### Array spread -The array spread expansion allows to pass an array of scalars as parameter. +The array spread expansion allows to pass an array of scalars as parameter. + #### Syntax: + ```ts -$$paramName +$$paramName; ``` #### Example: + ```ts title="Query code:" const query = sql`SELECT FROM users where age in $$ages`; @@ -63,6 +65,7 @@ const parameters = { ages: [25, 30, 35] }; query.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Bindings: [25, 30, 35] SELECT FROM users WHERE age in (25, 30, 35); @@ -70,21 +73,26 @@ SELECT FROM users WHERE age in (25, 30, 35); ### Object pick -The object pick expansion allows to pass an object as a parameter. +The object pick expansion allows to pass an object as a parameter. + #### Syntax: + ``` $user(name, age) ``` #### Example: + ```ts title="Query code:" -const query = - sql`INSERT INTO users (name, age) VALUES $user(name, age) RETURNING id`; +const query = sql< + IQueryType +>`INSERT INTO users (name, age) VALUES $user(name, age) RETURNING id`; -const parameters = { user: {name: 'Rob', age: 56} }; +const parameters = { user: { name: 'Rob', age: 56 } }; query.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Bindings: ['Rob', 56] INSERT INTO users (name, age) VALUES ($1, $2) RETURNING id; @@ -92,26 +100,29 @@ INSERT INTO users (name, age) VALUES ($1, $2) RETURNING id; ### Array spread and pick -The array spread-and-pick expansion allows to pass an array of objects as a parameter. +The array spread-and-pick expansion allows to pass an array of objects as a parameter. + #### Syntax: + ``` $$user(name, age) ``` #### Example: + ```ts -const query = - sql`INSERT INTO users (name, age) VALUES $$users(name, age) RETURNING id`; +const query = sql`INSERT INTO users (name, age) VALUES $$users(name, age) RETURNING id`; const parameters = { users: [ - {name: 'Rob', age: 56}, - {name: 'Tom', age: 45}, - ] + { name: 'Rob', age: 56 }, + { name: 'Tom', age: 45 }, + ], }; query.run(parameters, connection); ``` + ```sql title="Resulting query:" -- Bindings: ['Rob', 56, 'Tom', 45] INSERT INTO users (name, age) VALUES ($1, $2), ($3, $4) RETURNING id; @@ -119,10 +130,9 @@ INSERT INTO users (name, age) VALUES ($1, $2), ($3, $4) RETURNING id; ## Reference -| Expansion | Syntax | Parameter Type | -|---------------------|-----------------------------|------------------------------------------------------------| -| Scalar parameter | `$paramName` | `paramName: ParamType` | -| Object pick | `$paramName(name, author)` | `paramName: { name: NameType, author: AuthorType }` | -| Array spread | `$$paramName` | `paramName: Array` | +| Expansion | Syntax | Parameter Type | +| --------------------- | --------------------------- | ---------------------------------------------------------- | +| Scalar parameter | `$paramName` | `paramName: ParamType` | +| Object pick | `$paramName(name, author)` | `paramName: { name: NameType, author: AuthorType }` | +| Array spread | `$$paramName` | `paramName: Array` | | Array pick and spread | `$$paramName(name, author)` | `paramName: Array<{ name: NameType, author: AuthorType }>` | - diff --git a/docs-new/docusaurus.config.js b/docs-new/docusaurus.config.js index db7ecacf..248c3066 100644 --- a/docs-new/docusaurus.config.js +++ b/docs-new/docusaurus.config.js @@ -46,8 +46,7 @@ module.exports = { homePageId: 'intro', sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/adelsz/pgtyped/edit/master/docs-new/', + editUrl: 'https://github.com/adelsz/pgtyped/edit/master/docs-new/', }, theme: { customCss: require.resolve('./src/css/custom.css'), @@ -55,5 +54,4 @@ module.exports = { }, ], ], - }; diff --git a/docs-new/sidebars.js b/docs-new/sidebars.js index 531f3112..18cb2e14 100644 --- a/docs-new/sidebars.js +++ b/docs-new/sidebars.js @@ -1,6 +1,12 @@ module.exports = { someSidebar: { - PgTyped: ['intro', 'features', 'getting-started', 'sql-file-intro', 'ts-file-intro'], + PgTyped: [ + 'intro', + 'features', + 'getting-started', + 'sql-file-intro', + 'ts-file-intro', + ], Queries: ['sql-file', 'ts-file', 'dynamic-queries'], CLI: ['cli'], }, diff --git a/docs-new/src/pages/index.js b/docs-new/src/pages/index.js index 96a4c376..b97fc76a 100644 --- a/docs-new/src/pages/index.js +++ b/docs-new/src/pages/index.js @@ -12,7 +12,8 @@ const features = [ imageUrl: 'img/typesafety.svg', description: ( <> - Pgtyped generates TS types for parameters and results of SQL queries of any complexity. + Pgtyped generates TS types for parameters and results of SQL queries of + any complexity. ), }, @@ -21,8 +22,9 @@ const features = [ imageUrl: 'img/multifile.svg', description: ( <> - Queries can be written in SQL files together with useful parameter annotations. - In Typescript files, queries can be defined using a sql template string literal. + Queries can be written in SQL files together with useful parameter + annotations. In Typescript files, queries can be defined using a{' '} + sql template string literal. ), }, @@ -31,14 +33,15 @@ const features = [ imageUrl: 'img/integrity.svg', description: ( <> - PgTyped prevents SQL injections by separately sending queries and parameters to the DB for execution. - This allows parameter substitution to be safely done by the PostgreSQL server + PgTyped prevents SQL injections by separately sending queries and + parameters to the DB for execution. This allows parameter substitution + to be safely done by the PostgreSQL server ), }, ]; -function Feature({imageUrl, title, description}) { +function Feature({ imageUrl, title, description }) { const imgUrl = useBaseUrl(imageUrl); return (
@@ -55,11 +58,12 @@ function Feature({imageUrl, title, description}) { function Home() { const context = useDocusaurusContext(); - const {siteConfig = {}} = context; + const { siteConfig = {} } = context; return ( + description="Typesafe SQL in Typescript" + >

{siteConfig.title}

@@ -70,7 +74,8 @@ function Home() { 'button button--outline button--secondary button--lg', styles.getStarted, )} - to={useBaseUrl('docs/')}> + to={useBaseUrl('docs/')} + > Get Started
diff --git a/lerna.json b/lerna.json index 7553e064..b065d301 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,4 @@ { - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "version": "0.8.2" } diff --git a/packages/cli/README.md b/packages/cli/README.md index be7b5300..a713dd16 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -6,28 +6,32 @@ The `pgtyped` CLI can work in build and watch mode. ### Flags: The CLI supports two flags: -* `-c config_file_path.json` to pass the config file path. -* `-w` to start in watch mode. + +- `-c config_file_path.json` to pass the config file path. +- `-w` to start in watch mode. Running the CLI: + ``` npx pgtyped -w -c config.json ``` ### Env variables: -PgTyped supports common PostgreSQL environment variables: -* `PGHOST` -* `PGUSER` -* `PGPASSWORD` -* `PGDATABASE` -* `PGPORT` +PgTyped supports common PostgreSQL environment variables: + +- `PGHOST` +- `PGUSER` +- `PGPASSWORD` +- `PGDATABASE` +- `PGPORT` These variables will override values provided in `config.json`. ### Config file: Config file format (`config.json`): + ```js { // You can specify as many transforms as you want @@ -62,6 +66,7 @@ By default, PgTyped saves generated files in the same folder as the source files This behavior can be customized using the `emitTemplate` config parameter. In that template, four parameters are available for interpolation: `root`, `dir`, `base`, `name` and `ext`. For example, when parsing source/query file `/home/user/dir/file.sql`, these parameters are assigned the following values: + ``` ┌─────────────────────┬────────────┐ │ dir │ base │ @@ -71,6 +76,8 @@ For example, when parsing source/query file `/home/user/dir/file.sql`, these par └──────┴──────────────┴──────┴─────┘ (All spaces in the "" line should be ignored. They are purely for formatting.) ``` + --- + This package is part of the PgTyped project. Refer to root [README](https://github.com/adelsz/pgtyped) for details. diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 9dcb5805..412f5667 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -1,387 +1,387 @@ { - "name": "@pgtyped/cli", - "version": "0.8.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", - "dev": true - }, - "@types/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", - "dev": true, - "requires": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", - "dev": true - }, - "@types/node": { - "version": "14.0.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.24.tgz", - "integrity": "sha512-btt/oNOiDWcSuI721MdL8VQGnjsKjlTMdrKyTcLCKeQp/n4AAMFJ961wMbp+09y8WuGPClDEv07RIItdXKIXAA==", - "dev": true - }, - "@types/nunjucks": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/nunjucks/-/nunjucks-3.1.3.tgz", - "integrity": "sha512-42IiIIBdoB7ZDwCVhCWYT4fMCj+4TeacuVgh7xyT2du5EhkpA+OFeeDdYTFCUt1MrHb8Aw7ZqFvr8s1bwP9l8w==" - }, - "a-sync-waterfall": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", - "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==" - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "camel-case": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.1.tgz", - "integrity": "sha512-7fa2WcG4fYFkclIvEmxBbTvmibwF2/agfEBc6q3lOpVu0A13ltLsA+Hr/8Hp6kp5f+G7hKi6t8lys6XxP+1K6Q==", - "requires": { - "pascal-case": "^3.1.1", - "tslib": "^1.10.0" - } - }, - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fp-ts": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.5.3.tgz", - "integrity": "sha512-lQd+hahLd8cygNoXbEHDjH/cbF6XVWlEPb8h5GXXlozjCSDxWgclvkpOoTRfBA0P+r69l9VvW1nEsSGIJRQpWw==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "optional": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "io-ts": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-2.1.2.tgz", - "integrity": "sha512-whVRGaNBZSrkPrg1y+sSy/kv/fDjweQPP1UCLhKwJUHWGD6rFgbZ44FBF98JlY/FFzTA0MkhGeHWZ/aFhF42eA==" - }, - "io-ts-reporters": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/io-ts-reporters/-/io-ts-reporters-1.0.0.tgz", - "integrity": "sha512-jjMvTnFYYxX3ue3cajmqCAf7sM4+lFvaaUuAL+otJv2DE+WDxYvQeCcUYveoq37rVSftJHZBEOrnvz3x0VdRXA==", - "requires": { - "fp-ts": "^2.0.2", - "io-ts": "^2.0.0" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "lower-case": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz", - "integrity": "sha512-LiWgfDLLb1dwbFQZsSglpRj+1ctGnayXz3Uv0/WO8n558JycT5fg6zkNcnW0G68Nn0aEldTFeEfmjCfmqry/rQ==", - "requires": { - "tslib": "^1.10.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "no-case": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz", - "integrity": "sha512-ehY/mVQCf9BL0gKfsJBvFJen+1V//U+0HQMPrWct40ixE4jnv0bfvxDbWtAHL9EcaPEOJHVVYKoQn1TlZUB8Tw==", - "requires": { - "lower-case": "^2.0.1", - "tslib": "^1.10.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "nunjucks": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.2.tgz", - "integrity": "sha512-KUi85OoF2NMygwODAy28Lh9qHmq5hO3rBlbkYoC8v377h4l8Pt5qFjILl0LWpMbOrZ18CzfVVUvIHUIrtED3sA==", - "requires": { - "a-sync-waterfall": "^1.0.0", - "asap": "^2.0.3", - "chokidar": "^3.3.0", - "commander": "^5.1.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "pascal-case": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.1.tgz", - "integrity": "sha512-XIeHKqIrsquVTQL2crjq3NfJUxmdLasn3TYOU0VBM+UX2a6ztAWBlJQBePLGY7VHW8+2dRadeIPK5+KImwTxQA==", - "requires": { - "no-case": "^3.0.3", - "tslib": "^1.10.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==" - }, - "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", - "requires": { - "picomatch": "^2.0.7" - } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } + "name": "@pgtyped/cli", + "version": "0.8.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", + "dev": true + }, + "@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "@types/node": { + "version": "14.0.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.24.tgz", + "integrity": "sha512-btt/oNOiDWcSuI721MdL8VQGnjsKjlTMdrKyTcLCKeQp/n4AAMFJ961wMbp+09y8WuGPClDEv07RIItdXKIXAA==", + "dev": true + }, + "@types/nunjucks": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/nunjucks/-/nunjucks-3.1.3.tgz", + "integrity": "sha512-42IiIIBdoB7ZDwCVhCWYT4fMCj+4TeacuVgh7xyT2du5EhkpA+OFeeDdYTFCUt1MrHb8Aw7ZqFvr8s1bwP9l8w==" + }, + "a-sync-waterfall": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", + "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==" + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "camel-case": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.1.tgz", + "integrity": "sha512-7fa2WcG4fYFkclIvEmxBbTvmibwF2/agfEBc6q3lOpVu0A13ltLsA+Hr/8Hp6kp5f+G7hKi6t8lys6XxP+1K6Q==", + "requires": { + "pascal-case": "^3.1.1", + "tslib": "^1.10.0" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fp-ts": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.5.3.tgz", + "integrity": "sha512-lQd+hahLd8cygNoXbEHDjH/cbF6XVWlEPb8h5GXXlozjCSDxWgclvkpOoTRfBA0P+r69l9VvW1nEsSGIJRQpWw==" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "optional": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "io-ts": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-2.1.2.tgz", + "integrity": "sha512-whVRGaNBZSrkPrg1y+sSy/kv/fDjweQPP1UCLhKwJUHWGD6rFgbZ44FBF98JlY/FFzTA0MkhGeHWZ/aFhF42eA==" + }, + "io-ts-reporters": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/io-ts-reporters/-/io-ts-reporters-1.0.0.tgz", + "integrity": "sha512-jjMvTnFYYxX3ue3cajmqCAf7sM4+lFvaaUuAL+otJv2DE+WDxYvQeCcUYveoq37rVSftJHZBEOrnvz3x0VdRXA==", + "requires": { + "fp-ts": "^2.0.2", + "io-ts": "^2.0.0" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "lower-case": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz", + "integrity": "sha512-LiWgfDLLb1dwbFQZsSglpRj+1ctGnayXz3Uv0/WO8n558JycT5fg6zkNcnW0G68Nn0aEldTFeEfmjCfmqry/rQ==", + "requires": { + "tslib": "^1.10.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "no-case": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz", + "integrity": "sha512-ehY/mVQCf9BL0gKfsJBvFJen+1V//U+0HQMPrWct40ixE4jnv0bfvxDbWtAHL9EcaPEOJHVVYKoQn1TlZUB8Tw==", + "requires": { + "lower-case": "^2.0.1", + "tslib": "^1.10.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "nunjucks": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.2.tgz", + "integrity": "sha512-KUi85OoF2NMygwODAy28Lh9qHmq5hO3rBlbkYoC8v377h4l8Pt5qFjILl0LWpMbOrZ18CzfVVUvIHUIrtED3sA==", + "requires": { + "a-sync-waterfall": "^1.0.0", + "asap": "^2.0.3", + "chokidar": "^3.3.0", + "commander": "^5.1.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "pascal-case": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.1.tgz", + "integrity": "sha512-XIeHKqIrsquVTQL2crjq3NfJUxmdLasn3TYOU0VBM+UX2a6ztAWBlJQBePLGY7VHW8+2dRadeIPK5+KImwTxQA==", + "requires": { + "no-case": "^3.0.3", + "tslib": "^1.10.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "picomatch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", + "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==" + }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "requires": { + "picomatch": "^2.0.7" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } } diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts index d1c62dbf..1c671b06 100644 --- a/packages/cli/src/types.ts +++ b/packages/cli/src/types.ts @@ -97,7 +97,7 @@ function declareAlias(name: string, definition: string): string { } function declareStringUnion(name: string, values: string[]) { - return declareAlias(name, values.map(v => `'${v}'`).join(' | ')); + return declareAlias(name, values.map((v) => `'${v}'`).join(' | ')); } function declareEnum(name: string, values: string[]) { @@ -118,8 +118,7 @@ export class TypeAllocator { constructor( private mapping: TypeMapping, private allowUnmappedTypes?: boolean, - ) { - } + ) {} isMappedType(name: string): name is keyof TypeMapping { return name in this.mapping; diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index e7fb6037..0f140092 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,14 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib/", /* Redirect output structure to the directory. */ + "outDir": "./lib/" /* Redirect output structure to the directory. */, "rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ }, - "exclude": [ - "tests", - "lib" - ], - "include": [ - "./src" - ] + "exclude": ["tests", "lib"], + "include": ["./src"] } diff --git a/packages/query/README.md b/packages/query/README.md index e83d570b..13605c6a 100644 --- a/packages/query/README.md +++ b/packages/query/README.md @@ -6,18 +6,22 @@ For each query PgTyped generates an interface that can be used in this parameter To run a query defined with the `sql` tagged template, call the `sql.run` method. The `sql.run` method automatically enforces correct input `TParams` and output `TResult` types. + ```js public run: ( params: TParams, dbConnection: IDatabaseConnection, ) => Promise; ``` + Here `dbConnection` is any object that satisifies the `IDatabaseConnection` interface. It is used to actually send the query to the DB for execution. + ``` interface IDatabaseConnection { query: (query: string, bindings: any[]) => Promise<{ rows: any[] }>; } ``` + This is usually the `client` object created with [node-postgres](https://github.com/brianc/node-postgres), but can be any other connection of your choice. This package is part of the pgtyped project. diff --git a/packages/query/package-lock.json b/packages/query/package-lock.json index 6ecb3d9e..2f9b275d 100644 --- a/packages/query/package-lock.json +++ b/packages/query/package-lock.json @@ -1,94 +1,94 @@ { - "name": "@pgtyped/query", - "version": "0.8.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/chalk": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz", - "integrity": "sha512-1zzPV9FDe1I/WHhRkf9SNgqtRJWZqrBWgu7JGveuHmmyR9CnAPCie2N/x+iHrgnpYBIcCJWHBoMRv2TRWktsvw==", - "requires": { - "chalk": "*" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==" - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "antlr4ts": { - "version": "0.5.0-alpha.3", - "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.3.tgz", - "integrity": "sha512-La89tKkGcHFIVuruv4Bm1esc3zLmES2NOTEwwNS1pudz+zx/0FNqQeUu9p48i9/QHKPVqjN87LB+q3buTg7oDQ==" - }, - "antlr4ts-cli": { - "version": "0.5.0-alpha.3", - "resolved": "https://registry.npmjs.org/antlr4ts-cli/-/antlr4ts-cli-0.5.0-alpha.3.tgz", - "integrity": "sha512-i6oyxfaXU6qnw4HgyeSIsOLlsvT7zU3vmenoJKFNVFP1QNodtJMZYpnyxc8TmOFpJs7fEoWanLavSSDEmcCZBQ==", - "dev": true - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - } - } + "name": "@pgtyped/query", + "version": "0.8.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/chalk": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz", + "integrity": "sha512-1zzPV9FDe1I/WHhRkf9SNgqtRJWZqrBWgu7JGveuHmmyR9CnAPCie2N/x+iHrgnpYBIcCJWHBoMRv2TRWktsvw==", + "requires": { + "chalk": "*" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==" + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "antlr4ts": { + "version": "0.5.0-alpha.3", + "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.3.tgz", + "integrity": "sha512-La89tKkGcHFIVuruv4Bm1esc3zLmES2NOTEwwNS1pudz+zx/0FNqQeUu9p48i9/QHKPVqjN87LB+q3buTg7oDQ==" + }, + "antlr4ts-cli": { + "version": "0.5.0-alpha.3", + "resolved": "https://registry.npmjs.org/antlr4ts-cli/-/antlr4ts-cli-0.5.0-alpha.3.tgz", + "integrity": "sha512-i6oyxfaXU6qnw4HgyeSIsOLlsvT7zU3vmenoJKFNVFP1QNodtJMZYpnyxc8TmOFpJs7fEoWanLavSSDEmcCZBQ==", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + } + } + } } diff --git a/packages/query/tsconfig.json b/packages/query/tsconfig.json index 41943e15..0f140092 100644 --- a/packages/query/tsconfig.json +++ b/packages/query/tsconfig.json @@ -1,14 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib/", /* Redirect output structure to the directory. */ + "outDir": "./lib/" /* Redirect output structure to the directory. */, "rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ }, - "exclude": [ - "tests", - "lib" - ], - "include": [ - "./src" - ] -} \ No newline at end of file + "exclude": ["tests", "lib"], + "include": ["./src"] +} diff --git a/packages/wire/package-lock.json b/packages/wire/package-lock.json index 2d3bb176..4ae1813f 100644 --- a/packages/wire/package-lock.json +++ b/packages/wire/package-lock.json @@ -1,26 +1,26 @@ { - "name": "@pgtyped/wire", - "version": "0.8.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } + "name": "@pgtyped/wire", + "version": "0.8.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } } diff --git a/packages/wire/tsconfig.json b/packages/wire/tsconfig.json index 41943e15..0f140092 100644 --- a/packages/wire/tsconfig.json +++ b/packages/wire/tsconfig.json @@ -1,14 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib/", /* Redirect output structure to the directory. */ + "outDir": "./lib/" /* Redirect output structure to the directory. */, "rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ }, - "exclude": [ - "tests", - "lib" - ], - "include": [ - "./src" - ] -} \ No newline at end of file + "exclude": ["tests", "lib"], + "include": ["./src"] +} diff --git a/renovate.json b/renovate.json index e9514925..c8868eb5 100644 --- a/renovate.json +++ b/renovate.json @@ -1,12 +1,8 @@ { - "extends": [ - "config:base" - ], + "extends": ["config:base"], "packageRules": [ { - "packagePatterns": [ - "*" - ], + "packagePatterns": ["*"], "minor": { "groupName": "all non-major dependencies", "groupSlug": "all-minor-patch" diff --git a/tsconfig.json b/tsconfig.json index 1408a940..ad59da3c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,14 +2,14 @@ "compilerOptions": { /* Basic Options */ "target": "ES6", - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ // "composite": true, /* Enable project compilation */ // "incremental": true, /* Enable incremental compilation */ @@ -21,12 +21,12 @@ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - "strictNullChecks": true, /* Enable strict null checks. */ - "strictFunctionTypes": true, /* Enable strict checking of function types. */ - "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* Enable strict null checks. */, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */, + "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ @@ -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 */ diff --git a/tslint.json b/tslint.json index b18bace4..44294898 100644 --- a/tslint.json +++ b/tslint.json @@ -23,7 +23,9 @@ "**/*Parser.ts", "**/*ParserListener.ts", "**/*ParserVisitor.ts", - "**/*queries.ts" + "**/*queries.ts", + "packages/example/**/*.ts", + "packages/query/src/loader/*/parser/**/*.ts" ] } }