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

Merged
merged 23 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 21 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
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ build/
.vscode/
.history
.vscode
target
target

### Template Builder ###
templates-assets/templates/Mail_VerificationCodeBody/index.html
templates-assets/templates/PEC_ValidationContactsRejectBody/index.html
templates-assets/templates/PEC_ValidationContactsSuccessBody/index.html
templates-assets/templates/PEC_VerificationCodeBody/index.html
templates-assets/templates/NotificationAARForEMAIL/index.html
templates-assets/templates/NotificationAARForPEC/index.html
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 @@
v16
28 changes: 28 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,28 @@
# HTML Templates Generator

## Requirements

- Node.js v16

## Generate Script

Install all the dependencies listed in the package.json file

`npm ci`

To generate the final templates in the output folder, run the command:

`npm run generate`

For debug logs:

`npm run generate -- --debug`

## Test

Tests are executed using Jest (<https://jestjs.io/>).

`npm run test`

The tests generate the templates in the `test/mock/output` folder starting from the test templates in the `test/mock/source` folder.
For a detailed test coverage report, open the file `test/coverage/lcov-report/index.html` in the browser.
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