@oriflame/config-typescript 5.1.11 → 5.1.12-alpha.10
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 +19 -18
- package/lib/index.js +22 -21
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +25 -18
package/dts/index.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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
|
-
|
|
18
|
-
export declare function
|
|
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
|
+
buildFolder: string;
|
|
14
|
+
declarationFolder?: string;
|
|
15
|
+
declarationOnly?: boolean;
|
|
16
|
+
skipLibCheck?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function getCompilerOptions({ library, future, react, srcFolder, allowJs, skipLibCheck, sourceMaps, declarationOnly, declarationFolder, buildFolder, includeTests, workspaces, }: Partial<TypeScriptOptions>): import("@beemo/driver-typescript").CompilerOptions;
|
|
19
|
+
export declare function getConfig(options: TypeScriptOptions): TypeScriptConfig;
|
|
19
20
|
//# 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
|
});
|
|
@@ -24,9 +18,10 @@ function getCompilerOptions({
|
|
|
24
18
|
allowJs = false,
|
|
25
19
|
skipLibCheck = false,
|
|
26
20
|
sourceMaps = true,
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
declarationOnly = false,
|
|
22
|
+
declarationFolder,
|
|
29
23
|
buildFolder,
|
|
24
|
+
includeTests,
|
|
30
25
|
workspaces
|
|
31
26
|
}) {
|
|
32
27
|
if (workspaces) {
|
|
@@ -34,11 +29,10 @@ function getCompilerOptions({
|
|
|
34
29
|
} // Do we need isolated modules?
|
|
35
30
|
|
|
36
31
|
|
|
37
|
-
compilerOptions.isolatedModules = future && library;
|
|
32
|
+
compilerOptions.isolatedModules = future && library && !includeTests;
|
|
38
33
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
39
34
|
compilerOptions.allowJs = allowJs;
|
|
40
35
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
41
|
-
compilerOptions.declaration = library || emitDeclarationOnly;
|
|
42
36
|
|
|
43
37
|
if (react) {
|
|
44
38
|
var _compilerOptions$lib;
|
|
@@ -54,13 +48,16 @@ function getCompilerOptions({
|
|
|
54
48
|
};
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
if (!workspaces) {
|
|
58
|
-
compilerOptions.
|
|
51
|
+
if (!workspaces && library) {
|
|
52
|
+
compilerOptions.declarationDir = declarationFolder || buildFolder;
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
if (
|
|
62
|
-
compilerOptions.
|
|
63
|
-
compilerOptions.
|
|
55
|
+
if (!workspaces) {
|
|
56
|
+
compilerOptions.outDir = buildFolder;
|
|
57
|
+
compilerOptions.rootDir = srcFolder;
|
|
58
|
+
compilerOptions.composite = library;
|
|
59
|
+
compilerOptions.declaration = library || declarationOnly;
|
|
60
|
+
compilerOptions.emitDeclarationOnly = declarationOnly;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
if (sourceMaps) {
|
|
@@ -73,10 +70,10 @@ function getCompilerOptions({
|
|
|
73
70
|
|
|
74
71
|
function getConfig(options) {
|
|
75
72
|
const workspaces = options.workspaces,
|
|
76
|
-
library = options.library,
|
|
77
73
|
srcFolder = options.srcFolder,
|
|
78
74
|
typesFolder = options.typesFolder,
|
|
79
|
-
|
|
75
|
+
includeTests = options.includeTests,
|
|
76
|
+
testsFolder = options.testsFolder;
|
|
80
77
|
|
|
81
78
|
if (workspaces) {
|
|
82
79
|
return {
|
|
@@ -84,13 +81,17 @@ function getConfig(options) {
|
|
|
84
81
|
};
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
compilerOptions:
|
|
89
|
-
outDir: buildFolder
|
|
90
|
-
}),
|
|
84
|
+
const tsconfig = {
|
|
85
|
+
compilerOptions: getCompilerOptions(options),
|
|
91
86
|
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
92
87
|
exclude: ['**/node_modules/*']
|
|
93
88
|
};
|
|
89
|
+
|
|
90
|
+
if (includeTests) {
|
|
91
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return tsconfig;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
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","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":null,"names":["config","require","compilerOptions","getCompilerOptions","library","future","react","srcFolder","allowJs","skipLibCheck","sourceMaps","declarationOnly","declarationFolder","buildFolder","includeTests","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","lib","jsx","baseUrl","paths","ALIAS_PATTERN","declarationDir","outDir","rootDir","composite","declaration","emitDeclarationOnly","sourceMap","declarationMap","getConfig","options","typesFolder","testsFolder","tsconfig","include","exclude","push"],"mappings":";;;;;;AAGA,MAAMA,MAAM,GAAGC,OAAO,CAAC,iCAAD,CAAtB;;AAEA,MAAMC,eAAe,GAAGF,MAAM,CAACE,eAA/B;AAmBO,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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0BvB,SAA1B;AACAL,IAAAA,eAAe,CAAC6B,SAAhB,GAA4B3B,OAA5B;AACAF,IAAAA,eAAe,CAAC8B,WAAhB,GAA8B5B,OAAO,IAAIO,eAAzC;AACAT,IAAAA,eAAe,CAAC+B,mBAAhB,GAAsCtB,eAAtC;AACD;;AAED,MAAID,UAAJ,EAAgB;AACdR,IAAAA,eAAe,CAACgC,SAAhB,GAA4B,IAA5B;AACAhC,IAAAA,eAAe,CAACiC,cAAhB,GAAiC,IAAjC;AACD;;AAED,SAAOjC,eAAP;AACD;AAEM,SAASkC,SAAT,CAAmBC,OAAnB,EAAiE;AACtE,QAAM;AAAEtB,IAAAA,UAAF;AAAcR,IAAAA,SAAd;AAAyB+B,IAAAA,WAAzB;AAAsCxB,IAAAA,YAAtC;AAAoDyB,IAAAA;AAApD,MAAoEF,OAA1E;;AACA,MAAItB,UAAJ,EAAgB;AACd,WAAO;AACLb,MAAAA,eAAe,EAAEC,kBAAkB,CAACkC,OAAD;AAD9B,KAAP;AAGD;;AAED,QAAMG,QAAQ,GAAG;AACftC,IAAAA,eAAe,EAAEC,kBAAkB,CAACkC,OAAD,CADpB;AAEfI,IAAAA,OAAO,EAAE,CAAE,KAAIlC,SAAU,OAAhB,EAAyB,KAAI+B,WAAY,OAAzC,CAFM;AAGfI,IAAAA,OAAO,EAAE,CAAC,mBAAD;AAHM,GAAjB;;AAMA,MAAI5B,YAAJ,EAAkB;AAChB0B,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.10+cd2e4a9f",
|
|
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.10+cd2e4a9f",
|
|
32
|
+
"tsconfig-oriflame": "^5.1.12-alpha.10+cd2e4a9f"
|
|
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": "cd2e4a9fbb18cb4000f876c131b854d21f6d2bfe"
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -15,10 +15,11 @@ export interface TypeScriptOptions {
|
|
|
15
15
|
workspaces?: boolean;
|
|
16
16
|
allowJs?: boolean;
|
|
17
17
|
includeTests?: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
testsFolder: string;
|
|
19
|
+
buildFolder: string;
|
|
20
|
+
declarationFolder?: string;
|
|
21
|
+
declarationOnly?: boolean;
|
|
20
22
|
skipLibCheck?: boolean;
|
|
21
|
-
buildFolder?: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export function getCompilerOptions({
|
|
@@ -29,9 +30,10 @@ export function getCompilerOptions({
|
|
|
29
30
|
allowJs = false,
|
|
30
31
|
skipLibCheck = false,
|
|
31
32
|
sourceMaps = true,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
declarationOnly = false,
|
|
34
|
+
declarationFolder,
|
|
34
35
|
buildFolder,
|
|
36
|
+
includeTests,
|
|
35
37
|
workspaces,
|
|
36
38
|
}: Partial<TypeScriptOptions>) {
|
|
37
39
|
if (workspaces) {
|
|
@@ -41,11 +43,10 @@ export function getCompilerOptions({
|
|
|
41
43
|
);
|
|
42
44
|
}
|
|
43
45
|
// Do we need isolated modules?
|
|
44
|
-
compilerOptions.isolatedModules = future && library;
|
|
46
|
+
compilerOptions.isolatedModules = future && library && !includeTests;
|
|
45
47
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
46
48
|
compilerOptions.allowJs = allowJs;
|
|
47
49
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
48
|
-
compilerOptions.declaration = library || emitDeclarationOnly;
|
|
49
50
|
|
|
50
51
|
if (react) {
|
|
51
52
|
compilerOptions.lib = [...(compilerOptions.lib ?? []), 'dom.iterable'];
|
|
@@ -59,13 +60,16 @@ export function getCompilerOptions({
|
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
if (!workspaces) {
|
|
63
|
-
compilerOptions.
|
|
63
|
+
if (!workspaces && library) {
|
|
64
|
+
compilerOptions.declarationDir = declarationFolder || buildFolder;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
if (
|
|
67
|
-
compilerOptions.
|
|
68
|
-
compilerOptions.
|
|
67
|
+
if (!workspaces) {
|
|
68
|
+
compilerOptions.outDir = buildFolder;
|
|
69
|
+
compilerOptions.rootDir = srcFolder;
|
|
70
|
+
compilerOptions.composite = library;
|
|
71
|
+
compilerOptions.declaration = library || declarationOnly;
|
|
72
|
+
compilerOptions.emitDeclarationOnly = declarationOnly;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
if (sourceMaps) {
|
|
@@ -77,19 +81,22 @@ export function getCompilerOptions({
|
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
export function getConfig(options: TypeScriptOptions): TypeScriptConfig {
|
|
80
|
-
const { workspaces,
|
|
84
|
+
const { workspaces, srcFolder, typesFolder, includeTests, testsFolder } = options;
|
|
81
85
|
if (workspaces) {
|
|
82
86
|
return {
|
|
83
87
|
compilerOptions: getCompilerOptions(options),
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
|
|
88
|
-
compilerOptions:
|
|
89
|
-
...getCompilerOptions(options),
|
|
90
|
-
...(library && { outDir: buildFolder }),
|
|
91
|
-
},
|
|
91
|
+
const tsconfig = {
|
|
92
|
+
compilerOptions: getCompilerOptions(options),
|
|
92
93
|
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
93
94
|
exclude: ['**/node_modules/*'],
|
|
94
95
|
};
|
|
96
|
+
|
|
97
|
+
if (includeTests) {
|
|
98
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return tsconfig;
|
|
95
102
|
}
|