@quatrain/cli 1.1.8
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 +60 -0
- package/bin/core.js +3 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +33 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +696 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/generate/config.d.ts +2 -0
- package/dist/commands/generate/config.d.ts.map +1 -0
- package/dist/commands/generate/config.js +121 -0
- package/dist/commands/generate/config.js.map +1 -0
- package/dist/commands/generate/migration.d.ts +2 -0
- package/dist/commands/generate/migration.d.ts.map +1 -0
- package/dist/commands/generate/migration.js +42 -0
- package/dist/commands/generate/migration.js.map +1 -0
- package/dist/commands/generate/scaffold.d.ts +2 -0
- package/dist/commands/generate/scaffold.d.ts.map +1 -0
- package/dist/commands/generate/scaffold.js +65 -0
- package/dist/commands/generate/scaffold.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
- package/src/cli.ts +38 -0
- package/src/commands/deploy.ts +829 -0
- package/src/commands/generate/config.ts +130 -0
- package/src/commands/generate/migration.ts +49 -0
- package/src/commands/generate/scaffold.ts +86 -0
- package/src/index.ts +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @quatrain/core-cli
|
|
2
|
+
|
|
3
|
+
The official Command Line Interface (CLI) for the Quatrain ecosystem.
|
|
4
|
+
This CLI provides tools to scaffold projects, generate normalized bootloader configurations, and create migration files.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
You can install the CLI globally via NPM or Yarn, or run it on the fly using `npx` or `bunx`.
|
|
9
|
+
|
|
10
|
+
### Global Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @quatrain/core-cli
|
|
14
|
+
# or
|
|
15
|
+
yarn global add @quatrain/core-cli
|
|
16
|
+
# or via Bun
|
|
17
|
+
bun add -g @quatrain/core-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### On-the-fly Execution
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @quatrain/core-cli <command>
|
|
24
|
+
# or
|
|
25
|
+
bunx @quatrain/core-cli <command>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
### `core generate scaffold <project-name>`
|
|
31
|
+
Quickly initializes a new Quatrain project.
|
|
32
|
+
- Creates a base directory.
|
|
33
|
+
- Sets up the `apps/`, `data/`, `config/`, `packages/`, and `migrations/` folders.
|
|
34
|
+
- Generates a monorepo-ready `package.json` utilizing Yarn workspaces.
|
|
35
|
+
- Generates a `tsconfig.json` pre-configured with the required path mappings.
|
|
36
|
+
|
|
37
|
+
### `core generate config`
|
|
38
|
+
Starts an interactive wizard to generate a `quatrain.json` configuration file.
|
|
39
|
+
- Prompts for Backend, Auth, Queue, Storage, and Messaging adapters.
|
|
40
|
+
- Generates a normalized JSON configuration.
|
|
41
|
+
- The generated `env(...)` tokens will be resolved at runtime by the `AppBootloader`.
|
|
42
|
+
|
|
43
|
+
### `core generate migration <name>`
|
|
44
|
+
Scaffolds a new migration file.
|
|
45
|
+
- Creates a `migrations/` directory if it does not exist.
|
|
46
|
+
- Generates a timestamped TypeScript file (e.g., `20260427184500_init.ts`).
|
|
47
|
+
- Provides boilerplate `up()` and `down()` methods.
|
|
48
|
+
|
|
49
|
+
## Language Guidelines
|
|
50
|
+
> **Recommendation:** All text contents (such as console logs, commit messages, and comments) within the Quatrain ecosystem must be written in **International English**. This ensures accessibility and maintainability for developers worldwide.
|
|
51
|
+
|
|
52
|
+
## HOWTO / Usage Examples
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Example of scaffolding a new project
|
|
56
|
+
yarn global add @quatrain/core-cli
|
|
57
|
+
quatrain generate scaffold my-app
|
|
58
|
+
cd my-app
|
|
59
|
+
yarn install
|
|
60
|
+
```
|
package/bin/core.js
ADDED
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const config_1 = require("./commands/generate/config");
|
|
5
|
+
const migration_1 = require("./commands/generate/migration");
|
|
6
|
+
const scaffold_1 = require("./commands/generate/scaffold");
|
|
7
|
+
const deploy_1 = require("./commands/deploy");
|
|
8
|
+
const program = new commander_1.Command();
|
|
9
|
+
program
|
|
10
|
+
.name('core')
|
|
11
|
+
.description('Global CLI for Quatrain Core (configuration generation, migrations...)')
|
|
12
|
+
.version('1.0.0');
|
|
13
|
+
program
|
|
14
|
+
.command('deploy')
|
|
15
|
+
.description('Manage Kubernetes installations (create, list, modify, promote, delete)')
|
|
16
|
+
.action(deploy_1.deployCommand);
|
|
17
|
+
const generate = program
|
|
18
|
+
.command('generate')
|
|
19
|
+
.description('Generate files (config, migration, etc.)');
|
|
20
|
+
generate
|
|
21
|
+
.command('config')
|
|
22
|
+
.description('Generate a normalized configuration file for the bootloader')
|
|
23
|
+
.action(config_1.generateConfig);
|
|
24
|
+
generate
|
|
25
|
+
.command('migration <name>')
|
|
26
|
+
.description('Generate a blank migration file')
|
|
27
|
+
.action(migration_1.generateMigration);
|
|
28
|
+
generate
|
|
29
|
+
.command('scaffold <project-name>')
|
|
30
|
+
.description('Initialize a new Quatrain project with its basic structure')
|
|
31
|
+
.action(scaffold_1.generateScaffold);
|
|
32
|
+
program.parse(process.argv);
|
|
33
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAAA,yCAAmC;AACnC,uDAA2D;AAC3D,6DAAiE;AACjE,2DAA+D;AAC/D,8CAAiD;AAEjD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAA;AAE7B,OAAO;KACH,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,wEAAwE,CAAC;KACrF,OAAO,CAAC,OAAO,CAAC,CAAA;AAEpB,OAAO;KACH,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,yEAAyE,CAAC;KACtF,MAAM,CAAC,sBAAa,CAAC,CAAA;AAEzB,MAAM,QAAQ,GAAG,OAAO;KACpB,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,0CAA0C,CAAC,CAAA;AAE3D,QAAQ;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,MAAM,CAAC,uBAAc,CAAC,CAAA;AAE1B,QAAQ;KACJ,OAAO,CAAC,kBAAkB,CAAC;KAC3B,WAAW,CAAC,iCAAiC,CAAC;KAC9C,MAAM,CAAC,6BAAiB,CAAC,CAAA;AAE7B,QAAQ;KACJ,OAAO,CAAC,yBAAyB,CAAC;KAClC,WAAW,CAAC,4DAA4D,CAAC;KACzE,MAAM,CAAC,2BAAgB,CAAC,CAAA;AAE5B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAgVA,wBAAsB,aAAa,kBA4elC"}
|