Skip to content

Commit

Permalink
fix: cleaned up editor configs. added job schema to package export
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Jul 10, 2024
1 parent 2893026 commit f5b33c8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 31 deletions.
18 changes: 0 additions & 18 deletions .editorconfig

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true
}

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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);
Expand All @@ -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);
```

Expand Down Expand Up @@ -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/)
Expand Down
12 changes: 7 additions & 5 deletions validator.js
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -16,5 +17,6 @@ function validate(resumeJson, callback) {

module.exports = {
validate: validate,
schema: schema,
schema,
jobSchema,
};

0 comments on commit f5b33c8

Please sign in to comment.