@seethruhead/cra-payroll 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79630,7 +79630,7 @@ import { existsSync as existsSync4, renameSync, unlinkSync, chmodSync } from "fs
79630
79630
  // package.json
79631
79631
  var package_default = {
79632
79632
  name: "@seethruhead/cra-payroll",
79633
- version: "0.5.0",
79633
+ version: "0.5.2",
79634
79634
  description: "Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator",
79635
79635
  type: "module",
79636
79636
  bin: {
@@ -79644,7 +79644,7 @@ var package_default = {
79644
79644
  build: "bun build --compile src/cli.ts --outfile cra-payroll --external electron",
79645
79645
  "build:npm": "bun build src/cli.ts --outfile dist/cra-payroll.js --target=node",
79646
79646
  release: "bash release.sh",
79647
- test: "bun test src/unit.test.ts src/cache.test.ts src/monthly.test.ts",
79647
+ test: "bun test src/unit.test.ts src/cache.test.ts src/monthly.test.ts src/views.test.ts",
79648
79648
  "test:integration": "bun test src/integration.test.ts --timeout 120000 --max-concurrency 1",
79649
79649
  "test:all": "bun test --timeout 120000 --max-concurrency 1"
79650
79650
  },
@@ -79790,6 +79790,7 @@ var money = (n5) => n5.toLocaleString("en-CA", { minimumFractionDigits: 2, maxim
79790
79790
  var line = (ch, width) => ch.repeat(width);
79791
79791
  var when = (cond, s) => cond ? `
79792
79792
  ${s}` : "";
79793
+ var pct = (n5) => `${n5.toFixed(1)}%`;
79793
79794
 
79794
79795
  // src/views/config.ts
79795
79796
  var renderConfig = (config2, showCppEi) => `
@@ -79877,6 +79878,7 @@ var renderTable = (yearly, periodsPerYear, year = 2026) => t3(yearly, (ctx) => (
79877
79878
  RRSP You: $${money(empTotal)}/yr ($${money(empTotal / periodsPerYear)}/period)${t8.rrspMatched > 0 ? ` — matched: $${money(t8.rrspMatched)}/yr` : ""}${t8.rrspUnmatched > 0 ? ` — unmatched: $${money(t8.rrspUnmatched)}/yr` : ""}
79878
79879
  RRSP Er: $${money(t8.rrspEmployer)}/yr ($${money(t8.rrspEmployer / periodsPerYear)}/period)
79879
79880
  RRSP Total (You + Er): $${money(empTotal + t8.rrspEmployer)}/yr`;
79881
+ const taxRate = t8.grossIncome > 0 ? t8.totalDeductions / t8.grossIncome * 100 : 0;
79880
79882
  return `Per-Paycheck Table (${year})
79881
79883
  ${line("═", ctx.W)}
79882
79884
  ${ctx.header}
@@ -79885,7 +79887,8 @@ ${ctx.bodyRows.join(`
79885
79887
  `)}
79886
79888
  ${line("─", ctx.W)}
79887
79889
  ${ctx.totalsStr}
79888
- ${line("═", ctx.W)}${rrspSummary}`;
79890
+ ${line("═", ctx.W)}
79891
+ Effective tax rate: ${pct(taxRate)}${rrspSummary}`;
79889
79892
  });
79890
79893
 
79891
79894
  // src/views/monthlyTable.ts
@@ -79935,6 +79938,7 @@ var renderMonthlyTable = (monthly, year = 2026) => t3(monthly, (ctx) => ({ ...ct
79935
79938
  RRSP You: $${money(empTotal)}/yr${t8.rrspMatched > 0 ? ` — matched: $${money(t8.rrspMatched)}/yr` : ""}${t8.rrspUnmatched > 0 ? ` — unmatched: $${money(t8.rrspUnmatched)}/yr` : ""}
79936
79939
  RRSP Er: $${money(t8.rrspEmployer)}/yr
79937
79940
  RRSP Total (You + Er): $${money(empTotal + t8.rrspEmployer)}/yr`;
79941
+ const taxRate = t8.grossIncome > 0 ? t8.totalDeductions / t8.grossIncome * 100 : 0;
79938
79942
  return `Monthly Table (${year})
79939
79943
  ${line("═", ctx.W)}
79940
79944
  ${ctx.header}
@@ -79943,7 +79947,8 @@ ${ctx.bodyRows.join(`
79943
79947
  `)}
79944
79948
  ${line("─", ctx.W)}
79945
79949
  ${ctx.totalsStr}
79946
- ${line("═", ctx.W)}${rrspSummary}`;
79950
+ ${line("═", ctx.W)}
79951
+ Effective tax rate: ${pct(taxRate)}${rrspSummary}`;
79947
79952
  });
79948
79953
 
79949
79954
  // src/monthly.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seethruhead/cra-payroll",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,7 @@
14
14
  "build": "bun build --compile src/cli.ts --outfile cra-payroll --external electron",
15
15
  "build:npm": "bun build src/cli.ts --outfile dist/cra-payroll.js --target=node",
16
16
  "release": "bash release.sh",
17
- "test": "bun test src/unit.test.ts src/cache.test.ts src/monthly.test.ts",
17
+ "test": "bun test src/unit.test.ts src/cache.test.ts src/monthly.test.ts src/views.test.ts",
18
18
  "test:integration": "bun test src/integration.test.ts --timeout 120000 --max-concurrency 1",
19
19
  "test:all": "bun test --timeout 120000 --max-concurrency 1"
20
20
  },