Skip to content

Commit 8cc3ad3

Browse files
committed
refactor: dual package is dead. long live esm
1 parent 8971768 commit 8cc3ad3

8 files changed

+17
-39
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
dist/esm/
2-
dist/cjs/*
1+
dist/
32
!dist/cjs/package.json
43
.idea/
54
node_modules/

dist/cjs/package.json

-3
This file was deleted.

package.json

+7-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
"type": "module",
55
"license": "MIT",
66
"homepage": "https://noim.me/idrac6/",
7-
"main": "dist/cjs/index.js",
8-
"module": "dist/esm/index.js",
9-
"exports": {
10-
"import": "./dist/esm/index.js",
11-
"require": "./dist/cjs/index.js"
12-
},
7+
"exports": "./dist/index.js",
138
"devDependencies": {
149
"@types/debug": "^4.1.7",
1510
"@types/fs-extra": "^9.0.13",
16-
"@types/lodash-es": "^4.17.6",
11+
"@types/lodash-es": "^4.17.12",
1712
"@types/node": "^18.0.5",
1813
"prettier": "^2.7.1",
1914
"typedoc": "^0.23.7",
@@ -28,18 +23,18 @@
2823
"lodash-es": "^4.17.21"
2924
},
3025
"scripts": {
31-
"build": "tsc && tsc -p tsconfig.cjs.json",
26+
"build": "tsc",
3227
"docs": "typedoc --excludeInternal false --cleanOutputDir --cname noim.me --excludePrivate --name iDrac6 --out docs/ src/index.ts",
3328
"test": "tsc && node dist/esm/test.js",
3429
"format": "prettier --write ./src/**/*"
3530
},
36-
"resolutions": {
37-
"lodash": "4.17.21"
38-
},
3931
"files": [
4032
"dist",
4133
"package.json",
4234
"yarn.lock"
4335
],
44-
"packageManager": "[email protected]"
36+
"packageManager": "[email protected]",
37+
"engines": {
38+
"node": ">=18"
39+
}
4540
}

pnpm-lock.yaml

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/idrac6.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
import { IDrac6Options } from "./interfaces/iDrac6Options.js";
66
import { get } from "lodash-es";
7-
import { URL, URLSearchParams } from "url";
7+
import { URL, URLSearchParams } from "node:url";
88
import {
99
iDrac6ConfigError,
1010
iDrac6MissingConfigError,
1111
} from "./errors/ConfigErrors.js";
1212
import { IDrac6Session } from "./interfaces/iDrac6Session.js";
13-
import { join, dirname } from "path";
13+
import { join, dirname } from "node:path";
1414
import fsExtra from "fs-extra";
15-
import { unlink } from "fs/promises";
15+
import { unlink } from "node:fs/promises";
1616
import ky from "ky-universal";
1717
import { iDrac6LoginError } from "./errors/iDrac6Error.js";
18-
import { Agent } from "https";
19-
import { homedir } from "os";
18+
import { Agent } from "node:https";
19+
import { homedir } from "node:os";
2020
import { IDrac6DataTypes, PowerActions, PowerState } from "./enums/iDrac6.js";
2121
import debug from "debug";
2222
import {

src/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IDrac6Options, iDrac6, IDrac6DataTypes } from "./index.js";
2-
import { readFile } from "fs/promises";
3-
import { URL } from "url";
2+
import { readFile } from "node:fs/promises";
3+
import { URL } from "node:url";
44

55
const config = JSON.parse(
66
(

tsconfig.cjs.json

-10
This file was deleted.

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
1919
"sourceMap": true /* Generates corresponding '.map' file. */,
2020
// "outFile": "./", /* Concatenate and emit output to single file. */
21-
"outDir": "./dist/esm" /* Redirect output structure to the directory. */,
21+
"outDir": "./dist" /* Redirect output structure to the directory. */,
2222
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
2323
// "composite": true, /* Enable project compilation */
2424
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */

0 commit comments

Comments
 (0)