diff --git a/.gitignore b/.gitignore index 776c3ca..85f0c81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -dist/esm/ -dist/cjs/* +dist/ !dist/cjs/package.json .idea/ node_modules/ diff --git a/dist/cjs/package.json b/dist/cjs/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/package.json b/package.json index c7592f2..f11c3d6 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,11 @@ "type": "module", "license": "MIT", "homepage": "https://noim.me/idrac6/", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "exports": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" - }, + "exports": "./dist/index.js", "devDependencies": { "@types/debug": "^4.1.7", "@types/fs-extra": "^9.0.13", - "@types/lodash-es": "^4.17.6", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.0.5", "prettier": "^2.7.1", "typedoc": "^0.23.7", @@ -28,18 +23,18 @@ "lodash-es": "^4.17.21" }, "scripts": { - "build": "tsc && tsc -p tsconfig.cjs.json", + "build": "tsc", "docs": "typedoc --excludeInternal false --cleanOutputDir --cname noim.me --excludePrivate --name iDrac6 --out docs/ src/index.ts", "test": "tsc && node dist/esm/test.js", "format": "prettier --write ./src/**/*" }, - "resolutions": { - "lodash": "4.17.21" - }, "files": [ "dist", "package.json", "yarn.lock" ], - "packageManager": "pnpm@9.9.0" + "packageManager": "pnpm@9.9.0", + "engines": { + "node": ">=18" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fe10fb..2b5ae3a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - lodash: 4.17.21 - importers: .: @@ -37,7 +34,7 @@ importers: specifier: ^9.0.13 version: 9.0.13 '@types/lodash-es': - specifier: ^4.17.6 + specifier: ^4.17.12 version: 4.17.12 '@types/node': specifier: ^18.0.5 diff --git a/src/idrac6.ts b/src/idrac6.ts index c544b93..eb281b9 100644 --- a/src/idrac6.ts +++ b/src/idrac6.ts @@ -4,19 +4,19 @@ import { IDrac6Options } from "./interfaces/iDrac6Options.js"; import { get } from "lodash-es"; -import { URL, URLSearchParams } from "url"; +import { URL, URLSearchParams } from "node:url"; import { iDrac6ConfigError, iDrac6MissingConfigError, } from "./errors/ConfigErrors.js"; import { IDrac6Session } from "./interfaces/iDrac6Session.js"; -import { join, dirname } from "path"; +import { join, dirname } from "node:path"; import fsExtra from "fs-extra"; -import { unlink } from "fs/promises"; +import { unlink } from "node:fs/promises"; import ky from "ky-universal"; import { iDrac6LoginError } from "./errors/iDrac6Error.js"; -import { Agent } from "https"; -import { homedir } from "os"; +import { Agent } from "node:https"; +import { homedir } from "node:os"; import { IDrac6DataTypes, PowerActions, PowerState } from "./enums/iDrac6.js"; import debug from "debug"; import { diff --git a/src/test.ts b/src/test.ts index 575c278..d3c79d6 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,6 +1,6 @@ import { IDrac6Options, iDrac6, IDrac6DataTypes } from "./index.js"; -import { readFile } from "fs/promises"; -import { URL } from "url"; +import { readFile } from "node:fs/promises"; +import { URL } from "node:url"; const config = JSON.parse( ( diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json deleted file mode 100644 index 321b33c..0000000 --- a/tsconfig.cjs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "outDir": "./dist/cjs" - }, - "exclude": [ - "./src/test.ts" - ] -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 6aaf754..7a13050 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist/esm" /* Redirect output structure to the directory. */, + "outDir": "./dist" /* Redirect output structure to the directory. */, // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */