ui5-tooling-transpile
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.0.2](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/ui5-tooling-transpile@3.0.1...ui5-tooling-transpile@3.0.2) (2023-08-09) | ||
### Bug Fixes | ||
* **ui5-tooling-transpile:** derive transpileDependencies from tsconfig ([#786](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/786)) ([ba5d734](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/ba5d734bd6772a6c4b05344ec7f69b4d1de4a1ea)) | ||
## [3.0.1](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/ui5-tooling-transpile@3.0.0...ui5-tooling-transpile@3.0.1) (2023-08-01) | ||
@@ -8,0 +19,0 @@ |
@@ -81,4 +81,25 @@ const os = require("os"); | ||
// if a tsconfig.json file exists, the project is a TypeScript project | ||
const isTypeScriptProject = fs.existsSync(path.join(cwd, "tsconfig.json")); | ||
const tscJsonPath = path.join(cwd, "tsconfig.json"); | ||
const isTypeScriptProject = fs.existsSync(tscJsonPath); | ||
// read package.json and tsconfig.json to determine whether to transpile dependencies or not | ||
if (isTypeScriptProject && !config.transpileDependencies) { | ||
const tscJson = JSON.parse(fs.readFileSync(tscJsonPath, { encoding: "utf8" })); | ||
const tsDeps = tscJson?.compilerOptions?.types?.filter((typePkgName) => { | ||
try { | ||
// if a type dependency includes a ui5.yaml we assume | ||
// to support transpiling of dependencies - and in case | ||
// of the project is built already the js files are | ||
// available and can be served directly without transpile | ||
const ui5YamlPath = require.resolve(`${typePkgName}/ui5.yaml`, { | ||
paths: [cwd] | ||
}); | ||
return !!ui5YamlPath; | ||
} catch (e) { | ||
return false; | ||
} | ||
}); | ||
config.transpileDependencies = tsDeps?.length || 0 > 0; | ||
} | ||
// derive whether TypeScript should be transformed or not | ||
@@ -85,0 +106,0 @@ const transformTypeScript = config.transformTypeScript ?? config.transpileTypeScript ?? isTypeScriptProject; |
{ | ||
"name": "ui5-tooling-transpile", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "UI5 tooling extensions to transpile code", | ||
@@ -37,3 +37,3 @@ "author": "Jorge Martins, Peter Muessig", | ||
}, | ||
"gitHead": "648744879c475e77319f84dfe8f14509bdd4a667" | ||
"gitHead": "b8fc3f2142f4b1cedfe7767ab0b55aa0a9ef7aaa" | ||
} |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
80446
822
7