From 0ca7eb5bfe5288249d788cd54a5f88b3eeb7c025 Mon Sep 17 00:00:00 2001 From: udondan Date: Wed, 10 Apr 2024 11:14:58 +0200 Subject: [PATCH] test: fix imports --- Makefile | 18 ++++++++++++++++++ test/Makefile | 3 +-- test/lib/index.ts | 3 +-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cb42f6a..b5eea45 100644 --- a/Makefile +++ b/Makefile @@ -22,3 +22,21 @@ eslint: @echo -e "$(TARGET_COLOR)Running eslint $$(npx eslint --version)$(NO_COLOR)" @npx eslint .; \ echo "Passed" + +validate-package: + @echo -e "$(TARGET_COLOR)Checking package content$(NO_COLOR)" + @npm publish --dry-run 2>&1 | tee publish_output.txt + @\ + FILES_TO_CHECK="lambda/code.zip lib/index.d.ts lib/index.js lib/types.d.ts lib/types.js"; \ + MISSING_FILES=""; \ + for file in $$FILES_TO_CHECK; do \ + if ! grep -q $$file publish_output.txt; then \ + MISSING_FILES="$$MISSING_FILES $$file"; \ + fi; \ + done; \ + if [ -n "$$MISSING_FILES" ]; then \ + echo "❌ The following files are NOT included in the package:$$MISSING_FILES"; \ + rm publish_output.txt; \ + exit 1; \ + fi + @rm publish_output.txt diff --git a/test/Makefile b/test/Makefile index 537203a..9d2cad6 100644 --- a/test/Makefile +++ b/test/Makefile @@ -5,7 +5,6 @@ clean: install: package @echo Installing dependencies... - @cd .. && make install @npm install ../cdk-athena-test.tgz --no-save --prefer-offline --cache ../.npm @npm list @@ -33,6 +32,6 @@ package: @echo Building npm tgz... @ \ cd .. && \ - make build && \ + make install build && \ npm pack && \ mv cdk-athena-*.tgz cdk-athena-test.tgz diff --git a/test/lib/index.ts b/test/lib/index.ts index 355340f..666fb4a 100644 --- a/test/lib/index.ts +++ b/test/lib/index.ts @@ -8,8 +8,7 @@ import { Tags, } from 'aws-cdk-lib'; import { Construct } from 'constructs'; - -import { EncryptionOption, LogLevel, NamedQuery, WorkGroup } from '../../lib'; +import { EncryptionOption, LogLevel, NamedQuery, WorkGroup } from 'cdk-athena'; export class TestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) {