prepare for depoyment
This commit is contained in:
@@ -179,7 +179,7 @@ This implementation adheres to all five SOLID principles:
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
```text
|
||||
src/
|
||||
├── core/
|
||||
│ └── HashMap.ts # Main HashMap implementation
|
||||
|
||||
16
package.json
16
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"
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
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": {
|
||||
// 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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user