Skip to content

Commit

Permalink
Merge pull request #168 from mcollina/windows-fix
Browse files Browse the repository at this point in the history
Fix windows compatibility
  • Loading branch information
seriousme authored Nov 13, 2024
2 parents e4f417a + 33fe377 commit 5108b33
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ permissions: {}
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{matrix.os}}

strategy:
matrix:
node-version: [ 'lts/-1', 'lts/*', 'node']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

## [Unreleased]
### Changed

## [v2.2.4] 12-11-2024
### Changed
- fix: removed dependency on "node:url" to aid in bundling
- updated dependencies
- @biomejs/biome ^1.8.3 → ^1.9.4

Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFileSync } from "node:fs";
import { readFile } from "node:fs/promises";
import { URL, fileURLToPath } from "node:url";
import Ajv04 from "ajv-draft-04";
import addFormats from "ajv-formats";
import Ajv2020 from "ajv/dist/2020.js";
Expand All @@ -13,8 +14,8 @@ const ajvVersions = {
};
const inlinedRefs = "x-inlined-refs";

function localFile(file) {
return new URL(file, import.meta.url).pathname;
function localFile(fileName) {
return fileURLToPath(new URL(fileName, import.meta.url));
}

function importJSON(file) {
Expand Down
1 change: 1 addition & 0 deletions test/check-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createHash } from "node:crypto";
import { readFileSync } from "node:fs";
import { readdir } from "node:fs/promises";
import { test } from "node:test";
import { URL } from "node:url";
import { Validator } from "../index.js";
import { Snapshot } from "./snapshot.js";

Expand Down
5 changes: 3 additions & 2 deletions test/test-bundle-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { strict as assert } from "node:assert/strict";
import { execSync } from "node:child_process";
import { readFileSync, unlinkSync } from "node:fs";
import { test } from "node:test";
import { URL, fileURLToPath } from "node:url";
import { load } from "js-yaml";

function localFile(file) {
return new URL(file, import.meta.url).pathname;
function localFile(fileName) {
return fileURLToPath(new URL(fileName, import.meta.url));
}

function importJSON(file) {
Expand Down
5 changes: 3 additions & 2 deletions test/test-validate-cli.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { strict as assert } from "node:assert/strict";
import { execSync } from "node:child_process";
import { test } from "node:test";
import { URL, fileURLToPath } from "node:url";

function localFile(file) {
return new URL(file, import.meta.url).pathname;
function localFile(fileName) {
return fileURLToPath(new URL(fileName, import.meta.url));
}

const cli = localFile("../bin/validate-api-cli.js");
Expand Down
5 changes: 3 additions & 2 deletions test/test-validation-refs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { strict as assert } from "node:assert/strict";
import { test } from "node:test";
import { URL, fileURLToPath } from "node:url";
import { Validator } from "../index.js";

function localFile(file) {
return new URL(file, import.meta.url).pathname;
function localFile(fileName) {
return fileURLToPath(new URL(fileName, import.meta.url));
}

const invalidRefsSpec = localFile("./validation/invalid-refs.yaml");
Expand Down
5 changes: 3 additions & 2 deletions test/test-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { strict as assert } from "node:assert/strict";
import { readFileSync } from "node:fs";
import { readFile } from "node:fs/promises";
import { test } from "node:test";
import { URL, fileURLToPath } from "node:url";
import { Validator } from "../index.js";

function localFile(file) {
return new URL(file, import.meta.url).pathname;
function localFile(fileName) {
return fileURLToPath(new URL(fileName, import.meta.url));
}

function importJSON(file) {
Expand Down

0 comments on commit 5108b33

Please sign in to comment.