@seethruhead/cra-payroll 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/dist/cra-payroll.js +48 -29
  2. package/package.json +1 -1
@@ -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.6.0",
79633
+ version: "0.6.1",
79634
79634
  description: "Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator",
79635
79635
  type: "module",
79636
79636
  bin: {
@@ -79707,7 +79707,7 @@ var checkForUpdate = async () => {
79707
79707
  const data = await resp.json();
79708
79708
  const latestTag = data.tag_name;
79709
79709
  const latestVersion = latestTag.replace(/^v/, "");
79710
- if (!isNewer(latestVersion, VERSION))
79710
+ if (!isNewer(latestVersion, currentVersion()))
79711
79711
  return $ok(null);
79712
79712
  const target = getTarget();
79713
79713
  if (target.isErr())
@@ -79755,7 +79755,7 @@ Need sudo to replace binary...`);
79755
79755
  }
79756
79756
  };
79757
79757
  var selfUpdate = async () => {
79758
- console.log(`Current version: v${VERSION}`);
79758
+ console.log(`Current version: v${currentVersion()}`);
79759
79759
  console.log(`Checking for updates...
79760
79760
  `);
79761
79761
  const updateResult = await checkForUpdate();
@@ -79763,9 +79763,9 @@ var selfUpdate = async () => {
79763
79763
  return $err(updateResult.error);
79764
79764
  const update = updateResult.value;
79765
79765
  if (!update) {
79766
- return $ok(`Already on the latest version (v${VERSION})`);
79766
+ return $ok(`Already on the latest version (v${currentVersion()})`);
79767
79767
  }
79768
- console.log(`New version available: ${update.tag} (current: v${VERSION})`);
79768
+ console.log(`New version available: ${update.tag} (current: v${currentVersion()})`);
79769
79769
  console.log(`Downloading ${update.downloadUrl}...
79770
79770
  `);
79771
79771
  let binaryPath = "";
@@ -80139,31 +80139,50 @@ var PAY_PERIODS2 = [
80139
80139
  "Semi-monthly (24 pay periods a year)",
80140
80140
  "Monthly (12 pay periods a year)"
80141
80141
  ];
80142
- var { values } = parseArgs({
80143
- args: process.argv.slice(2),
80144
- options: {
80145
- config: { type: "string", short: "c", default: "" },
80146
- salary: { type: "string", short: "s" },
80147
- province: { type: "string", short: "p" },
80148
- "pay-period": { type: "string" },
80149
- year: { type: "string", short: "y" },
80150
- "rrsp-match": { type: "string" },
80151
- "rrsp-unmatched": { type: "string" },
80152
- "cpp-maxed": { type: "boolean", default: false },
80153
- "ei-maxed": { type: "boolean", default: false },
80154
- table: { type: "boolean", short: "t", default: false },
80155
- "month-table": { type: "boolean", short: "M", default: false },
80156
- annual: { type: "boolean", short: "a", default: false },
80157
- monthly: { type: "boolean", short: "m", default: false },
80158
- "no-cache": { type: "boolean", default: false },
80159
- update: { type: "boolean", default: false },
80160
- version: { type: "boolean", default: false },
80161
- headless: { type: "boolean", default: false },
80162
- verbose: { type: "boolean", short: "v", default: false },
80163
- help: { type: "boolean", short: "h", default: false }
80164
- },
80165
- strict: true
80142
+ process.on("SIGINT", () => {
80143
+ console.error(`
80144
+ Interrupted.`);
80145
+ process.exit(130);
80166
80146
  });
80147
+ var values;
80148
+ try {
80149
+ ({ values } = parseArgs({
80150
+ args: process.argv.slice(2),
80151
+ options: {
80152
+ config: { type: "string", short: "c", default: "" },
80153
+ salary: { type: "string", short: "s" },
80154
+ province: { type: "string", short: "p" },
80155
+ "pay-period": { type: "string" },
80156
+ year: { type: "string", short: "y" },
80157
+ "rrsp-match": { type: "string" },
80158
+ "rrsp-unmatched": { type: "string" },
80159
+ "cpp-maxed": { type: "boolean", default: false },
80160
+ "ei-maxed": { type: "boolean", default: false },
80161
+ table: { type: "boolean", short: "t", default: false },
80162
+ "month-table": { type: "boolean", short: "M", default: false },
80163
+ annual: { type: "boolean", short: "a", default: false },
80164
+ monthly: { type: "boolean", short: "m", default: false },
80165
+ "no-cache": { type: "boolean", default: false },
80166
+ update: { type: "boolean", default: false },
80167
+ version: { type: "boolean", default: false },
80168
+ headless: { type: "boolean", default: false },
80169
+ verbose: { type: "boolean", short: "v", default: false },
80170
+ help: { type: "boolean", short: "h", default: false }
80171
+ },
80172
+ strict: true
80173
+ }));
80174
+ } catch (e2) {
80175
+ if (e2.code === "ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL") {
80176
+ const arg = e2.message.match(/Unexpected argument '([^']+)'/)?.[1];
80177
+ console.error(`❌ Unexpected argument '${arg}'. Did you mean '--${arg}'?`);
80178
+ } else if (e2.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION") {
80179
+ const opt = e2.message.match(/Unknown option '([^']+)'/)?.[1];
80180
+ console.error(`❌ Unknown option '${opt}'. Run 'cra-payroll --help' for usage.`);
80181
+ } else {
80182
+ console.error(`❌ ${e2.message}`);
80183
+ }
80184
+ process.exit(1);
80185
+ }
80167
80186
  if (values.help) {
80168
80187
  console.log(`
80169
80188
  cra-payroll - Calculate Canadian payroll deductions using CRA's PDOC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seethruhead/cra-payroll",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator",
5
5
  "type": "module",
6
6
  "bin": {