Skip to content

Commit 5800b9d

Browse files
committed
feat: Use local tsc-alias dependency instead of bstack_node_modules_path
- Updated readCypressConfigUtil.js to use require.resolve() for tsc-alias - Added tsc-alias as a local dependency in package.json - Ensures cross-platform compatibility and proper module resolution
1 parent 06bf282 commit 5800b9d

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

bin/accessibility-automation/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ exports.createAccessibilityTestRun = async (user_config, framework) => {
109109
logger.debug(`BrowserStack Accessibility Automation Test Run ID: ${response.data.data.id}`);
110110

111111
this.setAccessibilityCypressCapabilities(user_config, response.data);
112-
helper.setBrowserstackCypressCliDependency(user_config);
112+
if(user_config.run_settings.auto_import_dev_dependencies != true) helper.setBrowserstackCypressCliDependency(user_config);
113113

114114
} catch (error) {
115115
if (error.response) {

bin/helpers/readCypressConfigUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function resolveTsConfigPath(bsConfig, cypress_config_filepath) {
3737
function generateTscCommandAndTempTsConfig(bsConfig, bstack_node_modules_path, complied_js_dir, cypress_config_filepath) {
3838
const working_dir = path.dirname(cypress_config_filepath);
3939
const typescript_path = path.join(bstack_node_modules_path, 'typescript', 'bin', 'tsc');
40-
const tsc_alias_path = path.join(bstack_node_modules_path, 'tsc-alias', 'dist', 'bin', 'index.js');
40+
const tsc_alias_path = require.resolve('tsc-alias/dist/bin/index.js');
4141

4242
// Smart tsconfig detection and validation
4343
const resolvedTsConfigPath = resolveTsConfigPath(bsConfig, cypress_config_filepath);

bin/testObservability/helper/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ exports.launchTestSession = async (user_config, bsConfigPath) => {
418418
exports.debug('Build creation successfull!');
419419
process.env.BS_TESTOPS_BUILD_COMPLETED = true;
420420
setEnvironmentVariablesForRemoteReporter(response.data.jwt, response.data.build_hashed_id, response.data.allow_screenshots, data.observability_version.sdkVersion);
421-
if(this.isBrowserstackInfra()) helper.setBrowserstackCypressCliDependency(user_config);
421+
if(this.isBrowserstackInfra() && (user_config.run_settings.auto_import_dev_dependencies != true)) helper.setBrowserstackCypressCliDependency(user_config);
422422
} catch(error) {
423423
if(!error.errorType) {
424424
if (error.response) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"mocha": "^10.2.0",
3232
"node-ipc": "9.1.1",
3333
"table": "5.4.6",
34+
"tsc-alias": "^1.8.16",
3435
"unzipper": "^0.12.3",
3536
"update-notifier": "7.0.0",
3637
"uuid": "8.3.2",

0 commit comments

Comments
 (0)