@oriflame/config-typescript 5.1.9 → 5.1.12-alpha.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 +19 -14
- package/lib/index.js +43 -3
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +42 -3
package/dts/index.d.ts
CHANGED
|
@@ -1,15 +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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
15
20
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -18,6 +18,10 @@ function getCompilerOptions({
|
|
|
18
18
|
allowJs = false,
|
|
19
19
|
skipLibCheck = false,
|
|
20
20
|
sourceMaps = true,
|
|
21
|
+
declarationOnly = false,
|
|
22
|
+
declarationFolder,
|
|
23
|
+
buildFolder,
|
|
24
|
+
includeTests,
|
|
21
25
|
workspaces
|
|
22
26
|
}) {
|
|
23
27
|
if (workspaces) {
|
|
@@ -25,7 +29,7 @@ function getCompilerOptions({
|
|
|
25
29
|
} // Do we need isolated modules?
|
|
26
30
|
|
|
27
31
|
|
|
28
|
-
compilerOptions.isolatedModules = future && library;
|
|
32
|
+
compilerOptions.isolatedModules = future && library && !includeTests;
|
|
29
33
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
30
34
|
compilerOptions.allowJs = allowJs;
|
|
31
35
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
@@ -44,17 +48,53 @@ function getCompilerOptions({
|
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
if (!workspaces && library) {
|
|
52
|
+
compilerOptions.declarationDir = declarationFolder || buildFolder;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!workspaces) {
|
|
56
|
+
if (!includeTests) {
|
|
57
|
+
compilerOptions.rootDir = srcFolder;
|
|
58
|
+
compilerOptions.emitDeclarationOnly = declarationOnly;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
compilerOptions.outDir = buildFolder;
|
|
62
|
+
compilerOptions.composite = library;
|
|
63
|
+
compilerOptions.declaration = library || declarationOnly;
|
|
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) {
|
|
55
|
-
|
|
56
|
-
|
|
75
|
+
const workspaces = options.workspaces,
|
|
76
|
+
srcFolder = options.srcFolder,
|
|
77
|
+
typesFolder = options.typesFolder,
|
|
78
|
+
includeTests = options.includeTests,
|
|
79
|
+
testsFolder = options.testsFolder;
|
|
80
|
+
|
|
81
|
+
if (workspaces) {
|
|
82
|
+
return {
|
|
83
|
+
compilerOptions: getCompilerOptions(options)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const tsconfig = {
|
|
88
|
+
compilerOptions: getCompilerOptions(options),
|
|
89
|
+
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
90
|
+
exclude: ['**/node_modules/*']
|
|
57
91
|
};
|
|
92
|
+
|
|
93
|
+
if (includeTests) {
|
|
94
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return tsconfig;
|
|
58
98
|
}
|
|
59
99
|
|
|
60
100
|
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","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","declarationOnly","declarationFolder","buildFolder","includeTests","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","lib","jsx","baseUrl","paths","ALIAS_PATTERN","declarationDir","rootDir","emitDeclarationOnly","outDir","composite","declaration","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,EAAAA,UAAU,GAAG,IAPoB;AAQjCC,EAAAA,eAAe,GAAG,KARe;AASjCC,EAAAA,iBATiC;AAUjCC,EAAAA,WAViC;AAWjCC,EAAAA,YAXiC;AAYjCC,EAAAA;AAZiC,CAA5B,EAawB;AAC7B,MAAIA,UAAJ,EAAgB;AACdC,IAAAA,MAAM,CAACC,MAAP,CACEf,eADF,EAEGD,OAAO,CAAC,4CAAD,CAAR,CAA4EC,eAF9E;AAID,GAN4B;;;AAQ7BA,EAAAA,eAAe,CAACgB,eAAhB,GAAkCb,MAAM,IAAID,OAAV,IAAqB,CAACU,YAAxD;AACAZ,EAAAA,eAAe,CAACiB,uBAAhB,GAA0Cd,MAAM,IAAIe,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7E;AACApB,EAAAA,eAAe,CAACM,OAAhB,GAA0BA,OAA1B;AACAN,EAAAA,eAAe,CAACO,YAAhB,GAA+BA,YAA/B;;AAEA,MAAIH,KAAJ,EAAW;AACTJ,IAAAA,eAAe,CAACqB,GAAhB,GAAsB,CAAC,IAAIrB,eAAe,CAACqB,GAAhB,IAAuB,EAA3B,CAAD,EAAiC,cAAjC,CAAtB;AACArB,IAAAA,eAAe,CAACsB,GAAhB,GAAsB,WAAtB;AACD;;AAED,MAAI,CAACpB,OA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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.11+1c168aa5",
|
|
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.11+1c168aa5",
|
|
32
|
+
"tsconfig-oriflame": "^5.1.12-alpha.11+1c168aa5"
|
|
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": "1c168aa53cbf1437b33b2225154aa52c2f600ae4"
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,10 +11,15 @@ 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
|
+
testsFolder: string;
|
|
19
|
+
buildFolder: string;
|
|
20
|
+
declarationFolder?: string;
|
|
21
|
+
declarationOnly?: boolean;
|
|
16
22
|
skipLibCheck?: boolean;
|
|
17
|
-
buildFolder?: string;
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
export function getCompilerOptions({
|
|
@@ -25,6 +30,10 @@ export function getCompilerOptions({
|
|
|
25
30
|
allowJs = false,
|
|
26
31
|
skipLibCheck = false,
|
|
27
32
|
sourceMaps = true,
|
|
33
|
+
declarationOnly = false,
|
|
34
|
+
declarationFolder,
|
|
35
|
+
buildFolder,
|
|
36
|
+
includeTests,
|
|
28
37
|
workspaces,
|
|
29
38
|
}: Partial<TypeScriptOptions>) {
|
|
30
39
|
if (workspaces) {
|
|
@@ -34,7 +43,7 @@ export function getCompilerOptions({
|
|
|
34
43
|
);
|
|
35
44
|
}
|
|
36
45
|
// Do we need isolated modules?
|
|
37
|
-
compilerOptions.isolatedModules = future && library;
|
|
46
|
+
compilerOptions.isolatedModules = future && library && !includeTests;
|
|
38
47
|
compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
|
|
39
48
|
compilerOptions.allowJs = allowJs;
|
|
40
49
|
compilerOptions.skipLibCheck = skipLibCheck;
|
|
@@ -51,15 +60,45 @@ export function getCompilerOptions({
|
|
|
51
60
|
};
|
|
52
61
|
}
|
|
53
62
|
|
|
63
|
+
if (!workspaces && library) {
|
|
64
|
+
compilerOptions.declarationDir = declarationFolder || buildFolder;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!workspaces) {
|
|
68
|
+
if (!includeTests) {
|
|
69
|
+
compilerOptions.rootDir = srcFolder;
|
|
70
|
+
compilerOptions.emitDeclarationOnly = declarationOnly;
|
|
71
|
+
}
|
|
72
|
+
compilerOptions.outDir = buildFolder;
|
|
73
|
+
compilerOptions.composite = library;
|
|
74
|
+
compilerOptions.declaration = library || declarationOnly;
|
|
75
|
+
}
|
|
76
|
+
|
|
54
77
|
if (sourceMaps) {
|
|
55
78
|
compilerOptions.sourceMap = true;
|
|
79
|
+
compilerOptions.declarationMap = true;
|
|
56
80
|
}
|
|
57
81
|
|
|
58
82
|
return compilerOptions;
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
export function getConfig(options: TypeScriptOptions): TypeScriptConfig {
|
|
62
|
-
|
|
86
|
+
const { workspaces, srcFolder, typesFolder, includeTests, testsFolder } = options;
|
|
87
|
+
if (workspaces) {
|
|
88
|
+
return {
|
|
89
|
+
compilerOptions: getCompilerOptions(options),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const tsconfig = {
|
|
63
94
|
compilerOptions: getCompilerOptions(options),
|
|
95
|
+
include: [`./${srcFolder}/**/*`, `./${typesFolder}/**/*`],
|
|
96
|
+
exclude: ['**/node_modules/*'],
|
|
64
97
|
};
|
|
98
|
+
|
|
99
|
+
if (includeTests) {
|
|
100
|
+
tsconfig.include.push(`./${testsFolder}/**/*`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return tsconfig;
|
|
65
104
|
}
|