From b3ed374cbc4b041fcb08908ea0516c667e54b9d0 Mon Sep 17 00:00:00 2001 From: prettymuchbryce Date: Tue, 8 Sep 2020 18:50:41 -0700 Subject: [PATCH] Remove ncc --- package-lock.json | 8 +------- package.json | 1 - scripts/build.sh | 14 ++------------ tsconfig-build.json => tsconfig-cjs.json | 2 ++ tsconfig-es.json | 7 +++++++ tsconfig.json | 1 - 6 files changed, 12 insertions(+), 21 deletions(-) rename tsconfig-build.json => tsconfig-cjs.json (64%) create mode 100644 tsconfig-es.json diff --git a/package-lock.json b/package-lock.json index 57c2a5b..1974987 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "http-status-codes", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1328,12 +1328,6 @@ "eslint-visitor-keys": "^1.1.0" } }, - "@vercel/ncc": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz", - "integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==", - "dev": true - }, "abab": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz", diff --git a/package.json b/package.json index c107594..a70c83a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@types/markdown-table": "^2.0.0", "@typescript-eslint/eslint-plugin": "^3.9.0", "@typescript-eslint/parser": "^3.9.1", - "@vercel/ncc": "^0.23.0", "eslint": "^7.7.0", "eslint-config-airbnb-typescript": "^9.0.0", "eslint-plugin-import": "^2.22.0", diff --git a/scripts/build.sh b/scripts/build.sh index 5756a59..2a8181b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,14 +1,4 @@ #!/bin/bash rm -rf ./build -rm -rf ./build-tmp -tsc --project tsconfig-build.json -ncc build ./build-tmp/index.js -o ./build/cjs -cat ./build-tmp/index.d.ts >> ./build-tmp/codes.d.ts -# Because we are concatting .d.ts files, we need to remove all imports of codes.ts from index.ts -sed -i.old '/^import/d' ./build-tmp/codes.d.ts -# as well as exports that already exist within codes.ts -sed -i.old '/^export { StatusCodes, ReasonPhrases, }/d;' ./build-tmp/codes.d.ts -mv ./build-tmp/codes.d.ts ./build/cjs/index.d.ts -rm -rf ./build-tmp -tsc --project tsconfig-build.json -mv ./build-tmp ./build/es/ +tsc --project tsconfig-cjs.json +tsc --project tsconfig-es.json diff --git a/tsconfig-build.json b/tsconfig-cjs.json similarity index 64% rename from tsconfig-build.json rename to tsconfig-cjs.json index 88fe771..cdbbd08 100644 --- a/tsconfig-build.json +++ b/tsconfig-cjs.json @@ -1,5 +1,7 @@ { "compilerOptions": { + "module": "commonjs", + "outDir": "./build/cjs/", "resolveJsonModule": false }, "extends": "./tsconfig.json" diff --git a/tsconfig-es.json b/tsconfig-es.json new file mode 100644 index 0000000..bee304d --- /dev/null +++ b/tsconfig-es.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "resolveJsonModule": false, + "outDir": "./build/es/" + }, + "extends": "./tsconfig.json" +} diff --git a/tsconfig.json b/tsconfig.json index 408d5e7..138fc82 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,6 @@ "declaration": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "outDir": "./build-tmp/", "resolveJsonModule": true, "moduleResolution": "node" },