Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
^cran-comments\.md$
^CRAN-SUBMISSION$
^\.claude$
^CLAUDE\.md$
^\.Rhistory$
^\.positai$
281 changes: 0 additions & 281 deletions .Rhistory

This file was deleted.

76 changes: 76 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# CLAUDE.md

Guidance for working in the **DT2** repository.

## What this package is

DT2 is an `htmlwidgets` binding for **DataTables v2** (the JS library by SpryMedia).
It configures DataTables via plain R lists (1:1 with the JS API), with modular
extension loading, Bootstrap 5 styling, and Shiny integration (proxy, events,
inline inputs, server-side processing). Written from scratch for the v2 API —
not a fork of the `DT` package.

- R code: `R/` · JS runtime: `inst/htmlwidgets/dt2.js` · bundled libs: `inst/htmlwidgets/lib/`
- Vignettes: `vignettes/` · built site: `docs/` (gitignored, see below)

## Common commands

```r
# load for interactive dev / run a quick check
pkgload::load_all(".")

# regenerate Rd from roxygen (package uses roxygen2 8 — Config/roxygen2/version)
roxygen2::roxygenise()

# tests (testthat edition 3)
testthat::test_dir("tests/testthat")

# full check (clean: 0/0/0)
devtools::check(args = "--as-cran")

# CRAN pre-submission (results emailed to maintainer)
devtools::check_win_devel(); devtools::check_win_release()
```

## Conventions / gotchas

- **roxygen2 8**: version is recorded in `Config/roxygen2/version` (no `RoxygenNote`).
Run `roxygenise()` after changing any `#'` block. Build with the system R
(`Rscript`/`R CMD`), which is R 4.6 here.
- **`options$columns` is the name→index map.** Name-based helpers
(`dt2_cols_*`, `dt2_format_*`, `dt2_order`, ...) resolve names against
`options$columns`. The user must set `opts <- list(columns = names(df))`
*before* calling them; `dt2()` injects it from the data, but that runs after
the helpers. Resolution is centralized in `.dt2_name_to_idx()` (`R/dt2_utils.R`),
which **warns** on unresolved names instead of returning silent `NA`.
- **Generated JS must be quote-safe.** Use `.dt2_js_str()` (jsonlite) to build
JS string literals, never `sprintf("'%s'", x)`.
- **SSP query strings:** `dt2.js` encodes query-string *keys* with
`encodeURIComponent`, so the server parser (`.dt2_parse_ssp_request`) must
URL-decode keys, not just values.
- **CRAN is live:** DT2 is on CRAN. Public API is frozen — do not remove
exported functions; cross-link/deprecate instead.

## pkgdown site (`docs/`)

- The site theme uses **`tidytemplate`** (NOT on CRAN). Install before building:
`pak::pak("tidyverse/tidytemplate")`.
- `docs/` is in `.gitignore` but the tracked site is **force-committed**. To
rebuild and commit:
1. `R CMD INSTALL .` then `pkgdown::build_site(install = FALSE)`
2. delete orphaned versioned asset dirs (old `dt2-binding-*`, old `bootstrap-*`)
3. `git add -f docs/`, then unstage every `.DS_Store`
- `_pkgdown.yml` has a curated grouped `reference:` index — keep it in sync with
`NAMESPACE` exports (every export must appear exactly once or pkgdown errors).

## Release flow (followed for 0.1.2)

Bump `DESCRIPTION` Version+Date → update `NEWS.md` → update `cran-comments.md`
→ `check(--as-cran)` + win-builder devel/release → rebuild site → publish GitHub
release/tag `vX.Y.Z` (`gh release ...`) → `devtools::submit_cran()` (maintainer
runs this; CRAN confirmation is emailed).

## House rules in this repo

- Never stage `.DS_Store` or `.Rhistory` (they show as modified but are noise).
- Branch per change + PR + merge; reference issues with `Closes #N`.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.1
Date: 2026-04-29 17:40:56 UTC
SHA: da1c22281b59b3c8d60f33abb4cc1de8a5284390
Version: 0.1.2
Date: 2026-06-13 23:44:56 UTC
SHA: ee47dc3fb6b625f3416a23e6c9e0a302f4591fb2
Binary file removed docs/.DS_Store
Binary file not shown.
Binary file removed docs/deps/.DS_Store
Binary file not shown.
Binary file removed docs/reference/.DS_Store
Binary file not shown.
Binary file removed inst/.DS_Store
Binary file not shown.
Loading