Skip to content

Commit

Permalink
Merge pull request #2 from a-type/fix-peer-deps
Browse files Browse the repository at this point in the history
move capacitor and kysely to peer dependencies
  • Loading branch information
DawidWetzler authored Nov 7, 2024
2 parents b0b9b68 + e7e466c commit eafe500
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 17 deletions.
19 changes: 12 additions & 7 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@
"fix:lint": "eslint src --ext .ts --fix",
"watch:build": "tsc -p tsconfig.json -w"
},
"dependencies": {
"@capacitor/core": "^5.5.1",
"kysely": "^0.26.3"
"peerDependencies": {
"@capacitor/core": ">=5.0.0",
"kysely": ">=0.26.0"
},
"devDependencies": {
"@capacitor/core": "^5.5.1",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"kysely": "^0.26.3",
"typescript": "^5.2.2"
},
"prettier": {
Expand Down
5 changes: 5 additions & 0 deletions src/CapacitorSQLiteKyselyConnection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Capacitor } from '@capacitor/core';
import { CompiledQuery, DatabaseConnection, QueryResult } from 'kysely';
import type {
CapacitorSQLiteKysely,
CapacitorSQLiteKyselyConfig,
CapacitorSQLiteKyselyDatabaseConnection,
} from './types';

export class CapacitorSQLiteKyselyConnection implements DatabaseConnection {
#config: CapacitorSQLiteKyselyConfig;
Expand Down
4 changes: 4 additions & 0 deletions src/CapacitorSQLiteKyselyDialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {
} from 'kysely';

import { CapacitorSQLiteKyselyDriver } from './CapacitorSQLiteKyselyDriver';
import type {
CapacitorSQLiteKysely,
CapacitorSQLiteKyselyConfig,
} from './types';

export class CapacitorSQLiteKyselyDialect implements Dialect {
#config: CapacitorSQLiteKyselyConfig;
Expand Down
4 changes: 4 additions & 0 deletions src/CapacitorSQLiteKyselyDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { Capacitor } from '@capacitor/core';
import { DatabaseConnection, Driver, TransactionSettings } from 'kysely';

import { CapacitorSQLiteKyselyConnection } from './CapacitorSQLiteKyselyConnection';
import type {
CapacitorSQLiteKysely,
CapacitorSQLiteKyselyConfig,
} from './types';

export class CapacitorSQLiteKyselyDriver implements Driver {
#config: CapacitorSQLiteKyselyConfig;
Expand Down
12 changes: 6 additions & 6 deletions src/types/types.d.ts → src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface CapacitorSQLiteKyselyConfig {
export interface CapacitorSQLiteKyselyConfig {
/**
* name of database
*
Expand Down Expand Up @@ -34,24 +34,24 @@ interface CapacitorSQLiteKyselyConfig {
readonly: boolean;
}

interface CapacitorSQLiteKyselyDatabaseConnectionResult {
export interface CapacitorSQLiteKyselyDatabaseConnectionResult {
result?: boolean;
}

interface CapacitorSQLiteOptions {
export interface CapacitorSQLiteOptions {
database?: string;
readonly?: boolean;
}

interface CapacitorSQLiteChangesResult {
export interface CapacitorSQLiteChangesResult {
changes?: {
changes?: number;
lastId?: number;
values?: any[];
};
}

interface CapacitorSQLiteKyselyDatabaseConnection {
export interface CapacitorSQLiteKyselyDatabaseConnection {
open(): Promise<void>;
run(
statement: string,
Expand All @@ -73,7 +73,7 @@ interface CapacitorSQLiteKyselyDatabaseConnection {
isTransactionActive(): Promise<{ result?: boolean }>;
}

interface CapacitorSQLiteKysely {
export interface CapacitorSQLiteKysely {
closeConnection(database: string, readonly: boolean): Promise<void>;
createConnection(
database: string,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
}

0 comments on commit eafe500

Please sign in to comment.