Skip to content

Commit

Permalink
Migrate to @rdfjs/types, Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 11, 2021
1 parent d1f281d commit 5da60e2
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/BlankNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';

/**
* A term that represents an RDF blank node with a label.
Expand Down
2 changes: 1 addition & 1 deletion lib/DataFactory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';
import { BlankNode } from './BlankNode';
import { DefaultGraph } from './DefaultGraph';
import { Literal } from './Literal';
Expand Down
2 changes: 1 addition & 1 deletion lib/DefaultGraph.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';

/**
* A singleton term instance that represents the default graph.
Expand Down
2 changes: 1 addition & 1 deletion lib/Literal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';
import { NamedNode } from './NamedNode';

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/NamedNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';

/**
* A term that contains an IRI.
Expand Down
2 changes: 1 addition & 1 deletion lib/Quad.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';

/**
* An instance of DefaultGraph represents the default graph.
Expand Down
2 changes: 1 addition & 1 deletion lib/Variable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';

/**
* A term that represents a variable.
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"index.js"
],
"dependencies": {
"@types/rdf-js": "*"
"@rdfjs/types": "*"
},
"pre-commit": [
"build",
Expand All @@ -36,7 +36,6 @@
"devDependencies": {
"@rubensworks/eslint-config": "^1.0.0",
"@types/jest": "^26.0.0",
"@types/rdf-js": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.1.1",
"coveralls": "^3.0.0",
Expand Down Expand Up @@ -85,5 +84,8 @@
"validate": "npm ls",
"prepare": "npm run build",
"version": "manual-git-changelog onversion"
},
"resolutions": {
"@types/rdf-js": "4.0.1"
}
}
2 changes: 1 addition & 1 deletion test/DataFactory-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'jest-rdf';
import type * as RDF from 'rdf-js';
import type * as RDF from '@rdfjs/types';
import { DataFactory } from '../lib/DataFactory';

describe('DataFactory', () => {
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,13 @@
dependencies:
"@types/rdf-js" "^2.0.1"

"@rdfjs/types@*":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@rdfjs/types/-/types-1.0.1.tgz#92908a13bc88c71b349b332f3db19178282d6f4e"
integrity sha512-YxVkH0XrCNG3MWeZxfg596GFe+oorTVusmNxRP6ZHTsGczZ8AGvG3UchRNkg3Fy4MyysI7vBAA5YZbESL+VmHQ==
dependencies:
"@types/node" "*"

"@rubensworks/eslint-config@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@rubensworks/eslint-config/-/eslint-config-1.0.0.tgz#dcf6798457a2546f7009dcf71cd25a9c4d910e5b"
Expand Down Expand Up @@ -715,17 +722,10 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.0.tgz#5f96562c1075ee715a5b138f0b7f591c1f40f6b8"
integrity sha512-hiYA88aHiEIgDmeKlsyVsuQdcFn3Z2VuFd/Xm/HCnGnPD8UFU5BM128uzzRVVGEzKDKYUrRsRH9S2o+NUy/3IA==

"@types/rdf-js@^2.0.1":
version "2.0.12"
resolved "https://registry.yarnpkg.com/@types/rdf-js/-/rdf-js-2.0.12.tgz#d305a0b6fd105e33f58d5c1b3de33ff8edcb3210"
integrity sha512-NBzHFHp2vHOJkPlSqzsOrkEsD9grKn+PdFjZieIw59pc0FlRG6WEQAjQZvHzFxJlYzC6ZDCFyTA1wBvUnnzUQw==
dependencies:
"@types/node" "*"

"@types/rdf-js@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/rdf-js/-/rdf-js-4.0.0.tgz#96f7314b09b77ecd16fca7f358db90db8ac86d1b"
integrity sha512-2uaR7ks0380MqzUWGOPOOk9yZIr/6MOaCcaj3ntKgd2PqNocgi8j5kSHIJTDe+5ABtTHqKMSE0v0UqrsT8ibgQ==
"@types/rdf-js@4.0.1", "@types/rdf-js@^2.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/rdf-js/-/rdf-js-4.0.1.tgz#bf89dfc080e292f06273f059b3a82e5e69fec4c0"
integrity sha512-S+28+3RoFI+3arls7dS813gYnhb2HiyLX+gs00rgIvCzHU93DaYajhx4tyT+XEO8SjtzZw90OF4OVdYXBwbvkQ==
dependencies:
"@types/node" "*"

Expand Down

2 comments on commit 5da60e2

@pmcb55
Copy link

@pmcb55 pmcb55 commented on 5da60e2 Aug 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious @rubensworks - why the need to add the resolutions entry for the dependency you've now removed?

  "resolutions": {
    "@types/rdf-js": "4.0.1"
  }

@rubensworks
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was just a temporary hack that was needed because this package has a dev dependency on jest-rdf, which has a transitive dependency on this package again (but of an older version), and therefore depended on an old version of @types/rdf-js.
In order to make @rdfjs/types compatible with @types/rdf-js for the TS compiler, this resolution was needed (will only apply within this package in dev).

But now that jest-rdf has been updated as well, just bumping that will make it possible to remove that resolution.

Please sign in to comment.