From ec438f5bf03bd2dc0b770dca89262e1f6fa822a2 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 17 Jun 2024 12:27:15 +0200 Subject: [PATCH] Improve tsconfig.json, add Makefile commands --- .../{{ cookiecutter.__folder_name }}/Makefile | 9 +++++++ .../tsconfig.json | 25 ++++++++----------- .../_project_files/Makefile | 9 +++++++ 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile index 9680b36..04f6521 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile @@ -50,6 +50,15 @@ start: ## Starts Volto, allowing reloading of the add-on during development build: ## Build a production bundle for distribution of the project with the add-on pnpm build +core/packages/registry/dist: core/packages/registry/src + pnpm --filter @plone/registry build + +core/packages/components/dist: core/packages/components/src + pnpm --filter @plone/components build + +.PHONY: build-deps +build-deps: core/packages/registry/dist core/packages/components/dist ## Build dependencies + .PHONY: i18n i18n: ## Sync i18n pnpm --filter $(ADDON_NAME) i18n diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/tsconfig.json b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/tsconfig.json index 7bb754d..ddb0f54 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/tsconfig.json +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/tsconfig.json @@ -1,32 +1,29 @@ { "compilerOptions": { - "target": "ESNext", - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "module": "commonjs", - "allowJs": true, - "skipLibCheck": true, "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "strictPropertyInitialization": false, - "moduleResolution": "Node", + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, "resolveJsonModule": true, + "moduleDetection": "force", "isolatedModules": true, + "verbatimModuleSyntax": true, + "module": "preserve", "noEmit": true, + "lib": ["es2022", "dom", "dom.iterable"], "jsx": "react-jsx", "paths": { "@plone/volto/*": ["../../core/packages/volto/src/*"] } }, - "include": ["src", "src/**/*.js"], + "include": ["**/*.ts", "**/*.tsx"], "exclude": [ "node_modules", "build", "public", "coverage", - "src/**/*.test.{js,jsx,ts,tsx}", - "src/**/*.spec.{js,jsx,ts,tsx}", - "src/**/*.stories.{js,jsx,ts,tsx}" + "**/*.test.{js,jsx,ts,tsx}", + "**/*.spec.{js,jsx,ts,tsx}", + "**/*.stories.{js,jsx,ts,tsx}" ] } diff --git a/sub/frontend_project/{{ cookiecutter.__folder_name }}/_project_files/Makefile b/sub/frontend_project/{{ cookiecutter.__folder_name }}/_project_files/Makefile index 73d512a..0d2ff68 100644 --- a/sub/frontend_project/{{ cookiecutter.__folder_name }}/_project_files/Makefile +++ b/sub/frontend_project/{{ cookiecutter.__folder_name }}/_project_files/Makefile @@ -44,6 +44,15 @@ start: ## Starts Volto, allowing reloading of the add-on during development build: ## Build a production bundle for distribution of the project with the add-on pnpm build +core/packages/registry/dist: core/packages/registry/src + pnpm --filter @plone/registry build + +core/packages/components/dist: core/packages/components/src + pnpm --filter @plone/components build + +.PHONY: build-deps +build-deps: core/packages/registry/dist core/packages/components/dist ## Build dependencies + .PHONY: format format: ## Format codebase pnpm lint:fix