diff --git a/package.json b/package.json index 91c3b6b5a..880bc5671 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,6 @@ "keywords": [ "ipfs" ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "private": true, "scripts": { "reset": "aegir run clean && aegir clean **/node_modules **/package-lock.json", diff --git a/packages/interop/package.json b/packages/interop/package.json index 001e0e3d9..585d781dc 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -14,10 +14,6 @@ "keywords": [ "IPFS" ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "type": "module", "types": "./dist/src/index.d.ts", "files": [ diff --git a/packages/unixfs/package.json b/packages/unixfs/package.json index ddb00c1e4..583831c36 100644 --- a/packages/unixfs/package.json +++ b/packages/unixfs/package.json @@ -14,12 +14,24 @@ "keywords": [ "IPFS" ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "type": "module", "types": "./dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ], + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ] + } + }, "files": [ "src", "dist", @@ -30,6 +42,10 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" + }, + "./errors": { + "types": "./dist/src/errors.d.ts", + "import": "./dist/src/errors.js" } }, "eslintConfig": { diff --git a/packages/unixfs/src/commands/cat.ts b/packages/unixfs/src/commands/cat.ts index 1360281f5..18269a805 100644 --- a/packages/unixfs/src/commands/cat.ts +++ b/packages/unixfs/src/commands/cat.ts @@ -1,6 +1,6 @@ import { exporter } from 'ipfs-unixfs-exporter' import mergeOpts from 'merge-options' -import { NoContentError, NotAFileError } from './utils/errors.js' +import { NoContentError, NotAFileError } from '../errors.js' import { resolve } from './utils/resolve.js' import type { CatOptions } from '../index.js' import type { Blocks } from '@helia/interface/blocks' diff --git a/packages/unixfs/src/commands/chmod.ts b/packages/unixfs/src/commands/chmod.ts index b0092d398..fc72c57a4 100644 --- a/packages/unixfs/src/commands/chmod.ts +++ b/packages/unixfs/src/commands/chmod.ts @@ -9,8 +9,8 @@ import mergeOpts from 'merge-options' import { CID } from 'multiformats/cid' import * as raw from 'multiformats/codecs/raw' import { sha256 } from 'multiformats/hashes/sha2' +import { InvalidPBNodeError, NotUnixFSError, UnknownError } from '../errors.js' import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js' -import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js' import { persist } from './utils/persist.js' import { resolve, updatePathCids } from './utils/resolve.js' import type { ChmodOptions } from '../index.js' diff --git a/packages/unixfs/src/commands/cp.ts b/packages/unixfs/src/commands/cp.ts index 010a9612a..f8bbfdf13 100644 --- a/packages/unixfs/src/commands/cp.ts +++ b/packages/unixfs/src/commands/cp.ts @@ -1,10 +1,10 @@ import { logger } from '@libp2p/logger' import mergeOpts from 'merge-options' +import { InvalidParametersError } from '../errors.js' import { addLink } from './utils/add-link.js' import { cidToDirectory } from './utils/cid-to-directory.js' import { cidToPBLink } from './utils/cid-to-pblink.js' import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js' -import { InvalidParametersError } from './utils/errors.js' import type { CpOptions } from '../index.js' import type { Blocks } from '@helia/interface/blocks' import type { CID } from 'multiformats/cid' diff --git a/packages/unixfs/src/commands/ls.ts b/packages/unixfs/src/commands/ls.ts index 7525b66f5..c27566bd6 100644 --- a/packages/unixfs/src/commands/ls.ts +++ b/packages/unixfs/src/commands/ls.ts @@ -1,6 +1,6 @@ import { exporter, type UnixFSEntry } from 'ipfs-unixfs-exporter' import mergeOpts from 'merge-options' -import { NoContentError, NotADirectoryError } from './utils/errors.js' +import { NoContentError, NotADirectoryError } from '../errors.js' import { resolve } from './utils/resolve.js' import type { LsOptions } from '../index.js' import type { Blocks } from '@helia/interface/blocks' diff --git a/packages/unixfs/src/commands/mkdir.ts b/packages/unixfs/src/commands/mkdir.ts index 272a94ead..36c968c54 100644 --- a/packages/unixfs/src/commands/mkdir.ts +++ b/packages/unixfs/src/commands/mkdir.ts @@ -5,11 +5,11 @@ import { exporter } from 'ipfs-unixfs-exporter' import mergeOpts from 'merge-options' import { CID } from 'multiformats/cid' import { sha256 } from 'multiformats/hashes/sha2' +import { InvalidParametersError, NotADirectoryError } from '../errors.js' import { addLink } from './utils/add-link.js' import { cidToDirectory } from './utils/cid-to-directory.js' import { cidToPBLink } from './utils/cid-to-pblink.js' import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js' -import { InvalidParametersError, NotADirectoryError } from './utils/errors.js' import type { MkdirOptions } from '../index.js' import type { Blocks } from '@helia/interface/blocks' diff --git a/packages/unixfs/src/commands/rm.ts b/packages/unixfs/src/commands/rm.ts index 8da00de40..e640ac4ab 100644 --- a/packages/unixfs/src/commands/rm.ts +++ b/packages/unixfs/src/commands/rm.ts @@ -1,8 +1,8 @@ import { logger } from '@libp2p/logger' import mergeOpts from 'merge-options' +import { InvalidParametersError } from '../errors.js' import { cidToDirectory } from './utils/cid-to-directory.js' import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js' -import { InvalidParametersError } from './utils/errors.js' import { removeLink } from './utils/remove-link.js' import type { RmOptions } from '../index.js' import type { Blocks } from '@helia/interface/blocks' diff --git a/packages/unixfs/src/commands/stat.ts b/packages/unixfs/src/commands/stat.ts index 6955418ea..e7a84f866 100644 --- a/packages/unixfs/src/commands/stat.ts +++ b/packages/unixfs/src/commands/stat.ts @@ -4,7 +4,7 @@ import { UnixFS } from 'ipfs-unixfs' import { exporter } from 'ipfs-unixfs-exporter' import mergeOpts from 'merge-options' import * as raw from 'multiformats/codecs/raw' -import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js' +import { InvalidPBNodeError, NotUnixFSError, UnknownError } from '../errors.js' import { resolve } from './utils/resolve.js' import type { StatOptions, UnixFSStats } from '../index.js' import type { Blocks } from '@helia/interface/blocks' diff --git a/packages/unixfs/src/commands/touch.ts b/packages/unixfs/src/commands/touch.ts index 7482f6f72..1cdae6de8 100644 --- a/packages/unixfs/src/commands/touch.ts +++ b/packages/unixfs/src/commands/touch.ts @@ -9,8 +9,8 @@ import mergeOpts from 'merge-options' import { CID } from 'multiformats/cid' import * as raw from 'multiformats/codecs/raw' import { sha256 } from 'multiformats/hashes/sha2' +import { InvalidPBNodeError, NotUnixFSError, UnknownError } from '../errors.js' import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js' -import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js' import { persist } from './utils/persist.js' import { resolve, updatePathCids } from './utils/resolve.js' import type { TouchOptions } from '../index.js' diff --git a/packages/unixfs/src/commands/utils/add-link.ts b/packages/unixfs/src/commands/utils/add-link.ts index 350c7ddc7..a48b20539 100644 --- a/packages/unixfs/src/commands/utils/add-link.ts +++ b/packages/unixfs/src/commands/utils/add-link.ts @@ -6,8 +6,8 @@ import { sha256 } from 'multiformats/hashes/sha2' // @ts-expect-error no types import SparseArray from 'sparse-array' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { AlreadyExistsError, InvalidParametersError, InvalidPBNodeError } from '../../errors.js' import { wrapHash } from './consumable-hash.js' -import { AlreadyExistsError, InvalidParametersError, InvalidPBNodeError } from './errors.js' import { hamtBucketBits, hamtHashFn } from './hamt-constants.js' import { createShard, diff --git a/packages/unixfs/src/commands/utils/cid-to-directory.ts b/packages/unixfs/src/commands/utils/cid-to-directory.ts index afe5638a6..dc072c2c8 100644 --- a/packages/unixfs/src/commands/utils/cid-to-directory.ts +++ b/packages/unixfs/src/commands/utils/cid-to-directory.ts @@ -1,5 +1,5 @@ import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter' -import { NotADirectoryError } from './errors.js' +import { NotADirectoryError } from '../../errors.js' import type { Blocks } from '@helia/interface/blocks' import type { PBNode } from '@ipld/dag-pb' import type { CID } from 'multiformats/cid' diff --git a/packages/unixfs/src/commands/utils/cid-to-pblink.ts b/packages/unixfs/src/commands/utils/cid-to-pblink.ts index 513ea0abe..a1a460ddf 100644 --- a/packages/unixfs/src/commands/utils/cid-to-pblink.ts +++ b/packages/unixfs/src/commands/utils/cid-to-pblink.ts @@ -1,6 +1,6 @@ import * as dagPb from '@ipld/dag-pb' import { exporter, type ExporterOptions } from 'ipfs-unixfs-exporter' -import { NotUnixFSError } from './errors.js' +import { NotUnixFSError } from '../../errors.js' import type { Blocks } from '@helia/interface/blocks' import type { PBNode, PBLink } from '@ipld/dag-pb' import type { CID } from 'multiformats/cid' diff --git a/packages/unixfs/src/commands/utils/remove-link.ts b/packages/unixfs/src/commands/utils/remove-link.ts index a60f64123..a39256f47 100644 --- a/packages/unixfs/src/commands/utils/remove-link.ts +++ b/packages/unixfs/src/commands/utils/remove-link.ts @@ -3,7 +3,7 @@ import * as dagPB from '@ipld/dag-pb' import { logger } from '@libp2p/logger' import { UnixFS } from 'ipfs-unixfs' import { exporter } from 'ipfs-unixfs-exporter' -import { InvalidParametersError, InvalidPBNodeError } from './errors.js' +import { InvalidParametersError, InvalidPBNodeError } from '../../errors.js' import { recreateShardedDirectory, type UpdateHamtDirectoryOptions, diff --git a/packages/unixfs/src/commands/utils/resolve.ts b/packages/unixfs/src/commands/utils/resolve.ts index a2391d937..9f8cecf29 100644 --- a/packages/unixfs/src/commands/utils/resolve.ts +++ b/packages/unixfs/src/commands/utils/resolve.ts @@ -1,9 +1,9 @@ import { logger } from '@libp2p/logger' import { exporter } from 'ipfs-unixfs-exporter' +import { DoesNotExistError, InvalidParametersError } from '../../errors.js' import { addLink } from './add-link.js' import { cidToDirectory } from './cid-to-directory.js' import { cidToPBLink } from './cid-to-pblink.js' -import { DoesNotExistError, InvalidParametersError } from './errors.js' import type { Blocks } from '@helia/interface/blocks' import type { AbortOptions } from '@libp2p/interfaces' import type { CID } from 'multiformats/cid' diff --git a/packages/unixfs/src/commands/utils/errors.ts b/packages/unixfs/src/errors.ts similarity index 100% rename from packages/unixfs/src/commands/utils/errors.ts rename to packages/unixfs/src/errors.ts