Skip to content

Prepare shinyTZ v0.2.0 for CRAN submission#3

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/prepare-shinytz-for-cran-submission
Draft

Prepare shinyTZ v0.2.0 for CRAN submission#3
Copilot wants to merge 2 commits intomainfrom
copilot/prepare-shinytz-for-cran-submission

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 9, 2026

Summary

This PR prepares the shinyTZ package for CRAN submission by fixing critical bugs, completing the API, adding CI/CD infrastructure, vignettes, and improving test coverage. A detailed implementation plan and decision log is recorded in inst/docs/cran-prep-plan.md.


Critical Bug Fixes

Issue Fix
`%
Three Output functions defined in both datetime-outputs.R AND individual .R files (duplicate exports) Deleted R/dateOutput.R, R/datetimeOutput.R, R/timeOutput.R
NAMESPACE missing all importFrom statements Added @importFrom roxygen tags to all R files; NAMESPACE regenerated
zzz.R missing .onLoad() (resource path not auto-registered on package load) Added .onLoad() to R/zzz.R

DESCRIPTION / Package Metadata

  • Fixed URL and BugReports (now point to Warnes-Innovations/shinyTZ)
  • Removed LazyData: true (no data files → was a CRAN NOTE)
  • Removed unused DBI and dplyr from Suggests
  • Added shinytest2 to Suggests
  • Added Config/testthat/edition: 3
  • Bumped version to 0.2.0

API Consistency

  • renderDate(): added formatter parameter (was missing vs. renderDatetime())
  • renderTime(): added formatter and locale parameters (was missing both)
  • All render functions now have consistent (expr, format, formatter, tz, locale, show_tz, env, quoted) signatures
  • Added @seealso cross-references on all exported functions

CI/CD (all new)

Workflow Description
.github/workflows/R-CMD-check.yaml Cross-platform R CMD check (Ubuntu/macOS/Windows × R-devel/release/oldrel-1)
.github/workflows/test-coverage.yaml Test coverage via covr + Codecov upload
.github/workflows/pkgdown.yaml Build and deploy pkgdown documentation site to gh-pages
.github/copilot-setup-steps.yml Copilot cloud agent pre-install steps

Documentation

  • README: Added CI/Codecov/License badges; fixed useShinyTZ() missing from Quick Start; corrected license reference (GPL-2, not MIT); updated install URL
  • NEWS.md: Added entries for v0.1.1, v0.1.2, v0.2.0 (previously only had v0.1.0)
  • Vignettes (new): vignettes/getting-started.Rmd and vignettes/advanced-usage.Rmd
  • cran-comments.md: Added CRAN submission checklist and policy notes

Tests

New/Updated Test File What It Covers
tests/testthat/test-utils.R `%
tests/testthat/test-useShinyTZ.R useShinyTZ() returns correct tag structure with JS src
tests/testthat/test-render-server.R Render execution with explicit tz override (format strings, timezone conversion, show_tz, custom formatters, invalid timezone fallback)
test-renderDate.R Added formatter parameter test
test-renderTime.R Added formatter and locale parameter tests

Areas for Detailed Review

  1. NAMESPACE (manually updated) — Since devtools::document() could not run in the agent environment, the NAMESPACE was updated by hand. Please verify it is complete and correct by running devtools::document() locally and checking for drift.

  2. renderTime() signature change — Adding formatter and locale before tz changes the positional argument order. Any existing code using positional args for tz or show_tz would silently break. The NEWS.md entry documents this as a breaking change — please confirm this is acceptable for a pre-1.0 package.

  3. .onLoad() resource registration — The zzz.R .onLoad() now calls shiny::addResourcePath() at package load time. This means the resource path is registered even if useShinyTZ() is never called. Please verify this is the desired behavior (no side-effects in non-Shiny contexts).

  4. Test coverage — The test-render-server.R tests call render functions directly without a full Shiny session. They work for explicit tz overrides but do not exercise the browser-timezone detection path. Full shiny::testServer() integration tests would require Shiny ≥ 1.7 to be available in the test environment.

  5. Vignette examples — All vignette code blocks use r fences but are not evaluated (eval = FALSE is the default for Shiny app examples). Consider whether any examples should be run to generate output for the pkgdown site.

Copilot AI and others added 2 commits April 9, 2026 22:31
…PI consistency

- Define %||% operator in R/utils.R for R < 4.4.0 compatibility
- Remove duplicate Output function definitions (dateOutput.R, datetimeOutput.R, timeOutput.R)
- Add importFrom roxygen tags to all R files; regenerate NAMESPACE
- Add .onLoad() to zzz.R for auto resource path registration
- Fix DESCRIPTION: URL/BugReports, LazyData, License, Suggests, version -> 0.2.0
- Add formatter parameter to renderDate(); add formatter+locale to renderTime()
- Add @Seealso cross-references to all exported functions
- Create CI/CD workflows: R-CMD-check, test-coverage, pkgdown
- Add copilot-setup-steps.yml
- Create vignettes: getting-started.Rmd, advanced-usage.Rmd
- Update NEWS.md with v0.1.1, v0.1.2, v0.2.0 entries
- Fix README: add badges, useShinyTZ() in Quick Start, correct license
- Add cran-comments.md
- Add tests: test-utils.R, test-useShinyTZ.R, test-render-server.R
- Update test-renderTime.R and test-renderDate.R for new parameters
- Update .Rbuildignore

Agent-Logs-Url: https://github.com/Warnes-Innovations/shinyTZ/sessions/4fa4fd1c-5a8f-45e2-846b-f3b40445b399

Co-authored-by: warnes <6144863+warnes@users.noreply.github.com>
- Rename ambiguous 'base' variable in advanced-usage vignette
- Add explicit permissions blocks to R-CMD-check and test-coverage workflows
- Improve test-render-server.R comment explaining test approach

Agent-Logs-Url: https://github.com/Warnes-Innovations/shinyTZ/sessions/4fa4fd1c-5a8f-45e2-846b-f3b40445b399

Co-authored-by: warnes <6144863+warnes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants