@strapi/typescript-utils 5.4.0 → 5.4.1

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.
@@ -7,6 +7,7 @@ const reportDiagnostics = require('./report-diagnostics');
7
7
  const resolveConfigOptions = require('./resolve-config-options');
8
8
  const formatHost = require('./format-host');
9
9
  const resolveOutDir = require('./resolve-outdir');
10
+ const resolveOutDirSync = require('./resolve-outdir-sync');
10
11
 
11
12
  module.exports = {
12
13
  isUsingTypeScript,
@@ -16,4 +17,5 @@ module.exports = {
16
17
  resolveConfigOptions,
17
18
  formatHost,
18
19
  resolveOutDir,
20
+ resolveOutDirSync,
19
21
  };
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const resolveConfigOptions = require('./resolve-config-options');
5
+ const isUsingTypescriptSync = require('./is-using-typescript-sync');
6
+
7
+ const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
8
+ /**
9
+ * Gets the outDir value from config file (tsconfig)
10
+ * @param {string} dir
11
+ * @param {string | undefined} configFilename
12
+ * @returns {string | undefined}
13
+ */
14
+ module.exports = (dir, configFilename = DEFAULT_TS_CONFIG_FILENAME) => {
15
+ return isUsingTypescriptSync(dir)
16
+ ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir
17
+ : undefined;
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/typescript-utils",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "description": "Typescript support for Strapi",
5
5
  "keywords": [
6
6
  "strapi",
@@ -49,5 +49,5 @@
49
49
  "node": ">=18.0.0 <=22.x.x",
50
50
  "npm": ">=6.0.0"
51
51
  },
52
- "gitHead": "186981dd710bedbe48a84bd819f95f9764da61e1"
52
+ "gitHead": "c7e2ed60ecd8893748d30753ce16f0357e3c3663"
53
53
  }