resuml 1.2.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.
- package/LICENSE +15 -0
- package/README.md +127 -0
- package/bin/resuml.cjs +21 -0
- package/dist/index.js +7130 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
- package/scripts/generate-types.js +55 -0
- package/src/types/resume.ts +344 -0
- package/src/types/schema.d.ts +6 -0
- package/src/types/theme.d.ts +15 -0
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "resuml",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Generate JSON resumes from YAML with theme support",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"resuml": "./bin/resuml.cjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"scripts",
|
|
14
|
+
"src/types"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"prepublishOnly": "npm run generate:types && npm run build",
|
|
19
|
+
"generate:types": "node scripts/generate-types.js",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"lint": "eslint src --ext .ts",
|
|
23
|
+
"format": "prettier --write .",
|
|
24
|
+
"release": "semantic-release",
|
|
25
|
+
"prepare": "husky"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@jsonresume/schema": "^1.0.0",
|
|
29
|
+
"ajv": "^8.12.0",
|
|
30
|
+
"chalk": "^5.3.0",
|
|
31
|
+
"commander": "^11.1.0",
|
|
32
|
+
"js-yaml": "^4.1.0",
|
|
33
|
+
"lodash.merge": "^4.6.2",
|
|
34
|
+
"yaml": "^2.3.4"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@commitlint/cli": "^19.8.1",
|
|
38
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
39
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
40
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
41
|
+
"@semantic-release/git": "^10.0.1",
|
|
42
|
+
"@semantic-release/github": "^11.0.3",
|
|
43
|
+
"@semantic-release/npm": "^12.0.1",
|
|
44
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
45
|
+
"@types/js-yaml": "^4.0.9",
|
|
46
|
+
"@types/lodash.merge": "^4.6.9",
|
|
47
|
+
"@types/node": "^20.11.19",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.33.0",
|
|
49
|
+
"@typescript-eslint/parser": "^8.33.0",
|
|
50
|
+
"eslint": "^8.0.0",
|
|
51
|
+
"eslint-config-prettier": "^9.0.0",
|
|
52
|
+
"husky": "^9.1.7",
|
|
53
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
54
|
+
"prettier": "^3.0.0",
|
|
55
|
+
"semantic-release": "^24.2.5",
|
|
56
|
+
"tsup": "^8.0.2",
|
|
57
|
+
"typescript": "^5.0.0",
|
|
58
|
+
"vitest": "^3.2.2"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=20.0.0"
|
|
62
|
+
},
|
|
63
|
+
"license": "ISC",
|
|
64
|
+
"author": "phoinixi",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public",
|
|
67
|
+
"registry": "https://registry.npmjs.org/"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const SCHEMA_URL = 'https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json';
|
|
6
|
+
const SCHEMA_FILE = 'resume.schema.json';
|
|
7
|
+
const OUTPUT_DIR = path.join('src', 'types');
|
|
8
|
+
const OUTPUT_FILE = path.join(OUTPUT_DIR, 'resume.ts');
|
|
9
|
+
|
|
10
|
+
function runCommand(command, description) {
|
|
11
|
+
console.log(`⏳ ${description}...`);
|
|
12
|
+
try {
|
|
13
|
+
execSync(command, { stdio: 'inherit' });
|
|
14
|
+
console.log(`✅ ${description} successful!`);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error(`❌ Error during ${description}:`, error.message);
|
|
17
|
+
if (error.stderr) {
|
|
18
|
+
console.error(error.stderr.toString());
|
|
19
|
+
}
|
|
20
|
+
if (error.stdout) {
|
|
21
|
+
console.error(error.stdout.toString());
|
|
22
|
+
}
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log('🚀 Starting type generation process...');
|
|
28
|
+
|
|
29
|
+
// 1. Fetch the schema
|
|
30
|
+
runCommand(`curl -s -L -o ${SCHEMA_FILE} ${SCHEMA_URL}`, 'Fetching latest JSON Resume schema');
|
|
31
|
+
|
|
32
|
+
// 2. Create output directory if it doesn't exist
|
|
33
|
+
if (!fs.existsSync(OUTPUT_DIR)) {
|
|
34
|
+
console.log(`⏳ Creating directory ${OUTPUT_DIR}...`);
|
|
35
|
+
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
|
|
36
|
+
console.log(`✅ Directory ${OUTPUT_DIR} created.`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 3. Generate TypeScript types
|
|
40
|
+
runCommand(
|
|
41
|
+
`npx json-schema-to-typescript ${SCHEMA_FILE} -o ${OUTPUT_FILE}`,
|
|
42
|
+
'Generating TypeScript types'
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// 4. Remove the downloaded schema file
|
|
46
|
+
console.log(`⏳ Removing temporary schema file ${SCHEMA_FILE}...`);
|
|
47
|
+
try {
|
|
48
|
+
fs.unlinkSync(SCHEMA_FILE);
|
|
49
|
+
console.log(`✅ Temporary schema file ${SCHEMA_FILE} removed.`);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error(`❌ Error removing temporary schema file ${SCHEMA_FILE}:`, error.message);
|
|
52
|
+
// Non-fatal, so don't exit
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log('🎉 TypeScript types generated successfully from JSON Resume schema!');
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Similar to the standard date type, but each section after the year is optional. e.g. 2014-06-29 or 2023-04
|
|
10
|
+
*/
|
|
11
|
+
export type Iso8601 = string;
|
|
12
|
+
|
|
13
|
+
export interface ResumeSchema {
|
|
14
|
+
/**
|
|
15
|
+
* link to the version of the schema that can validate the resume
|
|
16
|
+
*/
|
|
17
|
+
$schema?: string;
|
|
18
|
+
basics?: {
|
|
19
|
+
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* e.g. Web Developer
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* URL (as per RFC 3986) to a image in JPEG or PNG format
|
|
26
|
+
*/
|
|
27
|
+
image?: string;
|
|
28
|
+
/**
|
|
29
|
+
* e.g. thomas@gmail.com
|
|
30
|
+
*/
|
|
31
|
+
email?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Phone numbers are stored as strings so use any format you like, e.g. 712-117-2923
|
|
34
|
+
*/
|
|
35
|
+
phone?: string;
|
|
36
|
+
/**
|
|
37
|
+
* URL (as per RFC 3986) to your website, e.g. personal homepage
|
|
38
|
+
*/
|
|
39
|
+
url?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Write a short 2-3 sentence biography about yourself
|
|
42
|
+
*/
|
|
43
|
+
summary?: string;
|
|
44
|
+
location?: {
|
|
45
|
+
/**
|
|
46
|
+
* To add multiple address lines, use
|
|
47
|
+
* . For example, 1234 Glücklichkeit Straße
|
|
48
|
+
* Hinterhaus 5. Etage li.
|
|
49
|
+
*/
|
|
50
|
+
address?: string;
|
|
51
|
+
postalCode?: string;
|
|
52
|
+
city?: string;
|
|
53
|
+
/**
|
|
54
|
+
* code as per ISO-3166-1 ALPHA-2, e.g. US, AU, IN
|
|
55
|
+
*/
|
|
56
|
+
countryCode?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The general region where you live. Can be a US state, or a province, for instance.
|
|
59
|
+
*/
|
|
60
|
+
region?: string;
|
|
61
|
+
[k: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Specify any number of social networks that you participate in
|
|
65
|
+
*/
|
|
66
|
+
profiles?: {
|
|
67
|
+
/**
|
|
68
|
+
* e.g. Facebook or Twitter
|
|
69
|
+
*/
|
|
70
|
+
network?: string;
|
|
71
|
+
/**
|
|
72
|
+
* e.g. neutralthoughts
|
|
73
|
+
*/
|
|
74
|
+
username?: string;
|
|
75
|
+
/**
|
|
76
|
+
* e.g. http://twitter.example.com/neutralthoughts
|
|
77
|
+
*/
|
|
78
|
+
url?: string;
|
|
79
|
+
[k: string]: unknown;
|
|
80
|
+
}[];
|
|
81
|
+
[k: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
work?: {
|
|
84
|
+
/**
|
|
85
|
+
* e.g. Facebook
|
|
86
|
+
*/
|
|
87
|
+
name?: string;
|
|
88
|
+
/**
|
|
89
|
+
* e.g. Menlo Park, CA
|
|
90
|
+
*/
|
|
91
|
+
location?: string;
|
|
92
|
+
/**
|
|
93
|
+
* e.g. Social Media Company
|
|
94
|
+
*/
|
|
95
|
+
description?: string;
|
|
96
|
+
/**
|
|
97
|
+
* e.g. Software Engineer
|
|
98
|
+
*/
|
|
99
|
+
position?: string;
|
|
100
|
+
/**
|
|
101
|
+
* e.g. http://facebook.example.com
|
|
102
|
+
*/
|
|
103
|
+
url?: string;
|
|
104
|
+
startDate?: Iso8601;
|
|
105
|
+
endDate?: Iso8601;
|
|
106
|
+
/**
|
|
107
|
+
* Give an overview of your responsibilities at the company
|
|
108
|
+
*/
|
|
109
|
+
summary?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Specify multiple accomplishments
|
|
112
|
+
*/
|
|
113
|
+
highlights?: string[];
|
|
114
|
+
[k: string]: unknown;
|
|
115
|
+
}[];
|
|
116
|
+
volunteer?: {
|
|
117
|
+
/**
|
|
118
|
+
* e.g. Facebook
|
|
119
|
+
*/
|
|
120
|
+
organization?: string;
|
|
121
|
+
/**
|
|
122
|
+
* e.g. Software Engineer
|
|
123
|
+
*/
|
|
124
|
+
position?: string;
|
|
125
|
+
/**
|
|
126
|
+
* e.g. http://facebook.example.com
|
|
127
|
+
*/
|
|
128
|
+
url?: string;
|
|
129
|
+
startDate?: Iso8601;
|
|
130
|
+
endDate?: Iso8601;
|
|
131
|
+
/**
|
|
132
|
+
* Give an overview of your responsibilities at the company
|
|
133
|
+
*/
|
|
134
|
+
summary?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Specify accomplishments and achievements
|
|
137
|
+
*/
|
|
138
|
+
highlights?: string[];
|
|
139
|
+
[k: string]: unknown;
|
|
140
|
+
}[];
|
|
141
|
+
education?: {
|
|
142
|
+
/**
|
|
143
|
+
* e.g. Massachusetts Institute of Technology
|
|
144
|
+
*/
|
|
145
|
+
institution?: string;
|
|
146
|
+
/**
|
|
147
|
+
* e.g. http://facebook.example.com
|
|
148
|
+
*/
|
|
149
|
+
url?: string;
|
|
150
|
+
/**
|
|
151
|
+
* e.g. Arts
|
|
152
|
+
*/
|
|
153
|
+
area?: string;
|
|
154
|
+
/**
|
|
155
|
+
* e.g. Bachelor
|
|
156
|
+
*/
|
|
157
|
+
studyType?: string;
|
|
158
|
+
startDate?: Iso8601;
|
|
159
|
+
endDate?: Iso8601;
|
|
160
|
+
/**
|
|
161
|
+
* grade point average, e.g. 3.67/4.0
|
|
162
|
+
*/
|
|
163
|
+
score?: string;
|
|
164
|
+
/**
|
|
165
|
+
* List notable courses/subjects
|
|
166
|
+
*/
|
|
167
|
+
courses?: string[];
|
|
168
|
+
[k: string]: unknown;
|
|
169
|
+
}[];
|
|
170
|
+
/**
|
|
171
|
+
* Specify any awards you have received throughout your professional career
|
|
172
|
+
*/
|
|
173
|
+
awards?: {
|
|
174
|
+
/**
|
|
175
|
+
* e.g. One of the 100 greatest minds of the century
|
|
176
|
+
*/
|
|
177
|
+
title?: string;
|
|
178
|
+
date?: Iso8601;
|
|
179
|
+
/**
|
|
180
|
+
* e.g. Time Magazine
|
|
181
|
+
*/
|
|
182
|
+
awarder?: string;
|
|
183
|
+
/**
|
|
184
|
+
* e.g. Received for my work with Quantum Physics
|
|
185
|
+
*/
|
|
186
|
+
summary?: string;
|
|
187
|
+
[k: string]: unknown;
|
|
188
|
+
}[];
|
|
189
|
+
/**
|
|
190
|
+
* Specify any certificates you have received throughout your professional career
|
|
191
|
+
*/
|
|
192
|
+
certificates?: {
|
|
193
|
+
/**
|
|
194
|
+
* e.g. Certified Kubernetes Administrator
|
|
195
|
+
*/
|
|
196
|
+
name?: string;
|
|
197
|
+
date?: Iso8601;
|
|
198
|
+
/**
|
|
199
|
+
* e.g. http://example.com
|
|
200
|
+
*/
|
|
201
|
+
url?: string;
|
|
202
|
+
/**
|
|
203
|
+
* e.g. CNCF
|
|
204
|
+
*/
|
|
205
|
+
issuer?: string;
|
|
206
|
+
[k: string]: unknown;
|
|
207
|
+
}[];
|
|
208
|
+
/**
|
|
209
|
+
* Specify your publications through your career
|
|
210
|
+
*/
|
|
211
|
+
publications?: {
|
|
212
|
+
/**
|
|
213
|
+
* e.g. The World Wide Web
|
|
214
|
+
*/
|
|
215
|
+
name?: string;
|
|
216
|
+
/**
|
|
217
|
+
* e.g. IEEE, Computer Magazine
|
|
218
|
+
*/
|
|
219
|
+
publisher?: string;
|
|
220
|
+
releaseDate?: Iso8601;
|
|
221
|
+
/**
|
|
222
|
+
* e.g. http://www.computer.org.example.com/csdl/mags/co/1996/10/rx069-abs.html
|
|
223
|
+
*/
|
|
224
|
+
url?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Short summary of publication. e.g. Discussion of the World Wide Web, HTTP, HTML.
|
|
227
|
+
*/
|
|
228
|
+
summary?: string;
|
|
229
|
+
[k: string]: unknown;
|
|
230
|
+
}[];
|
|
231
|
+
/**
|
|
232
|
+
* List out your professional skill-set
|
|
233
|
+
*/
|
|
234
|
+
skills?: {
|
|
235
|
+
/**
|
|
236
|
+
* e.g. Web Development
|
|
237
|
+
*/
|
|
238
|
+
name?: string;
|
|
239
|
+
/**
|
|
240
|
+
* e.g. Master
|
|
241
|
+
*/
|
|
242
|
+
level?: string;
|
|
243
|
+
/**
|
|
244
|
+
* List some keywords pertaining to this skill
|
|
245
|
+
*/
|
|
246
|
+
keywords?: string[];
|
|
247
|
+
[k: string]: unknown;
|
|
248
|
+
}[];
|
|
249
|
+
/**
|
|
250
|
+
* List any other languages you speak
|
|
251
|
+
*/
|
|
252
|
+
languages?: {
|
|
253
|
+
/**
|
|
254
|
+
* e.g. English, Spanish
|
|
255
|
+
*/
|
|
256
|
+
language?: string;
|
|
257
|
+
/**
|
|
258
|
+
* e.g. Fluent, Beginner
|
|
259
|
+
*/
|
|
260
|
+
fluency?: string;
|
|
261
|
+
[k: string]: unknown;
|
|
262
|
+
}[];
|
|
263
|
+
interests?: {
|
|
264
|
+
/**
|
|
265
|
+
* e.g. Philosophy
|
|
266
|
+
*/
|
|
267
|
+
name?: string;
|
|
268
|
+
keywords?: string[];
|
|
269
|
+
[k: string]: unknown;
|
|
270
|
+
}[];
|
|
271
|
+
/**
|
|
272
|
+
* List references you have received
|
|
273
|
+
*/
|
|
274
|
+
references?: {
|
|
275
|
+
/**
|
|
276
|
+
* e.g. Timothy Cook
|
|
277
|
+
*/
|
|
278
|
+
name?: string;
|
|
279
|
+
/**
|
|
280
|
+
* e.g. Joe blogs was a great employee, who turned up to work at least once a week. He exceeded my expectations when it came to doing nothing.
|
|
281
|
+
*/
|
|
282
|
+
reference?: string;
|
|
283
|
+
[k: string]: unknown;
|
|
284
|
+
}[];
|
|
285
|
+
/**
|
|
286
|
+
* Specify career projects
|
|
287
|
+
*/
|
|
288
|
+
projects?: {
|
|
289
|
+
/**
|
|
290
|
+
* e.g. The World Wide Web
|
|
291
|
+
*/
|
|
292
|
+
name?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Short summary of project. e.g. Collated works of 2017.
|
|
295
|
+
*/
|
|
296
|
+
description?: string;
|
|
297
|
+
/**
|
|
298
|
+
* Specify multiple features
|
|
299
|
+
*/
|
|
300
|
+
highlights?: string[];
|
|
301
|
+
/**
|
|
302
|
+
* Specify special elements involved
|
|
303
|
+
*/
|
|
304
|
+
keywords?: string[];
|
|
305
|
+
startDate?: Iso8601;
|
|
306
|
+
endDate?: Iso8601;
|
|
307
|
+
/**
|
|
308
|
+
* e.g. http://www.computer.org/csdl/mags/co/1996/10/rx069-abs.html
|
|
309
|
+
*/
|
|
310
|
+
url?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Specify your role on this project or in company
|
|
313
|
+
*/
|
|
314
|
+
roles?: string[];
|
|
315
|
+
/**
|
|
316
|
+
* Specify the relevant company/entity affiliations e.g. 'greenpeace', 'corporationXYZ'
|
|
317
|
+
*/
|
|
318
|
+
entity?: string;
|
|
319
|
+
/**
|
|
320
|
+
* e.g. 'volunteering', 'presentation', 'talk', 'application', 'conference'
|
|
321
|
+
*/
|
|
322
|
+
type?: string;
|
|
323
|
+
[k: string]: unknown;
|
|
324
|
+
}[];
|
|
325
|
+
/**
|
|
326
|
+
* The schema version and any other tooling configuration lives here
|
|
327
|
+
*/
|
|
328
|
+
meta?: {
|
|
329
|
+
/**
|
|
330
|
+
* URL (as per RFC 3986) to latest version of this document
|
|
331
|
+
*/
|
|
332
|
+
canonical?: string;
|
|
333
|
+
/**
|
|
334
|
+
* A version field which follows semver - e.g. v1.0.0
|
|
335
|
+
*/
|
|
336
|
+
version?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Using ISO 8601 with YYYY-MM-DDThh:mm:ss
|
|
339
|
+
*/
|
|
340
|
+
lastModified?: string;
|
|
341
|
+
[k: string]: unknown;
|
|
342
|
+
};
|
|
343
|
+
[k: string]: unknown;
|
|
344
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare module 'jsonresume-theme-mock' {
|
|
2
|
+
export interface Theme {
|
|
3
|
+
render: (resumeData: unknown) => string;
|
|
4
|
+
}
|
|
5
|
+
const theme: Theme;
|
|
6
|
+
export default theme;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module '@resuml/theme-mock-native' {
|
|
10
|
+
export interface Theme {
|
|
11
|
+
render: (resumeData: unknown, options: unknown) => string;
|
|
12
|
+
}
|
|
13
|
+
const theme: Theme;
|
|
14
|
+
export default theme;
|
|
15
|
+
}
|