From f5b33c8c4674601ff3ecccb2312266bf82e05bb6 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Wed, 10 Jul 2024 22:06:36 +1000 Subject: [PATCH] fix: cleaned up editor configs. added job schema to package export --- .editorconfig | 18 ------------------ .prettierrc | 4 ++++ LICENSE.md | 2 +- README.md | 27 ++++++++++++++++++++------- validator.js | 12 +++++++----- 5 files changed, 32 insertions(+), 31 deletions(-) delete mode 100644 .editorconfig create mode 100644 .prettierrc diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 9f8f0698..00000000 --- a/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -# indentation -indent_style = space -indent_size = 2 - -# Charset -charset = utf-8 - -# Markdown -[*.md] -trim_trailing_whitespace = false \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..44156bed --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true + } + \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 309142a4..1a6acd54 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright © 2014 JSON Resume +Copyright © 2024 JSON Resume Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index dfe0e0d8..ac3f1fac 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,14 @@ The current working version of the schema is `v1.0.0` that is represented by the All PR's for the next version should be made against the `develop` branch. -This enforces that the schema package, always has the official stable release of the schema. +This enforces that the schema package always has the official stable release of the schema. + +### Homepage and Registry + +If you are looking for the homepage, registry, tooling or themes, see the JSON Resume monorepo + +[@jsonresume/jsonresume.org](https://github.com/jsonresume/jsonresume.org/) + ### Getting started @@ -26,9 +33,9 @@ npm install --save @jsonresume/schema To use ```js -const resumeSchema = require("@jsonresume/schema"); +import resumeSchema from '@jsonresume/schema'; resumeSchema.validate( - { name: "Thomas" }, + { basics: { name: "Thomas" } }, function (err, report) { if (err) { console.error("The resume was invalid:", err); @@ -42,12 +49,12 @@ resumeSchema.validate( ); ``` -More likely +Or against a full `resume.json` ```js -var fs = require("fs"); -var resumeSchema = require("resume-schema"); -var resumeObject = JSON.parse(fs.readFileSync("resume.json", "utf8")); +import fs = require('fs'); +import schema from 'resume-schema'; +const resumeObject = JSON.parse(fs.readFileSync('./resume.json', 'utf8')); resumeSchema.validate(resumeObject); ``` @@ -87,6 +94,12 @@ Pull requests titles should be formatted as such A draft schema for job descriptions is available in this project as well. It is not yet finalized, but we encourage you to check it out and provide feedback. See `job-schema.json` and `sample.job.json`. +The JSON Job schema is available from: + +```js +require("resume-schema").jobSchema; +``` + ### Other resume standards - [HR-XML](https://schemas.liquid-technologies.com/HR-XML/2007-04-15/) diff --git a/validator.js b/validator.js index 4eea68d5..aaf93624 100644 --- a/validator.js +++ b/validator.js @@ -1,9 +1,10 @@ -"use strict"; -var schema = require("./schema"); -var Validator = require("jsonschema").Validator; +'use strict'; +const schema = require('./schema'); +const jobSchema = require('./job-schema'); +const Validator = require('jsonschema').Validator; function validate(resumeJson, callback) { - var v = new Validator(); + const v = new Validator(); const validation = v.validate(resumeJson, schema); @@ -16,5 +17,6 @@ function validate(resumeJson, callback) { module.exports = { validate: validate, - schema: schema, + schema, + jobSchema, };