diff --git a/.dockerignore b/.dockerignore index 71a7d2156..84f3d026b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,6 +15,7 @@ downloads env ## Node +package.json package-lock.json node_modules diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f275fc73..1823f24ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -112,11 +112,14 @@ jobs: if: ${{ matrix.test-case != 'test-docker' }} # install package and dependencies directly, # skip sys/conda setup to use active python - run: make install-sys install-pkg install-pip install-raw install-dev version + run: make install-sys install-pkg install-pip install-raw install-dev install-dev-npm - name: Display Packages # skip python setup if running with docker if: ${{ matrix.test-case != 'test-docker' }} - run: pip freeze + run: | + pip freeze + npm list + make version #- name: Setup Environment Variables # uses: c-py/action-dotenv-to-setenv@v2 # with: diff --git a/.gitignore b/.gitignore index 26ab4333f..b92754eec 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ venv environment.yml ## Node -package.json package-lock.json node_modules diff --git a/.remarkrc b/.remarkrc deleted file mode 100644 index c58b1117c..000000000 --- a/.remarkrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "settings": { - "bullet": "-", - "fence": "`", - "fences": "true", - "listItemIndent": "mixed", - "incrementListMarker": "true", - "resourceLink": "true", - "rule": "-" - }, - "plugins": [ - "remark-gfm", - "remark-preset-lint-markdown-style-guide", - "remark-preset-lint-recommended", - "remark-lint-list-item-content-indent", - "remark-lint-checkbox-content-indent", - ["lint-fenced-code-marker", "`"], - ["lint-list-item-indent", "mixed"], - ["lint-maximum-line-length", 120], - ["lint-ordered-list-marker-style", "."], - ["lint-ordered-list-marker-value", "ordered"], - ["lint-unordered-list-marker-style", "consistent"] - ] -} diff --git a/.stylelintrc.json b/.stylelintrc.json deleted file mode 100644 index 70646326a..000000000 --- a/.stylelintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "stylelint-config-standard", - "ignoreFiles": ["docs/_build/**", "docs/build/**"], - "rules": { - "block-no-empty": null, - "color-no-invalid-hex": true, - "color-hex-case": "upper", - "color-hex-length": "long", - "indentation": [4], - "no-descending-specificity": null - } -} diff --git a/Makefile b/Makefile index c838ed45e..cb2f63e6d 100644 --- a/Makefile +++ b/Makefile @@ -271,33 +271,29 @@ install-raw: ## install without any requirements or dependencies (suppose everyt # install locally to ensure they can be found by config extending them .PHONY: install-npm -install-npm: ## install npm package manager and dependencies if they cannot be found +install-npm: ## install npm package manager and dependencies if they cannot be found @[ -f "$(shell which npm)" ] || ( \ echo "Binary package manager npm not found. Attempting to install it."; \ apt-get install npm \ ) .PHONY: install-npm-stylelint -install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm - @[ `npm ls 2>/dev/null | grep stylelint-config-standard | wc -l` = 1 ] || ( \ +install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm + @[ `npm ls 2>/dev/null | grep stylelint-config-standard | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for CSS checks." && \ - npm install "stylelint@<16" "stylelint-config-standard@<35" --save-dev \ + npm install --save-dev \ ) .PHONY: install-npm-remarklint -install-npm-remarklint: install-npm ## install remark-lint dependency for 'check-md' target using npm - @[ `npm ls 2>/dev/null | grep remark-lint | wc -l` = 1 ] || ( \ +install-npm-remarklint: install-npm ## install remark-lint dependency for 'check-md' target using npm + @[ `npm ls 2>/dev/null | grep remark-lint | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for Markdown checks." && \ npm install --save-dev \ - remark-lint \ - remark-gfm \ - remark-cli \ - remark-lint-maximum-line-length \ - remark-lint-checkbox-content-indent \ - remark-preset-lint-recommended \ - remark-preset-lint-markdown-style-guide \ ) +.PHONY: install-dev-npm +install-dev-npm: install-npm install-npm-remarklint install-npm-remarklint ## install all npm development dependencies + ## -- Cleanup targets ----------------------------------------------------------------------------------------------- ## .PHONY: clean @@ -602,7 +598,7 @@ check-imports-only: mkdir-reports ## check imports ordering and styles check-css-only: mkdir-reports ## check CSS linting @echo "Running CSS style checks..." @npx --no-install stylelint \ - --config "$(APP_ROOT)/.stylelintrc.json" \ + --config "$(APP_ROOT)/package.json" \ --output-file "$(REPORTS_DIR)/check-css.txt" \ "$(APP_ROOT)/**/*.css" @@ -617,7 +613,7 @@ check-md-only: mkdir-reports ## check Markdown linting --inspect --frail \ --silently-ignore \ --stdout --color \ - --rc-path "$(APP_ROOT)/.remarkrc" \ + --rc-path "$(APP_ROOT)/package.json" \ --ignore-path "$(APP_ROOT)/.remarkignore" \ "$(APP_ROOT)" "$(APP_ROOT)/.*/" \ > "$(REPORTS_DIR)/check-md.txt" @@ -692,9 +688,9 @@ fix-fstring-only: mkdir-reports .PHONY: fix-css-only fix-css-only: mkdir-reports ## fix CSS linting problems automatically @echo "Fixing CSS style problems..." - @npx stylelint \ + @npx --no-install stylelint \ --fix \ - --config "$(APP_ROOT)/.stylelintrc.json" \ + --config "$(APP_ROOT)/package.json" \ --output-file "$(REPORTS_DIR)/fixed-css.txt" \ "$(APP_ROOT)/**/*.css" @@ -708,7 +704,7 @@ fix-md-only: mkdir-reports ## fix Markdown linting problems automatically @npx --no-install remark \ --output --frail \ --silently-ignore \ - --rc-path "$(APP_ROOT)/.remarkrc" \ + --rc-path "$(APP_ROOT)/package.json" \ --ignore-path "$(APP_ROOT)/.remarkignore" \ "$(APP_ROOT)" "$(APP_ROOT)/.*/" \ 2>&1 | tee "$(REPORTS_DIR)/fixed-md.txt" diff --git a/package.json b/package.json new file mode 100644 index 000000000..f805786a6 --- /dev/null +++ b/package.json @@ -0,0 +1,77 @@ +{ + "devDependencies": { + "remark-cli": "^12.0.0", + "remark-frontmatter": "^5.0.0", + "remark-gfm": "^4.0.0", + "remark-lint": "^9.1.2", + "remark-lint-checkbox-content-indent": "^4.1.2", + "remark-lint-maximum-line-length": "^3.1.3", + "remark-preset-lint-markdown-style-guide": "^5.1.3", + "remark-preset-lint-recommended": "^6.1.3", + "stylelint": "^15.11.0", + "stylelint-config-standard": "^34.0.0", + "stylelint-scss": "^5.3.2", + "stylelint-csstree-validator": "^3.0.0" + }, + "remarkConfig": { + "settings": { + "bullet": "-", + "fence": "`", + "fences": "true", + "listItemIndent": "mixed", + "incrementListMarker": "true", + "resourceLink": "true", + "rule": "-" + }, + "plugins": [ + "remark-gfm", + "remark-frontmatter", + "remark-preset-lint-markdown-style-guide", + "remark-preset-lint-recommended", + "remark-lint-list-item-content-indent", + "remark-lint-checkbox-content-indent", + [ + "lint-fenced-code-marker", + "`" + ], + [ + "lint-list-item-indent", + "mixed" + ], + [ + "lint-maximum-line-length", + 120 + ], + [ + "lint-ordered-list-marker-style", + "." + ], + [ + "lint-ordered-list-marker-value", + "ordered" + ], + [ + "lint-unordered-list-marker-style", + "consistent" + ] + ] + }, + "stylelint": { + "extends": "stylelint-config-standard", + "ignoreFiles": [ + "docs/_build/**", + "docs/build/**" + ], + "rules": { + "block-no-empty": null, + "color-no-invalid-hex": true, + "color-hex-case": "upper", + "color-hex-length": "long", + "indentation": [ + 4 + ], + "property-no-vendor-prefix": null, + "no-descending-specificity": null + } + } +}