-
Notifications
You must be signed in to change notification settings - Fork 63
Migrate codebase to Typescript #213
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
base: modernize-repository
Are you sure you want to change the base?
Changes from all commits
befdda6
e4d49b0
0ce69b1
20b1199
7e7f87c
4d311e3
b360004
c07d7c7
64e1276
9a8d074
a0c7033
3761b82
8f84682
303aefc
5808520
90cdfba
dde4dcd
7de1b4d
1b72641
cfb6623
dba473d
171cdf9
97b2507
b06fdae
8a230b0
40d5d5d
7edb2d8
3210fae
4299d2c
f116ff2
af29b86
0cfc18f
bbd53a2
928c9a4
0e2b2d8
56460e9
9c6141e
2ae213f
19f0580
a73d281
bce6ec3
cb510bf
c2f92e6
faa5eb6
694e67b
9b60c04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| node_modules | ||
| coverage | ||
| .nyc_output | ||
|
|
||
| # Compiled output for packages already converted to TypeScript | ||
| packages/*/**/*.js | ||
| packages/*/**/*.d.ts | ||
| !packages/*/test/** | ||
| !packages/preset-qpf/**/*.js | ||
| !packages/server/**/*.js |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,18 @@ | |
| "packages/*" | ||
| ], | ||
| "engines": { | ||
| "node": ">=10.0" | ||
| "node": ">=20.0" | ||
|
jitsedesmet marked this conversation as resolved.
|
||
| }, | ||
| "devDependencies": { | ||
| "@types/lodash": "^4.17.24", | ||
| "@types/lru-cache": "^5.1.1", | ||
| "@types/mime": "^2.0.3", | ||
| "@types/node": "^22.20.1", | ||
| "@types/parse-cache-control": "^1.0.4", | ||
| "@types/q": "^1.5.8", | ||
| "@types/request": "^2.48.13", | ||
| "@typescript-eslint/eslint-plugin": "^5.62.0", | ||
| "@typescript-eslint/parser": "^5.62.0", | ||
| "chai": "^4.0.0", | ||
| "coveralls": "^3.0.9", | ||
| "eslint": "^7.0.0", | ||
|
|
@@ -17,9 +26,11 @@ | |
| "mocha": "^8.0.0", | ||
| "nyc": "^15.0.0", | ||
| "pre-commit": "^1.1.3", | ||
| "rdf-object": "^1.14.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need an additional dependency? |
||
| "sinon": "^1.17.4", | ||
| "sinon-chai": "^2.14.0", | ||
| "supertest": "^6.0.0" | ||
| "supertest": "^6.0.0", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "pre-commit": [ | ||
| "lint", | ||
|
|
@@ -31,12 +42,14 @@ | |
| "mocha": "mocha \"packages/*/test/**/*-test.js\" --recursive --require ./test/test-setup --timeout 500", | ||
| "test": "nyc npm run mocha", | ||
| "test-ci": "nyc --reporter=lcov npm run mocha", | ||
| "lint": "eslint packages/*/bin/* packages/*/lib packages/*/test", | ||
| "typecheck": "tsc -p tsconfig.json --noEmit", | ||
|
Michiel-VandeVelde marked this conversation as resolved.
|
||
| "build": "tsc -p tsconfig.json", | ||
| "lint": "eslint packages/*/bin/* packages/*/lib packages/*/test --ext .js,.ts", | ||
| "clean": "rm -rf ./node_modules && rm -rf ./packages/*/node_modules", | ||
| "dedupe": "npx yarn-deduplicate yarn.lock --scopes", | ||
| "publish": "lerna publish", | ||
| "publish-bare": "lerna exec -- npm publish --silent", | ||
| "postinstall": "lerna run prepare", | ||
| "postinstall": "lerna run prepare && yarn run build", | ||
| "version": "manual-git-changelog onversion" | ||
| } | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| /*! @license MIT ©2015-2016 Ruben Verborgh, Ghent University - imec */ | ||
| /* Exports of the components of this package */ | ||
|
|
||
| import type * as Types from './lib/types'; | ||
|
|
||
| import { AssetsController } from './lib/controllers/AssetsController'; | ||
| import { Controller } from './lib/controllers/Controller'; | ||
| import { DeferenceController as DereferenceController } from './lib/controllers/DereferenceController'; | ||
| import { ErrorController } from './lib/controllers/ErrorController'; | ||
| import { NotFoundController } from './lib/controllers/NotFoundController'; | ||
|
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also look into TS-ifying these exports? A typical structure is e.g.: https://github.com/comunica/traqula/blob/main/packages/algebra-transformations-1-1/lib/index.ts |
||
|
|
||
| import { Datasource } from './lib/datasources/Datasource'; | ||
| import { EmptyDatasource } from './lib/datasources/EmptyDatasource'; | ||
| import { IndexDatasource } from './lib/datasources/IndexDatasource'; | ||
| import { MemoryDatasource } from './lib/datasources/MemoryDatasource'; | ||
|
|
||
| import { DatasourceRouter } from './lib/routers/DatasourceRouter'; | ||
| import { PageRouter } from './lib/routers/PageRouter'; | ||
|
|
||
| import { ErrorHtmlView } from './lib/views/error/ErrorHtmlView'; | ||
| import { ErrorRdfView } from './lib/views/error/ErrorRdfView'; | ||
| import { ForbiddenHtmlView } from './lib/views/forbidden/ForbiddenHtmlView'; | ||
| import { NotFoundHtmlView } from './lib/views/notfound/NotFoundHtmlView'; | ||
| import { NotFoundRdfView } from './lib/views/notfound/NotFoundRdfView'; | ||
| import { HtmlView } from './lib/views/HtmlView'; | ||
| import { RdfView } from './lib/views/RdfView'; | ||
| import { View } from './lib/views/View'; | ||
| import { ViewCollection } from './lib/views/ViewCollection'; | ||
|
|
||
| import { runCli, runCustom } from './lib/CliRunner'; | ||
| import { LinkedDataFragmentsServer } from './lib/LinkedDataFragmentsServer'; | ||
| import { LinkedDataFragmentsServerWorker } from './lib/LinkedDataFragmentsServerWorker'; | ||
| import { UrlData } from './lib/UrlData'; | ||
| import * as Util from './lib/Util'; | ||
|
|
||
| const Core = { | ||
| controllers: { | ||
| AssetsController, | ||
| Controller, | ||
| DereferenceController, | ||
| ErrorController, | ||
| NotFoundController, | ||
| }, | ||
| datasources: { | ||
| Datasource, | ||
| EmptyDatasource, | ||
| IndexDatasource, | ||
| MemoryDatasource, | ||
| }, | ||
| routers: { | ||
| DatasourceRouter, | ||
| PageRouter, | ||
| }, | ||
| views: { | ||
| error: { | ||
| ErrorHtmlView, | ||
| ErrorRdfView, | ||
| }, | ||
| forbidden: { | ||
| ForbiddenHtmlView, | ||
| }, | ||
| notfound: { | ||
| NotFoundHtmlView, | ||
| NotFoundRdfView, | ||
| }, | ||
| HtmlView, | ||
| RdfView, | ||
| View, | ||
| ViewCollection, | ||
| }, | ||
| runCli, | ||
| runCustom, | ||
| LinkedDataFragmentsServer, | ||
| LinkedDataFragmentsServerWorker, | ||
| UrlData, | ||
| Util, | ||
| }; | ||
|
|
||
| // Re-exports this package's shared type definitions, so consumers can pull | ||
| // them from the package root instead of reaching into `@ldf/core/lib/types` | ||
| namespace Core { | ||
| export type QueryFeatures = Types.QueryFeatures; | ||
| export type Query = Types.Query; | ||
| export type DatasourceRegistry = Types.DatasourceRegistry; | ||
| export type Pushable<T> = Types.Pushable<T>; | ||
| export type DatasourceOptions = Types.DatasourceOptions; | ||
| export type RenderDone = Types.RenderDone; | ||
| export type LdfRequest = Types.LdfRequest; | ||
| export type LdfResponse = Types.LdfResponse; | ||
| export type RouterRequest = Types.RouterRequest; | ||
| export type ControllerOptions = Types.ControllerOptions; | ||
| export type ViewSettings = Types.ViewSettings; | ||
| export type WorkerConfig = Types.WorkerConfig; | ||
| } | ||
|
|
||
| export = Core; | ||
Uh oh!
There was an error while loading. Please reload this page.