diff --git a/Resources/Private/.eslintignore b/.eslintignore similarity index 100% rename from Resources/Private/.eslintignore rename to .eslintignore diff --git a/Resources/Private/.eslintrc.json b/.eslintrc.json similarity index 100% rename from Resources/Private/.eslintrc.json rename to .eslintrc.json diff --git a/.gitattributes b/.gitattributes index 6349f56..75f3a26 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb43592..2b4c156 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" diff --git a/.github/workflows/predefined.yml b/.github/workflows/predefined.yml index 39b3390..070d5b9 100644 --- a/.github/workflows/predefined.yml +++ b/.github/workflows/predefined.yml @@ -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" diff --git a/.gitignore b/.gitignore index 53ad3a3..4464c08 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.gitlab/pipeline/jobs/.default-frontend.yml b/.gitlab/pipeline/jobs/.default-frontend.yml index 13e1713..6523ca5 100644 --- a/.gitlab/pipeline/jobs/.default-frontend.yml +++ b/.gitlab/pipeline/jobs/.default-frontend.yml @@ -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 diff --git a/Resources/Private/.prettierrc.js b/.prettierrc.js similarity index 71% rename from Resources/Private/.prettierrc.js rename to .prettierrc.js index 2c66e64..909b554 100644 --- a/Resources/Private/.prettierrc.js +++ b/.prettierrc.js @@ -2,6 +2,5 @@ module.exports = { semi: true, trailingComma: "all", singleQuote: true, - printWidth: 120, - tabWidth: 4 + printWidth: 120 }; diff --git a/CHANGELOG.md b/CHANGELOG.md index f90128d..2a21a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Resources/Public/JavaScript/Main.js b/Resources/Public/JavaScript/Main.js index dfc0c10..f927e08 100644 --- a/Resources/Public/JavaScript/Main.js +++ b/Resources/Public/JavaScript/Main.js @@ -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]); diff --git a/composer.json b/composer.json index 43565e8..751671b 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/Resources/Private/package.json b/package.json similarity index 58% rename from Resources/Private/package.json rename to package.json index bcab59d..395fa57 100644 --- a/Resources/Private/package.json +++ b/package.json @@ -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", diff --git a/Resources/Private/stylelint.config.js b/stylelint.config.js similarity index 100% rename from Resources/Private/stylelint.config.js rename to stylelint.config.js