@boostkit/storage 0.0.1
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 +21 -0
- package/README.md +53 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +163 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 BoostKit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @boostkit/storage
|
|
2
|
+
|
|
3
|
+
Storage facade, disk registry, and provider factory with a local filesystem driver.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @boostkit/storage
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// bootstrap/providers.ts
|
|
15
|
+
import { storage } from '@boostkit/storage'
|
|
16
|
+
import configs from '../config/index.js'
|
|
17
|
+
|
|
18
|
+
export default [
|
|
19
|
+
storage(configs.storage),
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
import { Storage } from '@boostkit/storage'
|
|
23
|
+
await Storage.put('avatars/a.txt', 'hello')
|
|
24
|
+
const text = await Storage.text('avatars/a.txt')
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API Reference
|
|
28
|
+
|
|
29
|
+
- `StorageAdapter`, `StorageAdapterProvider`
|
|
30
|
+
- `StorageRegistry`
|
|
31
|
+
- `Storage`
|
|
32
|
+
- `LocalDiskConfig`
|
|
33
|
+
- `StorageDiskConfig`, `StorageConfig`
|
|
34
|
+
- `storage(config)`
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
- `StorageConfig`
|
|
39
|
+
- `default`
|
|
40
|
+
- `disks`
|
|
41
|
+
- `StorageDiskConfig`
|
|
42
|
+
- `driver`
|
|
43
|
+
- additional driver-specific keys
|
|
44
|
+
- `LocalDiskConfig`
|
|
45
|
+
- `driver` (`'local'`)
|
|
46
|
+
- `root`
|
|
47
|
+
- `baseUrl?`
|
|
48
|
+
|
|
49
|
+
## Notes
|
|
50
|
+
|
|
51
|
+
- Built-in driver: `local`.
|
|
52
|
+
- Plugin driver supported by factory: `s3` (via `@boostkit/storage-s3`).
|
|
53
|
+
- Registers `storage:link` artisan command.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ServiceProvider, type Application } from '@boostkit/core';
|
|
2
|
+
export interface StorageAdapter {
|
|
3
|
+
/** Write a file. Creates parent directories as needed. */
|
|
4
|
+
put(filePath: string, contents: Buffer | string): Promise<void>;
|
|
5
|
+
/** Read a file. Returns null if it doesn't exist. */
|
|
6
|
+
get(filePath: string): Promise<Buffer | null>;
|
|
7
|
+
/** Read a file as a UTF-8 string. Returns null if it doesn't exist. */
|
|
8
|
+
text(filePath: string): Promise<string | null>;
|
|
9
|
+
/** Delete a file. No-op if it doesn't exist. */
|
|
10
|
+
delete(filePath: string): Promise<void>;
|
|
11
|
+
/** Check if a file exists. */
|
|
12
|
+
exists(filePath: string): Promise<boolean>;
|
|
13
|
+
/** List files in a directory (relative paths). */
|
|
14
|
+
list(directory?: string): Promise<string[]>;
|
|
15
|
+
/** Public URL for the file. */
|
|
16
|
+
url(filePath: string): string;
|
|
17
|
+
/** Absolute filesystem path. Throws for remote drivers. */
|
|
18
|
+
path(filePath: string): string;
|
|
19
|
+
}
|
|
20
|
+
export interface StorageAdapterProvider {
|
|
21
|
+
create(): StorageAdapter | Promise<StorageAdapter>;
|
|
22
|
+
}
|
|
23
|
+
export declare class StorageRegistry {
|
|
24
|
+
private static readonly adapters;
|
|
25
|
+
private static defaultDisk;
|
|
26
|
+
static set(name: string, adapter: StorageAdapter): void;
|
|
27
|
+
static setDefault(name: string): void;
|
|
28
|
+
static get(name?: string): StorageAdapter;
|
|
29
|
+
}
|
|
30
|
+
export declare class Storage {
|
|
31
|
+
/** Access a named disk, e.g. Storage.disk('s3').put(...) */
|
|
32
|
+
static disk(name: string): StorageAdapter;
|
|
33
|
+
static put(filePath: string, contents: Buffer | string): Promise<void>;
|
|
34
|
+
static get(filePath: string): Promise<Buffer | null>;
|
|
35
|
+
static text(filePath: string): Promise<string | null>;
|
|
36
|
+
static delete(filePath: string): Promise<void>;
|
|
37
|
+
static exists(filePath: string): Promise<boolean>;
|
|
38
|
+
static list(directory?: string): Promise<string[]>;
|
|
39
|
+
static url(filePath: string): string;
|
|
40
|
+
static path(filePath: string): string;
|
|
41
|
+
}
|
|
42
|
+
export interface LocalDiskConfig {
|
|
43
|
+
driver: 'local';
|
|
44
|
+
root: string;
|
|
45
|
+
baseUrl?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface StorageDiskConfig {
|
|
48
|
+
driver: string;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
export interface StorageConfig {
|
|
52
|
+
/** The default disk name */
|
|
53
|
+
default: string;
|
|
54
|
+
/** Named disk configurations */
|
|
55
|
+
disks: Record<string, StorageDiskConfig>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns a StorageServiceProvider that boots all configured disks.
|
|
59
|
+
*
|
|
60
|
+
* Built-in drivers: local (writes to filesystem)
|
|
61
|
+
* Plugin drivers: s3 (@boostkit/storage-s3) — AWS S3 + S3-compatible (MinIO, R2)
|
|
62
|
+
*
|
|
63
|
+
* Usage in bootstrap/providers.ts:
|
|
64
|
+
* import { storage } from '@boostkit/storage'
|
|
65
|
+
* import configs from '../config/index.js'
|
|
66
|
+
* export default [..., storage(configs.storage), ...]
|
|
67
|
+
*/
|
|
68
|
+
export declare function storage(config: StorageConfig): new (app: Application) => ServiceProvider;
|
|
69
|
+
//# 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,eAAe,EAAW,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAO3E,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D,qDAAqD;IACrD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAE7C,uEAAuE;IACvE,IAAI,CAAC,QAAQ,EA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M,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IACrD,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IACjD,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAClD,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IACpC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CACtC;AAID,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAI,OAAO,CAAA;IACjB,IAAI,EAAM,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAsDD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CACzC;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,KAAK,GAAG,EAAE,WAAW,KAAK,eAAe,CAwDxF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ServiceProvider, artisan } from '@boostkit/core';
|
|
2
|
+
import { resolveOptionalPeer } from '@boostkit/core';
|
|
3
|
+
import nodePath from 'node:path';
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
5
|
+
// ─── Storage Registry ──────────────────────────────────────
|
|
6
|
+
export class StorageRegistry {
|
|
7
|
+
static adapters = new Map();
|
|
8
|
+
static defaultDisk = 'local';
|
|
9
|
+
static set(name, adapter) { this.adapters.set(name, adapter); }
|
|
10
|
+
static setDefault(name) { this.defaultDisk = name; }
|
|
11
|
+
static get(name) {
|
|
12
|
+
const key = name ?? this.defaultDisk;
|
|
13
|
+
const a = this.adapters.get(key);
|
|
14
|
+
if (!a)
|
|
15
|
+
throw new Error(`[BoostKit Storage] Disk "${key}" not found. Check your storage config.`);
|
|
16
|
+
return a;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// ─── Storage Facade ────────────────────────────────────────
|
|
20
|
+
export class Storage {
|
|
21
|
+
/** Access a named disk, e.g. Storage.disk('s3').put(...) */
|
|
22
|
+
static disk(name) { return StorageRegistry.get(name); }
|
|
23
|
+
static put(filePath, contents) {
|
|
24
|
+
return StorageRegistry.get().put(filePath, contents);
|
|
25
|
+
}
|
|
26
|
+
static get(filePath) { return StorageRegistry.get().get(filePath); }
|
|
27
|
+
static text(filePath) { return StorageRegistry.get().text(filePath); }
|
|
28
|
+
static delete(filePath) { return StorageRegistry.get().delete(filePath); }
|
|
29
|
+
static exists(filePath) { return StorageRegistry.get().exists(filePath); }
|
|
30
|
+
static list(directory) { return StorageRegistry.get().list(directory); }
|
|
31
|
+
static url(filePath) { return StorageRegistry.get().url(filePath); }
|
|
32
|
+
static path(filePath) { return StorageRegistry.get().path(filePath); }
|
|
33
|
+
}
|
|
34
|
+
class LocalAdapter {
|
|
35
|
+
root;
|
|
36
|
+
baseUrl;
|
|
37
|
+
constructor(config) {
|
|
38
|
+
this.root = nodePath.resolve(config.root);
|
|
39
|
+
this.baseUrl = config.baseUrl?.replace(/\/$/, '') ?? '/storage';
|
|
40
|
+
}
|
|
41
|
+
abs(filePath) {
|
|
42
|
+
return nodePath.join(this.root, filePath);
|
|
43
|
+
}
|
|
44
|
+
async put(filePath, contents) {
|
|
45
|
+
const abs = this.abs(filePath);
|
|
46
|
+
await fs.mkdir(nodePath.dirname(abs), { recursive: true });
|
|
47
|
+
await fs.writeFile(abs, contents);
|
|
48
|
+
}
|
|
49
|
+
async get(filePath) {
|
|
50
|
+
try {
|
|
51
|
+
return await fs.readFile(this.abs(filePath));
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async text(filePath) {
|
|
58
|
+
const buf = await this.get(filePath);
|
|
59
|
+
return buf ? buf.toString('utf8') : null;
|
|
60
|
+
}
|
|
61
|
+
async delete(filePath) {
|
|
62
|
+
try {
|
|
63
|
+
await fs.unlink(this.abs(filePath));
|
|
64
|
+
}
|
|
65
|
+
catch { /* no-op */ }
|
|
66
|
+
}
|
|
67
|
+
async exists(filePath) {
|
|
68
|
+
try {
|
|
69
|
+
await fs.access(this.abs(filePath));
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async list(directory = '') {
|
|
77
|
+
try {
|
|
78
|
+
const entries = await fs.readdir(this.abs(directory), { withFileTypes: true });
|
|
79
|
+
return entries
|
|
80
|
+
.filter(e => e.isFile())
|
|
81
|
+
.map(e => nodePath.join(directory, e.name).replace(/\\/g, '/'));
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
url(filePath) { return `${this.baseUrl}/${filePath.replace(/^\//, '')}`; }
|
|
88
|
+
path(filePath) { return this.abs(filePath); }
|
|
89
|
+
}
|
|
90
|
+
// ─── Helpers ───────────────────────────────────────────────
|
|
91
|
+
function makeUnavailableAdapter(msg) {
|
|
92
|
+
const reject = () => Promise.reject(new Error(msg));
|
|
93
|
+
const throws = () => { throw new Error(msg); };
|
|
94
|
+
return { put: reject, get: reject, text: reject, delete: reject, exists: reject, list: reject, url: throws, path: throws };
|
|
95
|
+
}
|
|
96
|
+
// ─── Service Provider Factory ──────────────────────────────
|
|
97
|
+
/**
|
|
98
|
+
* Returns a StorageServiceProvider that boots all configured disks.
|
|
99
|
+
*
|
|
100
|
+
* Built-in drivers: local (writes to filesystem)
|
|
101
|
+
* Plugin drivers: s3 (@boostkit/storage-s3) — AWS S3 + S3-compatible (MinIO, R2)
|
|
102
|
+
*
|
|
103
|
+
* Usage in bootstrap/providers.ts:
|
|
104
|
+
* import { storage } from '@boostkit/storage'
|
|
105
|
+
* import configs from '../config/index.js'
|
|
106
|
+
* export default [..., storage(configs.storage), ...]
|
|
107
|
+
*/
|
|
108
|
+
export function storage(config) {
|
|
109
|
+
class StorageServiceProvider extends ServiceProvider {
|
|
110
|
+
register() { }
|
|
111
|
+
async boot() {
|
|
112
|
+
StorageRegistry.setDefault(config.default);
|
|
113
|
+
for (const [name, diskConfig] of Object.entries(config.disks)) {
|
|
114
|
+
const driver = diskConfig['driver'];
|
|
115
|
+
let adapter;
|
|
116
|
+
if (driver === 'local') {
|
|
117
|
+
adapter = new LocalAdapter(diskConfig);
|
|
118
|
+
}
|
|
119
|
+
else if (driver === 's3') {
|
|
120
|
+
let s3Mod;
|
|
121
|
+
try {
|
|
122
|
+
s3Mod = await resolveOptionalPeer('@boostkit/storage-s3');
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// Any import failure means @boostkit/storage-s3 isn't available (not installed or not built).
|
|
126
|
+
// Vite's module runner wraps ERR_MODULE_NOT_FOUND in a RunnerError without .code,
|
|
127
|
+
// so we catch broadly and mark the disk as unavailable instead of crashing.
|
|
128
|
+
const msg = `[BoostKit Storage] Disk "${name}" requires @boostkit/storage-s3. Install it: pnpm add @boostkit/storage-s3`;
|
|
129
|
+
StorageRegistry.set(name, makeUnavailableAdapter(msg));
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
adapter = await s3Mod.s3(diskConfig).create();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
throw new Error(`[BoostKit Storage] Unknown driver "${driver}" for disk "${name}". Available: local, s3`);
|
|
136
|
+
}
|
|
137
|
+
StorageRegistry.set(name, adapter);
|
|
138
|
+
}
|
|
139
|
+
this.app.instance('storage', StorageRegistry.get());
|
|
140
|
+
// storage:link — creates public/storage → storage/app/public symlink
|
|
141
|
+
artisan.command('storage:link', async () => {
|
|
142
|
+
const target = nodePath.resolve(process.cwd(), 'storage/app/public');
|
|
143
|
+
const link = nodePath.resolve(process.cwd(), 'public/storage');
|
|
144
|
+
await fs.mkdir(target, { recursive: true });
|
|
145
|
+
try {
|
|
146
|
+
await fs.symlink(target, link);
|
|
147
|
+
console.log(`[Storage] Linked: public/storage → storage/app/public`);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
const e = err;
|
|
151
|
+
if (e.code === 'EEXIST')
|
|
152
|
+
console.log('[Storage] Link already exists.');
|
|
153
|
+
else
|
|
154
|
+
throw err;
|
|
155
|
+
}
|
|
156
|
+
}).description('Create a symbolic link from public/storage to storage/app/public');
|
|
157
|
+
const diskNames = Object.keys(config.disks).join(', ');
|
|
158
|
+
console.log(`[StorageServiceProvider] booted — disks: ${diskNames}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return StorageServiceProvider;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAoB,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAkCjC,8DAA8D;AAE9D,MAAM,OAAO,eAAe;IAClB,MAAM,CAAU,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAA;IAC5D,MAAM,CAAC,WAAW,GAAG,OAAO,CAAA;IAEpC,MAAM,CAAC,G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E,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;gBAC3C,IAAI,CAAC;oBACH,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;oBAC9B,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAA;gBACtE,CAAC;gBAAC,OAAO,GAAY,EAAE,CAAC;oBACtB,MAAM,CAAC,GAAG,GAA4B,CAAA;oBACtC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;wBAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;;wBACjE,MAAM,GAAG,CAAA;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC,WAAW,CAAC,kEAAkE,CAAC,CAAA;YAElF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACtD,OAAO,CAAC,GAAG,CAAC,4CAA4C,SAAS,EAAE,CAAC,CAAA;QACtE,CAAC;KACF;IAED,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boostkit/storage",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/boostkitjs/boostkit",
|
|
8
|
+
"directory": "packages/storage"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@boostkit/core": "0.0.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.0.0",
|
|
27
|
+
"typescript": "^5.4.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"dev": "tsc --watch",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"clean": "rm -rf dist"
|
|
34
|
+
}
|
|
35
|
+
}
|