Skip to content

Commit

Permalink
experimental ESM dist
Browse files Browse the repository at this point in the history
  • Loading branch information
iccicci committed Feb 22, 2022
1 parent 393dc31 commit d9cb99d
Show file tree
Hide file tree
Showing 8 changed files with 386 additions and 358 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- 2022-02-22 - v3.0.3
- Experimental ESM dist
- devDependencies update
- 2021-11-20 - v3.0.2
- Required **Node.js v14**
- devDependencies update
Expand Down
684 changes: 343 additions & 341 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"coverage": "npm run clean && TZ=\"Europe/Rome\" nyc -r lcov -r text -r text-summary -r html mocha -r ts-node/register test/*ts",
"eslint": "eslint index.ts utils.ts test/*ts",
"ignore": "node -r ts-node/register utils.ts ignore",
"prepare": "npm run ignore && tsc",
"prepare": "npm run ignore && tsc -p tsconfig.cjs.json && tsc -p tsconfig.es.json && tsc -p tsconfig.types.json",
"test": "npm run clean && mocha -r ts-node/register test/*ts"
},
"bugs": "https://github.com/iccicci/rotating-file-stream/issues",
Expand Down Expand Up @@ -38,18 +38,20 @@
"url": "https://www.blockchain.com/btc/address/12p1p5q7sK75tPyuesZmssiMYr4TKzpSCN"
},
"readmeFilename": "README.md",
"types": "index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"types": "./dist/types/index.d.ts",
"devDependencies": {
"@types/mocha": "9.0.0",
"@types/node": "16.11.9",
"@typescript-eslint/eslint-plugin": "5.4.0",
"@typescript-eslint/parser": "5.4.0",
"eslint": "8.2.0",
"mocha": "9.1.3",
"@types/mocha": "9.1.0",
"@types/node": "17.0.19",
"@typescript-eslint/eslint-plugin": "5.12.1",
"@typescript-eslint/parser": "5.12.1",
"eslint": "8.9.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"prettier": "2.4.1",
"ts-node": "10.4.0",
"typescript": "4.5.2"
"prettier": "2.5.1",
"ts-node": "10.5.0",
"typescript": "4.5.5"
},
"prettier": {
"arrowParens": "avoid",
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/cjs",
"target": "es2019"
},
"extends": "./tsconfig.json"
}
8 changes: 8 additions & 0 deletions tsconfig.es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"module": "esnext",
"outDir": "dist/es",
"target": "esnext"
},
"extends": "./tsconfig.json"
}
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"lib": ["es2019", "es2020.bigint", "es2020.string", "es2020.symbol.wellknown"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es2019"
"suppressImplicitAnyIndexErrors": true
},
"include": ["./index.ts"]
}
8 changes: 8 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist/types"
},
"extends": "./tsconfig.json"
}
4 changes: 2 additions & 2 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { unlink, writeFile } from "fs";

const common: string[] = ["*gz", "*log", "*tmp", "*txt", ".gitignore", ".npmignore", ".nyc_output", "coverage", "node_modules", ""];
const git: string[] = ["index.d.ts", "index.js"];
const npm: string[] = [".*", "index.ts", "test", "tsconfig.json", "utils.ts"];
const git: string[] = ["dist"];
const npm: string[] = [".*", "index.ts", "test", "tsconfig.*", "utils.ts"];

if(process.argv[2] === "clean") unlink("index.js", (): void => {});
if(process.argv[2] === "ignore") writeFile(".gitignore", git.concat(common).join("\n"), (): void => writeFile(".npmignore", npm.concat(common).join("\n"), (): void => {}));

0 comments on commit d9cb99d

Please sign in to comment.