Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows compatibility #168

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading