refactor: Use node protocol when importing builtins

This commit is contained in:
Joachim Van Herwegen
2023-10-30 15:53:29 +01:00
parent def0b5c732
commit 990184dbb5
127 changed files with 170 additions and 172 deletions

View File

@@ -1,4 +1,4 @@
import assert from 'assert';
import assert from 'node:assert';
import type { Representation } from '../http/representation/Representation';
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
import type { ResourceIdentifier } from '../http/representation/ResourceIdentifier';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { AuxiliaryIdentifierStrategy } from '../http/auxiliary/AuxiliaryIdentifierStrategy';
import { BasicRepresentation } from '../http/representation/BasicRepresentation';
import type { Patch } from '../http/representation/Patch';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import { ensureDirSync, rename, unlink } from 'fs-extra';
import { v4 } from 'uuid';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { Representation } from '../../http/representation/Representation';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { Stats } from 'fs-extra';
import { createReadStream, createWriteStream, ensureDir, lstat, opendir, remove, stat } from 'fs-extra';
import type { Quad } from 'rdf-js';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import type { Guarded } from '../../util/GuardedStream';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import arrayifyStream from 'arrayify-stream';
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { Representation } from '../../http/representation/Representation';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import arrayifyStream from 'arrayify-stream';
import { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';
import { DataFactory } from 'n3';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { Validator } from '../../http/auxiliary/Validator';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';

View File

@@ -1,4 +1,4 @@
import { createReadStream } from 'fs';
import { createReadStream } from 'node:fs';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
import type { Representation } from '../../http/representation/Representation';
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import orderBy from 'lodash.orderby';
import type { Quad } from 'rdf-js';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';

View File

@@ -1,4 +1,4 @@
import assert from 'assert';
import assert from 'node:assert';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
import type { Representation } from '../../http/representation/Representation';
import { INTERNAL_ERROR } from '../../util/ContentTypes';

View File

@@ -1,4 +1,4 @@
import { parse } from 'querystring';
import { parse } from 'node:querystring';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
import type { Representation } from '../../http/representation/Representation';
import { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import { DataFactory, StreamWriter } from 'n3';
import type { Quad } from 'rdf-js';
import rdfSerializer from 'rdf-serialize';

View File

@@ -1,4 +1,4 @@
import { PassThrough } from 'stream';
import { PassThrough } from 'node:stream';
import { KeysRdfParseJsonLd } from '@comunica/context-entries';
import type { NamedNode } from '@rdfjs/types';
import rdfParser from 'rdf-parse';

View File

@@ -1,4 +1,4 @@
import { createHash } from 'crypto';
import { createHash } from 'node:crypto';
import { getLoggerFor } from '../../logging/LogUtil';
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
import type { KeyValueStorage } from './KeyValueStorage';

View File

@@ -1,4 +1,4 @@
import { createHash } from 'crypto';
import { createHash } from 'node:crypto';
import { getLoggerFor } from '../../logging/LogUtil';
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
import type { KeyValueStorage } from './KeyValueStorage';

View File

@@ -1,4 +1,4 @@
import { promises as fsPromises } from 'fs';
import { promises as fsPromises } from 'node:fs';
import * as mime from 'mime-types';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import { DEFAULT_CUSTOM_TYPES } from '../../util/ContentTypes';

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import { Store } from 'n3';
import { BasicRepresentation } from '../../http/representation/BasicRepresentation';
import type { RdfDatasetRepresentation } from '../../http/representation/RdfDatasetRepresentation';

View File

@@ -1,7 +1,7 @@
// These two eslint lines are needed to store 'this' in a variable so it can be used
// in the PassThrough of createQuotaGuard
/* eslint-disable ts/no-this-alias */
import { PassThrough } from 'stream';
import { PassThrough } from 'node:stream';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import { PayloadHttpError } from '../../util/errors/PayloadHttpError';

View File

@@ -1,5 +1,5 @@
import type { Stats } from 'fs';
import { promises as fsPromises } from 'fs';
import type { Stats } from 'node:fs';
import { promises as fsPromises } from 'node:fs';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import { joinFilePath, normalizeFilePath, trimTrailingSlashes } from '../../util/PathUtil';

View File

@@ -1,4 +1,4 @@
import { PassThrough, Readable } from 'stream';
import { PassThrough, Readable } from 'node:stream';
import { Validator } from '../../http/auxiliary/Validator';
import type { ValidatorInput } from '../../http/auxiliary/Validator';
import type { Representation } from '../../http/representation/Representation';