@oriflame/config-typescript 5.1.12-alpha.6 → 5.1.14

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 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
- 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, includeTests, workspaces, }: Partial<TypeScriptOptions>): import("@beemo/driver-typescript").CompilerOptions;
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
+ 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
@@ -18,8 +18,9 @@ function getCompilerOptions({
18
18
  allowJs = false,
19
19
  skipLibCheck = false,
20
20
  sourceMaps = true,
21
- emitDeclarationOnly = false,
22
- declarationDir = 'dts',
21
+ declarationOnly = false,
22
+ declarationFolder,
23
+ buildFolder,
23
24
  includeTests,
24
25
  workspaces
25
26
  }) {
@@ -32,7 +33,6 @@ function getCompilerOptions({
32
33
  compilerOptions.useDefineForClassFields = future && process.env.NODE_ENV === 'development';
33
34
  compilerOptions.allowJs = allowJs;
34
35
  compilerOptions.skipLibCheck = skipLibCheck;
35
- compilerOptions.declaration = library || emitDeclarationOnly;
36
36
 
37
37
  if (react) {
38
38
  var _compilerOptions$lib;
@@ -49,19 +49,23 @@ function getCompilerOptions({
49
49
  }
50
50
 
51
51
  if (!workspaces && library) {
52
- compilerOptions.declarationDir = declarationDir;
52
+ compilerOptions.declarationDir = declarationFolder || buildFolder;
53
53
  }
54
54
 
55
55
  if (!workspaces) {
56
- compilerOptions.outDir = declarationDir;
57
- compilerOptions.rootDir = srcFolder;
56
+ if (!includeTests) {
57
+ compilerOptions.rootDir = srcFolder;
58
+ compilerOptions.emitDeclarationOnly = declarationOnly;
59
+ compilerOptions.declaration = library || declarationOnly;
60
+ compilerOptions.declarationMap = library || declarationOnly;
61
+ compilerOptions.outDir = buildFolder;
62
+ }
63
+
64
+ compilerOptions.composite = library;
58
65
  }
59
66
 
60
- compilerOptions.composite = library && !workspaces;
61
-
62
67
  if (sourceMaps) {
63
68
  compilerOptions.sourceMap = true;
64
- compilerOptions.declarationMap = true;
65
69
  }
66
70
 
67
71
  return compilerOptions;
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","includeTests","workspaces","Object","assign","isolatedModules","useDefineForClassFields","process","env","NODE_ENV","declaration","lib","jsx","baseUrl","paths","ALIAS_PATTERN","outDir","rootDir","composite","sourceMap","declarationMap","getConfig","options","typesFolder","tests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Q,CAACC,OAAT,CAAiBE,IAAjB,CAAuB,KAAIJ,WAAY,OAAvC;AACD;;AAED,SAAOC,QAAP;AACD;;;;;"}
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","declaration","declarationMap","outDir","composite","sourceMap","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,C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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.12-alpha.6+7ad8f2ff",
3
+ "version": "5.1.14",
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.12-alpha.6+7ad8f2ff",
32
- "tsconfig-oriflame": "^5.1.12-alpha.6+7ad8f2ff"
31
+ "@oriflame/lumos-common": "^5.1.14",
32
+ "tsconfig-oriflame": "^5.1.14"
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": "7ad8f2ff2ecf20b1227078cc0e992f354a01788c"
48
+ "gitHead": "45d11bf63421be46295827d78f46c1f29216053a"
49
49
  }
package/src/index.ts CHANGED
@@ -16,8 +16,9 @@ export interface TypeScriptOptions {
16
16
  allowJs?: boolean;
17
17
  includeTests?: boolean;
18
18
  testsFolder: string;
19
- declarationDir?: string;
20
- emitDeclarationOnly?: boolean;
19
+ buildFolder: string;
20
+ declarationFolder?: string;
21
+ declarationOnly?: boolean;
21
22
  skipLibCheck?: boolean;
22
23
  }
23
24
 
@@ -29,8 +30,9 @@ export function getCompilerOptions({
29
30
  allowJs = false,
30
31
  skipLibCheck = false,
31
32
  sourceMaps = true,
32
- emitDeclarationOnly = false,
33
- declarationDir = 'dts',
33
+ declarationOnly = false,
34
+ declarationFolder,
35
+ buildFolder,
34
36
  includeTests,
35
37
  workspaces,
36
38
  }: Partial<TypeScriptOptions>) {
@@ -45,7 +47,6 @@ export function getCompilerOptions({
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'];
@@ -60,19 +61,22 @@ export function getCompilerOptions({
60
61
  }
61
62
 
62
63
  if (!workspaces && library) {
63
- compilerOptions.declarationDir = declarationDir;
64
+ compilerOptions.declarationDir = declarationFolder || buildFolder;
64
65
  }
65
66
 
66
67
  if (!workspaces) {
67
- compilerOptions.outDir = declarationDir;
68
- compilerOptions.rootDir = srcFolder;
68
+ if (!includeTests) {
69
+ compilerOptions.rootDir = srcFolder;
70
+ compilerOptions.emitDeclarationOnly = declarationOnly;
71
+ compilerOptions.declaration = library || declarationOnly;
72
+ compilerOptions.declarationMap = library || declarationOnly;
73
+ compilerOptions.outDir = buildFolder;
74
+ }
75
+ compilerOptions.composite = library;
69
76
  }
70
77
 
71
- compilerOptions.composite = library && !workspaces;
72
-
73
78
  if (sourceMaps) {
74
79
  compilerOptions.sourceMap = true;
75
- compilerOptions.declarationMap = true;
76
80
  }
77
81
 
78
82
  return compilerOptions;