Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7df0ff3
You shall be TS tests!
Michiel-VandeVelde Aug 31, 2026
1cb93ae
remove unncessary pin added
Michiel-VandeVelde Aug 31, 2026
0cd4a60
LDTFS small refactor
Michiel-VandeVelde Aug 31, 2026
e785c00
make the controller-test a bit more readable
Michiel-VandeVelde Aug 31, 2026
e017c89
refactor of some AI-changes
Michiel-VandeVelde Aug 31, 2026
1170bdf
trying to get it inline diff...
Michiel-VandeVelde Aug 31, 2026
7acecf0
lil test
Michiel-VandeVelde Aug 31, 2026
7b0aa1c
adding some Types...
Michiel-VandeVelde Aug 31, 2026
395f7f2
another batch of improvements
Michiel-VandeVelde Aug 31, 2026
09b4f44
We on go
Michiel-VandeVelde Sep 1, 2026
07d5a9d
We on go v2
Michiel-VandeVelde Sep 1, 2026
4ae5464
let that async in
Michiel-VandeVelde Sep 1, 2026
dd77110
remove comments
Michiel-VandeVelde Sep 1, 2026
260f1fb
Merge branch 'LinkedDataFragments:master' into TS-test-conversion
Michiel-VandeVelde Sep 8, 2026
73f412f
Address review feedback: fix CI typecheck, remove ephemeral ports, dr…
Michiel-VandeVelde Sep 9, 2026
6ea8a6d
Address more review feedback: centralize Router type, fix pathname ty…
Michiel-VandeVelde Sep 9, 2026
286177e
Upgrade to TypeScript 6, drop the extra tsconfigs and skipLibCheck
jitsedesmet Sep 10, 2026
2eee55a
Merge remote-tracking branch 'upstream/master' into TS-test-conversion
Michiel-VandeVelde Sep 28, 2026
aa8d19c
review fix: servers are never close , servers now close
Michiel-VandeVelde Sep 28, 2026
fbb76fd
fixes
Michiel-VandeVelde Sep 28, 2026
f59bba6
first batch of improvements from review
Michiel-VandeVelde Sep 29, 2026
2fd1a80
second batch of improvements
Michiel-VandeVelde Sep 29, 2026
7179bc3
another one Bytes the Dust
Michiel-VandeVelde Sep 29, 2026
50aff74
Address more review feedback: createRequest headers param, real suppo…
Michiel-VandeVelde Sep 30, 2026
eabbab1
revert the datafactory shizzle
Michiel-VandeVelde Sep 30, 2026
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
6 changes: 3 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
overrides: [
{
// Specific rules for test files
files: [ "packages/**/test/**/*-test.js" ],
files: [ "packages/**/test/**/*-test.ts" ],
plugins: [ "eslint-plugin-promise" ],
rules: {
"import/no-extraneous-dependencies": "off",
Expand All @@ -203,13 +203,13 @@
},
{
// TypeScript source files
files: [ "packages/**/*.ts" ],
files: [ "packages/**/*.ts", "test/**/*.ts" ],
parser: "@typescript-eslint/parser",
extends: [ "plugin:@typescript-eslint/recommended-requiring-type-checking" ],
parserOptions: {
ecmaVersion: 9,
sourceType: "module",
project: "./tsconfig.json"
project: "./tsconfig.eslint.json"
},
plugins: [ "@typescript-eslint" ],
rules: {
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
"workspaces": [
"packages/*"
],
"resolutions": {
"immutable": "^5.1.3"
},
"devDependencies": {
"@types/lodash": "^4.17.24",
"@types/lru-cache": "^5.1.1",
"@types/mime": "^2.0.3",
"@types/n3": "^1.26.3",
"@types/node": "^24.0.0",
"@types/parse-cache-control": "^1.0.4",
"@types/q": "^1.5.8",
"@types/rdf-js": "^4.0.2",
"@types/request": "^2.48.13",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -20,12 +25,12 @@
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-promise": "^7.3.0",
"lerna": "^4.0.0",
"light-my-request": "^6.6.0",
"manual-git-changelog": "^1.0.1",
"node-gyp": "^11.0.0",
"pre-commit": "^2.0.0",
"rdf-object": "^3.0.0",
"supertest": "^7.0.0",
"typescript": "^5.9.3",
"typescript": "^6.0.0",
"vitest": "^4.1.10"
},
"pre-commit": [
Expand All @@ -37,8 +42,7 @@
"lint-changed": "lerna run lint --since HEAD",
"test": "vitest run --coverage",
"test-ci": "vitest run --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit",
"build": "tsc -p tsconfig.json",
"build": "tsc",
"lint": "eslint packages/*/bin/* packages/*/lib packages/*/test test --ext .js,.ts",
"clean": "rm -rf ./node_modules && rm -rf ./packages/*/node_modules",
"dedupe": "npx yarn-deduplicate yarn.lock --scopes",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/datasources/Datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as fs from 'fs';
import { EventEmitter } from 'events';
import { AsyncIterator, BufferedIterator, empty } from 'asynciterator';
import { stringToTerm } from 'rdf-string';
import type { DataFactory, Quad, Quad_Graph } from 'rdf-js';
import type { DataFactory, Quad, Quad_Graph } from '@rdfjs/types';
import { UrlData } from '../UrlData';
import type { DatasourceOptions, Query } from '../types';
import type { CoreOptions, RequestAPI, RequiredUriUrl, Request as RequestT } from 'request';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/datasources/EmptyDatasource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! @license MIT ©2015-2016 Ruben Verborgh, Ghent University - imec */
/* An empty data source doesn't contain any quads. */

import type { Quad } from 'rdf-js';
import type { Quad } from '@rdfjs/types';
import { MemoryDatasource } from './MemoryDatasource';
import type { DatasourceOptions } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/datasources/IndexDatasource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
/* An IndexDatasource is a datasource that lists other data sources. */

import type { Quad } from 'rdf-js';
import type { Quad } from '@rdfjs/types';
import { MemoryDatasource } from './MemoryDatasource';
import type { DatasourceOptions, DatasourceRegistry } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/datasources/MemoryDatasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* A MemoryDatasource queries a set of in-memory quads. */

import { Store as N3Store } from 'n3';
import type { Quad } from 'rdf-js';
import type { Quad } from '@rdfjs/types';
import { Datasource } from './Datasource';
import type { DatasourceOptions, Pushable, Query } from '../types';

Expand Down
4 changes: 2 additions & 2 deletions packages/core/lib/routers/DatasourceRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* A DatasourceRouter routes URLs to data sources. */

import { UrlData } from '../UrlData';
import type { Query, RouterRequest } from '../types';
import type { Query, Router, RouterRequest } from '../types';

// Creates a new DatasourceRouter
export class DatasourceRouter {
export class DatasourceRouter implements Router {
protected _baseLength: number;

constructor(options?: { urlData?: UrlData }) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/lib/routers/PageRouter.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
/* A PageRouter routes page numbers to offsets */

import type { Query, RouterRequest } from '../types';
import type { Query, Router, RouterRequest } from '../types';

// Creates a new PageRouter with the given page size, which defaults to 100.
export class PageRouter {
export class PageRouter implements Router {
pageSize: number;

constructor(config?: { pageSize?: number }) {
Expand Down
9 changes: 7 additions & 2 deletions packages/core/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! @license MIT ©2026 Ghent University - imec */
/* Shared type definitions for @ldf/core */

import type { DataFactory, Term } from 'rdf-js';
import type { DataFactory, Term } from '@rdfjs/types';
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http';
import type { ParsedUrlQuery } from 'querystring';
import type { UrlObject } from 'url';
Expand Down Expand Up @@ -93,10 +93,15 @@ export interface LdfResponse extends ServerResponse {
// The (already-parsed) request shape routers' extractQueryParams receives —
// note this is distinct from LdfRequest: callers pass { url: request.parsedUrl, headers }.
export interface RouterRequest {
url?: { pathname?: string; query?: ParsedUrlQuery };
url?: { pathname?: string | null; query?: ParsedUrlQuery };
headers?: IncomingHttpHeaders;
}

// A router extracts query parameters from a (partial) request into a query object
export interface Router {
extractQueryParams(request: RouterRequest, query: Query): void;
}

// Options accepted by the Controller base class (and its subclasses) constructor
export interface ControllerOptions {
urlData?: UrlData;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/views/RdfView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { View } from './View';
import * as N3 from 'n3';
import { JsonLdSerializer } from 'jsonld-streaming-serializer';
import * as _ from 'lodash';
import type { DataFactory, Quad } from 'rdf-js';
import type { DataFactory, Quad } from '@rdfjs/types';
import type { LdfRequest, LdfResponse, RdfViewSettings, RenderDone, ViewSettings } from '../types';

let dcTerms = 'http://purl.org/dc/terms/',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/views/View.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* View is a base class for objects that generate server responses. */

import { join } from 'path';
import type { DataFactory } from 'rdf-js';
import type { DataFactory } from '@rdfjs/types';
import { ViewCollection } from './ViewCollection';
import type { LdfRequest, LdfResponse, RenderDone, ViewSettings } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/views/error/ErrorRdfView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* An ErrorRdfView represents a 500 response in RDF. */

import { RdfView } from '../RdfView';
import type { Quad } from 'rdf-js';
import type { Quad } from '@rdfjs/types';
import type { RdfViewSettings, RenderDone, ViewSettings } from '../../types';

// Creates a new ErrorRdfView
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/views/notfound/NotFoundRdfView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* A NotFoundRdfView represents a 404 response in RDF. */

import { RdfView } from '../RdfView';
import type { Quad } from 'rdf-js';
import type { Quad } from '@rdfjs/types';
import type { RdfViewSettings, RenderDone, ViewSettings } from '../../types';

// Creates a new NotFoundRdfView
Expand Down
9 changes: 5 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
"lint": "eslint bin/* lib test"
},
"dependencies": {
"asynciterator": "^3.0.0",
"@rdfjs/types": "^2.0.1",
"asynciterator": "^3.10.0",
"componentsjs": "^4.0.4",
"forwarded-parse": "^2.1.0",
"jsonld-streaming-serializer": "^3.0.0",
"jsonld-streaming-serializer": "^4.0.0",
"lodash": "^4.0.0",
"mime": "^2.4.4",
"n3": "^1.10.0",
"n3": "^1.26.0",
"negotiate": "^1.0.1",
"q": "^1.4.1",
"qejs": "^3.0.5",
"rdf-string": "^1.3.1",
"rdf-string": "^1.6.3",
"request": "^2.88.2",
"uritemplate": "^0.3.4"
},
Expand Down
Loading
Loading