From a18617f3f9d70102352ba8af79fce05904817d53 Mon Sep 17 00:00:00 2001 From: David Lourenco Date: Thu, 30 Jul 2026 15:23:43 +0100 Subject: [PATCH 1/4] ROU-12910: Update volta versions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 179763d2..8991d4af 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,6 @@ }, "volta": { "node": "24.13.1", - "npm": "11.10.1" + "npm": "11.18.0" } } From 123f5e63e9c412f56fa938db191d46dddc8eb730 Mon Sep 17 00:00:00 2001 From: David Lourenco Date: Thu, 30 Jul 2026 15:29:13 +0100 Subject: [PATCH 2/4] ROU-12910: Update gulp version and remove gulp-typescript --- gulp/Tasks/TsTranspile.js | 69 +++++++++++++++++++++++++-------------- package.json | 5 ++- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/gulp/Tasks/TsTranspile.js b/gulp/Tasks/TsTranspile.js index 10d925a4..dad39841 100644 --- a/gulp/Tasks/TsTranspile.js +++ b/gulp/Tasks/TsTranspile.js @@ -1,8 +1,7 @@ -const gulp = require('gulp'); const { series } = require('gulp'); const fs = require('fs'); -const sourcemaps = require('gulp-sourcemaps'); -const ts = require('gulp-typescript'); +const path = require('path'); +const ts = require('typescript'); const distFolder = './dist'; const project = require('../DefaultSpecs'); @@ -88,34 +87,54 @@ function tsTranspile(cb, envMode, platformType) { // Method that will trigger the transpile of Ts according if it's development or production mode and platform type (O11 or ODC) async function tsTranspileBasedOnPlatform(cb, envMode, platformType, shouldCreateAll) { - let tsProject = ts.createProject('tsconfig.json', { + const compilerOptions = { outDir: distFolder, declaration: envMode === project.globalConsts.envType.production ? true : false, - outFile: `${envMode === project.globalConsts.envType.production ? '' : envMode + '.'}${ - platformType !== '' ? platformType + '.' : '' - }${project.globalConsts.fileName}.js`, - }); + outFile: path.join( + distFolder, + `${envMode === project.globalConsts.envType.production ? '' : envMode + '.'}${ + platformType !== '' ? platformType + '.' : '' + }${project.globalConsts.fileName}.js` + ), + }; if (envMode === project.globalConsts.envType.development) { - tsProject - .src() - .pipe(sourcemaps.init()) - .pipe(tsProject()) - .js.pipe(sourcemaps.write('.')) - .pipe(gulp.dest(distFolder)) - .on('finish', () => { - onTsCompileFinish(platformType, cb, shouldCreateAll); - }); - } else { - tsProject - .src() - .pipe(tsProject()) - .pipe(gulp.dest(distFolder)) - .on('finish', () => { - onTsCompileFinish(platformType, cb, shouldCreateAll); - }); + compilerOptions.sourceMap = true; + } + + const configFile = ts.readConfigFile('tsconfig.json', ts.sys.readFile); + const parsedConfig = ts.parseJsonConfigFileContent( + configFile.config, + ts.sys, + path.dirname(path.resolve('tsconfig.json')), + compilerOptions, + path.resolve('tsconfig.json') + ); + + const program = ts.createProgram({ + rootNames: parsedConfig.fileNames, + options: parsedConfig.options, + }); + + const emitResult = program.emit(); + const diagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); + + if (diagnostics.length > 0) { + console.error( + ts.formatDiagnosticsWithColorAndContext(diagnostics, { + getCurrentDirectory: () => ts.sys.getCurrentDirectory(), + getCanonicalFileName: (fileName) => fileName, + getNewLine: () => ts.sys.newLine, + }) + ); } + if (emitResult.emitSkipped) { + throw new Error('TypeScript compilation failed'); + } + + onTsCompileFinish(platformType, cb, shouldCreateAll); + // Rollback tsconfig file to the default state if (defaultTsConfigText !== '') { rollBackTsConfigFile(); diff --git a/package.json b/package.json index 8991d4af..716d3a3e 100644 --- a/package.json +++ b/package.json @@ -36,12 +36,11 @@ "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.0.0", - "gulp": "^4.0.2", + "gulp": "^5.0.0", "gulp-autoprefixer": "^8.0.0", "gulp-clean": "^0.4.0", "gulp-remove-empty-lines": "^0.1.0", "gulp-sourcemaps": "^3.0.0", - "gulp-typescript": "^6.0.0-alpha.1", "postcss": "^8.5.6", "postcss-discard-comments": "^5.1.2", "postcss-discard-duplicates": "^5.1.0", @@ -61,4 +60,4 @@ "node": "24.13.1", "npm": "11.18.0" } -} +} \ No newline at end of file From 964ffad21c2b9760e778f451d322c587d45d0827 Mon Sep 17 00:00:00 2001 From: David Lourenco Date: Thu, 30 Jul 2026 16:50:37 +0100 Subject: [PATCH 3/4] Add readme information --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 07a2e056..d216b3ad 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,24 @@ We highly recommend the usage of the following tools: - Document This - ESLint - Prettier - Code formatter +- [Volta](https://volta.sh/) — manages Node.js and npm versions for this project + +#### Node.js and npm (Volta) + +This project pins Node.js and npm versions in `package.json`. Install [Volta](https://volta.sh/) once and the correct versions are applied automatically when you work in this repository. + +**Install Volta:** follow the official [Getting Started guide](https://docs.volta.sh/guide/getting-started) (macOS, Windows, and Linux). + +**Verify Volta is active:** + +```bash +volta --version # Volta is installed +volta which node # pinned Node version for this project +volta which npm # pinned npm version for this project +node -v +npm -v +``` + ### How to use change this code? From 440d5603b0f7d03af50bc7f0c1cb45b56d223b73 Mon Sep 17 00:00:00 2001 From: David Lourenco Date: Fri, 31 Jul 2026 11:02:19 +0100 Subject: [PATCH 4/4] Accepted changes requested from sonar --- gulp/Tasks/TsTranspile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulp/Tasks/TsTranspile.js b/gulp/Tasks/TsTranspile.js index dad39841..b7c1ceb1 100644 --- a/gulp/Tasks/TsTranspile.js +++ b/gulp/Tasks/TsTranspile.js @@ -1,6 +1,6 @@ const { series } = require('gulp'); const fs = require('fs'); -const path = require('path'); +const path = require('node:path'); const ts = require('typescript'); const distFolder = './dist';