From acd8dcb1298ffd6be2d9ad2702106b2068a8cadf Mon Sep 17 00:00:00 2001 From: Konstantin Kovalev Date: Wed, 29 May 2019 19:56:45 +0200 Subject: [PATCH] Fix import of particular utilities --- .gitignore | 7 +++++-- .prettierignore | 8 +++++--- package-lock.json | 18 +++++++++--------- package.json | 8 ++++---- rollup.config.js | 10 ++++++---- scripts/clean.js | 3 ++- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 6b69177..9f7fefb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ /coverage/ #distributive files -/dist/*.* -/esm/*.* /browser/*.* +*.js +*.mjs +*.map +!rollup.config.js +!babel.config.js diff --git a/.prettierignore b/.prettierignore index 81ba063..e7a262f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,8 @@ .vscode node_modules coverage -dist -esm -browser \ No newline at end of file +browser +*.js +*.mjs +!rollup.config.js +!babel.config.js \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 02288ee..0a23d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2354,9 +2354,9 @@ } }, "eslint-plugin-jest": { - "version": "22.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.5.1.tgz", - "integrity": "sha512-c3WjZR/HBoi4GedJRwo2OGHa8Pzo1EbSVwQ2HFzJ+4t2OoYM7Alx646EH/aaxZ+9eGcPiq0FT0UGkRuFFx2FHg==", + "version": "22.6.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.6.4.tgz", + "integrity": "sha512-36OqnZR/uMCDxXGmTsqU4RwllR0IiB/XF8GW3ODmhsjiITKuI0GpgultWFt193ipN3HARkaIcKowpE6HBvRHNg==", "dev": true }, "eslint-plugin-prettier": { @@ -6692,9 +6692,9 @@ } }, "rollup": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.12.3.tgz", - "integrity": "sha512-ueWhPijWN+GaPgD3l77hXih/gcDXmYph6sWeQegwBYtaqAE834e8u+MC2wT6FKIUsz1DBOyOXAQXUZB+rjWDoQ==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.12.4.tgz", + "integrity": "sha512-sHg0F05oTMJzM592MWU8irsPx8LIFMKSCnEkcp6vp/gnj+oJ9GJEBW9hl8jUqy2L6Q2uUxFzPgvoExLbfuSODA==", "dev": true, "requires": { "@types/estree": "0.0.39", @@ -6703,9 +6703,9 @@ }, "dependencies": { "@types/node": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", - "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.3.tgz", + "integrity": "sha512-zkOxCS/fA+3SsdA+9Yun0iANxzhQRiNwTvJSr6N95JhuJ/x27z9G2URx1Jpt3zYFfCGUXZGL5UDxt5eyLE7wgw==", "dev": true } } diff --git a/package.json b/package.json index 7ffc5b7..fc41c6c 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "@constantiner/fun-ctional", "version": "0.6.4", "description": "The library brings most of the familiar functional techniques (like functional composition) to asynchronous world with shining Promises", - "main": "dist/index.js", - "module": "esm/index.js", + "main": "index.js", + "module": "index.mjs", "scripts": { "test": "node -r esm scripts/unitTest.js", "lint": "npx eslint '**/*.js'", @@ -58,7 +58,7 @@ "del": "^4.1.1", "eslint": "^5.16.0", "eslint-config-prettier": "^4.3.0", - "eslint-plugin-jest": "^22.5.1", + "eslint-plugin-jest": "^22.6.4", "eslint-plugin-prettier": "^3.1.0", "eslint-plugin-unicorn": "^8.0.2", "esm": "^3.2.25", @@ -67,7 +67,7 @@ "jest": "^24.8.0", "lint-staged": "^8.1.7", "prettier": "^1.17.1", - "rollup": "^1.12.3", + "rollup": "^1.12.4", "rollup-plugin-babel": "^4.3.2", "rollup-plugin-prettier": "^0.6.0", "rollup-plugin-sourcemaps": "^0.4.2", diff --git a/rollup.config.js b/rollup.config.js index 8612511..03737c4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -48,10 +48,12 @@ const getUmdOutput = (input, minified = false) => `${getUmdFileName(input)}${min const config = (format, folder, minified = false) => input => ({ input, output: { - file: `${folder}/${format === "umd" ? getUmdOutput(input, minified) : getOutput(input, "js")}`, + file: `${folder ? folder + "/" : ""}${ + format === "umd" ? getUmdOutput(input, minified) : getOutput(input, format === "es" ? "mjs" : "js") + }`, format, sourcemap: true, - sourcemapFile: `${folder}/${getOutput(input, "js")}.map`, + sourcemapFile: `${folder ? folder + "/" : ""}${getOutput(input, format === "es" ? "mjs" : "js")}.map`, strict: true, banner: getActualBanner(), name: format === "umd" ? "funCtional" : undefined @@ -67,8 +69,8 @@ const config = (format, folder, minified = false) => input => ({ const sourceFiles = getSourceFilesList(); export default [ - ...sourceFiles.map(config("cjs", "dist")), - ...sourceFiles.map(config("es", "esm")), + ...sourceFiles.map(config("cjs")), + ...sourceFiles.map(config("es")), ...sourceFiles.map(config("umd", "browser")), ...sourceFiles.map(config("umd", "browser", true)) ]; diff --git a/scripts/clean.js b/scripts/clean.js index 1782137..51a602d 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -1,6 +1,7 @@ import del from "del"; -const clean = async () => del(["dist", "esm", "browser"]); +const clean = async () => + del(["browser", "*.js", "*.mjs", "*.map", "!babel.config.js", "!jest.config.js", "!rollup.config.js"]); // Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will