Giter Club home page Giter Club logo

pn-frontend's Introduction

SEND - Servizio Notifiche Digitali

Start

In project root run

yarn install

If you get an authentication error, please use this command: yarn config set "strict-ssl" false -g

Starting applications

  • yarn start:pf to start app for citizens in local
  • yarn start:pa to start app for public administration in local
  • yarn start:login to start the login section for citizens in local (url: localhost:3000)
  • yarn start:landing to start landing site in local (url: localhost:3000)

You can also run yarn start in the relative package folder:

cd packages/<package-folder>
yarn start

To run test for all packages yarn test

To build all the monorepo yarn build

Other scripts

  • yarn refresh:monorepo reinstalls all the dependencies of the whole workspace
  • yarn clean:win or yarn clean:nx deletes node_modules folder in the workspace (use win in you use Windows OS or nx if you use linux-based OS)

Lerna

This project uses lerna and craco These tools allow to handle a monorepo with multiple webapps which share common components. The content of monorepo is:

  • packages/pn-commons component-library for SEND
  • packages/pn-validator utility library to perform validation tasks on custom schemas
  • packages/pn-pa-webapp app for public administration
  • packages/pn-personafisica-webapp app for citizens
  • packages/pn-personafisica-login login section for citizen app
  • packages/pn-landing-webapp landing site for SEND

https://medium.com/geekculture/setting-up-monorepo-with-create-react-app-cb2cfa763b96

Sonar

You can run a task analysis with sonar-scanner using this script in each package

  • yarn sonar To run it locally, you need to add env variable SONAR_TOKEN which contains the token of the project. The analysis will bel available here

Version

Use yarn run version from branch main to tag a new version of the project and generate the relative changelog. This script uses lerna version. To generate a consistent changelog, we use conventional-commit

The tool automatically detects the modified packages starting from the previous version and then executes git commit and tag.

Examples:

  • yarn run version 1.0.1 to directly specify a version number
  • yarn run version patch to update the project according SemVer mode
  • yarn run version to make choices from prompt

When you have chosen desired version, you can end the procedure with git push origin --tags which will push the new tag.

For more details and options, please visit github

Cypress

To make tests in local with Cypress, make sure the app is running (in local too).

To start the tool with GUI support, execute this command:

  • yarn cy-open:pf from root project or yarn cy-open from package root.

To execute all the tests from command line, just replace open with run (ie: yarn cy-run:pf)

to get a valid session to make tests where auth is required, you can use the custom command cy.login() which programmatically makes login and it's more performing than cy.loginWithUI() (used only to test login steps via UI).

To use login commands you have to create an env file on the root of package and follow instructions found on configuration section in Confluence.

At this time, command login doesn't allow to specify which user to use. This will be done when a test environment for e2e will be available.

pn-frontend's People

Contributors

zorbadimatteo avatar andreacimini90 avatar carladimatteo avatar nicolagiornetta avatar lorenzococciarelli avatar maurizioflauti avatar clombardi avatar andriboca avatar marco-vit-pagopa avatar dependabot[bot] avatar fdammassa avatar leleofa avatar vincenzoliberti avatar kamokg avatar mturrappa avatar alessiobiasutto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.