@oro-dxeco/playwright-aws-lambda 133.0.0-alpha.2 → 133.0.0-alpha.3

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.
@@ -96,8 +96,13 @@ async function launchChromium(launchOptions) {
96
96
  const headless = isHeadlessModeEnabled_1.default();
97
97
  const args = getChromiumArgs(headless);
98
98
  const executablePath = await getChromiumExecutablePath(headless);
99
+ const baselibPath = isLambdaRuntimeEnvironment_1.default()
100
+ ? '/tmp/al2/lib'
101
+ : isLambdaRuntimeEnvironmentNode20_1.default()
102
+ ? '/tmp/al2023/lib'
103
+ : '/tmp/aws/lib';
99
104
  const env = {
100
- ...(await getEnvironmentVariables_1.default()),
105
+ ...(await getEnvironmentVariables_1.default(baselibPath)),
101
106
  ...((launchOptions === null || launchOptions === void 0 ? void 0 : launchOptions.env) || {}),
102
107
  };
103
108
  const browser = await playwright.chromium.launch({
@@ -1,3 +1,3 @@
1
1
  export declare const AWS_TMP_DIR = "/tmp/aws";
2
2
  export declare const AWS_FONT_DIR = "/tmp/fonts";
3
- export default function getEnvironmentVariables(): Promise<Record<string, string>>;
3
+ export default function getEnvironmentVariables(baselibPath: string): Promise<Record<string, string>>;
@@ -7,8 +7,8 @@ const isLambdaRuntimeEnvironment_1 = require("./isLambdaRuntimeEnvironment");
7
7
  const isLambdaRuntimeEnvironmentNode20_1 = require("./isLambdaRuntimeEnvironmentNode20");
8
8
  exports.AWS_TMP_DIR = '/tmp/aws';
9
9
  exports.AWS_FONT_DIR = '/tmp/fonts';
10
- const AWS_LIB_DIR = `${exports.AWS_TMP_DIR}/lib`;
11
- async function getEnvironmentVariables() {
10
+ //const AWS_LIB_DIR = `${AWS_TMP_DIR}/lib`;
11
+ async function getEnvironmentVariables(baselibPath) {
12
12
  if (!isLambdaRuntimeEnvironment_1.default() && !isLambdaRuntimeEnvironmentNode20_1.default()) {
13
13
  return {};
14
14
  }
@@ -30,11 +30,11 @@ async function getEnvironmentVariables() {
30
30
  env.FONTCONFIG_PATH = exports.AWS_TMP_DIR;
31
31
  }
32
32
  if (!process.env.LD_LIBRARY_PATH) {
33
- env.LD_LIBRARY_PATH = AWS_LIB_DIR;
33
+ env.LD_LIBRARY_PATH = baselibPath;
34
34
  }
35
- else if (!process.env.LD_LIBRARY_PATH.startsWith(AWS_LIB_DIR)) {
35
+ else if (!process.env.LD_LIBRARY_PATH.startsWith(baselibPath)) {
36
36
  env.LD_LIBRARY_PATH = [
37
- ...new Set([AWS_LIB_DIR, ...process.env.LD_LIBRARY_PATH.split(':')]),
37
+ ...new Set([baselibPath, ...process.env.LD_LIBRARY_PATH.split(':')]),
38
38
  ].join(':');
39
39
  }
40
40
  return env;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oro-dxeco/playwright-aws-lambda",
3
- "version": "133.0.0-alpha.2",
3
+ "version": "133.0.0-alpha.3",
4
4
  "description": "Support for running Microsoft's Playwrite on AWS Lambda and Google Cloud functions",
5
5
  "repository": {
6
6
  "type": "git",