@elysiumjs/styx 0.6.1 → 0.7.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.
@@ -0,0 +1,9 @@
1
+ $ bun run clean && bun run build:js && bun run build:ts
2
+ $ rimraf dist
3
+ $ bun build ./src/styx.ts ./src/index.ts --outdir ./dist --target bun -e @elysiumjs/* -e reflect-metadata --root ./src --minify
4
+ Bundled 96 modules in 45ms
5
+
6
+ styx.js 76 bytes (entry point)
7
+ index.js 115.57 KB (entry point)
8
+
9
+ $ tsc
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @elysiumjs/styx
2
+
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Use HermesLogger by default when generating services.
8
+ - Decouple CLI commands into individual modules.
9
+ - Add programmatic API entry point.
@@ -0,0 +1,8 @@
1
+ import { Command } from '@elysiumjs/core';
2
+ /**
3
+ * Base class for Styx commands.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare abstract class BaseCommand extends Command {
7
+ static readonly dev: boolean;
8
+ }
@@ -0,0 +1,13 @@
1
+ export * from './base.command';
2
+ export * from './make_command.command';
3
+ export * from './make_controller.command';
4
+ export * from './make_job.command';
5
+ export * from './make_middleware.command';
6
+ export * from './make_model.command';
7
+ export * from './make_repository.command';
8
+ export * from './make_service.command';
9
+ export * from './make_validator.command';
10
+ export * from './migration_generate.command';
11
+ export * from './migration_run.command';
12
+ export * from './module_new.command';
13
+ export * from './module_rename.command';
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker class for creating Elysium.js commands.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeCommandCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private command?;
12
+ private description?;
13
+ run(): Promise<void>;
14
+ private setup;
15
+ private build;
16
+ }
@@ -0,0 +1,21 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker class for creating Elysium.js controllers.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeControllerCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private http;
12
+ private wamp;
13
+ private ws;
14
+ private server;
15
+ private request;
16
+ private path;
17
+ private realm?;
18
+ run(): Promise<void>;
19
+ private setup;
20
+ private build;
21
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker class for creating Elysium.js jobs.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeJobCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private alias?;
12
+ private queue;
13
+ run(): Promise<void>;
14
+ private setup;
15
+ private build;
16
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker class for creating Elysium.js middlewares.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeMiddlewareCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ run(): Promise<void>;
12
+ private setup;
13
+ private build;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker command for creating Elysium.js models.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeModelCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private tableName?;
12
+ private supportTenancy;
13
+ run(): Promise<void>;
14
+ private setup;
15
+ private build;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker command for creating Elysium repositories.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeRepositoryCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private alias?;
12
+ private model?;
13
+ private factory;
14
+ private singleton;
15
+ run(): Promise<void>;
16
+ private setup;
17
+ private build;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker command for creating Elysium services.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeServiceCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private alias?;
12
+ private factory;
13
+ private singleton;
14
+ run(): Promise<void>;
15
+ private setup;
16
+ private build;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Maker command for creating Elysium validators.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MakeValidatorCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ run(): Promise<void>;
12
+ private setup;
13
+ private build;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Generates migration files.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MigrationGenerateCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Execute migration files.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class MigrationRunCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private tenant;
10
+ private connection;
11
+ private fresh;
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Command for creating Elysium.js modules.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class ModuleNewCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private name?;
10
+ private module?;
11
+ private convert;
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from './base.command';
2
+ /**
3
+ * Command for renaming Elysium.js modules.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare class ModuleRenameCommand extends BaseCommand {
7
+ static readonly command: string;
8
+ static readonly description: string;
9
+ private module?;
10
+ private name?;
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Describes the Elysium project's configuration.
3
+ * @author Axel Nana <axel.nana@workbud.com>
4
+ */
5
+ export interface ProjectConfig {
6
+ /**
7
+ * The name of the Elysium project.
8
+ */
9
+ projectName: string;
10
+ /**
11
+ * Whether the Elysium project is a mono module.
12
+ */
13
+ mono: boolean;
14
+ /**
15
+ * A map of module names to their paths.
16
+ *
17
+ * Only used if the Elysium project is not a mono module.
18
+ */
19
+ modules?: Record<string, string>;
20
+ }
21
+ /**
22
+ * Parses the Elysium project's configuration file.
23
+ * @author Axel Nana <axel.nana@workbud.com>
24
+ * @throws If the Elysium config file is not found.
25
+ * @returns The Elysium project's configuration.
26
+ */
27
+ export declare const parseProjectConfig: () => Promise<ProjectConfig>;
28
+ /**
29
+ * Writes the Elysium project's configuration file.
30
+ * @author Axel Nana <axel.nana@workbud.com>
31
+ * @param config The Elysium project's configuration.
32
+ */
33
+ export declare const writeProjectConfig: (config: ProjectConfig) => Promise<void>;
34
+ /**
35
+ * Checks if the Elysium project is a mono-module project.
36
+ * @author Axel Nana <axel.nana@workbud.com>
37
+ * @returns Whether the Elysium project is a mono module.
38
+ */
39
+ export declare const isMonoModule: () => Promise<boolean>;
40
+ /**
41
+ * Gets the path of a module.
42
+ * @author Axel Nana <axel.nana@workbud.com>
43
+ * @param moduleName The name of the module.
44
+ * @returns The path of the module.
45
+ */
46
+ export declare const getModulePath: (moduleName: string) => Promise<string>;
47
+ /**
48
+ * Checks if a module exists.
49
+ * @author Axel Nana <axel.nana@workbud.com>
50
+ * @param moduleName The name of the module.
51
+ * @returns Whether the module exists.
52
+ */
53
+ export declare const moduleExists: (moduleName: string) => Promise<boolean>;
@@ -0,0 +1,7 @@
1
+ import 'reflect-metadata';
2
+ import '@elysiumjs/core';
3
+ import './commands';
4
+ declare const App: any;
5
+ export declare class StyxApp extends App {
6
+ }
7
+ export {};