@ooneex/command 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ooneex
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,185 @@
1
+ # @ooneex/seeds
2
+
3
+ Database seeding framework for populating initial data, fixtures, and test datasets with execution logging and idempotent operations.
4
+
5
+ ![Bun](https://img.shields.io/badge/Bun-Compatible-orange?style=flat-square&logo=bun)
6
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)
7
+ ![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)
8
+
9
+ ## Features
10
+
11
+ ✅ **Seed Decorator** - Register seed classes with the DI container using `@decorator.seed()`
12
+
13
+ ✅ **ISeed Interface** - Standard interface with `run()`, `isActive()`, and `getDependencies()` methods
14
+
15
+ ✅ **Dependency Resolution** - Define and automatically resolve seed dependencies before execution
16
+
17
+ ✅ **Active/Inactive Control** - Enable or disable individual seeds via the `isActive()` method
18
+
19
+ ✅ **Seed Runner** - Execute all active seeds in order with terminal logging via `seedRun()`
20
+
21
+ ✅ **Seed Scaffolding** - Generate new seed files from a template with `seedCreate()`
22
+
23
+ ✅ **Execution Logging** - Built-in terminal logging for seed progress, success, and failure
24
+
25
+ ✅ **Container Integration** - Automatic registration with `@ooneex/container` for dependency injection
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ bun add @ooneex/seeds
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ### Basic Seed
36
+
37
+ ```typescript
38
+ import { decorator, type ISeed, type SeedClassType } from '@ooneex/seeds';
39
+
40
+ @decorator.seed()
41
+ export class UserSeed implements ISeed {
42
+ public async run<T>(data?: unknown[]): Promise<T> {
43
+ // Insert initial users into the database
44
+ return data as T;
45
+ }
46
+
47
+ public isActive(): boolean {
48
+ return true;
49
+ }
50
+
51
+ public async getDependencies(): Promise<SeedClassType[]> {
52
+ return [];
53
+ }
54
+ }
55
+ ```
56
+
57
+ ### Seed with Dependencies
58
+
59
+ ```typescript
60
+ import { decorator, type ISeed, type SeedClassType } from '@ooneex/seeds';
61
+
62
+ @decorator.seed()
63
+ export class RoleSeed implements ISeed {
64
+ public async run<T>(data?: unknown[]): Promise<T> {
65
+ // Insert roles first
66
+ return data as T;
67
+ }
68
+
69
+ public isActive(): boolean {
70
+ return true;
71
+ }
72
+
73
+ public async getDependencies(): Promise<SeedClassType[]> {
74
+ return [];
75
+ }
76
+ }
77
+
78
+ @decorator.seed()
79
+ export class UserSeed implements ISeed {
80
+ public async run<T>(data?: unknown[]): Promise<T> {
81
+ // Roles are available in data from resolved dependencies
82
+ return data as T;
83
+ }
84
+
85
+ public isActive(): boolean {
86
+ return true;
87
+ }
88
+
89
+ public async getDependencies(): Promise<SeedClassType[]> {
90
+ return [RoleSeed];
91
+ }
92
+ }
93
+ ```
94
+
95
+ ### Running Seeds
96
+
97
+ ```typescript
98
+ import { seedRun } from '@ooneex/seeds';
99
+
100
+ await seedRun();
101
+ ```
102
+
103
+ ### Creating a New Seed
104
+
105
+ ```typescript
106
+ import { seedCreate } from '@ooneex/seeds';
107
+
108
+ const filePath = await seedCreate({ name: 'product', dir: 'seeds' });
109
+ // Creates seeds/ProductSeed.ts from the built-in template
110
+ ```
111
+
112
+ ## API Reference
113
+
114
+ ### Decorators
115
+
116
+ #### `@decorator.seed(scope?)`
117
+
118
+ Decorator to register a seed class with the DI container.
119
+
120
+ **Parameters:**
121
+ - `scope` - Container scope (default: `EContainerScope.Singleton`)
122
+
123
+ ### Interfaces
124
+
125
+ #### `ISeed`
126
+
127
+ Interface for seed implementations.
128
+
129
+ ```typescript
130
+ interface ISeed {
131
+ run: <T = unknown>(data?: unknown[]) => Promise<T> | T;
132
+ isActive: () => Promise<boolean> | boolean;
133
+ getDependencies: () => Promise<SeedClassType[]> | SeedClassType[];
134
+ }
135
+ ```
136
+
137
+ ### Functions
138
+
139
+ #### `seedRun(): Promise<void>`
140
+
141
+ Execute all active seeds with dependency resolution and terminal logging.
142
+
143
+ #### `seedCreate(config: { name: string; dir?: string }): Promise<string>`
144
+
145
+ Generate a new seed file from the built-in template. Returns the path of the created file.
146
+
147
+ #### `getSeeds(): ISeed[]`
148
+
149
+ Retrieve all registered and active seed instances from the container.
150
+
151
+ ### Types
152
+
153
+ #### `SeedClassType`
154
+
155
+ Type for seed class constructors.
156
+
157
+ ```typescript
158
+ type SeedClassType = new (...args: any[]) => ISeed;
159
+ ```
160
+
161
+ ## License
162
+
163
+ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
164
+
165
+ ## Contributing
166
+
167
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
168
+
169
+ ### Development Setup
170
+
171
+ 1. Clone the repository
172
+ 2. Install dependencies: `bun install`
173
+ 3. Run tests: `bun run test`
174
+ 4. Build the project: `bun run build`
175
+
176
+ ### Guidelines
177
+
178
+ - Write tests for new features
179
+ - Follow the existing code style
180
+ - Update documentation for API changes
181
+ - Ensure all tests pass before submitting PR
182
+
183
+ ---
184
+
185
+ Made with ❤️ by the Ooneex team
@@ -0,0 +1,25 @@
1
+ import { Exception } from "@ooneex/exception";
2
+ declare class CommandException extends Exception {
3
+ constructor(message: string, key: string, data?: Record<string, unknown>);
4
+ }
5
+ declare const commandCreate: (config: {
6
+ name: string;
7
+ commandDir?: string;
8
+ testsDir?: string;
9
+ }) => Promise<{
10
+ commandPath: string;
11
+ testPath: string;
12
+ }>;
13
+ declare const commandRun: () => Promise<void>;
14
+ import { EContainerScope } from "@ooneex/container";
15
+ type CommandClassType = new (...args: any[]) => ICommand;
16
+ interface ICommand<Options extends Record<string, unknown> = Record<string, unknown>> {
17
+ run: (options: Options) => Promise<void> | void;
18
+ getName: () => string;
19
+ getDescription: () => string;
20
+ }
21
+ declare const decorator: {
22
+ command: (scope?: EContainerScope) => (command: CommandClassType) => void;
23
+ };
24
+ declare const getCommand: (name: string) => ICommand | null;
25
+ export { getCommand, decorator, commandRun, commandCreate, ICommand, CommandException, CommandClassType };
package/dist/index.js ADDED
@@ -0,0 +1,211 @@
1
+ // @bun
2
+ // src/CommandException.ts
3
+ import { Exception } from "@ooneex/exception";
4
+ import { HttpStatus } from "@ooneex/http-status";
5
+
6
+ class CommandException extends Exception {
7
+ constructor(message, key, data = {}) {
8
+ super(message, {
9
+ key,
10
+ status: HttpStatus.Code.InternalServerError,
11
+ data
12
+ });
13
+ this.name = "CommandException";
14
+ }
15
+ }
16
+ // src/commandCreate.ts
17
+ import { join } from "path";
18
+ import { toKebabCase, toPascalCase } from "@ooneex/utils";
19
+ var {Glob } = globalThis.Bun;
20
+
21
+ // src/command.test.txt
22
+ var command_test_default = `import { describe, expect, test } from "bun:test";
23
+ import { {{NAME}}Command } from "@/commands/{{NAME}}Command";
24
+
25
+ describe("{{NAME}}Command", () => {
26
+ test("should have class name ending with 'Command'", () => {
27
+ expect({{NAME}}Command.name.endsWith("Command")).toBe(true);
28
+ });
29
+
30
+ test("should have 'getName' method", () => {
31
+ expect({{NAME}}Command.prototype.getName).toBeDefined();
32
+ expect(typeof {{NAME}}Command.prototype.getName).toBe("function");
33
+ });
34
+
35
+ test("should have 'getDescription' method", () => {
36
+ expect({{NAME}}Command.prototype.getDescription).toBeDefined();
37
+ expect(typeof {{NAME}}Command.prototype.getDescription).toBe("function");
38
+ });
39
+
40
+ test("should have 'run' method", () => {
41
+ expect({{NAME}}Command.prototype.run).toBeDefined();
42
+ expect(typeof {{NAME}}Command.prototype.run).toBe("function");
43
+ });
44
+ });
45
+ `;
46
+
47
+ // src/command.txt
48
+ var command_default = `import { type ICommand, decorator } from "@ooneex/command";
49
+
50
+ type CommandOptionsType = {
51
+ name?: string;
52
+ };
53
+
54
+ @decorator.command()
55
+ export class {{NAME}}Command<T extends CommandOptionsType = CommandOptionsType> implements ICommand<T> {
56
+ public getName(): string {
57
+ return "{{COMMAND_NAME}}";
58
+ }
59
+
60
+ public getDescription(): string {
61
+ return "{{COMMAND_DESCRIPTION}}";
62
+ }
63
+
64
+ public async run(options: T): Promise<void> {
65
+ // TODO: Implement command logic
66
+ }
67
+ }
68
+ `;
69
+
70
+ // src/commandCreate.ts
71
+ var commandCreate = async (config) => {
72
+ const name = toPascalCase(config.name).replace(/Command$/, "");
73
+ const commandName = toKebabCase(name).replace(/-/g, ":");
74
+ const commandDir = config.commandDir || join("src", "commands");
75
+ const testsDir = config.testsDir || join("tests", "commands");
76
+ const content = command_default.replace(/\{\{NAME\}\}/g, name).replace(/\{\{COMMAND_NAME\}\}/g, commandName).replace(/\{\{COMMAND_DESCRIPTION\}\}/g, `Execute ${commandName} command`);
77
+ await Bun.write(join(process.cwd(), commandDir, `${name}Command.ts`), content);
78
+ const testContent = command_test_default.replace(/\{\{NAME\}\}/g, name);
79
+ await Bun.write(join(process.cwd(), testsDir, `${name}Command.spec.ts`), testContent);
80
+ const imports = [];
81
+ const glob = new Glob("**/*Command.ts");
82
+ for await (const file of glob.scan(join(process.cwd(), commandDir))) {
83
+ const commandClassName = file.replace(/\.ts$/, "");
84
+ imports.push(`export { ${commandClassName} } from './${commandClassName}';`);
85
+ }
86
+ await Bun.write(join(process.cwd(), commandDir, "commands.ts"), `${imports.sort().join(`
87
+ `)}
88
+ `);
89
+ return {
90
+ commandPath: join(commandDir, `${name}Command.ts`),
91
+ testPath: join(testsDir, `${name}Command.spec.ts`)
92
+ };
93
+ };
94
+ // src/commandRun.ts
95
+ import { parseArgs } from "util";
96
+ import { Exception as Exception2 } from "@ooneex/exception";
97
+ import { TerminalLogger } from "@ooneex/logger";
98
+
99
+ // src/getCommand.ts
100
+ import { container } from "@ooneex/container";
101
+
102
+ // src/container.ts
103
+ var COMMANDS_CONTAINER = [];
104
+
105
+ // src/getCommand.ts
106
+ var getCommand = (name) => {
107
+ let command = null;
108
+ COMMANDS_CONTAINER.find((CommandClass) => {
109
+ command = container.get(CommandClass);
110
+ return command.getName() === name;
111
+ });
112
+ return command;
113
+ };
114
+
115
+ // src/commandRun.ts
116
+ var commandRun = async () => {
117
+ const { values, positionals } = parseArgs({
118
+ args: Bun.argv,
119
+ options: {
120
+ name: {
121
+ type: "string"
122
+ },
123
+ "route-name": {
124
+ type: "string"
125
+ },
126
+ "route-path": {
127
+ type: "string"
128
+ },
129
+ "route-method": {
130
+ type: "string"
131
+ },
132
+ "is-socket": {
133
+ type: "boolean"
134
+ },
135
+ dir: {
136
+ type: "string"
137
+ },
138
+ channel: {
139
+ type: "string"
140
+ },
141
+ "table-name": {
142
+ type: "string"
143
+ },
144
+ module: {
145
+ type: "string"
146
+ },
147
+ destination: {
148
+ type: "string"
149
+ }
150
+ },
151
+ strict: false,
152
+ allowPositionals: true
153
+ });
154
+ const logger = new TerminalLogger;
155
+ const commandName = positionals[2];
156
+ if (!commandName) {
157
+ logger.error(`Command name is required
158
+ `);
159
+ process.exit(1);
160
+ }
161
+ const command = getCommand(commandName);
162
+ if (!command) {
163
+ logger.info(`No commands found
164
+ `);
165
+ process.exit(1);
166
+ }
167
+ const parsedValues = {
168
+ name: values.name,
169
+ dir: values.dir,
170
+ channel: values.channel,
171
+ isSocket: values["is-socket"],
172
+ tableName: values["table-name"],
173
+ module: values.module,
174
+ destination: values.destination,
175
+ route: {
176
+ name: values["route-name"],
177
+ path: values["route-path"],
178
+ method: values["route-method"]
179
+ }
180
+ };
181
+ try {
182
+ await command.run(parsedValues);
183
+ } catch (error) {
184
+ const exception = error instanceof Exception2 ? error : new Exception2(error instanceof Error ? error : String(error));
185
+ logger.error(exception, undefined, {
186
+ showArrow: false,
187
+ showTimestamp: false,
188
+ showLevel: false
189
+ });
190
+ process.exit(1);
191
+ }
192
+ };
193
+ // src/decorators.ts
194
+ import { container as container2, EContainerScope } from "@ooneex/container";
195
+ var decorator = {
196
+ command: (scope = EContainerScope.Singleton) => {
197
+ return (command) => {
198
+ container2.add(command, scope);
199
+ COMMANDS_CONTAINER.push(command);
200
+ };
201
+ }
202
+ };
203
+ export {
204
+ getCommand,
205
+ decorator,
206
+ commandRun,
207
+ commandCreate,
208
+ CommandException
209
+ };
210
+
211
+ //# debugId=86D9C789DBF8297E64756E2164756E21
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/CommandException.ts", "src/commandCreate.ts", "src/commandRun.ts", "src/getCommand.ts", "src/container.ts", "src/decorators.ts"],
4
+ "sourcesContent": [
5
+ "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class CommandException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n\n this.name = \"CommandException\";\n }\n}\n",
6
+ "import { join } from \"node:path\";\nimport { toKebabCase, toPascalCase } from \"@ooneex/utils\";\nimport { Glob } from \"bun\";\nimport testTemplate from \"./command.test.txt\";\nimport template from \"./command.txt\";\n\nexport const commandCreate = async (config: {\n name: string;\n commandDir?: string;\n testsDir?: string;\n}): Promise<{ commandPath: string; testPath: string }> => {\n const name = toPascalCase(config.name).replace(/Command$/, \"\");\n const commandName = toKebabCase(name).replace(/-/g, \":\");\n const commandDir = config.commandDir || join(\"src\", \"commands\");\n const testsDir = config.testsDir || join(\"tests\", \"commands\");\n\n const content = template\n .replace(/\\{\\{NAME\\}\\}/g, name)\n .replace(/\\{\\{COMMAND_NAME\\}\\}/g, commandName)\n .replace(/\\{\\{COMMAND_DESCRIPTION\\}\\}/g, `Execute ${commandName} command`);\n\n await Bun.write(join(process.cwd(), commandDir, `${name}Command.ts`), content);\n\n const testContent = testTemplate.replace(/\\{\\{NAME\\}\\}/g, name);\n await Bun.write(join(process.cwd(), testsDir, `${name}Command.spec.ts`), testContent);\n\n const imports: string[] = [];\n const glob = new Glob(\"**/*Command.ts\");\n for await (const file of glob.scan(join(process.cwd(), commandDir))) {\n const commandClassName = file.replace(/\\.ts$/, \"\");\n imports.push(`export { ${commandClassName} } from './${commandClassName}';`);\n }\n await Bun.write(join(process.cwd(), commandDir, \"commands.ts\"), `${imports.sort().join(\"\\n\")}\\n`);\n\n return {\n commandPath: join(commandDir, `${name}Command.ts`),\n testPath: join(testsDir, `${name}Command.spec.ts`),\n };\n};\n",
7
+ "import { parseArgs } from \"node:util\";\nimport type { IException } from \"@ooneex/exception\";\nimport { Exception } from \"@ooneex/exception\";\nimport { TerminalLogger } from \"@ooneex/logger\";\nimport type { HttpMethodType } from \"@ooneex/types\";\nimport { getCommand } from \"./getCommand\";\n\nexport const commandRun = async (): Promise<void> => {\n const { values, positionals } = parseArgs({\n args: Bun.argv,\n options: {\n name: {\n type: \"string\",\n },\n \"route-name\": {\n type: \"string\",\n },\n \"route-path\": {\n type: \"string\",\n },\n \"route-method\": {\n type: \"string\",\n },\n \"is-socket\": {\n type: \"boolean\",\n },\n dir: {\n type: \"string\",\n },\n channel: {\n type: \"string\",\n },\n \"table-name\": {\n type: \"string\",\n },\n module: {\n type: \"string\",\n },\n destination: {\n type: \"string\",\n },\n },\n strict: false,\n allowPositionals: true,\n });\n\n const logger = new TerminalLogger();\n\n const commandName = positionals[2];\n\n if (!commandName) {\n logger.error(\"Command name is required\\n\");\n process.exit(1);\n }\n\n const command = getCommand(commandName);\n\n if (!command) {\n logger.info(\"No commands found\\n\");\n process.exit(1);\n }\n\n const parsedValues = {\n name: values.name,\n dir: values.dir,\n channel: values.channel,\n isSocket: values[\"is-socket\"],\n tableName: values[\"table-name\"],\n module: values.module,\n destination: values.destination,\n route: {\n name: values[\"route-name\"],\n path: values[\"route-path\"] as `/${string}` | undefined,\n method: values[\"route-method\"] as HttpMethodType | undefined,\n },\n };\n\n try {\n await command.run(parsedValues);\n } catch (error) {\n const exception: IException =\n error instanceof Exception ? error : new Exception(error instanceof Error ? error : String(error));\n logger.error(exception, undefined, {\n showArrow: false,\n showTimestamp: false,\n showLevel: false,\n });\n process.exit(1);\n }\n};\n",
8
+ "import { container } from \"@ooneex/container\";\nimport { COMMANDS_CONTAINER } from \"./container\";\nimport type { ICommand } from \"./types\";\n\nexport const getCommand = (name: string): ICommand | null => {\n let command: ICommand | null = null;\n\n COMMANDS_CONTAINER.find((CommandClass) => {\n command = container.get(CommandClass);\n\n return command.getName() === name;\n });\n\n return command;\n};\n",
9
+ "import type { CommandClassType } from \"./types\";\n\nexport const COMMANDS_CONTAINER: CommandClassType[] = [];\n",
10
+ "import { container, EContainerScope } from \"@ooneex/container\";\nimport { COMMANDS_CONTAINER } from \"./container\";\nimport type { CommandClassType } from \"./types\";\n\nexport const decorator = {\n command: (scope: EContainerScope = EContainerScope.Singleton) => {\n return (command: CommandClassType): void => {\n container.add(command, scope);\n COMMANDS_CONTAINER.push(command);\n };\n },\n};\n"
11
+ ],
12
+ "mappings": ";;AAAA;AACA;AAAA;AAEO,MAAM,yBAAyB,UAAU;AAAA,EAC9C,WAAW,CAAC,SAAiB,KAAa,OAAgC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A,MAAM,UAAU,WAAW,WAAW;AAAA,EAEtC,IAAI,CAAC,SAAS;AAAA,IACZ,OAAO,KAAK;AAAA,CAAqB;AAAA,IACjC,QAAQ,KAAK,CAAC;AAAA,EAChB;AAAA,EAEA,MAAM,eAAe;AAAA,IACnB,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,SAAS,OAAO;AAAA,IAChB,UAAU,OAAO;AAAA,IACjB,WAAW,OAAO;AAAA,IAClB,QAAQ,OAAO;AAAA,IACf,aAAa,OAAO;AAAA,IACpB,OAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,MAAM,OAAO;AAAA,MACb,QAAQ,OAAO;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,IAAI;AAAA,IACF,MAAM,QAAQ,IAAI,YAAY;AAAA,IAC9B,OAAO,OAAO;AAAA,IACd,MAAM,YACJ,iBAAiB,aAAY,QAAQ,IAAI,WAAU,iBAAiB,QAAQ,QAAQ,OAAO,KAAK,CAAC;AAAA,IACnG,OAAO,MAAM,WAAW,WAAW;AAAA,MACjC,WAAW;AAAA,MACX,eAAe;AAAA,MACf,WAAW;AAAA,IACb,CAAC;AAAA,IACD,QAAQ,KAAK,CAAC;AAAA;AAAA;;AGvFlB,sBAAS;AAIF,IAAM,YAAY;AAAA,EACvB,SAAS,CAAC,QAAyB,gBAAgB,cAAc;AAAA,IAC/D,OAAO,CAAC,YAAoC;AAAA,MAC1C,WAAU,IAAI,SAAS,KAAK;AAAA,MAC5B,mBAAmB,KAAK,OAAO;AAAA;AAAA;AAGrC;",
13
+ "debugId": "86D9C789DBF8297E64756E2164756E21",
14
+ "names": []
15
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@ooneex/command",
3
+ "description": "Command framework for building CLI commands with dependency injection, argument parsing, and execution logging",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "LICENSE",
9
+ "README.md",
10
+ "package.json"
11
+ ],
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "test": "bun test tests",
26
+ "build": "bunup",
27
+ "lint": "tsgo --noEmit && bunx biome lint",
28
+ "npm:publish": "bun publish --tolerate-republish --force --production --access public"
29
+ },
30
+ "dependencies": {
31
+ "@ooneex/container": "1.2.3",
32
+ "@ooneex/exception": "1.2.1",
33
+ "@ooneex/http-status": "1.1.4",
34
+ "@ooneex/logger": "1.2.7",
35
+ "@ooneex/utils": "0.4.2"
36
+ },
37
+ "devDependencies": {},
38
+ "keywords": [
39
+ "bun",
40
+ "cli",
41
+ "command",
42
+ "ooneex",
43
+ "typescript"
44
+ ]
45
+ }