@enure/jacklin 3.3.0 → 3.4.0

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.
package/README.md CHANGED
@@ -1,13 +1,3 @@
1
1
  # @enure/jacklin
2
2
 
3
- To install dependencies:
4
-
5
- ```bash
6
- bun install
7
- ```
8
-
9
- To run:
10
-
11
- ```bash
12
- bun run index.js
13
- ```
3
+ A JSON Resume theme. Renders resume data to HTML with a bundled Handlebars template.
package/index.ts CHANGED
@@ -3,21 +3,56 @@ import { dirname, resolve } from "path";
3
3
  import { readFileSync } from "fs";
4
4
  import Handlebars from "handlebars";
5
5
 
6
+ type WorkItem = {
7
+ name: string;
8
+ position: string;
9
+ startDate: string;
10
+ endDate?: string;
11
+ isFeatured?: boolean;
12
+ hide?: boolean;
13
+ summaryItems?: string[];
14
+ highlights?: string[];
15
+ };
16
+
17
+ type Resume = {
18
+ basics: {
19
+ name: string;
20
+ label: string;
21
+ email: string;
22
+ phone: string;
23
+ summary: string;
24
+ location: {
25
+ city: string;
26
+ region: string;
27
+ };
28
+ };
29
+ work: WorkItem[];
30
+ education: {
31
+ institution: string;
32
+ area: string;
33
+ studyType: string;
34
+ }[];
35
+ };
36
+
6
37
  Handlebars.registerHelper("or", (a, b) => a || b);
7
38
 
8
39
  Handlebars.registerHelper("getShortDate", (dateStr) => {
9
40
  if (typeof dateStr === 'string') {
10
41
  const date = new Date(dateStr);
42
+ if (isNaN(date.getTime())) {
43
+ throw new Error(`Invalid date: "${dateStr}"`);
44
+ }
11
45
  const year = date.getFullYear();
12
46
  const month = date.getMonth() + 1;
13
- const fullMonth = month.toString().length === 1 ? `0${month}` : month;
47
+ const fullMonth = String(month).padStart(2, '0');
48
+
14
49
  return `${fullMonth}/${year}`;
15
50
  } else {
16
51
  return dateStr;
17
52
  }
18
53
  });
19
54
 
20
- export const render = (resume) => {
55
+ export const render = (resume: Resume) => {
21
56
  const modulePath = dirname(fileURLToPath(import.meta.url));
22
57
  const template = readFileSync(
23
58
  resolve(modulePath, "./template.handlebars"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enure/jacklin",
3
- "version": "3.3.0",
4
- "description": "",
3
+ "version": "3.4.0",
4
+ "description": "A JSON Resume theme. Renders resume data to HTML with a bundled Handlebars template.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "exports": {
@@ -23,10 +23,10 @@
23
23
  "handlebars": "^4.7.8"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/bun": "latest",
26
+ "@types/bun": "1.3.9",
27
27
  "resumed": "^6.1.0"
28
28
  },
29
- "packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
29
+ "packageManager": "bun@1.3.9",
30
30
  "peerDependencies": {
31
31
  "typescript": "^5"
32
32
  }
@@ -150,6 +150,7 @@
150
150
  {{#each this.summaryItems}}
151
151
  <li class="SummaryList-item">{{this}}</li>
152
152
  {{/each}}
153
+ </ul>
153
154
  </div>
154
155
  {{#if this.highlights}}
155
156
  <ul class="WorkList-highlights">