https://github.com/catalalang/catala-dsfr

Web prototype for automated generation of individual explanations from Catala programs

https://github.com/catalalang/catala-dsfr

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

catala dsfr french-benefits react-dsfr rescript rescript-bindings rescript-react simulator
Last synced: 5 months ago · JSON representation

Repository

Web prototype for automated generation of individual explanations from Catala programs

Basic Info
Statistics
  • Stars: 1
  • Watchers: 6
  • Forks: 0
  • Open Issues: 6
  • Releases: 0
Topics
catala dsfr french-benefits react-dsfr rescript rescript-bindings rescript-react simulator
Created about 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

Catala DFSR

Report BugWebsite

Source code for the web demo about automated generation of individual explanations of [Catala](https://catala-lang.org) programs hosted at [https://code.gouv.fr/demos/catala](https://code.gouv.fr/demos/catala/).

This project is built on top of the following libraries:

Local dev

```

Install dependencies

yarn

Start a local dev server

yarn dev ```

[!WARNING] When adding modifications to the Rescript files, if you start seeing errors like that in your yarn dev output:

14:28:30 [vite] hmr invalidate /src/components/Form.bs.js Could not Fast Refresh.

That means that the fast reload isn't working properly. To avoid that, each ReScript file must export only one React component. You can hide internal code by providing an interface file that only exports the component you want to use.

Generally, you should always have an inteface file (.resi) for each implementation file (.res) to speed up incremental build.

Using local packages

If you want to use one of the @catala-lang packages from your local machine instead of the published version, you can use yarn link to link them to this project.

```

In the library you want to link

yarn link

In this project

yarn link @catala-lang/ ```

[!IMPORTANT] But then some shenanigans will appear. First, there might be duplicate dependencies between catala-dsfr and the linked dependencies. These duplicates will show as error messages so you know which they are. To remove the dependency duplication, you should link the version of the duplicate dependency in catala-dsfr/node_modules/<duplicate-library-name> and make sure @catala-lang/<library-name> uses it with yarn link <duplicate-library-name> in the local folder of @catala-lang/<library-name>.

Now that the links are OK, you have to tell vite to watch for the changes in the dependencies to have reloading work. For that, follow the instructions to modify vite.config.ts in catala-dsfr here. At last, don't forget to run yarn watch in the local folder of @catala-lang/<library-name>, so that the modifications in the Rescript files are watched and compiled to modifications to JS files that vite can pick up.

Versioned assets

Multiple versions of @catala-lang/catala-web-assets and @catala-lang/french-law are used in this project.

In the assets-versions.json file is defined the list of versions available. Each version is defined by a pair of versions for each package (one for the web assets and one for the french law library) and named with the corresponding date.

To add a new version

To add a new version of the assets, you need to use the yarn aliases:

```bash

For @catala-lang/catala-web-assets

yarn add @catala-lang/catala-web-assets-@npm:@catala-lang/catala-web-assets@

For @catala-lang/french-law

yarn add @catala-lang/french-law-@npm:@catala-lang/french-law@ ```

[!TIP] The latest version of the @catala-lang/catala-web-assets package and the @catala-lang/french-law package are automatically updated with the ./update-assets.sh (yarn assets) script run before yarn build and yarn dev. Consequently, you don't need to manually update the version of the packages in the package.json file.

[!IMPORTANT] For now, if a new version of one of the packages is added, you need to manually update the assets-versions.json file with the new version.

diff { "available": [ + { + "name": "<date>", + "french-law": "<latest-version>" + "catala-web-assets": "<latest-version>", + }, ] }

Using local assets

If you want to use @catala-lang/french-law (resp. @catala-lang/catala-web-assets) from your local machine instead of the published version, you can use yarn link to link them to this project.

[!IMPORTANT] See the Using local packages section for more information about how to link local packages.

Then, add the new version in assets-versions.json with the local version.

diff { "available": [ + { + "name": "local", # or whatever name you want to give to the version + "french-law": "local" + "catala-web-assets": "<latest-version>", + }, ] }

Build for production and deploy

To test before deploy

```

Build for production

yarn build

Locally preview the production build

yarn serve ```

To deploy

```

Build for production and rsync files to the (could be a ssh address)

yarn deploy ```

Sponsors

This library has been developed during a research project funded by the mission logiciels libres et communs numériques of the direction interministérielle du numérique in collaboration with the Catala project.

Owner

  • Name: CatalaLang
  • Login: CatalaLang
  • Kind: organization

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 189
  • Total Committers: 2
  • Avg Commits per committer: 94.5
  • Development Distribution Score (DDS): 0.032
Past Year
  • Commits: 11
  • Committers: 2
  • Avg Commits per committer: 5.5
  • Development Distribution Score (DDS): 0.091
Top Committers
Name Email Commits
Emile Rolley e****y@t****o 183
Denis Merigoux d****x@g****m 6
Committer Domains (Top 20 + Academic)
tuta.io: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 9
  • Total pull requests: 13
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 19 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.44
  • Average comments per pull request: 0.54
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 24 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • EmileRolley (6)
Pull Request Authors
  • EmileRolley (13)
Top Labels
Issue Labels
bug (4) enhancement (2) documentation (1)
Pull Request Labels
enhancement (7) bug (1)

Dependencies

package.json npm
  • @catala-lang/catala-web-assets ^0.8.0-b development
  • @jihchi/vite-plugin-rescript ^5.1.0 development
  • @originjs/vite-plugin-commonjs ^1.0.3 development
  • @rescript/core ^0.3.1 development
  • @vitejs/plugin-react ^3.1.0 development
  • autoprefixer ^10.4.13 development
  • gentype ^4.5.0 development
  • jsdom ^21.1.0 development
  • tailwindcss ^3.2.6 development
  • vite ^4.1.1 development
  • @catala-lang/french-law ^0.8.1
  • @catala-lang/rescript-catala ^0.8.0
  • @codegouvfr/react-dsfr ^0.52.1
  • @rescript/react ^0.11.0
  • @rjsf/core ^5.1.0
  • @rjsf/utils ^5.1.0
  • @rjsf/validator-ajv8 ^5.1.0
  • react ^18.2.0
  • react-dom ^18.2.0
  • rescript ^10.1.2
yarn.lock npm
  • 322 dependencies