@bifravst/http-api-mock 1.1.4 → 1.1.6

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.
@@ -2,20 +2,30 @@ import { packLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
2
2
  import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers'
3
3
  import { HTTPAPIMockApp } from './App.js'
4
4
  import { fromEnv } from '@nordicsemiconductor/from-env'
5
- import path, { dirname } from 'node:path'
5
+ import path from 'node:path'
6
6
  import { fileURLToPath } from 'node:url'
7
+ import fs from 'node:fs/promises'
8
+ import os from 'node:os'
7
9
 
8
10
  const { stackName } = fromEnv({ stackName: 'HTTP_API_MOCK_STACK_NAME' })(
9
11
  process.env,
10
12
  )
11
13
 
14
+ const baseDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '..')
15
+ const distDir = await fs.mkdtemp(path.join(os.tmpdir(), 'temp-'))
16
+ const lambdasDir = path.join(distDir, 'lambdas')
17
+ await fs.mkdir(lambdasDir)
18
+ const layersDir = path.join(distDir, 'layers')
19
+ await fs.mkdir(layersDir)
20
+
12
21
  new HTTPAPIMockApp(stackName, {
13
22
  lambdaSources: {
14
23
  httpApiMock: await packLambdaFromPath(
15
24
  'httpApiMock',
16
25
  'cdk/resources/http-api-mock-lambda.ts',
17
26
  undefined,
18
- path.join(dirname(fileURLToPath(import.meta.url)), '..'),
27
+ baseDir,
28
+ lambdasDir,
19
29
  ),
20
30
  },
21
31
  layer: await packLayer({
@@ -25,5 +35,7 @@ new HTTPAPIMockApp(stackName, {
25
35
  '@nordicsemiconductor/from-env',
26
36
  '@hello.nrfcloud.com/lambda-helpers',
27
37
  ],
38
+ baseDir,
39
+ distDir: layersDir,
28
40
  }),
29
41
  })
@@ -2,12 +2,20 @@ import { packLayer } from '@bifravst/aws-cdk-lambda-helpers/layer';
2
2
  import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers';
3
3
  import { HTTPAPIMockApp } from './App.js';
4
4
  import { fromEnv } from '@nordicsemiconductor/from-env';
5
- import path, { dirname } from 'node:path';
5
+ import path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
+ import fs from 'node:fs/promises';
8
+ import os from 'node:os';
7
9
  const { stackName } = fromEnv({ stackName: 'HTTP_API_MOCK_STACK_NAME' })(process.env);
10
+ const baseDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
11
+ const distDir = await fs.mkdtemp(path.join(os.tmpdir(), 'temp-'));
12
+ const lambdasDir = path.join(distDir, 'lambdas');
13
+ await fs.mkdir(lambdasDir);
14
+ const layersDir = path.join(distDir, 'layers');
15
+ await fs.mkdir(layersDir);
8
16
  new HTTPAPIMockApp(stackName, {
9
17
  lambdaSources: {
10
- httpApiMock: await packLambdaFromPath('httpApiMock', 'cdk/resources/http-api-mock-lambda.ts', undefined, path.join(dirname(fileURLToPath(import.meta.url)), '..')),
18
+ httpApiMock: await packLambdaFromPath('httpApiMock', 'cdk/resources/http-api-mock-lambda.ts', undefined, baseDir, lambdasDir),
11
19
  },
12
20
  layer: await packLayer({
13
21
  id: 'testResources',
@@ -16,5 +24,7 @@ new HTTPAPIMockApp(stackName, {
16
24
  '@nordicsemiconductor/from-env',
17
25
  '@hello.nrfcloud.com/lambda-helpers',
18
26
  ],
27
+ baseDir,
28
+ distDir: layersDir,
19
29
  }),
20
30
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifravst/http-api-mock",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Helper functions for AWS lambdas written in TypeScript.",
5
5
  "exports": {
6
6
  "./*": {
@@ -35,11 +35,11 @@
35
35
  "author": "Nordic Semiconductor ASA | nordicsemi.no",
36
36
  "license": "BSD-3-Clause",
37
37
  "devDependencies": {
38
- "@bifravst/eslint-config-typescript": "6.0.20",
38
+ "@bifravst/eslint-config-typescript": "6.0.22",
39
39
  "@bifravst/prettier-config": "1.0.0",
40
40
  "@commitlint/config-conventional": "19.1.0",
41
41
  "@types/aws-lambda": "8.10.137",
42
- "@types/node": "20.12.5",
42
+ "@types/node": "20.12.7",
43
43
  "globstar": "1.0.0",
44
44
  "husky": "9.0.11"
45
45
  },
@@ -93,20 +93,20 @@
93
93
  ],
94
94
  "prettier": "@bifravst/prettier-config",
95
95
  "peerDependencies": {
96
- "@aws-sdk/client-cloudformation": "^3.549.0",
97
- "@aws-sdk/client-sts": "^3.549.0",
98
- "@bifravst/aws-cdk-lambda-helpers": "^1.2.3",
96
+ "@aws-sdk/client-cloudformation": "^3.552.0",
97
+ "@aws-sdk/client-sts": "^3.552.0",
99
98
  "@bifravst/run": "^1.2.0",
100
99
  "@nordicsemiconductor/cloudformation-helpers": "^9.0.3",
101
- "aws-cdk-lib": "^2.135.0",
102
- "cdk": "^2.135.0",
100
+ "aws-cdk-lib": "^2.137.0",
101
+ "cdk": "^2.137.0",
103
102
  "chalk": "^5.3.0",
104
103
  "tsx": "^4.7.2"
105
104
  },
106
105
  "dependencies": {
107
- "@aws-sdk/client-dynamodb": "3.549.0",
108
- "@aws-sdk/util-dynamodb": "3.549.0",
109
- "@hello.nrfcloud.com/lambda-helpers": "1.0.0",
110
- "@nordicsemiconductor/from-env": "3.0.1"
106
+ "@aws-sdk/client-dynamodb": "^3.552.0",
107
+ "@aws-sdk/util-dynamodb": "^3.552.0",
108
+ "@bifravst/aws-cdk-lambda-helpers": "^1.3.3",
109
+ "@hello.nrfcloud.com/lambda-helpers": "^1.0.1",
110
+ "@nordicsemiconductor/from-env": "^3.0.1"
111
111
  }
112
112
  }