@laioutr/cli 0.2.1 → 0.3.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/CHANGELOG.md +31 -0
- package/README.md +1 -26
- package/oclif.manifest.json +2 -85
- package/package.json +9 -3
- package/dist/commands/project/fetch-rc.d.ts +0 -17
- package/dist/commands/project/fetch-rc.js +0 -52
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/laioutr-base-command.d.ts +0 -8
- package/dist/laioutr-base-command.js +0 -18
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @laioutr/cli
|
|
2
|
+
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 93b327e: Accept --project flag input with /p/ in string
|
|
8
|
+
|
|
9
|
+
## 0.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Move `project fetch-rc` to `rc fetch`, introduce `rc update` command
|
|
14
|
+
|
|
15
|
+
## 0.2.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Update readme
|
|
20
|
+
|
|
21
|
+
## 1.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- Make fetch-rc more convenient
|
|
26
|
+
|
|
27
|
+
## 1.1.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- Media Library upload handling, improved documentation-generation from canonical-types
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @laioutr/cli
|
|
|
20
20
|
$ laioutr COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ laioutr (--version)
|
|
23
|
-
@laioutr/cli/0.
|
|
23
|
+
@laioutr/cli/0.3.1 linux-x64 node-v24.14.1
|
|
24
24
|
$ laioutr --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ laioutr COMMAND
|
|
@@ -42,7 +42,6 @@ USAGE
|
|
|
42
42
|
* [`laioutr plugins uninstall [PLUGIN]`](#laioutr-plugins-uninstall-plugin)
|
|
43
43
|
* [`laioutr plugins unlink [PLUGIN]`](#laioutr-plugins-unlink-plugin)
|
|
44
44
|
* [`laioutr plugins update`](#laioutr-plugins-update)
|
|
45
|
-
* [`laioutr project fetch-rc [FILENAME]`](#laioutr-project-fetch-rc-filename)
|
|
46
45
|
|
|
47
46
|
## `laioutr help [COMMAND]`
|
|
48
47
|
|
|
@@ -353,28 +352,4 @@ DESCRIPTION
|
|
|
353
352
|
```
|
|
354
353
|
|
|
355
354
|
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/update.ts)_
|
|
356
|
-
|
|
357
|
-
## `laioutr project fetch-rc [FILENAME]`
|
|
358
|
-
|
|
359
|
-
Fetches the laioutrrc.json of a project from the cockpit api.
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
USAGE
|
|
363
|
-
$ laioutr project fetch-rc [FILENAME] --cockpitApiHost <value> --cwd <value> -e <value> -s <value> -p <value>
|
|
364
|
-
|
|
365
|
-
FLAGS
|
|
366
|
-
-e, --environmentName=<value> (required) [default: main] environment name
|
|
367
|
-
-p, --project=<value> (required) <organization slug>/<project slug>
|
|
368
|
-
-s, --projectSecret=<value> (required) project secret
|
|
369
|
-
--cockpitApiHost=<value> (required) [default: https://cockpit.laioutr.cloud] cockpit api host
|
|
370
|
-
--cwd=<value> (required) [default: /Users/sl/src/laioutr/apps/cli] current working directory
|
|
371
|
-
|
|
372
|
-
DESCRIPTION
|
|
373
|
-
Fetches the laioutrrc.json of a project from the cockpit api.
|
|
374
|
-
|
|
375
|
-
EXAMPLES
|
|
376
|
-
$ laioutr project fetch-rc
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
_See code: [src/commands/project/fetch-rc.ts](https://github.com/packages/cli/blob/v0.2.1/src/commands/project/fetch-rc.ts)_
|
|
380
355
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1,87 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commands": {
|
|
3
|
-
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {
|
|
6
|
-
"fileName": {
|
|
7
|
-
"default": "laioutrrc.json",
|
|
8
|
-
"name": "fileName",
|
|
9
|
-
"required": false
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"description": "Fetches the laioutrrc.json of a project from the cockpit api.",
|
|
13
|
-
"examples": [
|
|
14
|
-
"<%= config.bin %> <%= command.id %>"
|
|
15
|
-
],
|
|
16
|
-
"flags": {
|
|
17
|
-
"cockpitApiHost": {
|
|
18
|
-
"description": "cockpit api host",
|
|
19
|
-
"env": "COCKPIT_API_HOST",
|
|
20
|
-
"name": "cockpitApiHost",
|
|
21
|
-
"required": true,
|
|
22
|
-
"default": "https://cockpit.laioutr.cloud",
|
|
23
|
-
"hasDynamicHelp": false,
|
|
24
|
-
"multiple": false,
|
|
25
|
-
"type": "option"
|
|
26
|
-
},
|
|
27
|
-
"cwd": {
|
|
28
|
-
"description": "current working directory",
|
|
29
|
-
"env": "CWD",
|
|
30
|
-
"name": "cwd",
|
|
31
|
-
"required": true,
|
|
32
|
-
"default": "/Users/sl/src/laioutr/apps/cli",
|
|
33
|
-
"hasDynamicHelp": false,
|
|
34
|
-
"multiple": false,
|
|
35
|
-
"type": "option"
|
|
36
|
-
},
|
|
37
|
-
"environmentName": {
|
|
38
|
-
"char": "e",
|
|
39
|
-
"description": "environment name",
|
|
40
|
-
"env": "ENVIRONMENT_NAME",
|
|
41
|
-
"name": "environmentName",
|
|
42
|
-
"required": true,
|
|
43
|
-
"default": "main",
|
|
44
|
-
"hasDynamicHelp": false,
|
|
45
|
-
"multiple": false,
|
|
46
|
-
"type": "option"
|
|
47
|
-
},
|
|
48
|
-
"projectSecret": {
|
|
49
|
-
"char": "s",
|
|
50
|
-
"description": "project secret",
|
|
51
|
-
"env": "PROJECT_SECRET",
|
|
52
|
-
"name": "projectSecret",
|
|
53
|
-
"required": true,
|
|
54
|
-
"hasDynamicHelp": false,
|
|
55
|
-
"multiple": false,
|
|
56
|
-
"type": "option"
|
|
57
|
-
},
|
|
58
|
-
"project": {
|
|
59
|
-
"char": "p",
|
|
60
|
-
"description": "<organization slug>/<project slug>",
|
|
61
|
-
"env": "PROJECT",
|
|
62
|
-
"name": "project",
|
|
63
|
-
"required": true,
|
|
64
|
-
"hasDynamicHelp": false,
|
|
65
|
-
"multiple": false,
|
|
66
|
-
"type": "option"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"hasDynamicHelp": false,
|
|
70
|
-
"hiddenAliases": [],
|
|
71
|
-
"id": "project:fetch-rc",
|
|
72
|
-
"pluginAlias": "@laioutr/cli",
|
|
73
|
-
"pluginName": "@laioutr/cli",
|
|
74
|
-
"pluginType": "core",
|
|
75
|
-
"strict": true,
|
|
76
|
-
"enableJsonFlag": false,
|
|
77
|
-
"isESM": true,
|
|
78
|
-
"relativePath": [
|
|
79
|
-
"dist",
|
|
80
|
-
"commands",
|
|
81
|
-
"project",
|
|
82
|
-
"fetch-rc.js"
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"version": "0.2.1"
|
|
2
|
+
"commands": {},
|
|
3
|
+
"version": "0.3.1"
|
|
87
4
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laioutr/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Laioutr CLI",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/laioutr/laioutr.git",
|
|
8
|
+
"directory": "apps/cli"
|
|
9
|
+
},
|
|
6
10
|
"author": "Laioutr GmbH",
|
|
7
11
|
"type": "module",
|
|
8
12
|
"main": "dist/index.js",
|
|
@@ -13,7 +17,8 @@
|
|
|
13
17
|
"files": [
|
|
14
18
|
"/bin",
|
|
15
19
|
"/dist",
|
|
16
|
-
"/oclif.manifest.json"
|
|
20
|
+
"/oclif.manifest.json",
|
|
21
|
+
"/CHANGELOG.md"
|
|
17
22
|
],
|
|
18
23
|
"lint-staged": {
|
|
19
24
|
"*.{js,mjs,jsx,ts,tsx,vue}": [
|
|
@@ -36,6 +41,7 @@
|
|
|
36
41
|
"@oclif/core": "^4",
|
|
37
42
|
"@oclif/plugin-help": "^6",
|
|
38
43
|
"@oclif/plugin-plugins": "^5",
|
|
44
|
+
"jiti": "^2.6.1",
|
|
39
45
|
"zod": "3.25.61"
|
|
40
46
|
},
|
|
41
47
|
"devDependencies": {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import LaioutrBaseCommand from '../../laioutr-base-command.js';
|
|
2
|
-
export default class ProjectFetchRc extends LaioutrBaseCommand {
|
|
3
|
-
static args: {
|
|
4
|
-
fileName: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
-
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
|
-
static flags: {
|
|
9
|
-
environmentName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
projectSecret: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
cockpitApiHost: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
};
|
|
15
|
-
run(): Promise<void>;
|
|
16
|
-
private fetchRc;
|
|
17
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { writeFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { Args, Flags } from '@oclif/core';
|
|
4
|
-
import { z } from 'zod/v4';
|
|
5
|
-
import LaioutrBaseCommand from '../../laioutr-base-command.js';
|
|
6
|
-
const apiResponseSchema = z.object({
|
|
7
|
-
content: z.string(),
|
|
8
|
-
});
|
|
9
|
-
export default class ProjectFetchRc extends LaioutrBaseCommand {
|
|
10
|
-
static args = {
|
|
11
|
-
...LaioutrBaseCommand.args,
|
|
12
|
-
fileName: Args.string({ default: 'laioutrrc.json', name: 'fileName', required: false }),
|
|
13
|
-
};
|
|
14
|
-
static description = 'Fetches the laioutrrc.json of a project from the cockpit api.';
|
|
15
|
-
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
16
|
-
static flags = {
|
|
17
|
-
...LaioutrBaseCommand.flags,
|
|
18
|
-
environmentName: Flags.string({ char: 'e', default: 'main', description: 'environment name', env: 'ENVIRONMENT_NAME', required: true }),
|
|
19
|
-
projectSecret: Flags.string({ char: 's', description: 'project secret', env: 'PROJECT_SECRET', required: true }),
|
|
20
|
-
project: Flags.string({ char: 'p', description: '<organization slug>/<project slug>', env: 'PROJECT', required: true }),
|
|
21
|
-
};
|
|
22
|
-
async run() {
|
|
23
|
-
const { args, flags } = await this.parse(ProjectFetchRc);
|
|
24
|
-
const rc = await this.fetchRc(flags);
|
|
25
|
-
const filePath = path.join(flags.cwd, args.fileName);
|
|
26
|
-
this.log('Writing RC file', filePath);
|
|
27
|
-
return writeFile(filePath, rc);
|
|
28
|
-
}
|
|
29
|
-
async fetchRc(flags) {
|
|
30
|
-
const url = `${flags.cockpitApiHost}/api/v1/project/fetch-rc`;
|
|
31
|
-
const [organizationSlug, projectSlug] = flags.project.split('/');
|
|
32
|
-
const response = await fetch(url, {
|
|
33
|
-
body: JSON.stringify({
|
|
34
|
-
environmentName: flags.environmentName,
|
|
35
|
-
organizationSlug,
|
|
36
|
-
projectSecret: flags.projectSecret,
|
|
37
|
-
projectSlug,
|
|
38
|
-
}),
|
|
39
|
-
headers: {
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
},
|
|
42
|
-
method: 'POST',
|
|
43
|
-
});
|
|
44
|
-
const data = await response.json();
|
|
45
|
-
if (response.status !== 200) {
|
|
46
|
-
this.log(data);
|
|
47
|
-
this.error('Failed to fetch RC file. See error message above.', { exit: 1 });
|
|
48
|
-
}
|
|
49
|
-
const parsed = apiResponseSchema.parse(data);
|
|
50
|
-
return parsed.content;
|
|
51
|
-
}
|
|
52
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { run } from '@oclif/core';
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { run } from '@oclif/core';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default abstract class LaioutrBaseCommand extends Command {
|
|
3
|
-
static args: {};
|
|
4
|
-
static flags: {
|
|
5
|
-
cockpitApiHost: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
-
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
export default class LaioutrBaseCommand extends Command {
|
|
3
|
-
static args = {};
|
|
4
|
-
static flags = {
|
|
5
|
-
cockpitApiHost: Flags.string({
|
|
6
|
-
default: 'https://cockpit.laioutr.cloud',
|
|
7
|
-
description: 'cockpit api host',
|
|
8
|
-
env: 'COCKPIT_API_HOST',
|
|
9
|
-
required: true,
|
|
10
|
-
}),
|
|
11
|
-
cwd: Flags.string({
|
|
12
|
-
default: process.cwd(),
|
|
13
|
-
description: 'current working directory',
|
|
14
|
-
env: 'CWD',
|
|
15
|
-
required: true,
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
}
|