Skip to content

Commit

Permalink
refactor: dual package is dead. long live esm
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Sep 9, 2024
1 parent 8971768 commit 8cc3ad3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 39 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist/esm/
dist/cjs/*
dist/
!dist/cjs/package.json
.idea/
node_modules/
Expand Down
3 changes: 0 additions & 3 deletions dist/cjs/package.json

This file was deleted.

19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": "[email protected]"
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
}
}
5 changes: 1 addition & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/idrac6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/test.ts
Original file line number Diff line number Diff line change
@@ -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(
(
Expand Down
10 changes: 0 additions & 10 deletions tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8cc3ad3

Please sign in to comment.