Commit 95b3352c authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Oliver Bartsch
Browse files

[TASK] Remove unneeded TypeScript module path configuration

Simplify tsconfig.json by removing unneded lookup configurations for
typo3/sysext/*/Resources/Public/JavaScript/ folders, as actually
no files are included from there.

The configuration originates back from #81416 where TypeScript
sources have been stored in typo3/sysext/. It is no longer needed,
now that all Sources are located in Build/Sources/TypeScript.

As a slight bonus, tsconfig.json will now automatically be updated
if a new extension is added in Build/Sources/TypeScript (previously
a JavaScript folder in typo3/sysext/ had to be added beforehand).

Executed commands:

  # executed to regenerate tsconfig.json
  grunt tsconfig
  # produces no changes, since config is equal to prior state
  grunt build

Resolves: #96456
Related: #96323
Releases: main
Change-Id: I8f8cc569dce89116eca2440bff1ea52db859fdd8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72853


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 81f5d39b
......@@ -51,7 +51,7 @@ module.exports = function (grunt) {
sources: 'Sources/',
root: '../',
sass: '<%= paths.sources %>Sass/',
typescript: '<%= paths.sources %>/TypeScript/',
typescript: '<%= paths.sources %>TypeScript/',
sysext: '<%= paths.root %>typo3/sysext/',
form: '<%= paths.sysext %>form/Resources/',
dashboard: '<%= paths.sysext %>dashboard/Resources/',
......@@ -756,17 +756,12 @@ module.exports = function (grunt) {
* this task updates the tsconfig.json file with modules paths for all sysexts
*/
grunt.task.registerTask('tsconfig', function () {
var config = grunt.file.readJSON("tsconfig.json");
const config = grunt.file.readJSON("tsconfig.json");
const typescriptPath = grunt.config.get('paths.typescript');
config.compilerOptions.paths = {};
var sysext = grunt.config.get('paths.sysext');
grunt.file.expand(sysext + '*/Resources/Public/JavaScript').forEach(function (dir) {
var extname = ('_' + dir.match(/sysext\/(.*?)\//)[1]).replace(/_./g, function (match) {
return match.charAt(1).toUpperCase();
});
var namespace = 'TYPO3/CMS/' + extname + '/*';
var path = dir + "/*";
var extensionTypeScriptPath = path.replace('Public/JavaScript', 'Public/TypeScript').replace(sysext, '');
config.compilerOptions.paths[namespace] = [path, extensionTypeScriptPath];
grunt.file.expand(typescriptPath + '*/Resources/Public/TypeScript').map(dir => dir.replace(typescriptPath, '')).forEach((path) => {
const extname = ('_' + path.match(/^([^\/]+?)\//)[1]).replace(/_./g, (match) => match.charAt(1).toUpperCase());
config.compilerOptions.paths['TYPO3/CMS/' + extname + '/*'] = [path + '/*'];
});
grunt.file.write('tsconfig.json', JSON.stringify(config, null, 4) + '\n');
......
......@@ -27,107 +27,78 @@
"baseUrl": "Sources/TypeScript",
"paths": {
"TYPO3/CMS/Adminpanel/*": [
"../typo3/sysext/adminpanel/Resources/Public/JavaScript/*",
"adminpanel/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Backend/*": [
"../typo3/sysext/backend/Resources/Public/JavaScript/*",
"backend/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Belog/*": [
"../typo3/sysext/belog/Resources/Public/JavaScript/*",
"belog/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Beuser/*": [
"../typo3/sysext/beuser/Resources/Public/JavaScript/*",
"beuser/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Core/*": [
"../typo3/sysext/core/Resources/Public/JavaScript/*",
"core/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Dashboard/*": [
"../typo3/sysext/dashboard/Resources/Public/JavaScript/*",
"dashboard/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Extensionmanager/*": [
"../typo3/sysext/extensionmanager/Resources/Public/JavaScript/*",
"extensionmanager/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Filelist/*": [
"../typo3/sysext/filelist/Resources/Public/JavaScript/*",
"filelist/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Form/*": [
"../typo3/sysext/form/Resources/Public/JavaScript/*",
"form/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Frontend/*": [
"../typo3/sysext/frontend/Resources/Public/JavaScript/*",
"frontend/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Impexp/*": [
"../typo3/sysext/impexp/Resources/Public/JavaScript/*",
"impexp/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Info/*": [
"../typo3/sysext/info/Resources/Public/JavaScript/*",
"info/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Install/*": [
"../typo3/sysext/install/Resources/Public/JavaScript/*",
"install/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Linkvalidator/*": [
"../typo3/sysext/linkvalidator/Resources/Public/JavaScript/*",
"linkvalidator/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Lowlevel/*": [
"../typo3/sysext/lowlevel/Resources/Public/JavaScript/*",
"lowlevel/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Opendocs/*": [
"../typo3/sysext/opendocs/Resources/Public/JavaScript/*",
"opendocs/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Recordlist/*": [
"../typo3/sysext/recordlist/Resources/Public/JavaScript/*",
"recordlist/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Recycler/*": [
"../typo3/sysext/recycler/Resources/Public/JavaScript/*",
"recycler/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Redirects/*": [
"../typo3/sysext/redirects/Resources/Public/JavaScript/*",
"redirects/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/RteCkeditor/*": [
"../typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/*",
"rte_ckeditor/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Scheduler/*": [
"../typo3/sysext/scheduler/Resources/Public/JavaScript/*",
"scheduler/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Setup/*": [
"../typo3/sysext/setup/Resources/Public/JavaScript/*",
"setup/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/T3editor/*": [
"../typo3/sysext/t3editor/Resources/Public/JavaScript/*",
"t3editor/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Tstemplate/*": [
"../typo3/sysext/tstemplate/Resources/Public/JavaScript/*",
"tstemplate/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Viewpage/*": [
"../typo3/sysext/viewpage/Resources/Public/JavaScript/*",
"viewpage/Resources/Public/TypeScript/*"
],
"TYPO3/CMS/Workspaces/*": [
"../typo3/sysext/workspaces/Resources/Public/JavaScript/*",
"workspaces/Resources/Public/TypeScript/*"
]
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment