Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/email-validator-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/phone-number-validator-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
else
echo "### ℹ️ No Release Published" >> $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/email-validator-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/phone-number-validator-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
else
echo "### ℹ️ No Release Published" >> $GITHUB_STEP_SUMMARY
Expand Down
34 changes: 33 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,39 @@
"prerelease": true
}
],
"plugins": [["@semantic-release/npm"], ["@semantic-release/github"]],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "breaking",
"release": "major"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"subject": "*",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
],
"dryRun": false,
"ci": true
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
"@types/shelljs": "^0.8.17",
"esbuild": "^0.25.9",
"husky": "^9.1.7",
"jest": "^30.1.1",
"lint-staged": "^16.1.5",
"jest": "^30.1.3",
"lint-staged": "^16.1.6",
"prettier": "^3.6.2",
"rollup": "^4.49.0",
"rollup": "^4.50.0",
"rollup-plugin-esbuild": "^6.2.1",
"shelljs": "^0.10.0",
"ts-jest": "^29.4.1",
Expand Down
7 changes: 4 additions & 3 deletions src/index.serverless.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// Lightweight serverless version - requires resource loading at runtime
export * from 'libphonenumber-js'

import { type Document, deserialize } from 'bson'
import type { PhoneNumber } from 'libphonenumber-js'
import { type LRU, lru } from 'tiny-lru'
import type { CarrierLocale, GeocoderLocale } from './locales'
import { deserialize, type Document } from 'bson'
import { lru, type LRU } from 'tiny-lru'

const DEFAULT_CACHE_SIZE = 100
let codeDataCache: LRU<Document> = lru<Document>(DEFAULT_CACHE_SIZE)

// Resource loader interface - platforms must implement this
export interface ResourceLoader {
loadResource(path: string): Promise<Uint8Array | null>

loadResourceSync?(path: string): Uint8Array | null
}

Expand Down
Loading