@oriflame/config-typescript 5.1.10 → 5.1.11
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 +5 -1
- package/lib/index.js +37 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +31 -1
package/dts/index.d.ts
CHANGED
|
@@ -5,11 +5,15 @@ export interface TypeScriptOptions {
|
|
|
5
5
|
future?: boolean;
|
|
6
6
|
react?: boolean;
|
|
7
7
|
srcFolder: string;
|
|
8
|
+
typesFolder: string;
|
|
8
9
|
workspaces?: boolean;
|
|
9
10
|
allowJs?: boolean;
|
|
11
|
+
includeTests?: boolean;
|
|
12
|
+
declarationDir?: string;
|
|
13
|
+
emitDeclarationOnly?: boolean;
|
|
10
14
|
skipLibCheck?: boolean;
|
|
11
15
|
buildFolder?: string;
|
|
12
16
|
}
|
|
13
|
-
export declare function getCompilerOptions({ library, future, react, srcFolder, allowJs, skipLibCheck, sourceMaps, workspaces, }: Partial<TypeScriptOptions>): import("@beemo/driver-typescript").CompilerOptions;
|
|
17
|
+
export declare function getCompilerOptions({ library, future, react, srcFolder, allowJs, skipLibCheck, sourceMaps, emitDeclarationOnly, declarationDir, buildFolder, workspaces, }: Partial<TypeScriptOptions>): import("@beemo/driver-typescript").CompilerOptions;
|
|
14
18
|
export declare function getConfig(options: TypeScriptOptions): TypeScriptConfig;
|
|
15
19
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
Object.defineProperty(exports, '__esModule', {
|
|
4
10
|
value: true
|
|
5
11
|
});
|
|
@@ -18,6 +24,9 @@ function getCompilerOptions({
|
|
|
18
24
|
allowJs = false,
|
|
19
25
|
skipLibCheck = false,
|
|
20
26
|
sourceMaps = true,
|
|
27
|
+
emitDeclarationOnly = false,
|
|
28
|
+
declarationDir = 'dts',
|
|
29
|
+
buildFolder,
|
|
21
30
|
workspaces
|
|
22
31
|
}) {
|
|
23
32
|
if (workspaces) {
|
|
@@ -29,6 +38,7 @@ function getCompilerOptions({
|
|
|
29
38
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
30
39
|
compilerOptions.allowJs = allowJs;
|
|
31
40
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
41
|
+
compilerOptions.declaration = library || emitDeclarationOnly;
|
|
32
42
|
|
|
33
43
|
if (react) {
|
|
34
44
|
var _compilerOptions$lib;
|
|
@@ -44,16 +54,42 @@ function getCompilerOptions({
|
|
|
44
54
|
};
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
if (!workspaces) {
|
|
58
|
+
compilerOptions.outDir = `./${buildFolder}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (library && !workspaces) {
|
|
62
|
+
compilerOptions.composite = true;
|
|
63
|
+
compilerOptions.declarationDir = `./${declarationDir}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
47
66
|
if (sourceMaps) {
|
|
48
67
|
compilerOptions.sourceMap = true;
|
|
68
|
+
compilerOptions.declarationMap = true;
|
|
49
69
|
}
|
|
50
70
|
|
|
51
71
|
return compilerOptions;
|
|
52
72
|
}
|
|
53
73
|
|
|
54
74
|
function getConfig(options) {
|
|
75
|
+
const workspaces = options.workspaces,
|
|
76
|
+
library = options.library,
|
|
77
|
+
srcFolder = options.srcFolder,
|
|
78
|
+
typesFolder = options.typesFolder,
|
|
79
|
+
buildFolder = options.buildFolder;
|
|
80
|
+
|
|
81
|
+
if (workspaces) {
|
|
82
|
+
return {
|
|
83
|
+
compilerOptions: getCompilerOptions(options)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
55
87
|
return {
|
|
56
|
-
compilerOptions: getCompilerOptions(options)
|
|
88
|
+
compilerOptions: _objectSpread(_objectSpread({}, getCompilerOptions(options)), library && {
|
|
89
|
+
outDir: buildFolder
|
|
90
|
+
}),
|
|
91
|
+
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
92
|
+
exclude: ['**/node_modules/*']
|
|
57
93
|
};
|
|
58
94
|
}
|
|
59
95
|
|
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","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","lib","jsx","baseUrl","paths","ALIAS_PATTERN","sourceMap","getConfig","options"],"mappings":";;;;;;AAGA,MAAMA,MAAM,GAAGC,OAAO,CAAC,iCAAD,CAAtB;;AAEA,MAAMC,eAAe,GAAGF,MAAM,CAACE,eAA/B;
|
|
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","buildFolder","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","declaration","lib","jsx","baseUrl","paths","ALIAS_PATTERN","outDir","composite","sourceMap","declarationMap","getConfig","options","typesFolder","include","exclude"],"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,WAViC;AAWjCC,EAAAA;AAXiC,CAA5B,EAYwB;AAC7B,MAAIA,UAAJ,EAAgB;AACdC,IAAAA,MAAM,CAACC,MAAP,CACEd,eADF,EAEGD,OAAO,CAAC,4CAAD,CAAR,CAA4EC,eAF9E;AAID,GAN4B;;;AAQ7BA,EAAAA,eAAe,CAACe,eAAhB,GAAkCZ,MAAM,IAAID,OAA5C;AACAF,EAAAA,eAAe,CAACgB,uBAAhB,GAA0Cb,MAAM,IAAIc,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7E;AACAnB,EAAAA,eAAe,CAACM,OAAhB,GAA0BA,OAA1B;AACAN,EAAAA,eAAe,CAACO,YAAhB,GAA+BA,YAA/B;AACAP,EAAAA,eAAe,CAACoB,WAAhB,GAA8BlB,OAAO,IAAIO,mBAAzC;;AAEA,MAAIL,KAAJ,EAAW;AACTJ,IAAAA,eAAe,CAACqB,GAAhB,GAAsB,CAAC,IAAIrB,eAAe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SAAU,OAAhB,EAAyB,KAAI2B,WAAY,OAAzC,CALJ;AAMLE,IAAAA,OAAO,EAAE,CAAC,mBAAD;AANJ,GAAP;AAQD;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oriflame/config-typescript",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
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.11",
|
|
32
|
+
"tsconfig-oriflame": "^5.1.11"
|
|
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": "9de0434681490c0e307d6de006e3a06d08c774e7"
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,12 @@ export interface TypeScriptOptions {
|
|
|
11
11
|
future?: boolean;
|
|
12
12
|
react?: boolean;
|
|
13
13
|
srcFolder: string;
|
|
14
|
+
typesFolder: string;
|
|
14
15
|
workspaces?: boolean;
|
|
15
16
|
allowJs?: boolean;
|
|
17
|
+
includeTests?: boolean;
|
|
18
|
+
declarationDir?: string;
|
|
19
|
+
emitDeclarationOnly?: boolean;
|
|
16
20
|
skipLibCheck?: boolean;
|
|
17
21
|
buildFolder?: string;
|
|
18
22
|
}
|
|
@@ -25,6 +29,9 @@ export function getCompilerOptions({
|
|
|
25
29
|
allowJs = false,
|
|
26
30
|
skipLibCheck = false,
|
|
27
31
|
sourceMaps = true,
|
|
32
|
+
emitDeclarationOnly = false,
|
|
33
|
+
declarationDir = 'dts',
|
|
34
|
+
buildFolder,
|
|
28
35
|
workspaces,
|
|
29
36
|
}: Partial<TypeScriptOptions>) {
|
|
30
37
|
if (workspaces) {
|
|
@@ -38,6 +45,7 @@ export function getCompilerOptions({
|
|
|
38
45
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
39
46
|
compilerOptions.allowJs = allowJs;
|
|
40
47
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
48
|
+
compilerOptions.declaration = library || emitDeclarationOnly;
|
|
41
49
|
|
|
42
50
|
if (react) {
|
|
43
51
|
compilerOptions.lib = [...(compilerOptions.lib ?? []), 'dom.iterable'];
|
|
@@ -51,15 +59,37 @@ export function getCompilerOptions({
|
|
|
51
59
|
};
|
|
52
60
|
}
|
|
53
61
|
|
|
62
|
+
if (!workspaces) {
|
|
63
|
+
compilerOptions.outDir = `./${buildFolder}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (library && !workspaces) {
|
|
67
|
+
compilerOptions.composite = true;
|
|
68
|
+
compilerOptions.declarationDir = `./${declarationDir}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
54
71
|
if (sourceMaps) {
|
|
55
72
|
compilerOptions.sourceMap = true;
|
|
73
|
+
compilerOptions.declarationMap = true;
|
|
56
74
|
}
|
|
57
75
|
|
|
58
76
|
return compilerOptions;
|
|
59
77
|
}
|
|
60
78
|
|
|
61
79
|
export function getConfig(options: TypeScriptOptions): TypeScriptConfig {
|
|
80
|
+
const { workspaces, library, srcFolder, typesFolder, buildFolder } = options;
|
|
81
|
+
if (workspaces) {
|
|
82
|
+
return {
|
|
83
|
+
compilerOptions: getCompilerOptions(options),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
62
87
|
return {
|
|
63
|
-
compilerOptions:
|
|
88
|
+
compilerOptions: {
|
|
89
|
+
...getCompilerOptions(options),
|
|
90
|
+
...(library && { outDir: buildFolder }),
|
|
91
|
+
},
|
|
92
|
+
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
93
|
+
exclude: ['**/node_modules/*'],
|
|
64
94
|
};
|
|
65
95
|
}
|