@tylix/orm 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/package.json +2 -1
- package/src/adapters/AdapterFactory.d.ts +8 -0
- package/src/adapters/AdapterFactory.js +10 -10
- package/src/adapters/DatabaseAdapter.d.ts +18 -0
- package/src/adapters/MongoAdapter.d.ts +23 -0
- package/src/adapters/MongoAdapter.js +4 -0
- package/src/adapters/MysqlAdapter.d.ts +15 -0
- package/src/adapters/MysqlAdapter.js +4 -0
- package/src/adapters/PostgresAdapter.d.ts +17 -0
- package/src/adapters/PostgresAdapter.js +4 -1
- package/src/adapters/SqliteAdapter.d.ts +9 -0
- package/src/adapters/SqliteAdapter.js +4 -0
- package/src/ensureDatabaseExists.js +64 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +11 -9
- package/src/model/ConnectionManager.d.ts +7 -0
- package/src/model/Model.d.ts +49 -0
- package/src/model/Model.js +8 -5
- package/src/query/QueryBuilder.d.ts +16 -0
- package/src/query/buildSelectSql.d.ts +11 -0
- package/src/query/types.d.ts +18 -0
- package/src/query/types.js +4 -0
- package/src/types.ts +25 -0
- package/tsconfig.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @tylix/orm
|
|
2
|
+
|
|
3
|
+
A lightweight ORM for Tylix applications with adapters for SQLite,
|
|
4
|
+
PostgreSQL, MySQL, and MongoDB.
|
|
5
|
+
|
|
6
|
+
## What's included
|
|
7
|
+
|
|
8
|
+
- **Adapters** — `DatabaseAdapter` (base interface), `SqliteAdapter`,
|
|
9
|
+
`PostgresAdapter`, `MysqlAdapter`, `MongoAdapter`, selected at
|
|
10
|
+
runtime via `AdapterFactory`
|
|
11
|
+
- **Model** — `Model` base class, backed by `ConnectionManager`
|
|
12
|
+
- **Query** — `QueryBuilder` and `buildSelectSql` for building queries
|
|
13
|
+
independent of the underlying adapter
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { Model, QueryBuilder } from '@tylix/orm'
|
|
19
|
+
|
|
20
|
+
class Invoice extends Model {
|
|
21
|
+
static table = 'invoices'
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Ships with a `d.ts` declaration file. Pairs with the model/migration
|
|
26
|
+
templates in `@tylix/generator`.
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DatabaseAdapter } from './DatabaseAdapter.js';
|
|
2
|
+
|
|
3
|
+
export interface DatabaseConfig {
|
|
4
|
+
driver: 'sqlite' | 'postgres' | 'mysql' | 'mongodb';
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare function createAdapter(databaseConfig: DatabaseConfig): DatabaseAdapter;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { SqliteAdapter } from
|
|
2
|
-
import { PostgresAdapter } from
|
|
3
|
-
import { MysqlAdapter } from
|
|
4
|
-
import { MongoAdapter } from
|
|
1
|
+
import { SqliteAdapter } from './SqliteAdapter.js'
|
|
2
|
+
import { PostgresAdapter } from './PostgresAdapter.js'
|
|
3
|
+
import { MysqlAdapter } from './MysqlAdapter.js'
|
|
4
|
+
import { MongoAdapter } from './MongoAdapter.js'
|
|
5
5
|
|
|
6
6
|
const ADAPTERS = {
|
|
7
7
|
sqlite: SqliteAdapter,
|
|
8
8
|
postgres: PostgresAdapter,
|
|
9
9
|
mysql: MysqlAdapter,
|
|
10
10
|
mongodb: MongoAdapter,
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
|
|
13
13
|
export function createAdapter(databaseConfig) {
|
|
14
|
-
const { driver, ...options } = databaseConfig
|
|
14
|
+
const { driver, ...options } = databaseConfig
|
|
15
15
|
|
|
16
|
-
const AdapterClass = ADAPTERS[driver]
|
|
16
|
+
const AdapterClass = ADAPTERS[driver]
|
|
17
17
|
if (!AdapterClass) {
|
|
18
18
|
throw new Error(
|
|
19
|
-
`Unknown database driver "${driver}". Available drivers: ${Object.keys(ADAPTERS).join(
|
|
20
|
-
)
|
|
19
|
+
`Unknown database driver "${driver}". Available drivers: ${Object.keys(ADAPTERS).join(', ')}`,
|
|
20
|
+
)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
return new AdapterClass(options)
|
|
23
|
+
return new AdapterClass(options)
|
|
24
24
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QueryDescriptor } from '../query/types.js';
|
|
2
|
+
|
|
3
|
+
export interface RunResult {
|
|
4
|
+
lastInsertRowid: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare class DatabaseAdapter {
|
|
8
|
+
connect(): Promise<this>;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
run(sql: string, params?: unknown[]): Promise<RunResult>;
|
|
11
|
+
get(sql: string, params?: unknown[]): Promise<Record<string, unknown> | null>;
|
|
12
|
+
all(sql: string, params?: unknown[]): Promise<Record<string, unknown>[]>;
|
|
13
|
+
columnType(logicalType: string): string | null;
|
|
14
|
+
count(table: string): Promise<number>;
|
|
15
|
+
paginate(table: string, limit: number, offset: number): Promise<Record<string, unknown>[]>;
|
|
16
|
+
listTables(): Promise<string[]>;
|
|
17
|
+
query(table: string, descriptor?: QueryDescriptor): Promise<Record<string, unknown>[]>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DatabaseAdapter } from './DatabaseAdapter.js';
|
|
2
|
+
|
|
3
|
+
export interface MongoAdapterOptions {
|
|
4
|
+
url?: string;
|
|
5
|
+
database?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ParsedMongoQuery =
|
|
9
|
+
| { type: 'createTable'; table: string }
|
|
10
|
+
| { type: 'dropTable'; table: string }
|
|
11
|
+
| { type: 'alterAddColumn'; table: string; column: string }
|
|
12
|
+
| { type: 'alterDropColumn'; table: string; column: string }
|
|
13
|
+
| { type: 'findOne'; table: string; field: string }
|
|
14
|
+
| { type: 'findAll'; table: string }
|
|
15
|
+
| { type: 'insert'; table: string; columns: string[] }
|
|
16
|
+
| { type: 'update'; table: string; columns: string[]; whereField: string }
|
|
17
|
+
| { type: 'delete'; table: string; field: string };
|
|
18
|
+
|
|
19
|
+
export declare function parseQuery(sql: string): ParsedMongoQuery;
|
|
20
|
+
|
|
21
|
+
export declare class MongoAdapter extends DatabaseAdapter {
|
|
22
|
+
constructor(options?: MongoAdapterOptions);
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DatabaseAdapter } from './DatabaseAdapter.js';
|
|
2
|
+
|
|
3
|
+
export interface MysqlAdapterOptions {
|
|
4
|
+
host?: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
user?: string;
|
|
7
|
+
password?: string;
|
|
8
|
+
database?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare class MysqlAdapter extends DatabaseAdapter {
|
|
12
|
+
constructor(options?: MysqlAdapterOptions);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function toMysqlDateTime(value: unknown): unknown;
|
|
@@ -41,6 +41,10 @@ export class MysqlAdapter extends DatabaseAdapter {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
quoteIdentifier(name) {
|
|
45
|
+
return `\`${name.replace(/`/g, '``')}\``
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
ensureConnected() {
|
|
45
49
|
if (!this.connection) {
|
|
46
50
|
throw new Error('MysqlAdapter is not connected. Call connect() first.')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DatabaseAdapter } from './DatabaseAdapter.js';
|
|
2
|
+
|
|
3
|
+
export interface PostgresAdapterOptions {
|
|
4
|
+
connectionString?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
user?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
database?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare class PostgresAdapter extends DatabaseAdapter {
|
|
13
|
+
constructor(options?: PostgresAdapterOptions);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare function toPositionalPlaceholders(sql: string): string;
|
|
17
|
+
export declare function ensureReturningId(sql: string): string;
|
|
@@ -40,7 +40,6 @@ export class PostgresAdapter extends DatabaseAdapter {
|
|
|
40
40
|
this.pool = new pg.Pool(this.config)
|
|
41
41
|
return this
|
|
42
42
|
}
|
|
43
|
-
|
|
44
43
|
async close() {
|
|
45
44
|
if (this.pool) {
|
|
46
45
|
await this.pool.end()
|
|
@@ -48,6 +47,10 @@ export class PostgresAdapter extends DatabaseAdapter {
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
quoteIdentifier(name) {
|
|
51
|
+
return `"${name.replace(/"/g, '""')}"`
|
|
52
|
+
}
|
|
53
|
+
|
|
51
54
|
ensureConnected() {
|
|
52
55
|
if (!this.pool) {
|
|
53
56
|
throw new Error('PostgresAdapter is not connected. Call connect() first.')
|
|
@@ -32,6 +32,10 @@ export class SqliteAdapter extends DatabaseAdapter {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
quoteIdentifier(name) {
|
|
36
|
+
return `"${name.replace(/"/g, '""')}"`
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
ensureConnected() {
|
|
36
40
|
if (!this.db) {
|
|
37
41
|
throw new Error('SqliteAdapter is not connected. Call connect() first.')
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import pg from 'pg'
|
|
2
|
+
import mysql from 'mysql2/promise'
|
|
3
|
+
|
|
4
|
+
export async function ensureDatabaseExists(databaseConfig) {
|
|
5
|
+
const { driver } = databaseConfig
|
|
6
|
+
if (driver === 'postgres') {
|
|
7
|
+
await ensurePostgresDatabase(databaseConfig)
|
|
8
|
+
} else if (driver === 'mysql') {
|
|
9
|
+
await ensureMysqlDatabase(databaseConfig)
|
|
10
|
+
}
|
|
11
|
+
// sqlite: the file is created automatically on connect, nothing to do here.
|
|
12
|
+
// mongodb: databases/collections are created lazily on first write, nothing to do here.
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function ensurePostgresDatabase({
|
|
16
|
+
connectionString,
|
|
17
|
+
host,
|
|
18
|
+
port,
|
|
19
|
+
user,
|
|
20
|
+
password,
|
|
21
|
+
database,
|
|
22
|
+
}) {
|
|
23
|
+
// A connection string can already point at a specific target db and
|
|
24
|
+
// may not even include a "postgres" admin database to fall back to --
|
|
25
|
+
// safest to skip auto-create rather than guess at rewriting it.
|
|
26
|
+
if (connectionString) return
|
|
27
|
+
|
|
28
|
+
const adminPool = new pg.Pool({
|
|
29
|
+
host,
|
|
30
|
+
port,
|
|
31
|
+
user,
|
|
32
|
+
password,
|
|
33
|
+
database: 'postgres',
|
|
34
|
+
})
|
|
35
|
+
try {
|
|
36
|
+
const { rows } = await adminPool.query(
|
|
37
|
+
'SELECT 1 FROM pg_database WHERE datname = $1',
|
|
38
|
+
[database],
|
|
39
|
+
)
|
|
40
|
+
if (rows.length === 0) {
|
|
41
|
+
// Postgres doesn't support "CREATE DATABASE IF NOT EXISTS", and
|
|
42
|
+
// database names can't be parameterized -- quote defensively.
|
|
43
|
+
await adminPool.query(`CREATE DATABASE "${database.replace(/"/g, '""')}"`)
|
|
44
|
+
}
|
|
45
|
+
} finally {
|
|
46
|
+
await adminPool.end()
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function ensureMysqlDatabase({ host, port, user, password, database }) {
|
|
51
|
+
const connection = await mysql.createConnection({
|
|
52
|
+
host,
|
|
53
|
+
port,
|
|
54
|
+
user,
|
|
55
|
+
password,
|
|
56
|
+
})
|
|
57
|
+
try {
|
|
58
|
+
await connection.query(
|
|
59
|
+
`CREATE DATABASE IF NOT EXISTS \`${database.replace(/`/g, '``')}\``,
|
|
60
|
+
)
|
|
61
|
+
} finally {
|
|
62
|
+
await connection.end()
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./adapters/DatabaseAdapter.js";
|
|
2
|
+
export * from "./adapters/SqliteAdapter.js";
|
|
3
|
+
export * from "./adapters/PostgresAdapter.js";
|
|
4
|
+
export * from "./model/ConnectionManager.js";
|
|
5
|
+
export * from "./model/Model.js";
|
|
6
|
+
export * from "./adapters/AdapterFactory.js";
|
|
7
|
+
export * from "./adapters/MysqlAdapter.js";
|
|
8
|
+
export * from "./adapters/MongoAdapter.js";
|
|
9
|
+
export * from "./query/QueryBuilder.js";
|
|
10
|
+
export * from "./query/buildSelectSql.js";
|
|
11
|
+
export * from "./query/types.js";
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './adapters/DatabaseAdapter.js'
|
|
2
|
+
export * from './adapters/SqliteAdapter.js'
|
|
3
|
+
export * from './adapters/PostgresAdapter.js'
|
|
4
|
+
export * from './model/ConnectionManager.js'
|
|
5
|
+
export * from './model/Model.js'
|
|
6
|
+
export * from './adapters/AdapterFactory.js'
|
|
7
|
+
export * from './adapters/MysqlAdapter.js'
|
|
8
|
+
export * from './adapters/MongoAdapter.js'
|
|
9
|
+
export * from './query/QueryBuilder.js'
|
|
10
|
+
export * from './query/buildSelectSql.js'
|
|
11
|
+
export * from './ensureDatabaseExists.js'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// orm/src/model/Model.d.ts
|
|
2
|
+
import { QueryBuilder } from '../query/QueryBuilder.js';
|
|
3
|
+
|
|
4
|
+
interface PaginateOptions {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
where?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface PaginateResult<T> {
|
|
11
|
+
data: T[];
|
|
12
|
+
meta: {
|
|
13
|
+
page: number;
|
|
14
|
+
limit: number;
|
|
15
|
+
total: number;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare class Model {
|
|
21
|
+
static table: string | null;
|
|
22
|
+
static fillable: string[];
|
|
23
|
+
static timestamps: boolean;
|
|
24
|
+
|
|
25
|
+
static getTable(): string;
|
|
26
|
+
static getAdapter(): unknown;
|
|
27
|
+
|
|
28
|
+
static all(): Promise<Record<string, unknown>[]>;
|
|
29
|
+
static query(): QueryBuilder<Record<string, unknown>>;
|
|
30
|
+
static paginate(options?: PaginateOptions): Promise<PaginateResult<Record<string, unknown>>>;
|
|
31
|
+
static find(id: number | string): Promise<Record<string, unknown> | null>;
|
|
32
|
+
static create(data: Record<string, unknown>): Promise<Record<string, unknown> | null>;
|
|
33
|
+
static update(id: number | string, data: Record<string, unknown>): Promise<Record<string, unknown> | null>;
|
|
34
|
+
static delete(id: number | string): Promise<boolean>;
|
|
35
|
+
|
|
36
|
+
static belongsTo(
|
|
37
|
+
row: Record<string, unknown> | null,
|
|
38
|
+
foreignKey: string,
|
|
39
|
+
RelatedModel: typeof Model,
|
|
40
|
+
): Promise<Record<string, unknown> | null>;
|
|
41
|
+
static hasMany(
|
|
42
|
+
row: { id: number },
|
|
43
|
+
RelatedModel: typeof Model,
|
|
44
|
+
foreignKey: string,
|
|
45
|
+
): Promise<Record<string, unknown>[]>;
|
|
46
|
+
|
|
47
|
+
static first(): Promise<Record<string, unknown> | null>;
|
|
48
|
+
static count(): Promise<number>;
|
|
49
|
+
}
|
package/src/model/Model.js
CHANGED
|
@@ -30,14 +30,18 @@ export class Model {
|
|
|
30
30
|
return new QueryBuilder(this)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
static async paginate({ page = 1, limit = 20 } = {}) {
|
|
34
|
-
const adapter = ConnectionManager.getAdapter()
|
|
33
|
+
static async paginate({ page = 1, limit = 20, where = {} } = {}) {
|
|
35
34
|
const safePage = Math.max(1, Math.floor(page))
|
|
36
35
|
const safeLimit = Math.max(1, Math.min(100, Math.floor(limit)))
|
|
37
36
|
const offset = (safePage - 1) * safeLimit
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
const
|
|
38
|
+
let query = this.query()
|
|
39
|
+
for (const [field, value] of Object.entries(where)) {
|
|
40
|
+
query = query.where(field, value)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const total = await query.count()
|
|
44
|
+
const data = await query.limit(safeLimit).offset(offset).get()
|
|
41
45
|
|
|
42
46
|
return {
|
|
43
47
|
data,
|
|
@@ -49,7 +53,6 @@ export class Model {
|
|
|
49
53
|
},
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
|
|
53
56
|
static async find(id) {
|
|
54
57
|
const adapter = ConnectionManager.getAdapter()
|
|
55
58
|
return adapter.get(`SELECT * FROM ${this.getTable()} WHERE id = ?`, [id])
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WhereClause, QueryDescriptor } from './types.js';
|
|
2
|
+
|
|
3
|
+
export declare class QueryBuilder<TRow> {
|
|
4
|
+
constructor(ModelClass: { getAdapter(): unknown; getTable(): string });
|
|
5
|
+
|
|
6
|
+
where(field: string, value: unknown): this;
|
|
7
|
+
where(field: string, operator: WhereClause['operator'], value: unknown): this;
|
|
8
|
+
orderBy(field: string, direction?: 'ASC' | 'DESC'): this;
|
|
9
|
+
limit(value: number): this;
|
|
10
|
+
offset(value: number): this;
|
|
11
|
+
toDescriptor(): QueryDescriptor;
|
|
12
|
+
|
|
13
|
+
get(): Promise<TRow[]>;
|
|
14
|
+
first(): Promise<TRow | null>;
|
|
15
|
+
count(): Promise<number>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/query/types.d.ts
|
|
2
|
+
export interface WhereClause {
|
|
3
|
+
field: string
|
|
4
|
+
operator: '=' | '!=' | '>' | '<' | '>=' | '<='
|
|
5
|
+
value: unknown
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface OrderClause {
|
|
9
|
+
field: string
|
|
10
|
+
direction: 'ASC' | 'DESC'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface QueryDescriptor {
|
|
14
|
+
wheres: WhereClause[]
|
|
15
|
+
orders: OrderClause[]
|
|
16
|
+
limitValue?: number
|
|
17
|
+
offsetValue?: number
|
|
18
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export interface ColumnBuilder {
|
|
4
|
+
unique(): void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface TableBuilder {
|
|
8
|
+
increments(name: string): ColumnBuilder;
|
|
9
|
+
string(name: string): ColumnBuilder;
|
|
10
|
+
text(name: string): ColumnBuilder;
|
|
11
|
+
boolean(name: string): ColumnBuilder;
|
|
12
|
+
integer(name: string): ColumnBuilder;
|
|
13
|
+
date(name: string): ColumnBuilder;
|
|
14
|
+
datetime(name: string): ColumnBuilder;
|
|
15
|
+
json(name: string): ColumnBuilder;
|
|
16
|
+
timestamps(): void;
|
|
17
|
+
// present only in alterTable's callback, absent from createTable's
|
|
18
|
+
dropColumn?(name: string): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Schema {
|
|
22
|
+
createTable(tableName: string, callback: (table: TableBuilder) => void | Promise<void>): Promise<void>;
|
|
23
|
+
dropTable(tableName: string): Promise<void>;
|
|
24
|
+
alterTable(tableName: string, callback: (table: TableBuilder) => void | Promise<void>): Promise<void>;
|
|
25
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"checkJs": false,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"]
|
|
14
|
+
}
|