@logto/cli 1.1.0 → 1.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/lib/commands/connector/add.js +4 -4
- package/lib/commands/connector/index.js +2 -0
- package/lib/commands/connector/link.d.ts +9 -0
- package/lib/commands/connector/link.js +46 -0
- package/lib/commands/connector/list.js +4 -3
- package/lib/commands/connector/remove.js +6 -6
- package/lib/commands/connector/utils.d.ts +2 -0
- package/lib/commands/connector/utils.js +22 -10
- package/lib/commands/database/alteration/index.js +8 -8
- package/lib/commands/database/alteration/version.js +4 -4
- package/lib/commands/database/config.js +11 -11
- package/lib/commands/database/seed/cloud.js +2 -2
- package/lib/commands/database/seed/index.js +4 -5
- package/lib/commands/database/seed/oidc-config.js +5 -5
- package/lib/commands/database/seed/tables.js +2 -2
- package/lib/commands/database/seed/tenant.js +2 -2
- package/lib/commands/database/system.js +5 -5
- package/lib/commands/database/utils.js +1 -1
- package/lib/commands/install/index.js +3 -3
- package/lib/commands/install/utils.js +12 -12
- package/lib/commands/translate/create.js +17 -54
- package/lib/commands/translate/index.js +2 -0
- package/lib/commands/translate/list-tags.js +2 -1
- package/lib/commands/translate/openai.d.ts +8 -1
- package/lib/commands/translate/openai.js +15 -11
- package/lib/commands/translate/prompts.d.ts +14 -0
- package/lib/commands/translate/prompts.js +39 -0
- package/lib/commands/translate/sync.d.ts +7 -0
- package/lib/commands/translate/sync.js +40 -0
- package/lib/commands/translate/utils.d.ts +11 -0
- package/lib/commands/translate/utils.js +111 -2
- package/lib/connector/factories.js +2 -1
- package/lib/connector/loader.js +4 -3
- package/lib/database.js +3 -3
- package/lib/index.js +2 -2
- package/lib/package-json.d.ts +4 -0
- package/lib/package-json.js +13 -9
- package/lib/utils.d.ts +2 -8
- package/lib/utils.js +13 -17
- package/package.json +14 -10
package/lib/package-json.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const packageJson = {
|
|
2
2
|
"name": "@logto/cli",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Logto CLI.",
|
|
5
5
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
6
6
|
"homepage": "https://github.com/logto-io/logto#readme",
|
|
@@ -43,13 +43,13 @@ export const packageJson = {
|
|
|
43
43
|
"url": "https://github.com/logto-io/logto/issues"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@logto/connector-kit": "workspace:^",
|
|
47
|
-
"@logto/core-kit": "workspace:^",
|
|
48
|
-
"@logto/language-kit": "workspace:^",
|
|
49
|
-
"@logto/phrases": "workspace:^",
|
|
50
|
-
"@logto/phrases-ui": "workspace:^",
|
|
51
|
-
"@logto/schemas": "workspace:^",
|
|
52
|
-
"@logto/shared": "workspace:^",
|
|
46
|
+
"@logto/connector-kit": "workspace:^1.1.1",
|
|
47
|
+
"@logto/core-kit": "workspace:^2.0.0",
|
|
48
|
+
"@logto/language-kit": "workspace:^1.0.0",
|
|
49
|
+
"@logto/phrases": "workspace:^1.2.0",
|
|
50
|
+
"@logto/phrases-ui": "workspace:^1.2.0",
|
|
51
|
+
"@logto/schemas": "workspace:^1.2.1",
|
|
52
|
+
"@logto/shared": "workspace:^2.0.0",
|
|
53
53
|
"@silverhand/essentials": "^2.5.0",
|
|
54
54
|
"chalk": "^5.0.0",
|
|
55
55
|
"decamelize": "^6.0.0",
|
|
@@ -60,6 +60,7 @@ export const packageJson = {
|
|
|
60
60
|
"nanoid": "^4.0.0",
|
|
61
61
|
"ora": "^6.1.2",
|
|
62
62
|
"p-limit": "^4.0.0",
|
|
63
|
+
"p-queue": "^7.3.4",
|
|
63
64
|
"p-retry": "^5.1.2",
|
|
64
65
|
"pg-protocol": "^1.6.0",
|
|
65
66
|
"roarr": "^7.11.0",
|
|
@@ -72,7 +73,7 @@ export const packageJson = {
|
|
|
72
73
|
"zod": "^3.20.2"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
|
-
"@silverhand/eslint-config": "3.0.
|
|
76
|
+
"@silverhand/eslint-config": "3.0.1",
|
|
76
77
|
"@silverhand/ts-config": "3.0.0",
|
|
77
78
|
"@types/inquirer": "^9.0.0",
|
|
78
79
|
"@types/jest": "^29.4.0",
|
|
@@ -90,6 +91,9 @@ export const packageJson = {
|
|
|
90
91
|
},
|
|
91
92
|
"eslintConfig": {
|
|
92
93
|
"extends": "@silverhand",
|
|
94
|
+
"rules": {
|
|
95
|
+
"no-console": "error"
|
|
96
|
+
},
|
|
93
97
|
"ignorePatterns": [
|
|
94
98
|
"src/package-json.ts"
|
|
95
99
|
]
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
+
import { ConsoleLog } from '@logto/shared';
|
|
1
2
|
import type { Optional } from '@silverhand/essentials';
|
|
2
3
|
import type { Options } from 'ora';
|
|
3
4
|
export declare const safeExecSync: (command: string) => string | undefined;
|
|
4
|
-
|
|
5
|
-
info: typeof console.log;
|
|
6
|
-
succeed: typeof console.log;
|
|
7
|
-
warn: typeof console.log;
|
|
8
|
-
error: (...args: Parameters<typeof console.log>) => never;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const log: Log;
|
|
5
|
+
export declare const consoleLog: ConsoleLog;
|
|
11
6
|
export declare const getProxy: () => string | undefined;
|
|
12
7
|
export declare const downloadFile: (url: string, destination: string) => Promise<unknown>;
|
|
13
8
|
export declare const getPathInModule: (moduleName: string, relativePath?: string) => string;
|
|
@@ -38,4 +33,3 @@ export type ConnectorPackage = {
|
|
|
38
33
|
path: string;
|
|
39
34
|
};
|
|
40
35
|
export declare const getConnectorPackagesFromDirectory: (directory: string) => Promise<ConnectorPackage[]>;
|
|
41
|
-
export {};
|
package/lib/utils.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createWriteStream, existsSync } from 'node:fs';
|
|
|
3
3
|
import { readdir, readFile } from 'node:fs/promises';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import { ConsoleLog } from '@logto/shared';
|
|
6
7
|
import { conditionalString } from '@silverhand/essentials';
|
|
7
8
|
import chalk from 'chalk';
|
|
8
9
|
import { got } from 'got';
|
|
@@ -16,22 +17,17 @@ export const safeExecSync = (command) => {
|
|
|
16
17
|
}
|
|
17
18
|
catch { }
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
console.error(chalk.red('[error]'), ...args);
|
|
31
|
-
// eslint-disable-next-line unicorn/no-process-exit
|
|
32
|
-
process.exit(1);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
20
|
+
// The explicit type annotation is required to make `.fatal()`
|
|
21
|
+
// works correctly without `return`:
|
|
22
|
+
//
|
|
23
|
+
// ```ts
|
|
24
|
+
// const foo: number | undefined;
|
|
25
|
+
// consoleLog.fatal();
|
|
26
|
+
// typeof foo // Still `number | undefined` without explicit type annotation
|
|
27
|
+
// ```
|
|
28
|
+
//
|
|
29
|
+
// For now I have no idea why.
|
|
30
|
+
export const consoleLog = new ConsoleLog();
|
|
35
31
|
export const getProxy = () => {
|
|
36
32
|
const { HTTPS_PROXY, HTTP_PROXY, https_proxy, http_proxy } = process.env;
|
|
37
33
|
return HTTPS_PROXY ?? https_proxy ?? HTTP_PROXY ?? http_proxy;
|
|
@@ -79,7 +75,7 @@ export const oraPromise = async (promise, options, exitOnError = false) => {
|
|
|
79
75
|
catch (error) {
|
|
80
76
|
spinner.fail();
|
|
81
77
|
if (exitOnError) {
|
|
82
|
-
|
|
78
|
+
consoleLog.fatal(error);
|
|
83
79
|
}
|
|
84
80
|
throw error;
|
|
85
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/cli",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Logto CLI.",
|
|
5
5
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
6
6
|
"homepage": "https://github.com/logto-io/logto#readme",
|
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
"url": "https://github.com/logto-io/logto/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@logto/connector-kit": "^1.1.1",
|
|
32
|
+
"@logto/core-kit": "^2.0.0",
|
|
33
|
+
"@logto/language-kit": "^1.0.0",
|
|
34
|
+
"@logto/phrases": "^1.2.0",
|
|
35
|
+
"@logto/phrases-ui": "^1.2.0",
|
|
36
|
+
"@logto/schemas": "^1.2.1",
|
|
37
|
+
"@logto/shared": "^2.0.0",
|
|
31
38
|
"@silverhand/essentials": "^2.5.0",
|
|
32
39
|
"chalk": "^5.0.0",
|
|
33
40
|
"decamelize": "^6.0.0",
|
|
@@ -38,6 +45,7 @@
|
|
|
38
45
|
"nanoid": "^4.0.0",
|
|
39
46
|
"ora": "^6.1.2",
|
|
40
47
|
"p-limit": "^4.0.0",
|
|
48
|
+
"p-queue": "^7.3.4",
|
|
41
49
|
"p-retry": "^5.1.2",
|
|
42
50
|
"pg-protocol": "^1.6.0",
|
|
43
51
|
"roarr": "^7.11.0",
|
|
@@ -47,17 +55,10 @@
|
|
|
47
55
|
"slonik-sql-tag-raw": "^1.1.4",
|
|
48
56
|
"tar": "^6.1.11",
|
|
49
57
|
"yargs": "^17.6.0",
|
|
50
|
-
"zod": "^3.20.2"
|
|
51
|
-
"@logto/connector-kit": "^1.1.0",
|
|
52
|
-
"@logto/core-kit": "^1.1.0",
|
|
53
|
-
"@logto/language-kit": "^1.0.0",
|
|
54
|
-
"@logto/phrases": "^1.1.0",
|
|
55
|
-
"@logto/phrases-ui": "^1.1.0",
|
|
56
|
-
"@logto/schemas": "^1.1.0",
|
|
57
|
-
"@logto/shared": "^1.0.3"
|
|
58
|
+
"zod": "^3.20.2"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
|
-
"@silverhand/eslint-config": "3.0.
|
|
61
|
+
"@silverhand/eslint-config": "3.0.1",
|
|
61
62
|
"@silverhand/ts-config": "3.0.0",
|
|
62
63
|
"@types/inquirer": "^9.0.0",
|
|
63
64
|
"@types/jest": "^29.4.0",
|
|
@@ -75,6 +76,9 @@
|
|
|
75
76
|
},
|
|
76
77
|
"eslintConfig": {
|
|
77
78
|
"extends": "@silverhand",
|
|
79
|
+
"rules": {
|
|
80
|
+
"no-console": "error"
|
|
81
|
+
},
|
|
78
82
|
"ignorePatterns": [
|
|
79
83
|
"src/package-json.ts"
|
|
80
84
|
]
|