From 6c5fe2e5c9bb3434310ffbc57637e082d930ae1b Mon Sep 17 00:00:00 2001 From: TessavWalstijn Date: Fri, 26 May 2023 14:26:31 +0200 Subject: [PATCH 1/6] Added type to export --- index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index b7a4b96..68229a6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,6 @@ /// -export * from './data-model'; -export * from './stream'; -export * from './dataset'; -export * from './query'; +export type * from './data-model'; +export type * from './stream'; +export type * from './dataset'; +export type * from './query'; From 8e965dbb4aae726d4a191972f498ec1949f175ef Mon Sep 17 00:00:00 2001 From: TessavWalstijn Date: Fri, 26 May 2023 14:41:52 +0200 Subject: [PATCH 2/6] Added changeset --- .changeset/mighty-icons-sleep.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-icons-sleep.md diff --git a/.changeset/mighty-icons-sleep.md b/.changeset/mighty-icons-sleep.md new file mode 100644 index 0000000..8078ae4 --- /dev/null +++ b/.changeset/mighty-icons-sleep.md @@ -0,0 +1,5 @@ +--- +"@rdfjs/types": patch +--- + +Export as Type for new transpilers From 2eafb739f515b0f4b096a162062f34fda77fa9d2 Mon Sep 17 00:00:00 2001 From: TessavWalstijn Date: Wed, 8 May 2024 15:41:56 +0200 Subject: [PATCH 3/6] Resolved 'Only named exports may use "export type".' issue --- index.d.ts | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 130 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 68229a6..4f854c5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,132 @@ /// -export type * from './data-model'; -export type * from './stream'; -export type * from './dataset'; -export type * from './query'; +import type { + Term, + NamedNode, + BlankNode, + Literal, + Variable, + DefaultGraph, + Quad_Subject, + Quad_Predicate, + Quad_Object, + Quad_Graph, + BaseQuad, + Quad, + DataFactory, +} from './data-model.d.ts' + +import type { Stream, Source, Sink, Store } from './stream.d.ts' + +import type { + DatasetCore, + DatasetCoreFactory, + Dataset, + DatasetFactory, +} from './dataset.d.ts' + +import type { + QuadTermName, + ResultStream, + QueryOperationCost, + QueryOperationOrder, + QueryResultCardinality, + BaseMetadataQuery, + AllMetadataSupport, + CardinalityMetadataSupport, + OrderMetadataSupport, + AvailableOrdersMetadataSupport, + MetadataOpts, + CardinalityMetadataOpts, + OrderMetadataOpts, + AvailableOrdersMetadataOpts, + ConditionalMetadataType, + QueryExecuteOptions, + BaseQuery, + QueryBindings, + QueryQuads, + QueryBoolean, + QueryVoid, + Query, + Bindings, + BindingsFactory, +} from './query/common.d.ts' + +import type { + QueryContext, + QueryStringContext, + QueryAlgebraContext, + QuerySourceContext, + QueryFormat, + StringQueryable, + AlgebraQueryable, + StringSparqlQueryable, + AlgebraSparqlQueryable, + SparqlResultSupport, + BindingsResultSupport, + VoidResultSupport, + QuadsResultSupport, + BooleanResultSupport, +} from './query/queryable.d.ts' + +export type { + Term, + NamedNode, + BlankNode, + Literal, + Variable, + DefaultGraph, + Quad_Subject, + Quad_Predicate, + Quad_Object, + Quad_Graph, + BaseQuad, + Quad, + DataFactory, + Stream, + Source, + Sink, + Store, + DatasetCore, + DatasetCoreFactory, + Dataset, + DatasetFactory, + QuadTermName, + ResultStream, + QueryOperationCost, + QueryOperationOrder, + QueryResultCardinality, + BaseMetadataQuery, + AllMetadataSupport, + CardinalityMetadataSupport, + OrderMetadataSupport, + AvailableOrdersMetadataSupport, + MetadataOpts, + CardinalityMetadataOpts, + OrderMetadataOpts, + AvailableOrdersMetadataOpts, + ConditionalMetadataType, + QueryExecuteOptions, + BaseQuery, + QueryBindings, + QueryQuads, + QueryBoolean, + QueryVoid, + Query, + Bindings, + BindingsFactory, + QueryContext, + QueryStringContext, + QueryAlgebraContext, + QuerySourceContext, + QueryFormat, + StringQueryable, + AlgebraQueryable, + StringSparqlQueryable, + AlgebraSparqlQueryable, + SparqlResultSupport, + BindingsResultSupport, + VoidResultSupport, + QuadsResultSupport, + BooleanResultSupport, +} From 1a656ed59f469dd5300e75bea00e97c70869316b Mon Sep 17 00:00:00 2001 From: TessavWalstijn Date: Wed, 20 Nov 2024 10:14:46 +0100 Subject: [PATCH 4/6] Revert "Resolved 'Only named exports may use "export type".' issue" This reverts commit 2eafb739f515b0f4b096a162062f34fda77fa9d2. --- index.d.ts | 134 ++--------------------------------------------------- 1 file changed, 4 insertions(+), 130 deletions(-) diff --git a/index.d.ts b/index.d.ts index 4f854c5..68229a6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,132 +1,6 @@ /// -import type { - Term, - NamedNode, - BlankNode, - Literal, - Variable, - DefaultGraph, - Quad_Subject, - Quad_Predicate, - Quad_Object, - Quad_Graph, - BaseQuad, - Quad, - DataFactory, -} from './data-model.d.ts' - -import type { Stream, Source, Sink, Store } from './stream.d.ts' - -import type { - DatasetCore, - DatasetCoreFactory, - Dataset, - DatasetFactory, -} from './dataset.d.ts' - -import type { - QuadTermName, - ResultStream, - QueryOperationCost, - QueryOperationOrder, - QueryResultCardinality, - BaseMetadataQuery, - AllMetadataSupport, - CardinalityMetadataSupport, - OrderMetadataSupport, - AvailableOrdersMetadataSupport, - MetadataOpts, - CardinalityMetadataOpts, - OrderMetadataOpts, - AvailableOrdersMetadataOpts, - ConditionalMetadataType, - QueryExecuteOptions, - BaseQuery, - QueryBindings, - QueryQuads, - QueryBoolean, - QueryVoid, - Query, - Bindings, - BindingsFactory, -} from './query/common.d.ts' - -import type { - QueryContext, - QueryStringContext, - QueryAlgebraContext, - QuerySourceContext, - QueryFormat, - StringQueryable, - AlgebraQueryable, - StringSparqlQueryable, - AlgebraSparqlQueryable, - SparqlResultSupport, - BindingsResultSupport, - VoidResultSupport, - QuadsResultSupport, - BooleanResultSupport, -} from './query/queryable.d.ts' - -export type { - Term, - NamedNode, - BlankNode, - Literal, - Variable, - DefaultGraph, - Quad_Subject, - Quad_Predicate, - Quad_Object, - Quad_Graph, - BaseQuad, - Quad, - DataFactory, - Stream, - Source, - Sink, - Store, - DatasetCore, - DatasetCoreFactory, - Dataset, - DatasetFactory, - QuadTermName, - ResultStream, - QueryOperationCost, - QueryOperationOrder, - QueryResultCardinality, - BaseMetadataQuery, - AllMetadataSupport, - CardinalityMetadataSupport, - OrderMetadataSupport, - AvailableOrdersMetadataSupport, - MetadataOpts, - CardinalityMetadataOpts, - OrderMetadataOpts, - AvailableOrdersMetadataOpts, - ConditionalMetadataType, - QueryExecuteOptions, - BaseQuery, - QueryBindings, - QueryQuads, - QueryBoolean, - QueryVoid, - Query, - Bindings, - BindingsFactory, - QueryContext, - QueryStringContext, - QueryAlgebraContext, - QuerySourceContext, - QueryFormat, - StringQueryable, - AlgebraQueryable, - StringSparqlQueryable, - AlgebraSparqlQueryable, - SparqlResultSupport, - BindingsResultSupport, - VoidResultSupport, - QuadsResultSupport, - BooleanResultSupport, -} +export type * from './data-model'; +export type * from './stream'; +export type * from './dataset'; +export type * from './query'; From 845681b965b46ff237fa1931ea6a0583471e2371 Mon Sep 17 00:00:00 2001 From: TessavWalstijn Date: Fri, 29 Nov 2024 14:22:24 +0100 Subject: [PATCH 5/6] Updated dependency TypeScript to ^5 --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0708c1b..0f9dd23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@typescript-eslint/eslint-plugin": "^4.5.0", "@typescript-eslint/parser": "^4.5.0", "eslint": "^7.12.0", - "typescript": "^4.0.3" + "typescript": "^5.7.2" } }, "node_modules/@babel/code-frame": { @@ -2431,16 +2431,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/undici-types": { diff --git a/package.json b/package.json index fa4e4b5..a45f014 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@typescript-eslint/eslint-plugin": "^4.5.0", "@typescript-eslint/parser": "^4.5.0", "eslint": "^7.12.0", - "typescript": "^4.0.3" + "typescript": "^5.7.2" }, "bugs": { "email": "public-rdfjs@w3.org", From 611ba01a55fe12e01720f55db51937940b177661 Mon Sep 17 00:00:00 2001 From: Tessa van Walstijn Date: Fri, 29 Nov 2024 14:24:04 +0100 Subject: [PATCH 6/6] Update .changeset/mighty-icons-sleep.md Co-authored-by: Tomasz Pluskiewicz --- .changeset/mighty-icons-sleep.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/mighty-icons-sleep.md b/.changeset/mighty-icons-sleep.md index 8078ae4..9660b36 100644 --- a/.changeset/mighty-icons-sleep.md +++ b/.changeset/mighty-icons-sleep.md @@ -1,5 +1,5 @@ --- -"@rdfjs/types": patch +"@rdfjs/types": major --- -Export as Type for new transpilers +In some cases, loaders would report an error similar to `Could not resolve "./data-model"`. This is fixed by using `export type *` but requires [TypeScript 5+](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#support-for-export-type-)