prepare for depoyment
This commit is contained in:
@@ -179,7 +179,7 @@ This implementation adheres to all five SOLID principles:
|
|||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
```
|
```text
|
||||||
src/
|
src/
|
||||||
├── core/
|
├── core/
|
||||||
│ └── HashMap.ts # Main HashMap implementation
|
│ └── HashMap.ts # Main HashMap implementation
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -12,18 +12,17 @@
|
|||||||
"ci-build": "bash scripts/ci-build.sh",
|
"ci-build": "bash scripts/ci-build.sh",
|
||||||
"ci-deploy:ga": "bash scripts/ci-deploy.sh --beta false",
|
"ci-deploy:ga": "bash scripts/ci-deploy.sh --beta false",
|
||||||
"ci-deploy:beta": "bash scripts/ci-deploy.sh --beta true",
|
"ci-deploy:beta": "bash scripts/ci-deploy.sh --beta true",
|
||||||
"format": "bun run prettier --write ./src/**/*.ts",
|
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"prelint:fix": "bun run format",
|
|
||||||
"lint:fix": "eslint --fix",
|
"lint:fix": "eslint --fix",
|
||||||
"test": "bun test",
|
"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: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: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: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: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:types": "bunx tsc -p tsconfig.d.json",
|
||||||
"build:prepare-package-json": "bash scripts/prepare-package-json.sh"
|
"build:prepare-package-json": "bash scripts/prepare-package-json.sh"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hashmap",
|
"hashmap",
|
||||||
"hash-map",
|
"hash-map",
|
||||||
@@ -36,16 +35,7 @@
|
|||||||
"author": "Techniker.me",
|
"author": "Techniker.me",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/css": "0.14.1",
|
"@types/bun": "latest"
|
||||||
"@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"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
xtrace="false"
|
||||||
|
debug="false"
|
||||||
distDirectory=${DIST_DIRECTORY:-"dist"}
|
distDirectory=${DIST_DIRECTORY:-"dist"}
|
||||||
|
|
||||||
if [[ ! -z "${distDirectory}" ]]; then
|
if [[ ! -z "${distDirectory}" ]]; then
|
||||||
@@ -12,6 +14,19 @@ if [[ ! -z "${distDirectory}" ]]; then
|
|||||||
rm -rf ${distDirectory}
|
rm -rf ${distDirectory}
|
||||||
fi
|
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 lint
|
||||||
bun run build:node
|
bun run build:node
|
||||||
bun run build:browser
|
bun run build:browser
|
||||||
@@ -24,8 +39,8 @@ cp .npmrc ./${distDirectory}
|
|||||||
echo "Copying [.nvmrc] to [${distDirectory}]"
|
echo "Copying [.nvmrc] to [${distDirectory}]"
|
||||||
cp .nvmrc ./${distDirectory}
|
cp .nvmrc ./${distDirectory}
|
||||||
|
|
||||||
echo "Copying [README.md] to [${distDirectory}]"
|
# echo "Copying [README.md] to [${distDirectory}]"
|
||||||
cp README ./${distDirectory}
|
# cp README ./${distDirectory}
|
||||||
|
|
||||||
ls ${distDirectory}
|
ls ${distDirectory}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ describe("DefaultHashFunction", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should handle circular references gracefully", () => {
|
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
|
circular.self = circular; // Create circular reference
|
||||||
|
|
||||||
// Should not throw, should fall back to Object.prototype.toString
|
// Should not throw, should fall back to Object.prototype.toString
|
||||||
|
|||||||
26
tsconfig.d.json
Normal file
26
tsconfig.d.json
Normal file
@@ -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"]
|
||||||
|
}
|
||||||
@@ -1,28 +1,21 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// Environment setup & latest features
|
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "Preserve",
|
"module": "Preserve",
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
|
||||||
// Bundler mode
|
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
|
|
||||||
// Best practices
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noPropertyAccessFromIndexSignature": false
|
"noPropertyAccessFromIndexSignature": false
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// Environment setup & latest features
|
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "Preserve",
|
"module": "Preserve",
|
||||||
|
"outDir": "dist",
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
|
||||||
// Bundler mode
|
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"noEmit": true,
|
"noEmit": false,
|
||||||
|
"emitDeclarationOnly": false,
|
||||||
// Best practices
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noPropertyAccessFromIndexSignature": false
|
"noPropertyAccessFromIndexSignature": false
|
||||||
|
|||||||
Reference in New Issue
Block a user