diff --git a/cdk/TestStack.ts b/cdk/TestStack.ts index f075f01..b883cb1 100644 --- a/cdk/TestStack.ts +++ b/cdk/TestStack.ts @@ -2,8 +2,8 @@ import type { App } from 'aws-cdk-lib' import { CfnOutput, Duration, aws_lambda as Lambda, Stack } from 'aws-cdk-lib' import { LambdaSource } from '../src/cdk.js' import type { PackedLayer } from '../src/layer.js' -import type { TestLambdas } from './packTestLambdas.js' import { PackedLambdaFn } from '../src/PackedLambdaFn.js' +import type { TestLambdas } from './packTestLambdas.js' export class TestStack extends Stack { public constructor( diff --git a/cdk/baseLayer.ts b/cdk/baseLayer.ts index 2f4773f..6b19ccc 100644 --- a/cdk/baseLayer.ts +++ b/cdk/baseLayer.ts @@ -1,5 +1,5 @@ -import { packLayer, type PackedLayer } from '../src/layer.js' import type pJson from '../package.json' +import { packLayer, type PackedLayer } from '../src/layer.js' const dependencies: Array< keyof (typeof pJson)['devDependencies'] | keyof (typeof pJson)['dependencies'] diff --git a/cdk/e2e.ts b/cdk/e2e.ts index e5e1bc5..3a4ad51 100644 --- a/cdk/e2e.ts +++ b/cdk/e2e.ts @@ -1,7 +1,7 @@ +import { fromEnv } from '@bifravst/from-env' import { TestApp } from './TestApp.js' import { pack as packBaseLayer } from './baseLayer.js' import { packTestLambdas } from './packTestLambdas.js' -import { fromEnv } from '@bifravst/from-env' const { stackName } = fromEnv({ stackName: 'STACK_NAME', })(process.env) diff --git a/e2e.spec.ts b/e2e.spec.ts index e027ff0..eeade04 100644 --- a/e2e.spec.ts +++ b/e2e.spec.ts @@ -1,9 +1,9 @@ -import { describe, it } from 'node:test' -import assert from 'node:assert/strict' -import { stackOutput } from '@bifravst/cloudformation-helpers' import { CloudFormationClient } from '@aws-sdk/client-cloudformation' -import type { StackOutputs } from './cdk/TestStack.js' +import { stackOutput } from '@bifravst/cloudformation-helpers' import { fromEnv } from '@bifravst/from-env' +import assert from 'node:assert/strict' +import { describe, it } from 'node:test' +import type { StackOutputs } from './cdk/TestStack.js' void describe('end-to-end tests', () => { void it('should return an ULID', async () => { diff --git a/src/LambdaLogGroup.ts b/src/LambdaLogGroup.ts index 96c6472..9208ad1 100644 --- a/src/LambdaLogGroup.ts +++ b/src/LambdaLogGroup.ts @@ -1,5 +1,5 @@ -import { Construct } from 'constructs' import { aws_logs as Logs, Names, RemovalPolicy, Stack } from 'aws-cdk-lib' +import { Construct } from 'constructs' export class LambdaLogGroup extends Construct { public readonly logGroup: Logs.LogGroup diff --git a/src/PackedLambdaFn.ts b/src/PackedLambdaFn.ts index 863fa6b..e890403 100644 --- a/src/PackedLambdaFn.ts +++ b/src/PackedLambdaFn.ts @@ -1,14 +1,14 @@ +import { Permissions as SettingsPermissions } from '@bifravst/aws-ssm-settings-helpers/cdk' import { - aws_lambda as Lambda, Duration, + aws_lambda as Lambda, Stack, type aws_logs as Logs, } from 'aws-cdk-lib' import { Construct } from 'constructs' import { LambdaLogGroup } from './LambdaLogGroup.js' -import { Permissions as SettingsPermissions } from '@bifravst/aws-ssm-settings-helpers/cdk' -import type { PackedLambda } from './packLambda.js' import { LambdaSource } from './LambdaSource.js' +import type { PackedLambda } from './packLambda.js' /** * Creates a Lambda function with useful defaults: diff --git a/src/cdk.ts b/src/cdk.ts index 8de17ef..af2c6e7 100644 --- a/src/cdk.ts +++ b/src/cdk.ts @@ -1,4 +1,4 @@ -export * from './LambdaSource.js' -export * from './LambdaLogGroup.js' export * from './IoTActionRole.js' +export * from './LambdaLogGroup.js' +export * from './LambdaSource.js' export * from './PackedLambdaFn.js' diff --git a/src/checkSumOfFiles.spec.ts b/src/checkSumOfFiles.spec.ts index 96615e7..117f97b 100644 --- a/src/checkSumOfFiles.spec.ts +++ b/src/checkSumOfFiles.spec.ts @@ -1,6 +1,6 @@ -import { describe, it } from 'node:test' import assert from 'node:assert/strict' import path from 'node:path' +import { describe, it } from 'node:test' import { checkSumOfFiles } from './checksumOfFiles.js' void describe('checkSumOfFiles()', () => { diff --git a/src/commonParent.spec.ts b/src/commonParent.spec.ts index 51f3c30..7c1cdab 100644 --- a/src/commonParent.spec.ts +++ b/src/commonParent.spec.ts @@ -1,5 +1,5 @@ -import { describe, it } from 'node:test' import assert from 'node:assert/strict' +import { describe, it } from 'node:test' import { commonParent } from './commonParent.js' void describe('commonParent()', () => { diff --git a/src/module-folder-named-like-handler-bug.spec.ts b/src/module-folder-named-like-handler-bug.spec.ts index 0b1e0a3..f20df54 100644 --- a/src/module-folder-named-like-handler-bug.spec.ts +++ b/src/module-folder-named-like-handler-bug.spec.ts @@ -1,10 +1,10 @@ import assert from 'node:assert/strict' -import { it, describe } from 'node:test' -import { ImportFromFolderNameError, packLambda } from './packLambda.js' -import path, { dirname } from 'node:path' -import { fileURLToPath } from 'node:url' import fs from 'node:fs/promises' import os from 'node:os' +import path, { dirname } from 'node:path' +import { describe, it } from 'node:test' +import { fileURLToPath } from 'node:url' +import { ImportFromFolderNameError, packLambda } from './packLambda.js' const tmpDir = os.tmpdir() diff --git a/src/packLambda.ts b/src/packLambda.ts index 2d30b88..8a13193 100644 --- a/src/packLambda.ts +++ b/src/packLambda.ts @@ -1,12 +1,12 @@ import swc from '@swc/core' import { createWriteStream } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' import { parse } from 'path' import yazl from 'yazl' import { checkSumOfFiles } from './checksumOfFiles.js' import { commonParent } from './commonParent.js' import { findDependencies } from './findDependencies.js' -import { fileURLToPath } from 'node:url' -import path from 'node:path' export type PackedLambda = { id: string diff --git a/src/packLayer.ts b/src/packLayer.ts index 17707c9..8d9fc1f 100644 --- a/src/packLayer.ts +++ b/src/packLayer.ts @@ -2,10 +2,10 @@ import { spawn } from 'child_process' import { createWriteStream } from 'fs' import { copyFile, mkdir, readFile, rm, stat, writeFile } from 'fs/promises' import { glob } from 'glob' +import { fileURLToPath } from 'node:url' import path from 'path' import { ZipFile } from 'yazl' import { checkSumOfFiles, checkSumOfStrings } from './checksumOfFiles.js' -import { fileURLToPath } from 'node:url' export type PackedLayer = { layerZipFile: string; hash: string }