From d0db8e5076574d2db59c52218368f3983454e1f1 Mon Sep 17 00:00:00 2001 From: Alexander Zinn Date: Sat, 22 Nov 2025 21:12:02 -0500 Subject: [PATCH] prepare for depoyment --- README.md | 2 +- package.json | 16 +++------------- scripts/ci-build.sh | 19 +++++++++++++++++-- tests/HashFunctions.test.ts | 2 +- tsconfig.d.json | 26 ++++++++++++++++++++++++++ tsconfig.export.types.json | 7 ------- tsconfig.json | 11 +++-------- 7 files changed, 51 insertions(+), 32 deletions(-) create mode 100644 tsconfig.d.json diff --git a/README.md b/README.md index d051002..6e4091b 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ This implementation adheres to all five SOLID principles: ## Architecture -``` +```text src/ ├── core/ │ └── HashMap.ts # Main HashMap implementation diff --git a/package.json b/package.json index fdb14b8..f04aa3d 100644 --- a/package.json +++ b/package.json @@ -12,18 +12,17 @@ "ci-build": "bash scripts/ci-build.sh", "ci-deploy:ga": "bash scripts/ci-deploy.sh --beta false", "ci-deploy:beta": "bash scripts/ci-deploy.sh --beta true", - "format": "bun run prettier --write ./src/**/*.ts", "lint": "eslint", - "prelint:fix": "bun run format", "lint:fix": "eslint --fix", "test": "bun test", + "test:watch": "bun test --watch", "build:node:debug": "bun build ./src/index.ts --target=node --sourcemap=none --format=esm --sourcemap=inline --outdir=dist/node", "build:browser:debug": "bun build ./src/index.ts --target=browser --sourcemap=none --format=esm --sourcemap=inline --outdir=dist/browser", "build:node": "bun build ./src/index.ts --target=node --sourcemap=none --format=esm --splitting --minify --outdir=dist/node", "build:browser": "bun build ./src/index.ts --target=browser --sourcemap=none --format=esm --splitting --minify --outdir=dist/browser", "build:types": "bunx tsc -p tsconfig.d.json", "build:prepare-package-json": "bash scripts/prepare-package-json.sh" - }, + }, "keywords": [ "hashmap", "hash-map", @@ -36,16 +35,7 @@ "author": "Techniker.me", "license": "MIT", "devDependencies": { - "@eslint/css": "0.14.1", - "@eslint/js": "9.39.1", - "@eslint/json": "0.14.0", - "@eslint/markdown": "7.5.1", - "@types/bun": "latest", - "eslint": "9.39.1", - "globals": "16.5.0", - "jiti": "2.6.1", - "prettier": "3.6.2", - "typescript-eslint": "8.47.0" + "@types/bun": "latest" }, "peerDependencies": { "typescript": "^5" diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh index 71cc52b..5cf0e5d 100755 --- a/scripts/ci-build.sh +++ b/scripts/ci-build.sh @@ -4,6 +4,8 @@ set -o errexit set -o nounset set -o pipefail +xtrace="false" +debug="false" distDirectory=${DIST_DIRECTORY:-"dist"} if [[ ! -z "${distDirectory}" ]]; then @@ -12,6 +14,19 @@ if [[ ! -z "${distDirectory}" ]]; then rm -rf ${distDirectory} fi +while [[ $# -gt 0 ]]; do + case $1 in + --xtrace|-x) + xtrace="true" + shift + ;; + --debug|-d) + debug="true" + shift + ;; + esac +done + bun run lint bun run build:node bun run build:browser @@ -24,8 +39,8 @@ cp .npmrc ./${distDirectory} echo "Copying [.nvmrc] to [${distDirectory}]" cp .nvmrc ./${distDirectory} -echo "Copying [README.md] to [${distDirectory}]" -cp README ./${distDirectory} +# echo "Copying [README.md] to [${distDirectory}]" +# cp README ./${distDirectory} ls ${distDirectory} diff --git a/tests/HashFunctions.test.ts b/tests/HashFunctions.test.ts index dee1a01..31dade8 100644 --- a/tests/HashFunctions.test.ts +++ b/tests/HashFunctions.test.ts @@ -87,7 +87,7 @@ describe("DefaultHashFunction", () => { }); it("should handle circular references gracefully", () => { - const circular: any = { name: "test" }; + const circular: { name: string; self?: unknown } = { name: "test" }; circular.self = circular; // Create circular reference // Should not throw, should fall back to Object.prototype.toString diff --git a/tsconfig.d.json b/tsconfig.d.json new file mode 100644 index 0000000..9755af9 --- /dev/null +++ b/tsconfig.d.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "lib": ["esnext", "dom"], + "target": "es6", + "module": "esnext", + + "moduleResolution": "bundler", + "esModuleInterop": true, + "allowImportingTsExtensions": true, + "allowArbitraryExtensions": true, + "isolatedModules": true, + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "dist/types", + + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + + "noUnusedLocals": true, + "noUnusedParameters": true, + "noPropertyAccessFromIndexSignature": false + }, + "include": ["src"], + "exclude": ["dist", "test"] +} diff --git a/tsconfig.export.types.json b/tsconfig.export.types.json index 182ac73..d790303 100644 --- a/tsconfig.export.types.json +++ b/tsconfig.export.types.json @@ -1,28 +1,21 @@ { "compilerOptions": { - // Environment setup & latest features "lib": ["ESNext"], "target": "ESNext", "module": "Preserve", "moduleDetection": "force", "jsx": "react-jsx", "allowJs": true, - - // Bundler mode "moduleResolution": "bundler", "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, "noEmit": false, "emitDeclarationOnly": true, - - // Best practices "strict": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, "noImplicitOverride": true, - - // Some stricter flags (disabled by default) "noUnusedLocals": false, "noUnusedParameters": false, "noPropertyAccessFromIndexSignature": false diff --git a/tsconfig.json b/tsconfig.json index 0d9208a..cc312a3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,22 @@ { "compilerOptions": { - // Environment setup & latest features "lib": ["ESNext"], "target": "ESNext", "module": "Preserve", + "outDir": "dist", "moduleDetection": "force", "jsx": "react-jsx", "allowJs": true, - - // Bundler mode "moduleResolution": "bundler", "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, - "noEmit": true, - - // Best practices + "noEmit": false, + "emitDeclarationOnly": false, "strict": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, "noImplicitOverride": true, - - // Some stricter flags (disabled by default) "noUnusedLocals": false, "noUnusedParameters": false, "noPropertyAccessFromIndexSignature": false