merge-tsconfigs 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Merge-Tsconfigs
2
2
 
3
+ ![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript&label&labelColor=blue&color=555555)
4
+ [![npm version](https://badge.fury.io/js/merge-tsconfigs.svg)](https://badge.fury.io/js/merge-tsconfigs)
5
+ ![ci](https://github.com/yowainwright/merge-tsconfigs/actions/workflows/ci.yml/badge.svg)
6
+ [![Github](https://badgen.net/badge/icon/github?icon=github&label&color=grey)](https://github.com/yowainwright/merge-tsconfigs)
7
+ ![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2Fyowainwright%2Fmerge-tsconfigs)
8
+
3
9
  _Merge-tsconfigs_ is a CLI and node tool for merging tsconfig files into the exact tsconfig file you want. 💪
4
10
 
5
11
  ---
package/dist/index.cjs CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,10 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
19
 
26
20
  // src/index.ts
@@ -38,7 +32,6 @@ module.exports = __toCommonJS(src_exports);
38
32
 
39
33
  // src/scripts.ts
40
34
  var import_fs = require("fs");
41
- var import_gradient_string = __toESM(require("gradient-string"), 1);
42
35
  var import_path = require("path");
43
36
  var logger = ({ isDebugging = false, emoji = `\u{1F6E3}\uFE0F`, gap = ` => `, name = "merge-tsconfigs" }) => (type) => (section) => (message) => (err) => {
44
37
  const debugMsg = isDebugging ? "debugging:" : "";
@@ -46,21 +39,21 @@ var logger = ({ isDebugging = false, emoji = `\u{1F6E3}\uFE0F`, gap = ` => `, na
46
39
  const firstLine = `${name}:${debugMsg}${sectionMsg}`;
47
40
  const secondLine = message ? `${emoji}${gap}${message}` : "";
48
41
  if (type === "error") {
49
- console.error(import_gradient_string.default.passion(firstLine));
42
+ console.error(firstLine);
50
43
  if (secondLine)
51
44
  console.error(secondLine);
52
45
  if (err)
53
46
  console.error(err);
54
47
  } else if (type === "debug") {
55
- console.debug(import_gradient_string.default.passion(firstLine));
48
+ console.debug(firstLine);
56
49
  if (secondLine)
57
50
  console.debug(secondLine);
58
51
  } else if (type === "info") {
59
- console.info(import_gradient_string.default.teen(firstLine));
52
+ console.info(firstLine);
60
53
  if (secondLine)
61
54
  console.info(secondLine);
62
55
  } else {
63
- console.log(import_gradient_string.default.teen(firstLine));
56
+ console.log(firstLine);
64
57
  if (secondLine)
65
58
  console.log(secondLine);
66
59
  }
@@ -105,6 +98,8 @@ var writeTsconfig = (tsconfig, out) => {
105
98
  };
106
99
  var mergeTsConfigs = ({
107
100
  tsconfigs = [],
101
+ exclude = [],
102
+ include = [],
108
103
  compilerOptions: compilerOptions2 = {},
109
104
  debug = false,
110
105
  out = ""
@@ -119,6 +114,8 @@ var mergeTsConfigs = ({
119
114
  logger({ isDebugging: debug })("debug")("mergeTsConfig")("Updated tsconfig:")(updatedTsconfig);
120
115
  const tsconfig = {
121
116
  ...updatedTsconfig,
117
+ exclude: [...updatedTsconfig.exclude || [], ...exclude],
118
+ include: [...updatedTsconfig.include || [], ...include],
122
119
  ...compilerOptions2
123
120
  };
124
121
  return writeTsconfig(tsconfig, out);
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ interface ConfigOptions {
6
6
  debug?: boolean;
7
7
  out?: string;
8
8
  tsconfigs?: string[];
9
+ exclude?: string[];
10
+ include?: string[];
9
11
  }
10
12
  type LoggerParams = {
11
13
  isDebugging?: boolean;
@@ -24,7 +26,7 @@ declare const logger: ({ isDebugging, emoji, gap, name }: LoggerParams) => (type
24
26
  declare function resolveJSON(path: string, debug?: boolean): TsConfig;
25
27
  declare const mergeConfigContent: (tsconfigs: string[], debug?: boolean) => TsConfig;
26
28
  declare const writeTsconfig: (tsconfig: TsConfig, out: string) => TsConfig;
27
- declare const mergeTsConfigs: ({ tsconfigs, compilerOptions, debug, out, }: ConfigOptions) => TsConfig | undefined;
28
- declare const script: ({ tsconfigs, compilerOptions, debug, out, }: ConfigOptions) => TsConfig | undefined;
29
+ declare const mergeTsConfigs: ({ tsconfigs, exclude, include, compilerOptions, debug, out, }: ConfigOptions) => TsConfig | undefined;
30
+ declare const script: ({ tsconfigs, exclude, include, compilerOptions, debug, out, }: ConfigOptions) => TsConfig | undefined;
29
31
 
30
32
  export { mergeTsConfigs as default, logger, mergeConfigContent, mergeTsConfigs, resolveJSON, script, writeTsconfig };
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  // src/scripts.ts
2
2
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
3
- import gradient from "gradient-string";
4
3
  import { dirname } from "path";
5
4
  var logger = ({ isDebugging = false, emoji = `\u{1F6E3}\uFE0F`, gap = ` => `, name = "merge-tsconfigs" }) => (type) => (section) => (message) => (err) => {
6
5
  const debugMsg = isDebugging ? "debugging:" : "";
@@ -8,21 +7,21 @@ var logger = ({ isDebugging = false, emoji = `\u{1F6E3}\uFE0F`, gap = ` => `, na
8
7
  const firstLine = `${name}:${debugMsg}${sectionMsg}`;
9
8
  const secondLine = message ? `${emoji}${gap}${message}` : "";
10
9
  if (type === "error") {
11
- console.error(gradient.passion(firstLine));
10
+ console.error(firstLine);
12
11
  if (secondLine)
13
12
  console.error(secondLine);
14
13
  if (err)
15
14
  console.error(err);
16
15
  } else if (type === "debug") {
17
- console.debug(gradient.passion(firstLine));
16
+ console.debug(firstLine);
18
17
  if (secondLine)
19
18
  console.debug(secondLine);
20
19
  } else if (type === "info") {
21
- console.info(gradient.teen(firstLine));
20
+ console.info(firstLine);
22
21
  if (secondLine)
23
22
  console.info(secondLine);
24
23
  } else {
25
- console.log(gradient.teen(firstLine));
24
+ console.log(firstLine);
26
25
  if (secondLine)
27
26
  console.log(secondLine);
28
27
  }
@@ -67,6 +66,8 @@ var writeTsconfig = (tsconfig, out) => {
67
66
  };
68
67
  var mergeTsConfigs = ({
69
68
  tsconfigs = [],
69
+ exclude = [],
70
+ include = [],
70
71
  compilerOptions: compilerOptions2 = {},
71
72
  debug = false,
72
73
  out = ""
@@ -81,6 +82,8 @@ var mergeTsConfigs = ({
81
82
  logger({ isDebugging: debug })("debug")("mergeTsConfig")("Updated tsconfig:")(updatedTsconfig);
82
83
  const tsconfig = {
83
84
  ...updatedTsconfig,
85
+ exclude: [...updatedTsconfig.exclude || [], ...exclude],
86
+ include: [...updatedTsconfig.include || [], ...include],
84
87
  ...compilerOptions2
85
88
  };
86
89
  return writeTsconfig(tsconfig, out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merge-tsconfigs",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Merge-tsconfigs is a CLI and node tool for merging tsconfig files into the exact tsconfig file you want 🛣️",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -35,15 +35,11 @@
35
35
  "update": "codependence --update"
36
36
  },
37
37
  "dependencies": {
38
- "commander": "^9.5.0",
39
- "cosmiconfig": "^8.0.0",
40
- "fast-glob": "^3.2.12",
41
- "gradient-string": "^2.0.2"
38
+ "commander": "^9.5.0"
42
39
  },
43
40
  "devDependencies": {
44
41
  "@commitlint/cli": "^17.4.2",
45
42
  "@commitlint/config-conventional": "^17.4.2",
46
- "@types/gradient-string": "^1.1.2",
47
43
  "@types/node": "^18.11.18",
48
44
  "@typescript-eslint/eslint-plugin": "^5.48.1",
49
45
  "@typescript-eslint/parser": "^5.48.1",