{"id":14068160,"url":"https://github.com/RinteRface/charpente","last_synced_at":"2025-07-30T02:33:12.483Z","repository":{"id":46587189,"uuid":"292543460","full_name":"RinteRface/charpente","owner":"RinteRface","description":"Seamlessly design robust 'shiny' extensions","archived":false,"fork":false,"pushed_at":"2024-07-18T15:08:33.000Z","size":4982,"stargazers_count":52,"open_issues_count":8,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-29T21:39:35.741Z","etag":null,"topics":["css","development","esbuild","html","javascript","r","shiny"],"latest_commit_sha":null,"homepage":"https://rinterface.github.io/charpente/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RinteRface.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-03T10:56:15.000Z","updated_at":"2025-03-21T23:56:32.000Z","dependencies_parsed_at":"2024-08-13T07:24:04.623Z","dependency_job_id":null,"html_url":"https://github.com/RinteRface/charpente","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/RinteRface/charpente","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinteRface%2Fcharpente","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinteRface%2Fcharpente/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinteRface%2Fcharpente/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinteRface%2Fcharpente/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RinteRface","download_url":"https://codeload.github.com/RinteRface/charpente/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinteRface%2Fcharpente/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267798625,"owners_count":24145727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","development","esbuild","html","javascript","r","shiny"],"created_at":"2024-08-13T07:05:59.462Z","updated_at":"2025-07-30T02:33:12.164Z","avatar_url":"https://github.com/RinteRface.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\n# charpente \u003cimg src=\"https://rinterface.com/inst/images/charpente.png\" width=\"200px\" align=\"right\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/RinteRface/charpente/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RinteRface/charpente/actions/workflows/R-CMD-check.yaml)\n[![CRAN status](https://www.r-pkg.org/badges/version/charpente)](https://CRAN.R-project.org/package=charpente)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\u003c!-- badges: end --\u003e\n\nThe goal of `{charpente}` is to significantly reduce the complexity of creating new HTML templates for Shiny:\n\n  - `{charpente}` creates a plug and play package structure.\n  - `{charpente}` automatically import dependencies from [jsdelivr](https://www.jsdelivr.com/), so that you don't have to do it by hand! \n  - `{charpente}` eases the conversion from HTML to R.\n  - `{charpente}` offers multiple R and JS boilerplate for `{shiny}` input bindings, `{shiny}` message handlers, ...\n  - `{charpente}` enables seamless JavaScript code management (powered by [esbuild](https://esbuild.github.io/)): concat, compress, mangle, bundle, minify, ... for JS and\n  Sass code. \n\n\n## Installation\n\nYou can install the development version of `{charpente}` from Github with:\n\n``` r\n# latest version\nremotes::install_github(\"RinteRface/charpente\")\n```\n\n## Example\n\nThis is a basic example which shows you how to solve a common problem:\n\n``` r\nlibrary(charpente)\n\npath \u003c- file.path(tempdir(), \"mypkg\")\ncreate_charpente(path, license = \"mit\")\n\n# Once the package is created and opened\n\n# Look for all bulma flavors\nget_dependency_versions(\"bulma\")\n# Get latest stable\nget_dependency_versions(\"bulma\", latest = TRUE)\n# Inspect bulma\nget_dependency_assets(\"bulma\")\n\n# Download bulma locally\ncreate_dependency(\"bulma\")\ndevtools::load_all()\n# Test the newly added dependencies tools\nfindDependencies(add_bulma_deps(div()))\n\n# Create JS handler\ncreate_custom_handler(\"modal\")\n\n# Create input binding\ncreate_input_binding(\"myinput\")\n\n# Create output binding\ncreate_output_binding(\"myoutput\")\n\n# Compress JS and CSS (Sass) for production\nbuild_js()\ndevtools::load_all()\n```\n\n## Using esbuild and mocha\n\nIf you want to use `esbuild` and `mocha` in an existing project, you can use the functions `set_esbuild()` and `set_mocha()`. A simple workflow looks as follows:\n\n```r\n# Setup esbuild for JS code management\nset_esbuild()\n\n# Add mocha for tests\nset_mocha()\n```\n\n## Monolithic and component based bundling\n\n`{charpente}` offers two ways of bundling your JS code: monolithic and component based. The monolithic bundling is the default one and is the simplest to use. It will bundle all your JS and CSS code into single files. By default, the entry point is `/scrjs/main.js`, which will also be created when setting esbuild for the first time with `set_esbuid()`. In this case bundling is easy and can be achieved with:\n\n```r\nbuild_js()\n```\n\nComponent based bundling might be convenient in situations where you want to create a bundle for each (standalone) component. Bundling per component will make sure that only the necessary assets are loaded. This is particularly useful when you want to create a package with multiple components, and not a complete template. To use component based bundling, you can specify multiple `entry_points` in `build_js()`. \n\nFor the below structure in the /srcjs folder:\n\n```\nsrcjs\n├── component1.js\n└── component2.js\n```\n\nYou can build as follows:\n\n```r\nbuild_js(entry_points = c(\"component1.js\", \"component2.js\"))\n```\n\nCSS styles for each component can be loaded in the js files with `import` statements, e.g. `import \"../styles/component1.scss\";`. \n\nYou JS code will be bundled into `/inst/{package-name}-{version}/`. Dependencies for your HTML are automatically created in `R/{package-name}-dependencies.R`. There will be only one HTML dependency in case of monolithic building, and multiple in case of component based building.\n\n## Acknowledgment \nThe author would like to warmly thank [Victor Perrier](https://twitter.com/_pvictorr?lang=fr), \n[John Coene](https://twitter.com/jdatap), [Colin Fay](https://twitter.com/_ColinFay), [Alan Dipert](https://twitter.com/alandipert), [Kenton Russel](https://twitter.com/timelyportfolio) for providing many building block and inspiration to this package. \n\n## Code of Conduct\n  \n  Please note that the `{charpente}` project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). \n  By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRinteRface%2Fcharpente","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRinteRface%2Fcharpente","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRinteRface%2Fcharpente/lists"}