@kubun/db-expo 0.2.0
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/LICENSE.md +57 -0
- package/README.md +11 -0
- package/lib/driver.d.ts +54 -0
- package/lib/driver.d.ts.map +1 -0
- package/lib/driver.js +139 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/serialize.d.ts +3 -0
- package/lib/serialize.d.ts.map +1 -0
- package/lib/serialize.js +27 -0
- package/package.json +32 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# The Prosperity Public License 3.0.0
|
|
2
|
+
|
|
3
|
+
Contributor: Paul Le Cam
|
|
4
|
+
|
|
5
|
+
Source Code: https://github.com/PaulLeCam/kubun
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This license allows you to use and share this software for noncommercial purposes for free and to try this software for commercial purposes for thirty days.
|
|
10
|
+
|
|
11
|
+
## Agreement
|
|
12
|
+
|
|
13
|
+
In order to receive this license, you have to agree to its rules. Those rules are both obligations under that agreement and conditions to your license. Don't do anything with this software that triggers a rule you can't or won't follow.
|
|
14
|
+
|
|
15
|
+
## Notices
|
|
16
|
+
|
|
17
|
+
Make sure everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license and the contributor and source code lines above.
|
|
18
|
+
|
|
19
|
+
## Commercial Trial
|
|
20
|
+
|
|
21
|
+
Limit your use of this software for commercial purposes to a thirty-day trial period. If you use this software for work, your company gets one trial period for all personnel, not one trial per person.
|
|
22
|
+
|
|
23
|
+
## Contributions Back
|
|
24
|
+
|
|
25
|
+
Developing feedback, changes, or additions that you contribute back to the contributor on the terms of a standardized public software license such as [the Blue Oak Model License 1.0.0](https://blueoakcouncil.org/license/1.0.0), [the Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html), [the MIT license](https://spdx.org/licenses/MIT.html), or [the two-clause BSD license](https://spdx.org/licenses/BSD-2-Clause.html) doesn't count as use for a commercial purpose.
|
|
26
|
+
|
|
27
|
+
## Personal Uses
|
|
28
|
+
|
|
29
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, doesn't count as use for a commercial purpose.
|
|
30
|
+
|
|
31
|
+
## Noncommercial Organizations
|
|
32
|
+
|
|
33
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution doesn't count as use for a commercial purpose regardless of the source of funding or obligations resulting from the funding.
|
|
34
|
+
|
|
35
|
+
## Defense
|
|
36
|
+
|
|
37
|
+
Don't make any legal claim against anyone accusing this software, with or without changes, alone or with other technology, of infringing any patent.
|
|
38
|
+
|
|
39
|
+
## Copyright
|
|
40
|
+
|
|
41
|
+
The contributor licenses you to do everything with this software that would otherwise infringe their copyright in it.
|
|
42
|
+
|
|
43
|
+
## Patent
|
|
44
|
+
|
|
45
|
+
The contributor licenses you to do everything with this software that would otherwise infringe any patents they can license or become able to license.
|
|
46
|
+
|
|
47
|
+
## Reliability
|
|
48
|
+
|
|
49
|
+
The contributor can't revoke this license.
|
|
50
|
+
|
|
51
|
+
## Excuse
|
|
52
|
+
|
|
53
|
+
You're excused for unknowingly breaking [Notices](#notices) if you take all practical steps to comply within thirty days of learning you broke the rule.
|
|
54
|
+
|
|
55
|
+
## No Liability
|
|
56
|
+
|
|
57
|
+
***As far as the law allows, this software comes as is, without any warranty or condition, and the contributor won't be liable to anyone for any damages related to this software or this license, under any kind of legal claim.***
|
package/README.md
ADDED
package/lib/driver.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as SQLite from 'expo-sqlite';
|
|
2
|
+
import { type CompiledQuery, type DatabaseConnection, type DatabaseIntrospector, type Dialect, type DialectAdapter, type Driver, type Kysely, type QueryCompiler, type QueryResult } from 'kysely';
|
|
3
|
+
export type ExpoDialectParams = {
|
|
4
|
+
database: string;
|
|
5
|
+
disableForeignKeys?: boolean;
|
|
6
|
+
disableStrictModeCreateTable?: boolean;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
onError?: (message: string, exception: unknown) => void;
|
|
9
|
+
};
|
|
10
|
+
export type ExpoDialectConfig = ExpoDialectParams & {
|
|
11
|
+
disableForeignKeys?: boolean;
|
|
12
|
+
disableStrictModeCreateTable?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Expo dialect for Kysely.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ExpoDialect implements Dialect {
|
|
18
|
+
config: ExpoDialectConfig;
|
|
19
|
+
constructor(config: ExpoDialectParams);
|
|
20
|
+
createDriver(): ExpoDriver;
|
|
21
|
+
createQueryCompiler(): QueryCompiler;
|
|
22
|
+
createAdapter(): DialectAdapter;
|
|
23
|
+
createIntrospector(db: Kysely<unknown>): DatabaseIntrospector;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Expo driver for Kysely.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ExpoDriver implements Driver {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(config: ExpoDialectConfig);
|
|
31
|
+
releaseConnection(): Promise<void>;
|
|
32
|
+
init(): Promise<void>;
|
|
33
|
+
acquireConnection(): Promise<ExpoConnection>;
|
|
34
|
+
beginTransaction(connection: ExpoConnection): Promise<void>;
|
|
35
|
+
commitTransaction(connection: ExpoConnection): Promise<void>;
|
|
36
|
+
rollbackTransaction(connection: ExpoConnection): Promise<void>;
|
|
37
|
+
destroy(): Promise<void>;
|
|
38
|
+
getDatabaseRuntimeVersion(): Promise<any>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Expo connection for Kysely.
|
|
42
|
+
*/
|
|
43
|
+
declare class ExpoConnection implements DatabaseConnection {
|
|
44
|
+
sqlite: SQLite.SQLiteDatabase;
|
|
45
|
+
debug: boolean;
|
|
46
|
+
config: ExpoDialectConfig;
|
|
47
|
+
constructor(config: ExpoDialectConfig);
|
|
48
|
+
closeConnection(): Promise<void>;
|
|
49
|
+
executeQuery<R>(compiledQuery: CompiledQuery): Promise<QueryResult<R>>;
|
|
50
|
+
directQuery<T>(query: string): Promise<Array<T>>;
|
|
51
|
+
streamQuery<R>(compiledQuery: CompiledQuery, chunkSize?: number): AsyncIterableIterator<QueryResult<R>>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAIjB,MAAM,QAAQ,CAAA;AAIf,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,4BAA4B,CAAC,EAAE,OAAO,CAAA;CACvC,CAAA;AAED;;GAEG;AACH,qBAAa,WAAY,YAAW,OAAO;IACzC,MAAM,EAAE,iBAAiB,CAAA;gBAEb,MAAM,EAAE,iBAAiB;IAIrC,YAAY,IAAI,UAAU;IAI1B,mBAAmB,IAAI,aAAa;IAIpC,aAAa,IAAI,cAAc;IAI/B,kBAAkB,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,oBAAoB;CAG9D;AAED;;GAEG;AACH,qBAAa,UAAW,YAAW,MAAM;;gBAI3B,MAAM,EAAE,iBAAiB;IAI/B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;IAK5C,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,mBAAmB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,yBAAyB;CAUhC;AAED;;GAEG;AACH,cAAM,cAAe,YAAW,kBAAkB;IAChD,MAAM,EAAE,MAAM,CAAC,cAAc,CAAA;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,iBAAiB,CAAA;gBAEb,MAAM,EAAE,iBAAiB;IAa/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA2CtE,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAItD,WAAW,CAAC,CAAC,EACX,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,MAAM,GACjB,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAGzC"}
|
package/lib/driver.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as SQLite from 'expo-sqlite';
|
|
2
|
+
// Adapted from https://github.com/mphill/kysely-expo/blob/main/src/driver.ts
|
|
3
|
+
import { SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler } from 'kysely';
|
|
4
|
+
import { serialize } from './serialize.js';
|
|
5
|
+
/**
|
|
6
|
+
* Expo dialect for Kysely.
|
|
7
|
+
*/ export class ExpoDialect {
|
|
8
|
+
config;
|
|
9
|
+
constructor(config){
|
|
10
|
+
this.config = {
|
|
11
|
+
...config,
|
|
12
|
+
disableStrictModeCreateTable: true
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
createDriver() {
|
|
16
|
+
return new ExpoDriver(this.config);
|
|
17
|
+
}
|
|
18
|
+
createQueryCompiler() {
|
|
19
|
+
return new SqliteQueryCompiler();
|
|
20
|
+
}
|
|
21
|
+
createAdapter() {
|
|
22
|
+
return new SqliteAdapter();
|
|
23
|
+
}
|
|
24
|
+
createIntrospector(db) {
|
|
25
|
+
return new SqliteIntrospector(db);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Expo driver for Kysely.
|
|
30
|
+
*/ export class ExpoDriver {
|
|
31
|
+
#connectionMutex = new ConnectionMutex();
|
|
32
|
+
#connection;
|
|
33
|
+
constructor(config){
|
|
34
|
+
this.#connection = new ExpoConnection(config);
|
|
35
|
+
}
|
|
36
|
+
async releaseConnection() {
|
|
37
|
+
this.#connectionMutex.unlock();
|
|
38
|
+
}
|
|
39
|
+
async init() {}
|
|
40
|
+
async acquireConnection() {
|
|
41
|
+
await this.#connectionMutex.lock();
|
|
42
|
+
return this.#connection;
|
|
43
|
+
}
|
|
44
|
+
async beginTransaction(connection) {
|
|
45
|
+
await connection.directQuery('begin transaction');
|
|
46
|
+
}
|
|
47
|
+
async commitTransaction(connection) {
|
|
48
|
+
await connection.directQuery('commit');
|
|
49
|
+
}
|
|
50
|
+
async rollbackTransaction(connection) {
|
|
51
|
+
await connection.directQuery('rollback');
|
|
52
|
+
}
|
|
53
|
+
async destroy() {
|
|
54
|
+
this.#connection.closeConnection();
|
|
55
|
+
}
|
|
56
|
+
async getDatabaseRuntimeVersion() {
|
|
57
|
+
try {
|
|
58
|
+
const res = await this.#connection.directQuery('select sqlite_version() as version;');
|
|
59
|
+
//@ts-ignore
|
|
60
|
+
return res[0].version;
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.error(e);
|
|
63
|
+
return 'unknown';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Expo connection for Kysely.
|
|
69
|
+
*/ class ExpoConnection {
|
|
70
|
+
sqlite;
|
|
71
|
+
debug;
|
|
72
|
+
config;
|
|
73
|
+
constructor(config){
|
|
74
|
+
this.sqlite = SQLite.openDatabaseSync(config.database);
|
|
75
|
+
this.debug = config.debug ?? false;
|
|
76
|
+
this.config = config;
|
|
77
|
+
if (this.config.disableForeignKeys) {
|
|
78
|
+
this.sqlite.execSync('PRAGMA foreign_keys = OFF;');
|
|
79
|
+
} else {
|
|
80
|
+
this.sqlite.execSync('PRAGMA foreign_keys = ON;');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async closeConnection() {
|
|
84
|
+
return this.sqlite.closeAsync();
|
|
85
|
+
}
|
|
86
|
+
async executeQuery(compiledQuery) {
|
|
87
|
+
let { sql, parameters, query } = compiledQuery;
|
|
88
|
+
// Kysely uses varchar(255) as the default string type for migrations which is not supported by STRICT mode.
|
|
89
|
+
if (query.kind === 'CreateTableNode' && !sql.includes('kysely_migration') && !sql.includes('kysely_migration_lock') && !sql.includes('STRICT') && !this.config.disableStrictModeCreateTable) {
|
|
90
|
+
sql += ' STRICT';
|
|
91
|
+
}
|
|
92
|
+
const readonly = query.kind === 'SelectQueryNode' || query.kind === 'RawNode';
|
|
93
|
+
const transformedParameters = serialize([
|
|
94
|
+
...parameters
|
|
95
|
+
]);
|
|
96
|
+
if (this.debug) {
|
|
97
|
+
console.debug(`${query.kind}${readonly ? ' (readonly)' : ''}: ${sql}`);
|
|
98
|
+
}
|
|
99
|
+
if (readonly) {
|
|
100
|
+
const res = await this.sqlite.getAllAsync(sql, transformedParameters);
|
|
101
|
+
return {
|
|
102
|
+
rows: res
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const res = await this.sqlite.runAsync(sql, transformedParameters);
|
|
106
|
+
const queryResult = {
|
|
107
|
+
numUpdatedOrDeletedRows: BigInt(res.changes),
|
|
108
|
+
numAffectedRows: BigInt(res.changes),
|
|
109
|
+
insertId: BigInt(res.lastInsertRowId),
|
|
110
|
+
rows: []
|
|
111
|
+
};
|
|
112
|
+
if (this.debug) console.log('queryResult', queryResult);
|
|
113
|
+
return queryResult;
|
|
114
|
+
}
|
|
115
|
+
async directQuery(query) {
|
|
116
|
+
return await this.sqlite.getAllAsync(query, []);
|
|
117
|
+
}
|
|
118
|
+
streamQuery(compiledQuery, chunkSize) {
|
|
119
|
+
throw new Error('Expo SQLite driver does not support iterate on prepared statements');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
class ConnectionMutex {
|
|
123
|
+
#promise;
|
|
124
|
+
#resolve;
|
|
125
|
+
async lock() {
|
|
126
|
+
while(this.#promise){
|
|
127
|
+
await this.#promise;
|
|
128
|
+
}
|
|
129
|
+
this.#promise = new Promise((resolve)=>{
|
|
130
|
+
this.#resolve = resolve;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
unlock() {
|
|
134
|
+
const resolve = this.#resolve;
|
|
135
|
+
this.#promise = undefined;
|
|
136
|
+
this.#resolve = undefined;
|
|
137
|
+
resolve?.();
|
|
138
|
+
}
|
|
139
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractSQLiteAdapter, type Adapter } from '@kubun/db-adapter';
|
|
2
|
+
import type { Dialect } from 'kysely';
|
|
3
|
+
import { type ExpoDialectParams } from './driver.js';
|
|
4
|
+
export type AdapterParams = ExpoDialectParams;
|
|
5
|
+
export declare class ExpoAdapter extends AbstractSQLiteAdapter implements Adapter {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(params: AdapterParams);
|
|
8
|
+
get dialect(): Dialect;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAA;AAE7C,qBAAa,WAAY,SAAQ,qBAAsB,YAAW,OAAO;;gBAG3D,MAAM,EAAE,aAAa;IAKjC,IAAI,OAAO,IAAI,OAAO,CAErB;CACF"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractSQLiteAdapter } from '@kubun/db-adapter';
|
|
2
|
+
import { ExpoDialect } from './driver.js';
|
|
3
|
+
export class ExpoAdapter extends AbstractSQLiteAdapter {
|
|
4
|
+
#dialect;
|
|
5
|
+
constructor(params){
|
|
6
|
+
super();
|
|
7
|
+
this.#dialect = new ExpoDialect(params);
|
|
8
|
+
}
|
|
9
|
+
get dialect() {
|
|
10
|
+
return this.#dialect;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,wBAAgB,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,CAyB5E"}
|
package/lib/serialize.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function serialize(parameters) {
|
|
2
|
+
return parameters.map((parameter)=>{
|
|
3
|
+
if (typeof parameter === 'string') {
|
|
4
|
+
return parameter.toString();
|
|
5
|
+
}
|
|
6
|
+
if (parameter instanceof Date) {
|
|
7
|
+
return parameter.toISOString();
|
|
8
|
+
}
|
|
9
|
+
if (typeof parameter === 'number') {
|
|
10
|
+
return parameter;
|
|
11
|
+
}
|
|
12
|
+
if (parameter instanceof Uint8Array) {
|
|
13
|
+
return parameter;
|
|
14
|
+
}
|
|
15
|
+
if (parameter === null || parameter === undefined) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (typeof parameter === 'object') {
|
|
19
|
+
return JSON.stringify(parameter);
|
|
20
|
+
}
|
|
21
|
+
if (typeof parameter === 'boolean') {
|
|
22
|
+
return parameter ? 'true' : 'false' // SQLite booleans must be stored a strings.
|
|
23
|
+
;
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`Unknown type: ${typeof parameter}`);
|
|
26
|
+
});
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kubun/db-expo",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "see LICENSE.md",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./lib/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"lib/*",
|
|
14
|
+
"LICENSE.md"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"expo-sqlite": "~15.1.2",
|
|
19
|
+
"kysely": "^0.27.6",
|
|
20
|
+
"@kubun/db-adapter": "^0.2.0"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build:clean": "del lib",
|
|
24
|
+
"build:js": "swc src -d ./lib --config-file ../../swc.json --strip-leading-paths",
|
|
25
|
+
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
|
|
26
|
+
"build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
|
|
27
|
+
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|
|
28
|
+
"test:types": "tsc --noEmit",
|
|
29
|
+
"test:unit": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
|
|
30
|
+
"test": "pnpm run test:types && pnpm run test:unit"
|
|
31
|
+
}
|
|
32
|
+
}
|