mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-03 18:36:12 +01:00

[TASK] Move npm tools and config to default places (#445)

- Move npm tools and config to default places
- Remove now unnecessary config file parameter from npm scripts
- editorconfig and eslint config contradict, adapt editorconfig
- switch JS indent linting to TYPO3 coding standard of 2 spaces
- adapt composer scripts for new npm location
This commit is contained in:
jpmschuler 2022-05-18 17:17:45 +02:00 committed by GitHub
parent 71a08a1c20
commit 518bae014e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 27 additions and 38 deletions

10
.gitattributes vendored
View file

@ -1,21 +1,21 @@
/.Build/ export-ignore
/.ddev/ export-ignore
/.editorconfig export-ignore
/.eslintignore export-ignore
/.eslintrc.json export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitlab/ export-ignore
/.php-cs-fixer.php export-ignore
/.phpstorm.meta.php export-ignore
/Resources/Private/.eslintignore export-ignore
/Resources/Private/.eslintrc.json export-ignore
/Resources/Private/.prettierrc.js export-ignore
/Resources/Private/package.json export-ignore
/Resources/Private/stylelint.config.js export-ignore
/.prettierrc.js export-ignore
/Tests/ export-ignore
/codeception.yml export-ignore
/package.json export-ignore
/phive.xml export-ignore
/phpcs.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/stylelint.config.js export-ignore
/tools/ export-ignore binary

View file

@ -84,10 +84,8 @@ jobs:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install modules"
working-directory: ./Resources/Private
run: yarn
- name: "Run command"
working-directory: ./Resources/Private
run: "yarn lint:${{ matrix.command }}"
xliff-lint:
name: "Xliff linter"

View file

@ -137,10 +137,8 @@ jobs:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install modules"
working-directory: ./Resources/Private
run: yarn
- name: "Run command"
working-directory: ./Resources/Private
run: "yarn lint:${{ matrix.command }}"
xliff-lint:
name: "Xliff linter"

8
.gitignore vendored
View file

@ -3,12 +3,12 @@
/.php-cs-fixer.cache
/.phpunit.result.cache
/Documentation-GENERATED-temp/
/Resources/Private/node_modules/
/Resources/Private/package-lock.json
/Resources/Private/yarn-error.log
/Resources/Private/yarn.lock
/build
/clover.xml
/composer.lock
/nbproject
/node_modules/
/package-lock.json
/var
/yarn-error.log
/yarn.lock

View file

@ -7,6 +7,4 @@
- Resources/Private/node_modules/
- Resources/Private/.yarn
before_script:
- npm install -g eslint
- cd ./Resources/Private
- yarn install --cache-folder .yarn

View file

@ -2,6 +2,5 @@ module.exports = {
semi: true,
trailingComma: "all",
singleQuote: true,
printWidth: 120,
tabWidth: 4
printWidth: 120
};

View file

@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Use Coveralls for the code coverage (#425)
### Changed
- Move npm tools and config to default locations (#444)
- Use the TYPO3 Code of Conduct (#430)
### Deprecated

View file

@ -10,7 +10,7 @@ TYPO3.tea.makeSortable = function (table) {
while (--i >= 0)
(function (i) {
var dir = 1;
th[i].addEventListener("click", function () {
th[i].addEventListener('click', function () {
TYPO3.tea.sortTable(table, i, (dir = 1 - dir));
});
})(i);
@ -22,18 +22,13 @@ TYPO3.tea.sortTable = function (table, col, reverse) {
i;
reverse = -(+reverse || -1);
tr = tr.sort(function (a, b) {
return (
reverse *
a.cells[col].textContent
.trim()
.localeCompare(b.cells[col].textContent.trim())
);
return reverse * a.cells[col].textContent.trim().localeCompare(b.cells[col].textContent.trim());
});
for (i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
};
document.addEventListener("DOMContentLoaded", function () {
var t = document.querySelectorAll(".tx-tea table"),
document.addEventListener('DOMContentLoaded', function () {
var t = document.querySelectorAll('.tx-tea table'),
i = t.length;
while (--i >= 0) {
TYPO3.tea.makeSortable(t[i]);

View file

@ -122,7 +122,7 @@
"ci:dynamic": [
"@ci:tests"
],
"ci:json:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.json' | xargs -r php .Build/vendor/bin/jsonlint -q",
"ci:json:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -name '*.json' | xargs -r php .Build/vendor/bin/jsonlint -q",
"ci:php": [
"@ci:php:copypaste",
"@ci:php:cs-fixer",
@ -153,7 +153,7 @@
"ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/vendor/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml {}';",
"ci:tests:unit": ".Build/vendor/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit",
"ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript",
"ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.yml' | xargs -r php ./.Build/vendor/bin/yaml-lint",
"ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -name '*.yml' | xargs -r php ./.Build/vendor/bin/yaml-lint",
"coverage:create-directories": "mkdir -p build/logs .Build/coverage",
"docs:generate": [
"docker run --rm t3docs/render-documentation show-shell-commands > tempfile.sh; echo 'dockrun_t3rd makehtml' >> tempfile.sh; bash tempfile.sh; rm tempfile.sh"
@ -180,11 +180,11 @@
"rm .editorconfig",
"rm .gitattributes",
"rm .php-cs-fixer.php",
"rm Resources/Private/.eslintignore",
"rm Resources/Private/.eslintrc.json",
"rm Resources/Private/.prettierrc.js",
"rm Resources/Private/package.json",
"rm Resources/Private/stylelint.config.js",
"rm .eslintignore",
"rm .eslintrc.json",
"rm .prettierrc.js",
"rm package.json",
"rm stylelint.config.js",
"rm codeception.yml",
"rm phive.xml",
"rm phpstan-baseline.neon",

View file

@ -1,6 +1,6 @@
{
"name": "tea",
"description": "",
"description": "npm helper tools used for the extension",
"repository": {
"url": "https://github.com/TYPO3-Documentation/tea.git"
},
@ -9,10 +9,10 @@
"version": "1.0.0",
"license": "ISC",
"scripts": {
"lint:js": "eslint --config .eslintrc.json '../Public/**/*.js'",
"lint:js:fix": "eslint --config .eslintrc.json '../Public/**/*.js' --quiet --fix",
"lint:style": "stylelint --config stylelint.config.js ../Public/**/*.css",
"lint:style:fix": "stylelint --config stylelint.config.js ../Public/**/*.css --fix"
"lint:js": "eslint 'Resources/Public/**/*.js'",
"lint:js:fix": "eslint 'Resources/Public/**/*.js' --quiet --fix",
"lint:style": "stylelint Resources/Public/**/*.css",
"lint:style:fix": "stylelint Resources/Public/**/*.css --fix"
},
"devDependencies": {
"eslint": "^6.8.0",