@aponiajs/cli 0.0.0 → 0.2.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/README.md CHANGED
@@ -1,15 +1,46 @@
1
1
  # @aponiajs/cli
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/%40aponiajs%2Fcli)](https://www.npmjs.com/package/@aponiajs/cli)
4
+
3
5
  The Bun-native Aponia command-line interface.
4
6
 
5
- ## Create a project
7
+ ## Install
8
+
9
+ ```bash
10
+ bun add --dev @aponiajs/cli
11
+ ```
12
+
13
+ ## Commands
14
+
15
+ ```bash
16
+ bunx aponia new my-api
17
+ bunx aponia n my-api --dry-run
18
+ bunx aponia new my-api --skip-install
19
+ bunx aponia generate controller users
20
+ bunx aponia g s users
21
+ bunx aponia g resource users --type rest
22
+ bunx aponia g router health --no-spec
23
+ bunx aponia --version
24
+ ```
25
+
26
+ The generate command supports the complete built-in Nest schematic catalog:
27
+ application, library, class, controller, decorator, filter, gateway, guard,
28
+ interface, interceptor, middleware, module, pipe, provider, resolver, resource,
29
+ and service. Nest aliases are supported, and `router`, `routers`, and `route`
30
+ map to Aponia controllers.
31
+
32
+ Generated controllers, providers, services, modules, and resources are
33
+ registered in the nearest Aponia module unless `--skip-import` is used.
34
+ Resource transports include REST, GraphQL code-first, GraphQL schema-first,
35
+ microservices, and WebSockets.
36
+
37
+ For one-command project creation, use the separately published
38
+ [`create-aponia`](https://www.npmjs.com/package/create-aponia) entrypoint:
6
39
 
7
40
  ```bash
8
- aponia new my-api
9
- aponia n my-api --dry-run
10
- aponia new my-api --skip-install
41
+ bun create aponia my-api
11
42
  ```
12
43
 
13
- The initial CLI implements the standard application generator. Component and
14
- resource schematics will be added behind the same command architecture after
15
- their module-registration transforms are safe and testable.
44
+ [npm package](https://www.npmjs.com/package/@aponiajs/cli) ·
45
+ [complete CLI guide](../../docs/cli.md) ·
46
+ [complete package catalog](../../docs/packages.md)
package/dist/index.d.mts CHANGED
@@ -5,7 +5,24 @@ interface NewCommandOptions {
5
5
  readonly dryRun: boolean;
6
6
  readonly skipInstall: boolean;
7
7
  }
8
- type CliCommand = NewCommandOptions | {
8
+ declare const generateSchematics: readonly ["app", "library", "class", "controller", "decorator", "filter", "gateway", "guard", "interface", "interceptor", "middleware", "module", "pipe", "provider", "resolver", "resource", "service"];
9
+ type GenerateSchematic = (typeof generateSchematics)[number];
10
+ type ResourceTransport = "rest" | "graphql-code-first" | "graphql-schema-first" | "microservice" | "ws";
11
+ interface GenerateCommandOptions {
12
+ readonly command: "generate";
13
+ readonly schematic: GenerateSchematic;
14
+ readonly name: string;
15
+ readonly dryRun: boolean;
16
+ readonly flat?: boolean;
17
+ readonly spec?: boolean;
18
+ readonly skipImport: boolean;
19
+ readonly path?: string;
20
+ readonly module?: string;
21
+ readonly project?: string;
22
+ readonly crud: boolean;
23
+ readonly type: ResourceTransport;
24
+ }
25
+ type CliCommand = NewCommandOptions | GenerateCommandOptions | {
9
26
  readonly command: "help";
10
27
  } | {
11
28
  readonly command: "version";
@@ -27,7 +44,21 @@ interface GenerateProjectResult {
27
44
  }
28
45
  declare function generateProject(options: GenerateProjectOptions): Promise<GenerateProjectResult>;
29
46
  //#endregion
47
+ //#region src/schematic-generator.d.ts
48
+ interface GenerateSchematicOptions extends GenerateCommandOptions {
49
+ readonly cwd?: string;
50
+ }
51
+ interface SchematicChange {
52
+ readonly kind: "CREATE" | "UPDATE";
53
+ readonly path: string;
54
+ }
55
+ interface GenerateSchematicResult {
56
+ readonly changes: readonly SchematicChange[];
57
+ readonly dryRun: boolean;
58
+ }
59
+ declare function generateSchematic(options: GenerateSchematicOptions): Promise<GenerateSchematicResult>;
60
+ //#endregion
30
61
  //#region src/index.d.ts
31
62
  declare function runCli(arguments_: readonly string[]): Promise<number>;
32
63
  //#endregion
33
- export { type CliCommand, type GenerateProjectOptions, type GenerateProjectResult, generateProject, parseArguments, runCli };
64
+ export { type CliCommand, type GenerateCommandOptions, type GenerateProjectOptions, type GenerateProjectResult, type GenerateSchematic, type GenerateSchematicOptions, type GenerateSchematicResult, type ResourceTransport, type SchematicChange, generateProject, generateSchematic, generateSchematics, parseArguments, runCli };