@oriflame/config-typescript 5.1.11 → 5.1.12-alpha.2
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/dts/index.d.ts +18 -18
- package/lib/index.js +12 -18
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +12 -13
package/dts/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { TypeScriptConfig } from '@beemo/driver-typescript';
|
|
2
|
-
export interface TypeScriptOptions {
|
|
3
|
-
sourceMaps?: boolean;
|
|
4
|
-
library?: boolean;
|
|
5
|
-
future?: boolean;
|
|
6
|
-
react?: boolean;
|
|
7
|
-
srcFolder: string;
|
|
8
|
-
typesFolder: string;
|
|
9
|
-
workspaces?: boolean;
|
|
10
|
-
allowJs?: boolean;
|
|
11
|
-
includeTests?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export declare function getCompilerOptions({ library, future, react, srcFolder, allowJs, skipLibCheck, sourceMaps, emitDeclarationOnly, declarationDir,
|
|
18
|
-
export declare function getConfig(options: TypeScriptOptions): TypeScriptConfig;
|
|
1
|
+
import type { TypeScriptConfig } from '@beemo/driver-typescript';
|
|
2
|
+
export interface TypeScriptOptions {
|
|
3
|
+
sourceMaps?: boolean;
|
|
4
|
+
library?: boolean;
|
|
5
|
+
future?: boolean;
|
|
6
|
+
react?: boolean;
|
|
7
|
+
srcFolder: string;
|
|
8
|
+
typesFolder: string;
|
|
9
|
+
workspaces?: boolean;
|
|
10
|
+
allowJs?: boolean;
|
|
11
|
+
includeTests?: boolean;
|
|
12
|
+
testsFolder: string;
|
|
13
|
+
declarationDir?: string;
|
|
14
|
+
emitDeclarationOnly?: boolean;
|
|
15
|
+
skipLibCheck?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function getCompilerOptions({ library, future, react, srcFolder, allowJs, skipLibCheck, sourceMaps, emitDeclarationOnly, declarationDir, workspaces, }: Partial<TypeScriptOptions>): import("@beemo/driver-typescript").CompilerOptions;
|
|
18
|
+
export declare function getConfig(options: TypeScriptOptions): TypeScriptConfig;
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
3
|
Object.defineProperty(exports, '__esModule', {
|
|
10
4
|
value: true
|
|
11
5
|
});
|
|
@@ -26,7 +20,6 @@ function getCompilerOptions({
|
|
|
26
20
|
sourceMaps = true,
|
|
27
21
|
emitDeclarationOnly = false,
|
|
28
22
|
declarationDir = 'dts',
|
|
29
|
-
buildFolder,
|
|
30
23
|
workspaces
|
|
31
24
|
}) {
|
|
32
25
|
if (workspaces) {
|
|
@@ -55,13 +48,10 @@ function getCompilerOptions({
|
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
if (!workspaces) {
|
|
58
|
-
compilerOptions.outDir = `./${
|
|
51
|
+
compilerOptions.outDir = `./${declarationDir}`;
|
|
59
52
|
}
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
compilerOptions.composite = true;
|
|
63
|
-
compilerOptions.declarationDir = `./${declarationDir}`;
|
|
64
|
-
}
|
|
54
|
+
compilerOptions.composite = library && !workspaces;
|
|
65
55
|
|
|
66
56
|
if (sourceMaps) {
|
|
67
57
|
compilerOptions.sourceMap = true;
|
|
@@ -73,10 +63,10 @@ function getCompilerOptions({
|
|
|
73
63
|
|
|
74
64
|
function getConfig(options) {
|
|
75
65
|
const workspaces = options.workspaces,
|
|
76
|
-
library = options.library,
|
|
77
66
|
srcFolder = options.srcFolder,
|
|
78
67
|
typesFolder = options.typesFolder,
|
|
79
|
-
|
|
68
|
+
includeTests = options.includeTests,
|
|
69
|
+
testsFolder = options.testsFolder;
|
|
80
70
|
|
|
81
71
|
if (workspaces) {
|
|
82
72
|
return {
|
|
@@ -84,13 +74,17 @@ function getConfig(options) {
|
|
|
84
74
|
};
|
|
85
75
|
}
|
|
86
76
|
|
|
87
|
-
|
|
88
|
-
compilerOptions:
|
|
89
|
-
outDir: buildFolder
|
|
90
|
-
}),
|
|
77
|
+
const tsconfig = {
|
|
78
|
+
compilerOptions: getCompilerOptions(options),
|
|
91
79
|
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
92
80
|
exclude: ['**/node_modules/*']
|
|
93
81
|
};
|
|
82
|
+
|
|
83
|
+
if (includeTests) {
|
|
84
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return tsconfig;
|
|
94
88
|
}
|
|
95
89
|
|
|
96
90
|
exports.getCompilerOptions = getCompilerOptions;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":null,"names":["config","require","compilerOptions","getCompilerOptions","library","future","react","srcFolder","allowJs","skipLibCheck","sourceMaps","emitDeclarationOnly","declarationDir","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":null,"names":["config","require","compilerOptions","getCompilerOptions","library","future","react","srcFolder","allowJs","skipLibCheck","sourceMaps","emitDeclarationOnly","declarationDir","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","declaration","lib","jsx","baseUrl","paths","ALIAS_PATTERN","outDir","composite","sourceMap","declarationMap","getConfig","options","typesFolder","includeTests","testsFolder","tsconfig","include","exclude","push"],"mappings":";;;;;;AAGA,MAAMA,MAAM,GAAGC,OAAO,CAAC,iCAAD,CAAtB;;AAEA,MAAMC,eAAe,GAAGF,MAAM,CAACE,eAA/B;AAkBO,SAASC,kBAAT,CAA4B;AACjCC,EAAAA,OAAO,GAAG,KADuB;AAEjCC,EAAAA,MAAM,GAAG,KAFwB;AAGjCC,EAAAA,KAAK,GAAG,KAHyB;AAIjCC,EAAAA,SAAS,GAAG,KAJqB;AAKjCC,EAAAA,OAAO,GAAG,KALuB;AAMjCC,EAAAA,YAAY,GAAG,KANkB;AAOjCC,EAAAA,UAAU,GAAG,IAPoB;AAQjCC,EAAAA,mBAAmB,GAAG,KARW;AASjCC,EAAAA,cAAc,GAAG,KATgB;AAUjCC,EAAAA;AAViC,CAA5B,EAWwB;AAC7B,MAAIA,UAAJ,EAAgB;AACdC,IAAAA,MAAM,CAACC,MAAP,CACEb,eADF,EAEGD,OAAO,CAAC,4CAAD,CAAR,CAA4EC,eAF9E;AAID,GAN4B;;;AAQ7BA,EAAAA,eAAe,CAACc,eAAhB,GAAkCX,MAAM,IAAID,OAA5C;AACAF,EAAAA,eAAe,CAACe,uBAAhB,GAA0CZ,MAAM,IAAIa,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7E;AACAlB,EAAAA,eAAe,CAACM,OAAhB,GAA0BA,OAA1B;AACAN,EAAAA,eAAe,CAACO,YAAhB,GAA+BA,YAA/B;AACAP,EAAAA,eAAe,CAACmB,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;AAGfK,IAAAA,OAAO,EAAE,CAAC,mBAAD;AAHM,GAAjB;;AAMA,MAAIJ,YAAJ,EAAkB;AAChBE,IAAAA,QAAQ,CAACC,OAAT,CAAiBE,IAAjB,CAAuB,KAAIJ,WAAY,OAAvC;AACD;;AAED,SAAOC,QAAP;AACD;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oriflame/config-typescript",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.12-alpha.2+1274a120",
|
|
4
4
|
"description": "Reusable typescript config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lumos",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"src/**/*.{ts,tsx,json}"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@oriflame/lumos-common": "^5.1.
|
|
32
|
-
"tsconfig-oriflame": "^5.1.
|
|
31
|
+
"@oriflame/lumos-common": "^5.1.12-alpha.2+1274a120",
|
|
32
|
+
"tsconfig-oriflame": "^5.1.12-alpha.2+1274a120"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@beemo/core": "^2.1.3",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"format": "lib",
|
|
46
46
|
"platform": "node"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1274a120ad7daebb9919f8bd705df65fcf81a588"
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -15,10 +15,10 @@ export interface TypeScriptOptions {
|
|
|
15
15
|
workspaces?: boolean;
|
|
16
16
|
allowJs?: boolean;
|
|
17
17
|
includeTests?: boolean;
|
|
18
|
+
testsFolder: string;
|
|
18
19
|
declarationDir?: string;
|
|
19
20
|
emitDeclarationOnly?: boolean;
|
|
20
21
|
skipLibCheck?: boolean;
|
|
21
|
-
buildFolder?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function getCompilerOptions({
|
|
@@ -31,7 +31,6 @@ export function getCompilerOptions({
|
|
|
31
31
|
sourceMaps = true,
|
|
32
32
|
emitDeclarationOnly = false,
|
|
33
33
|
declarationDir = 'dts',
|
|
34
|
-
buildFolder,
|
|
35
34
|
workspaces,
|
|
36
35
|
}: Partial<TypeScriptOptions>) {
|
|
37
36
|
if (workspaces) {
|
|
@@ -60,13 +59,10 @@ export function getCompilerOptions({
|
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
if (!workspaces) {
|
|
63
|
-
compilerOptions.outDir = `./${
|
|
62
|
+
compilerOptions.outDir = `./${declarationDir}`;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
compilerOptions.composite = true;
|
|
68
|
-
compilerOptions.declarationDir = `./${declarationDir}`;
|
|
69
|
-
}
|
|
65
|
+
compilerOptions.composite = library && !workspaces;
|
|
70
66
|
|
|
71
67
|
if (sourceMaps) {
|
|
72
68
|
compilerOptions.sourceMap = true;
|
|
@@ -77,19 +73,22 @@ export function getCompilerOptions({
|
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
export function getConfig(options: TypeScriptOptions): TypeScriptConfig {
|
|
80
|
-
const { workspaces,
|
|
76
|
+
const { workspaces, srcFolder, typesFolder, includeTests, testsFolder } = options;
|
|
81
77
|
if (workspaces) {
|
|
82
78
|
return {
|
|
83
79
|
compilerOptions: getCompilerOptions(options),
|
|
84
80
|
};
|
|
85
81
|
}
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
compilerOptions:
|
|
89
|
-
...getCompilerOptions(options),
|
|
90
|
-
...(library && { outDir: buildFolder }),
|
|
91
|
-
},
|
|
83
|
+
const tsconfig = {
|
|
84
|
+
compilerOptions: getCompilerOptions(options),
|
|
92
85
|
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
93
86
|
exclude: ['**/node_modules/*'],
|
|
94
87
|
};
|
|
88
|
+
|
|
89
|
+
if (includeTests) {
|
|
90
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return tsconfig;
|
|
95
94
|
}
|