sst 2.49.4 → 2.49.5
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/package.json +1 -1
- package/package.json.bak +1 -1
- package/util/user-configuration.js +11 -2
package/package.json
CHANGED
package/package.json.bak
CHANGED
|
@@ -5,8 +5,17 @@ import * as fs from "fs";
|
|
|
5
5
|
export const PROJECT_CONFIG = "cdk.json";
|
|
6
6
|
export const USER_DEFAULTS = "~/.cdk.json";
|
|
7
7
|
const CONTEXT_KEY = "context";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
let cdkToolkitPath;
|
|
9
|
+
try {
|
|
10
|
+
const cdkToolkitUrl = await import.meta.resolve("@aws-cdk/toolkit-lib");
|
|
11
|
+
cdkToolkitPath = new URL(cdkToolkitUrl).pathname;
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// Fallback for test environment where import.meta.resolve is not available
|
|
15
|
+
const module = await import("module");
|
|
16
|
+
const require = module.createRequire(import.meta.url);
|
|
17
|
+
cdkToolkitPath = require.resolve("@aws-cdk/toolkit-lib");
|
|
18
|
+
}
|
|
10
19
|
const { ToolkitError } = await import(cdkToolkitPath);
|
|
11
20
|
const { Context, PROJECT_CONTEXT } = await import(fs_path.resolve(cdkToolkitPath, "..", "api", "context.js"));
|
|
12
21
|
const { Settings } = await import(fs_path.resolve(cdkToolkitPath, "..", "api", "settings.js"));
|