From 7899d117dafcfb77bba92b52983bf17f0fdbca19 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Thu, 26 Nov 2020 23:34:43 +0100 Subject: [PATCH] destruction of build system --- .gitignore | 1 + .npmignore | 4 +++- package.json | 7 ++++++- src/tsdb-kit.ts | 1 + tsconfig.bin.json | 11 +++++++++++ tsconfig.json => tsconfig.lib.json | 6 ++---- 6 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/tsdb-kit.ts create mode 100644 tsconfig.bin.json rename tsconfig.json => tsconfig.lib.json (62%) diff --git a/.gitignore b/.gitignore index bc9ecf6..8544c27 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ npm-debug.log .vscode/ lib/ +bin/ diff --git a/.npmignore b/.npmignore index ab72757..01b7b93 100644 --- a/.npmignore +++ b/.npmignore @@ -2,5 +2,7 @@ src spec .travis.yml jest.config.js +tsconfig.lib.json +tsconfig.bin.json tsconfig.jest.json -tsconfig.json + diff --git a/package.json b/package.json index 67f6d17..7c99100 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "version": "1.1.1", "description": "", "scripts": { - "build": "tsc", + "build": "yarn build:lib && yarn build:bin", + "build:lib": "tsc --p tsconfig.lib.json", + "build:bin": "tsc --p tsconfig.bin.json", "dev": "tsc -w", "test": "jest --config jest.config.js" }, @@ -34,5 +36,8 @@ "typescript": "3.3.1" }, "main": "./lib/index.js", + "bin": { + "tsdb-kit": "bin/tsdb-kit.js" + }, "typings": "./lib/index.d.ts" } diff --git a/src/tsdb-kit.ts b/src/tsdb-kit.ts new file mode 100644 index 0000000..7bc4a71 --- /dev/null +++ b/src/tsdb-kit.ts @@ -0,0 +1 @@ +console.log('Hello world'); diff --git a/tsconfig.bin.json b/tsconfig.bin.json new file mode 100644 index 0000000..9b909b6 --- /dev/null +++ b/tsconfig.bin.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "sourceMap": true, + "module": "commonjs", + "target": "es2015", + "declaration": true, + "outFile": "bin/tsdb-kit.js" + }, + "include": [ "src/**/*" ], + "exclude": [ "node_modules" ] +} diff --git a/tsconfig.json b/tsconfig.lib.json similarity index 62% rename from tsconfig.json rename to tsconfig.lib.json index 01c56a9..fd11be7 100644 --- a/tsconfig.json +++ b/tsconfig.lib.json @@ -1,12 +1,10 @@ { "compilerOptions": { "sourceMap": true, - "module": "commonjs", "target": "es2015", "declaration": true, "outDir": "lib" }, - "include": [ - "src/**/*" - ] + "include": [ "src/**/*" ], + "exclude": [ "node_modules", "**/*.d.ts"] ] }