Skip to content

Commit

Permalink
Add nodejs workflow action
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesrosiers committed Mar 6, 2024
1 parent 56f1f96 commit dfba66f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Node.js CI

on:
push:
branches: ["ci"]
pull_request:
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run check-types
6 changes: 3 additions & 3 deletions annotations/annotated-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { getKeywordId } from "../lib/keywords.js";

const defaultDialectId = "https://json-schema.org/validation";

export const nil = { ...nilInstance, annotations: {} };
export const cons = (instance, id = undefined) => ({
export const nil = { ...nilInstance, annotations: {} }; // eslint-disable-line import/export
export const cons = (instance, id = undefined) => ({ // eslint-disable-line import/export
...nil,
id: id ? toAbsoluteIri(id) : "",
instance,
Expand Down Expand Up @@ -47,4 +47,4 @@ export const annotatedWith = (instance, keyword, dialectId = defaultDialectId) =
return instances;
};

export * from "../lib/instance.js";
export * from "../lib/instance.js"; // eslint-disable-line import/export
2 changes: 1 addition & 1 deletion lib/yaml-schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const testDomain = "http://test.jsc.hyperjump.io";
addMediaTypePlugin("application/schema+yaml", {
parse: async (response) => {
const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? "");
const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile;
const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile; // eslint-disable-line @typescript-eslint/no-unnecessary-condition

const json = YAML.parse(await response.text()) as SchemaObject | boolean;

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"scripts": {
"clean": "xargs -a .gitignore rm -rf",
"lint": "eslint lib stable draft-* openapi-* bundle annotations",
"test": "vitest --watch=false"
"test": "vitest --watch=false",
"check-types": "tsc --noEmit"
},
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"moduleResolution": "Node16",
"esModuleInterop": true,
"strict": true,
"allowJs": true
"allowJs": true,
"skipLibCheck": true
}
}

0 comments on commit dfba66f

Please sign in to comment.