@logto/cli 1.26.0 → 1.28.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url';
|
|
1
2
|
import { conditionalString } from '@silverhand/essentials';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import { createPoolFromConfig } from '../../../database.js';
|
|
@@ -7,7 +8,7 @@ import { getAlterationFiles, getTimestampFromFilename, chooseRevertAlterationsBy
|
|
|
7
8
|
import { chooseAlterationsByVersion, chooseRevertAlterationsByVersion } from './version.js';
|
|
8
9
|
const importAlterationScript = async (filePath) => {
|
|
9
10
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
10
|
-
const module = await import(filePath);
|
|
11
|
+
const module = await import(pathToFileURL(filePath).href);
|
|
11
12
|
// eslint-disable-next-line no-restricted-syntax
|
|
12
13
|
return module.default;
|
|
13
14
|
};
|
|
@@ -118,7 +118,7 @@ export const seedTables = async (connection, latestTimestamp, isCloud) => {
|
|
|
118
118
|
connection.query(insertInto(createDefaultAccountCenter(defaultTenantId), AccountCenters.table)),
|
|
119
119
|
connection.query(insertInto(createDefaultAccountCenter(adminTenantId), AccountCenters.table)),
|
|
120
120
|
]);
|
|
121
|
-
// The below seed data is for the Logto Cloud only. We put it here for the
|
|
121
|
+
// The below seed data is for the Logto Cloud only. We put it here for the sake of simplicity.
|
|
122
122
|
// The data is not harmful for OSS, since they are all admin tenant data. OSS will not use them
|
|
123
123
|
// and they cannot be seen by the Console.
|
|
124
124
|
await Promise.all([
|
|
@@ -16,13 +16,19 @@ import { cliConfig, ConfigKey, consoleLog, downloadFile, isTty, oraPromise, safe
|
|
|
16
16
|
import { seedByPool } from '../database/seed/index.js';
|
|
17
17
|
const pgRequired = new semver.SemVer('14.0.0');
|
|
18
18
|
export const validateNodeVersion = () => {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const requiredVersionString = packageJson.engines.node;
|
|
20
|
+
const requiredRange = new semver.Range(requiredVersionString);
|
|
21
|
+
const required = requiredVersionString
|
|
22
|
+
.split('||')
|
|
23
|
+
.map((version) => new semver.SemVer(version.trim().replace(/^\^/, '')));
|
|
21
24
|
const current = new semver.SemVer(execSync('node -v', { encoding: 'utf8', stdio: 'pipe' }));
|
|
22
|
-
if
|
|
25
|
+
// Exit if the major version is lower than the required version since there may be changes that
|
|
26
|
+
// break the compatibility.
|
|
27
|
+
if (required.every((version) => version.major > current.major)) {
|
|
23
28
|
consoleLog.fatal(`Logto requires NodeJS ${requiredVersionString}, but ${current.version} found.`);
|
|
24
29
|
}
|
|
25
|
-
|
|
30
|
+
// Only warn for incompatible minor/patch versions or higher major versions.
|
|
31
|
+
if (!requiredRange.test(current.version)) {
|
|
26
32
|
consoleLog.warn(`Logto is tested under NodeJS ${requiredVersionString}, but version ${current.version} found.`);
|
|
27
33
|
}
|
|
28
34
|
};
|
package/lib/connector/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import connectorKitMeta from '@logto/connector-kit/package.json'
|
|
2
|
+
import connectorKitMeta from '@logto/connector-kit/package.json' with { type: 'json' };
|
|
3
3
|
import { satisfies } from 'semver';
|
|
4
4
|
import { consoleLog } from '../utils.js';
|
|
5
5
|
import { isKeyInObject } from './utils.js';
|
|
@@ -26,7 +26,7 @@ export const loadConnector = async (connectorPath, ignoreVersionMismatch) => {
|
|
|
26
26
|
const { default: { dependencies },
|
|
27
27
|
// eslint-disable-next-line no-restricted-syntax
|
|
28
28
|
} = (await import(path.join(connectorPath, 'package.json'), {
|
|
29
|
-
|
|
29
|
+
with: { type: 'json' },
|
|
30
30
|
}));
|
|
31
31
|
checkConnectorKitVersion(dependencies, ignoreVersionMismatch);
|
|
32
32
|
const loaded = await import(path.join(connectorPath, 'lib/index.js'));
|
package/lib/package-json.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const packageJson = {
|
|
2
2
|
"name": "@logto/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Logto CLI.",
|
|
5
5
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
6
6
|
"homepage": "https://github.com/logto-io/logto#readme",
|
|
@@ -36,16 +36,16 @@ export const packageJson = {
|
|
|
36
36
|
"prepack": "pnpm build"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
|
-
"node": "^
|
|
39
|
+
"node": "^22.14.0"
|
|
40
40
|
},
|
|
41
41
|
"bugs": {
|
|
42
42
|
"url": "https://github.com/logto-io/logto/issues"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@logto/connector-kit": "workspace:^4.
|
|
46
|
-
"@logto/core-kit": "workspace:^2.
|
|
47
|
-
"@logto/schemas": "workspace:1.
|
|
48
|
-
"@logto/shared": "workspace:^3.
|
|
45
|
+
"@logto/connector-kit": "workspace:^4.3.0",
|
|
46
|
+
"@logto/core-kit": "workspace:^2.6.0",
|
|
47
|
+
"@logto/schemas": "workspace:1.28.0",
|
|
48
|
+
"@logto/shared": "workspace:^3.3.0",
|
|
49
49
|
"@silverhand/essentials": "^2.9.1",
|
|
50
50
|
"@silverhand/slonik": "31.0.0-beta.2",
|
|
51
51
|
"chalk": "^5.3.0",
|
|
@@ -62,25 +62,25 @@ export const packageJson = {
|
|
|
62
62
|
"semver": "^7.3.8",
|
|
63
63
|
"tar": "^7.0.0",
|
|
64
64
|
"yargs": "^17.6.0",
|
|
65
|
-
"zod": "
|
|
65
|
+
"zod": "3.24.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@silverhand/eslint-config": "6.0.1",
|
|
69
69
|
"@silverhand/ts-config": "6.0.0",
|
|
70
70
|
"@types/inquirer": "^9.0.0",
|
|
71
|
-
"@types/node": "^
|
|
71
|
+
"@types/node": "^22.14.0",
|
|
72
72
|
"@types/semver": "^7.3.12",
|
|
73
73
|
"@types/sinon": "^17.0.0",
|
|
74
74
|
"@types/tar": "^6.1.12",
|
|
75
75
|
"@types/yargs": "^17.0.13",
|
|
76
|
-
"@vitest/coverage-v8": "^
|
|
76
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
77
77
|
"@withtyped/server": "^0.14.0",
|
|
78
78
|
"eslint": "^8.56.0",
|
|
79
79
|
"lint-staged": "^15.0.0",
|
|
80
|
-
"prettier": "^3.
|
|
80
|
+
"prettier": "^3.5.3",
|
|
81
81
|
"sinon": "^19.0.0",
|
|
82
82
|
"typescript": "^5.5.3",
|
|
83
|
-
"vitest": "^
|
|
83
|
+
"vitest": "^3.1.1"
|
|
84
84
|
},
|
|
85
85
|
"eslintConfig": {
|
|
86
86
|
"extends": "@silverhand",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Logto CLI.",
|
|
5
5
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
6
6
|
"homepage": "https://github.com/logto-io/logto#readme",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"url": "git+https://github.com/logto-io/logto.git"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": "^
|
|
25
|
+
"node": "^22.14.0"
|
|
26
26
|
},
|
|
27
27
|
"bugs": {
|
|
28
28
|
"url": "https://github.com/logto-io/logto/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@logto/connector-kit": "^4.
|
|
32
|
-
"@logto/core-kit": "^2.
|
|
33
|
-
"@logto/schemas": "1.
|
|
34
|
-
"@logto/shared": "^3.
|
|
31
|
+
"@logto/connector-kit": "^4.3.0",
|
|
32
|
+
"@logto/core-kit": "^2.6.0",
|
|
33
|
+
"@logto/schemas": "1.28.0",
|
|
34
|
+
"@logto/shared": "^3.3.0",
|
|
35
35
|
"@silverhand/essentials": "^2.9.1",
|
|
36
36
|
"@silverhand/slonik": "31.0.0-beta.2",
|
|
37
37
|
"chalk": "^5.3.0",
|
|
@@ -48,25 +48,25 @@
|
|
|
48
48
|
"semver": "^7.3.8",
|
|
49
49
|
"tar": "^7.0.0",
|
|
50
50
|
"yargs": "^17.6.0",
|
|
51
|
-
"zod": "
|
|
51
|
+
"zod": "3.24.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@silverhand/eslint-config": "6.0.1",
|
|
55
55
|
"@silverhand/ts-config": "6.0.0",
|
|
56
56
|
"@types/inquirer": "^9.0.0",
|
|
57
|
-
"@types/node": "^
|
|
57
|
+
"@types/node": "^22.14.0",
|
|
58
58
|
"@types/semver": "^7.3.12",
|
|
59
59
|
"@types/sinon": "^17.0.0",
|
|
60
60
|
"@types/tar": "^6.1.12",
|
|
61
61
|
"@types/yargs": "^17.0.13",
|
|
62
|
-
"@vitest/coverage-v8": "^
|
|
62
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
63
63
|
"@withtyped/server": "^0.14.0",
|
|
64
64
|
"eslint": "^8.56.0",
|
|
65
65
|
"lint-staged": "^15.0.0",
|
|
66
|
-
"prettier": "^3.
|
|
66
|
+
"prettier": "^3.5.3",
|
|
67
67
|
"sinon": "^19.0.0",
|
|
68
68
|
"typescript": "^5.5.3",
|
|
69
|
-
"vitest": "^
|
|
69
|
+
"vitest": "^3.1.1"
|
|
70
70
|
},
|
|
71
71
|
"eslintConfig": {
|
|
72
72
|
"extends": "@silverhand",
|