Project

General

Profile

Actions

Task #98271

closed

Make it possible to easily and correctly build assets for core contribution in branch 11.5 (buildJavaScript)

Added by Sybille Peters about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2022-09-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

For main branch, there is Build/Scripts/runTests.sh -s buildJavascript to build TypeScript / JavaScript. This also exists in 11.5, but it results in extra .js files being generated, so probably this is incorrect. Previously, cd Build;yarn install;yarn build was used, not sure if this is still the case in 11.5

Probably best to fix the command for runTests.sh or remove / change it. Might need also change in contribution guide. (I did not test the building of css files. Should also be checked)

Reproduce

git reset --hard origin/11.5;git pull origin 11.5
Build/Scripts/runTests.sh -s buildJavascript
git status

Result

On branch 11.5
Your branch is up to date with 'origin/11.5'.

Untracked files:
(use "git add <file>..." to include in what will be committed)
typo3/sysext/backend/Resources/Public/JavaScript/ClipboardComponent.js
typo3/sysext/backend/Resources/Public/JavaScript/ToggleSearchToolbox.js
typo3/sysext/backend/Resources/Public/JavaScript/Wizard/
typo3/sysext/filelist/Resources/Public/JavaScript/FileListLocalisation.js
typo3/sysext/recordlist/Resources/Public/JavaScript/ColumnSelectorButton.js

Actions #1

Updated by Oliver Hader about 2 years ago

Mh, not sure, you created that change, suggesting to use runTests.sh in https://github.com/TYPO3-Documentation/TYPO3CMS-Guide-ContributionWorkflow/pull/277

From my POV runTests.sh is misused for building assets. In case this shall be working with Docker support (e.g. for environments not having nvm, node and Co installed), then there should be simplified wrapper that is not doing too much magic - no npm ci, no clean-up - just execute the given commands e.g. npmRun.sh exec grunt eslint would just run npm exec grunt eslint.

Actions #2

Updated by Oliver Hader about 2 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Jonas Eberle about 2 years ago

Using runTests.sh for all building (yes, the naming of the tool is not good any more) was recommended because it requires less setup on the user-side and should produce canonical results since CI runs it, too.

It has been recommended to newcomers, albeit it lacks features for more involved asset developers. Those can use the Grunt tasks directly (for quicker partial builds or "watch" etc.).

It might be that your local changes where just about the "execute" bit of the files (that was one inconsistency we had earlier between using yarn/npm and runTests.sh but that should be fixed). Depending on your git configuration it might be that git has not checked out/changed that bit correctly (this would show up in git diff as something like `old mode 100644 - new mode ...`).
You can force git to checkout these files again by deleting them and running git checkout ..

I currently cannot reproduce unstaged changes with running Build/Scripts/runTests.sh -s buildJavascript on branch 11.5 any more.
Could you please try again Sybille?

Actions #4

Updated by Sybille Peters about 2 years ago

  • Status changed from Needs Feedback to Closed

@Jonas Eberle

If Build/Scripts/runTests.sh -s buildJavascript works correctly in v11, I think we can close here. I also cannot reproduce the problem I described earlier.

The specifics docs related things can be handled in Contribution Guide and discussed in issues there (see https://github.com/TYPO3-Documentation/TYPO3CMS-Guide-ContributionWorkflow/issues/297).

I think we were a bit premature in merging some PR in the contrib guide but can be revisited.

I am currently not sure how to build assets in various versions. I used to use cd Build;yarn install;yarn build, but it seems that is outdated. But still works for v11 (so only outdated for current main / v12). If you can clarify/confirm that in the issue, that would be helpful.

Actions

Also available in: Atom PDF