Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PN-13228 - Create template generator script #10

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6ed6943
feat: script for generate templates
alessandrogelmi Nov 21, 2024
bce9ca9
feat(PN-13228): update templates folder structure
SarahDonvito Nov 22, 2024
271e232
refactor files txt in template
fbianchicodermine Nov 25, 2024
6d39d88
feat(PN-13228): fix file name
SarahDonvito Nov 25, 2024
9e6a15b
Merge branch 'feat/PN-13228' of github.com:pagopa/pn-templates-engine…
fbianchicodermine Nov 25, 2024
f19bf29
remove pino logger
fbianchicodermine Nov 25, 2024
3cbcf7c
rename it.html -> index_it.html
fbianchicodermine Nov 25, 2024
300247d
remove generated html from mjml
fbianchicodermine Nov 25, 2024
c881c7a
ignore file html from mjml
fbianchicodermine Nov 25, 2024
b98a70d
remove templateName rename for user_attributes
fbianchicodermine Nov 25, 2024
38795c9
exec -> execFile for security github report
fbianchicodermine Nov 25, 2024
2d21378
readme in english
fbianchicodermine Nov 25, 2024
8b41962
remove unused logo
fbianchicodermine Nov 25, 2024
7d04e9d
change node version from 20 to 16
fbianchicodermine Nov 25, 2024
481cf20
feat(PN-13228): fix readme file
SarahDonvito Nov 25, 2024
9896a1f
feat(PN-13228): fix version of node
SarahDonvito Nov 25, 2024
61e403f
rename script command
fbianchicodermine Nov 26, 2024
de25d26
log error in log.error
fbianchicodermine Nov 26, 2024
aaf3f05
remove withFilesTypes in readdir
fbianchicodermine Nov 26, 2024
7999e9b
fix span in title AAR
fbianchicodermine Nov 26, 2024
c713f06
fix span in title
fbianchicodermine Nov 26, 2024
7de9d64
test throw error
fbianchicodermine Nov 26, 2024
d9054f4
rename tests
fbianchicodermine Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/templates-builder/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
test/mock/output/
test/coverage/
1 change: 1 addition & 0 deletions scripts/templates-builder/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
SarahDonvito marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 24 additions & 0 deletions scripts/templates-builder/README.md
SarahDonvito marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Html templates generator

## Requirements

- Node.js v20 or higher
SarahDonvito marked this conversation as resolved.
Show resolved Hide resolved

## Generate script

Per generare i template finali nella cartella output, lanciare il comando:

`npm run build`

Per avere log di debug:

`npm run build -- --debug`

## Test

I test sono eseguiti utilizzando Jest (<https://jestjs.io/>).

`npm run test`

I test generano i template nella cartella `test/mock/output` partendo dai template di test della cartella `test/mock/source`.
Per un rapporto dettagliato del test coverage, aprire nel browser il file `test/coverage/lcov-report/index.html`.
7 changes: 7 additions & 0 deletions scripts/templates-builder/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('jest').Config} */
const config = {
setupFilesAfterEnv: ["<rootDir>/test/setupTests.js", "jest-extended/all"],
coverageDirectory: "<rootDir>/test/coverage/",
};

module.exports = config;
Loading