Conversation
Adds a new pure, zero-dependency `gst.js` module with helper functions that most GST tools end up reimplementing: - calculateTax — tax + total at a given rate - calculateGSTBreakdown — CGST/SGST (intra) or IGST (inter) + cess - reverseCalculateTax — extract base + tax from inclusive total - getApplicableTaxType — IGST vs CGST_SGST from state codes - calculateInvoiceTotals — line-item invoice totals with round-off - groupItemsByTaxRate — GSTR-1 style grouping - applyRoundOffRules — 2-decimal half-up rounding All re-exported from index.js, fully typed in index.d.ts, documented in the README, and covered by 20 new tests (gst.js 100% coverage). The rate-lookup-from-HSN variant (calculateItemTax) is intentionally deferred — it depends on rate data being added to the dataset (#2). Refs #3 https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
…CLI, advanced lookups - Add gstin.js: validateGSTIN, formatGSTIN, getStateFromGSTIN, isValidPAN, getGSTINComponents - Add sac.js + data/sac_codes.json: 490+ real SAC codes with getAllSac, getSacByCode, searchSac, getCodeDetails - Add export.js: exportToCSV, exportToJSON, generateGSTR1Summary - Add advanced HSN: getChapterSummary, findCodesByDescription, bulkValidateHsnCodes - Add bin/cli.js: CLI with search, validate, chapter, stats, gstin, sac, export commands - Add 4 new test files (gstin, sac, export, advanced) - Update TypeScript definitions and README docs - Bump version to 2.2.0 Closes #4 https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
…te job - Add data/gst_rates.json with IGST/CGST/SGST/cess per HSN code (12,604 entries) based on CBIC Notification No. 09/2025-CT(Rate), effective 22 Sep 2025 - Add scripts/update-gst-rates.js: download-or-fallback pipeline for rate data - Add .github/workflows/update-gst-rates.yml: weekly Monday cron + manual dispatch with auto-issue on failure - Add getGstRateByCode(), getHsnByExactCodeWithRate(), getHsnByRateSlabs() - Add TypeScript types: GstRate, HsnCodeWithRate - Add tests/gst-rates.test.js - Bump version to 2.3.0 Closes #2 https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
feat: add rate-agnostic GST calculation utilities (#3)
Merged gst.js calculation utilities (from dev/PR #5) with all PR #6 features: GSTIN validation, SAC codes, export utils, CLI, advanced HSN lookups, and GST rate data. All 105 tests passing. https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
feat: GSTIN validation, SAC codes, export utilities, CLI, and advanced HSN lookups (Issue #4)
- Rewrite README with full API docs, ToC, examples for all 30+ functions - Audit index.d.ts: complete types, interfaces, correct signatures - Add tests/types.test.ts TypeScript smoke test - Add typecheck npm script (tsc --strict --noEmit) - Add .npmignore to keep published package lean - Add update:rates npm script alias - Fix any compatibility issues found - All 105 tests passing, typecheck clean https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v2.3.0
This release turns
hsn-code-packagefrom an HSN lookup library into a full, zero-runtime-dependency GST toolkit for India. It bundles three feature tracks plus a pre-release quality pass.Features since
mainIssue #2 — GST rate data
getGstRateByCode,getHsnByExactCodeWithRate,getHsnByRateSlabs.update-gst-rates.yml) andnpm run update:rates.Issue #3 — GST calculation utilities
calculateTax,calculateGSTBreakdown,reverseCalculateTax,getApplicableTaxType,calculateInvoiceTotals,groupItemsByTaxRate,applyRoundOffRules.Issue #4 — GSTIN/PAN, SAC, export, CLI, advanced HSN
validateGSTIN,formatGSTIN,getStateFromGSTIN,isValidPAN,getGSTINComponents.getAllSac,getSacByCode,searchSac,getCodeDetails.exportToCSV,exportToJSON,generateGSTR1Summary.getChapterSummary,findCodesByDescription,bulkValidateHsnCodes.hsnCLI:search,validate,chapter,stats,gstin,sac,export,help.Pre-release polish (this pass)
index.d.tsaudit: module docstring, complete/accurate interfaces,unknown/readonlywhere appropriate.tests/types.test.tsTypeScript smoke test andnpm run typecheck(tsc --strict --noEmit)..npmignoreto keep the published tarball lean (excludes scripts/tests/.github/coverage/xlsx).package.json: refreshed keywords,files,update:ratesscript, jesttestMatchscoped totests/**/*.test.js.Verification
npm test— 105/105 passing, 7 suites green.npm run typecheck— zero errors.stats/search/gstin/validatesmoke-tested.https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
Generated by Claude Code