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: upgrade dependencies #34

Open
wants to merge 11 commits into
base: main
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
strategy:
matrix:
node-version:
- 12.22.1-buster
- 14.16.1-buster
- 14.19.3-buster
- 16.15.0-buster

container:
image: node:${{ matrix.node-version }}
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
roots: ["<rootDir>/src", "<rootDir>/__tests__"],
roots: [
"<rootDir>/src",
// "<rootDir>/__tests__"
],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
Expand Down
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,55 @@
"dependencies": {
"@graphile/logger": "^0.2.0",
"@types/cryptr": "^4.0.1",
"chokidar": "^3.3.1",
"cosmiconfig": "^6.0.0",
"cryptr": "^6.0.2",
"faker": "^4.1.0",
"glob": "^7.1.6",
"chokidar": "^3.5.3",
"cosmiconfig": "^7.0.1",
"cryptr": "^6.0.3",
"glob": "^8.0.3",
"graphile-scheduler": "^0.8.0",
"graphile-worker": "^0.13.0",
"lodash": "^4.17.20",
"mustache": "^4.0.1",
"runtypes": "^4.2.0",
"tape": "^4.13.2",
"tslib": "^1.9.3",
"yaml": "^1.10.0",
"yargs": "^15.3.1"
"lodash": "^4.17.21",
"mustache": "^4.2.0",
"runtypes": "^6.5.1",
"tape": "^5.5.3",
"tslib": "^2.4.0",
"yaml": "^2.1.1",
"yargs": "^17.5.1"
},
"peerDependencies": {
"@types/pg": ">=6.5 <9",
"pg": ">=6.5 <9"
},
"devDependencies": {
"@types/chokidar": "^2.1.3",
"@types/debug": "^4.1.2",
"@types/faker": "^4.1.11",
"@types/glob": "^7.1.1",
"@types/jest": "^25.1.1",
"@types/lodash": "^4.14.168",
"@types/mustache": "^4.0.1",
"@types/debug": "^4.1.7",
"@types/faker": "^5.1.5",
"@types/glob": "^7.2.0",
"@types/jest": "^28.1.4",
"@types/lodash": "^4.14.182",
"@types/mustache": "^4.1.3",
"@types/pg": "^8.6.5",
"@types/tape": "^4.13.0",
"@types/yargs": "^15.0.5",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"depcheck": "^0.9.2",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.5",
"@types/tape": "^4.13.2",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"depcheck": "^1.4.3",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint_d": "^8.0.0",
"fast-check": "^1.23.0",
"jest": "^25.1.0",
"eslint_d": "^12.2.0",
"faker": "^5.5.3",
"fast-check": "^3.0.1",
"jest": "^28.1.2",
"jsverify": "^0.8.4",
"pg": "^8.7.3",
"pg-connection-string": "^2.5.0",
"prettier": "^1.19.1",
"standard-version": "^9.1.0",
"ts-jest": "^25.2.0",
"ts-node": "^8.8.2",
"typescript": "^3.7.5"
"standard-version": "^9.5.0",
"ts-jest": "^28.0.5",
"ts-node": "^10.8.2",
"typescript": "^4.7.4"
},
"resolutions": {
"graphile-worker": "^0.13.0"
Expand Down
6 changes: 4 additions & 2 deletions src/cli-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ import {
// };

interface CliOpts {
[x: string]: unknown;
database: string;
files: string;
schema: string;
out?: string;
testFiles: string;
watch: boolean;
out: string | undefined;
_: (string | number)[];
$0: string;
}

const install = (taskList?: TaskList) => async (argv: CliOpts) => {
Expand Down
6 changes: 3 additions & 3 deletions src/objects/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const toStatement = (context: RunContextI) =>
`CREATE FUNCTION "${context.schema}".${
op.func.name
}(${op.func.arguments
.map(p => [p.name, p.type].join(" "))
.map((p: any) => [p.name, p.type].join(" "))
.join(", ")}) RETURNS ${op.func.returns} as $$ ${
op.func.body
} $$ language ${op.func.language} ${op.func.volatility} SECURITY ${
Expand All @@ -294,7 +294,7 @@ const toStatement = (context: RunContextI) =>
`CREATE OR REPLACE FUNCTION "${context.schema}".${
op.func.name
}(${op.func.arguments
.map(p => [p.name, p.type].join(" "))
.map((p: any) => [p.name, p.type].join(" "))
.join(", ")}) RETURNS ${op.func.returns} as $$ ${
op.func.body
} $$ language ${op.func.language} ${op.func.volatility} SECURITY ${
Expand All @@ -307,7 +307,7 @@ const toStatement = (context: RunContextI) =>
`DROP FUNCTION "${context.schema}".${
op.func.name
}(${op.func.arguments
.map(p => [p.name, p.type].join(" "))
.map((p: any) => [p.name, p.type].join(" "))
.join(", ")});`,
],
[
Expand Down
12 changes: 10 additions & 2 deletions src/objects/table/introspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,18 @@ const introspectIndexes = async (
),
on: idx.columns
.filter(c => c.is_key)
.map(c => ({ column: c.column, order: c.order, nulls: c.nulls_status })),
.map(c => ({
column: c.column,
order: c.order,
nulls: c.nulls_status,
})),
include: idx.columns
.filter(c => !c.is_key)
.map(c => ({ column: c.column, order: c.order, nulls: c.nulls_status })),
.map(c => ({
column: c.column,
order: c.order,
nulls: c.nulls_status,
})),
}));
};

Expand Down
2 changes: 1 addition & 1 deletion src/objects/table/property.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TableProvider } from "./index";
import { Column, TableI } from "./records";

const PgIdentifierArbitrary = fc
.unicodeString(1, 20)
.unicodeString({ minLength: 1, maxLength: 20 })
.filter(PgIdentifier.guard);

type RecordShape = {
Expand Down
6 changes: 4 additions & 2 deletions src/objects/table/statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ export const makeIndexToStatement = (context: RunContextI) =>
op.table.name,
)} (${op.index.on
.map(
col =>
(col: any) =>
`${col.column} ${col.order || "ASC"} ${
col.nulls ? `NULLS ${col.nulls}` : ""
}`,
)
.join(", ")}) ${
op.index.include !== undefined
? `INCLUDE (${op.index.include.map(c => c.column).join(", ")})`
? `INCLUDE (${op.index.include
.map((c: any) => c.column)
.join(", ")})`
: ""
} ${op.index.where ? `WHERE ${op.index.where}` : ""};`,
],
Expand Down
14 changes: 8 additions & 6 deletions src/sexp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const compile = (sexp: SExpr): CompiledExpression =>
);
}

const compiledOperands = operands.map(op => compile(op as SExpr));
const compiledOperands = operands.map((op: SExpr) => compile(op));

const operandArgumentPairs = zip(
compiledOperands,
Expand All @@ -40,11 +40,11 @@ const compile = (sexp: SExpr): CompiledExpression =>
);

for (const opArgPair of operandArgumentPairs) {
const operand = opArgPair[0]!;
const argSpec = opArgPair[1]!;
const operand = opArgPair[0]! as any;
const argSpec = opArgPair[1]! as any;

const disallowedOperandTypes = operand.types.filter(
type => !argSpec.types.includes(type),
(type: any) => !argSpec.types.includes(type),
);
if (disallowedOperandTypes.length > 0) {
throw new Error(
Expand All @@ -61,12 +61,14 @@ const compile = (sexp: SExpr): CompiledExpression =>

const returnTypes =
operation.dynamicReturns !== undefined
? operation.dynamicReturns(compiledOperands.map(i => i.types))
? operation.dynamicReturns(
compiledOperands.map((i: any) => i.types),
)
: operation.returns;

return {
expression: operation.template(
compiledOperands.map(i => `(${i.expression})`),
compiledOperands.map((i: any) => `(${i.expression})`),
),
types: returnTypes,
};
Expand Down
Loading