From ac4d673370cef7b709e3ed2eac08eb4443c01e2c Mon Sep 17 00:00:00 2001 From: dreaming-augustin Date: Sun, 22 Dec 2024 13:58:02 +0800 Subject: [PATCH 1/5] [#1] Include the version in the released file --- tasks/config/project/release.js | 20 +++++++++++++++++++- tasks/config/tasks.js | 12 ++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 8981ffd229..46579a69a5 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -7,7 +7,9 @@ const requireDotFile = require('require-dot-file'); let config, npmPackage, - version + version, + revision, + versionInFileName ; /******************************* @@ -31,6 +33,21 @@ version = npmPackage && npmPackage.version !== undefined && npmPackage.name === ? npmPackage.version : config.version; +// looks for revision in config. +revision = config.revision === undefined ? '' : config.revision; + +includeVersionInFileName = config.includeVersionInFileName === undefined ? false : config.includeVersionInFileName; + +versionInFileName = ''; + +if (includeVersionInFileName) { + versionInFileName = '-' + version; + if (revision != '') { + versionInFileName += '-' + revision; + } +} + + /******************************* Export *******************************/ @@ -54,5 +71,6 @@ module.exports = { + ' */\n', version: version, + versionInFileName: versionInFileName, }; diff --git a/tasks/config/tasks.js b/tasks/config/tasks.js index 561b7d197e..886f8d5cd2 100644 --- a/tasks/config/tasks.js +++ b/tasks/config/tasks.js @@ -40,12 +40,12 @@ module.exports = { }, filenames: { - concatenatedCSS: 'semantic.css', - concatenatedJS: 'semantic.js', - concatenatedMinifiedCSS: 'semantic.min.css', - concatenatedMinifiedJS: 'semantic.min.js', - concatenatedRTLCSS: 'semantic.rtl.css', - concatenatedMinifiedRTLCSS: 'semantic.rtl.min.css', + concatenatedCSS: 'semantic' + release.versionInFileName + '.css', + concatenatedJS: 'semantic' + release.versionInFileName + '.js', + concatenatedMinifiedCSS: 'semantic' + release.versionInFileName + '.min.css', + concatenatedMinifiedJS: 'semantic' + release.versionInFileName + '.min.js', + concatenatedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.css', + concatenatedMinifiedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.min.css', }, regExp: { From 1f9f110ed0396ff1de8fbd81f357b3775a5bd400 Mon Sep 17 00:00:00 2001 From: dreaming-augustin Date: Sun, 22 Dec 2024 16:06:44 +0800 Subject: [PATCH 2/5] [#1] Fix lint issues. --- tasks/config/project/release.js | 14 +++++++------- tasks/config/tasks.js | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 46579a69a5..65f02d6161 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -9,7 +9,8 @@ let npmPackage, version, revision, - versionInFileName + versionInFileName, + includeVersionInFileName ; /******************************* @@ -29,7 +30,7 @@ try { } // looks for version in config or package.json (whichever is available) -version = npmPackage && npmPackage.version !== undefined && npmPackage.name === 'fomantic-ui' +version = npmPackage && npmPackage.version != undefined && npmPackage.name === 'fomantic-ui' ? npmPackage.version : config.version; @@ -41,13 +42,12 @@ includeVersionInFileName = config.includeVersionInFileName === undefined ? false versionInFileName = ''; if (includeVersionInFileName) { - versionInFileName = '-' + version; - if (revision != '') { - versionInFileName += '-' + revision; - } + versionInFileName = '-' + version; + if (revision != '') { + versionInFileName += '-' + revision; + } } - /******************************* Export *******************************/ diff --git a/tasks/config/tasks.js b/tasks/config/tasks.js index 886f8d5cd2..c111f4085e 100644 --- a/tasks/config/tasks.js +++ b/tasks/config/tasks.js @@ -40,12 +40,12 @@ module.exports = { }, filenames: { - concatenatedCSS: 'semantic' + release.versionInFileName + '.css', - concatenatedJS: 'semantic' + release.versionInFileName + '.js', - concatenatedMinifiedCSS: 'semantic' + release.versionInFileName + '.min.css', - concatenatedMinifiedJS: 'semantic' + release.versionInFileName + '.min.js', - concatenatedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.css', - concatenatedMinifiedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.min.css', + concatenatedCSS: 'semantic' + release.versionInFileName + '.css', + concatenatedJS: 'semantic' + release.versionInFileName + '.js', + concatenatedMinifiedCSS: 'semantic' + release.versionInFileName + '.min.css', + concatenatedMinifiedJS: 'semantic' + release.versionInFileName + '.min.js', + concatenatedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.css', + concatenatedMinifiedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.min.css', }, regExp: { From 151de5e241f85124a5e9d5bcd6c4e5429750d5e4 Mon Sep 17 00:00:00 2001 From: dreaming-augustin Date: Sun, 22 Dec 2024 16:24:16 +0800 Subject: [PATCH 3/5] [#1] Fix lint issues. --- tasks/config/project/release.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 65f02d6161..66abed9e35 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -43,7 +43,7 @@ versionInFileName = ''; if (includeVersionInFileName) { versionInFileName = '-' + version; - if (revision != '') { + if (revision !== '') { versionInFileName += '-' + revision; } } From 64d710b6ef9cef8e39bfb8be36b9b945c8d7f1fa Mon Sep 17 00:00:00 2001 From: dreaming-augustin Date: Sun, 22 Dec 2024 16:49:39 +0800 Subject: [PATCH 4/5] Lint: revert !== change. --- tasks/config/project/release.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 66abed9e35..5f6fe52cb0 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -30,7 +30,7 @@ try { } // looks for version in config or package.json (whichever is available) -version = npmPackage && npmPackage.version != undefined && npmPackage.name === 'fomantic-ui' +version = npmPackage && npmPackage.version !== undefined && npmPackage.name === 'fomantic-ui' ? npmPackage.version : config.version; From 37600db7c9424c7dc2f8732d50427a4de1d4fde0 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Sun, 22 Dec 2024 13:25:47 +0100 Subject: [PATCH 5/5] put rtl suffix after version number --- tasks/config/tasks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/config/tasks.js b/tasks/config/tasks.js index c111f4085e..050db04101 100644 --- a/tasks/config/tasks.js +++ b/tasks/config/tasks.js @@ -44,8 +44,8 @@ module.exports = { concatenatedJS: 'semantic' + release.versionInFileName + '.js', concatenatedMinifiedCSS: 'semantic' + release.versionInFileName + '.min.css', concatenatedMinifiedJS: 'semantic' + release.versionInFileName + '.min.js', - concatenatedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.css', - concatenatedMinifiedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.min.css', + concatenatedRTLCSS: 'semantic' + release.versionInFileName + '.rtl.css', + concatenatedMinifiedRTLCSS: 'semantic' + release.versionInFileName + '.rtl.min.css', }, regExp: {