From f6bffa446ce6ea06c30511deb263c6f03e10c096 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 7 May 2024 18:21:02 +0200 Subject: [PATCH] Fixes from last month --- .editorconfig | 2 -- .../.eslintrc.js | 20 +++++++++++++++---- .../.release-it.json | 7 ++++++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index 63aa5e6..ccf06cb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,8 +18,6 @@ trim_trailing_whitespace = true charset = utf-8 # Indent style default indent_style = space -# Max Line Length - a hard line wrap, should be disabled -max_line_length = off [*.{py,cfg,ini}] # 4 space indentation diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/.eslintrc.js b/frontend_addon/{{ cookiecutter.__folder_name }}/.eslintrc.js index cb3ce41..49ffa7c 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/.eslintrc.js +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/.eslintrc.js @@ -1,5 +1,14 @@ +const fs = require('fs'); +const projectRootPath = __dirname; + +let coreLocation; +if (fs.existsSync(`${projectRootPath}/core`)) + coreLocation = `${projectRootPath}/core`; +else if (fs.existsSync(`${projectRootPath}/../../core`)) + coreLocation = `${projectRootPath}/../../core`; + module.exports = { - extends: './core/packages/volto/.eslintrc', + extends: `${coreLocation}/packages/volto/.eslintrc`, rules: { 'import/no-unresolved': 1, }, @@ -7,9 +16,12 @@ module.exports = { 'import/resolver': { alias: { map: [ - ['@plone/volto', './core/packages/volto/src'], - ['@plone/volto-slate', './core/packages/volto-slate/src'], - ['@plone/registry', './core/packages/registry/src'], + ['@plone/volto', `${coreLocation}/packages/volto/src`], + [ + '@plone/volto-slate', + `${coreLocation}/core/packages/volto-slate/src`, + ], + ['@plone/registry', `${coreLocation}/packages/registry/src`], [ '{{ cookiecutter.npm_package_name }}', './packages/{{ cookiecutter.frontend_addon_name }}/src', diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json index ccd9061..cdcd359 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json @@ -1,6 +1,11 @@ { "hooks": { - "after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version} && cp ../../README.md ./", + "after:bump": [ + "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", + "pipx run towncrier build --yes --version ${version}", + "cp ../../README.md ./ && cp CHANGELOG.md ../../CHANGELOG.md", + "git add ../../CHANGELOG.md" + ], "after:release": "rm .changelog.draft README.md" }, "git": {