Skip to content

Commit bab4553

Browse files
committed
Merge branch 'main' into bookmark
* main: chore(r): Fix readme logo chore: Update new R package link chore: add recommended extensions chore: fix logo chore: Add a README chore: remove unused scripts ci(quartodoc): Builds API docs in CI docs: metadata on index/404 pages docs: Add custom 404 page docs: Remove redirects docs: Fixup redirects ci(pkgdown): Run when `pkgdown.yaml` changes ci(docs): Need `contents: write` permissions ci(quartodoc): Needs read permissions ci(quartodoc): Use `quarto` binary to render quarto in CI ci(verify-js-built): Only check if JS files change ci(quartodoc): Just install all extras here too Reorganize `shinychat` into a monorepo (#56)
2 parents 0a8889b + 19adb1a commit bab4553

File tree

173 files changed

+14909
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+14909
-499
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
on:
44
push:
55
branches: [main, master]
6+
paths:
7+
- 'pkg-r/**'
8+
- '.github/workflows/R-CMD-check.yaml'
69
pull_request:
10+
paths:
11+
- 'pkg-r/**'
12+
- '.github/workflows/R-CMD-check.yaml'
713

814
name: R-CMD-check.yaml
915

@@ -44,8 +50,10 @@ jobs:
4450
with:
4551
extra-packages: any::rcmdcheck
4652
needs: check
53+
working-directory: pkg-r
4754

4855
- uses: r-lib/actions/check-r-package@v2
4956
with:
57+
working-directory: pkg-r
5058
upload-snapshots: true
5159
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
on:
44
push:
55
branches: [main, master]
6+
paths:
7+
- 'pkg-r/man'
8+
- 'pkg-r/vignettes'
9+
- 'pkg-r/pkgdown'
10+
- '.github/workflows/pkgdown.yaml'
611
pull_request:
12+
paths:
13+
- 'pkg-r/man'
14+
- 'pkg-r/vignettes'
15+
- 'pkg-r/pkgdown'
16+
- '.github/workflows/pkgdown.yaml'
717
release:
818
types: [published]
919
workflow_dispatch:
1020

1121
name: pkgdown.yaml
1222

13-
permissions: read-all
23+
permissions:
24+
contents: write
1425

1526
jobs:
1627
pkgdown:
@@ -35,10 +46,10 @@ jobs:
3546
with:
3647
extra-packages: any::pkgdown, local::.
3748
needs: website
49+
working-directory: pkg-r
3850

3951
- name: Build site
40-
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41-
shell: Rscript {0}
52+
run: make r-docs
4253

4354
- name: Deploy to GitHub pages 🚀
4455
if: github.event_name != 'pull_request'

.github/workflows/py-check.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: py-check.yaml
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'pkg-py/**/*'
8+
- 'pyproject.toml'
9+
- '.github/workflows/py-check.yaml'
10+
pull_request:
11+
paths:
12+
- 'pkg-py/**/*'
13+
- 'pyproject.toml'
14+
- '.github/workflows/py-check.yaml'
15+
16+
permissions:
17+
contents: read
18+
19+
env:
20+
UV_VERSION: "0.7.x"
21+
22+
jobs:
23+
py-test:
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
python-version:
29+
- "3.9"
30+
- "3.10"
31+
- "3.11"
32+
- "3.12"
33+
- "3.13"
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: 🚀 Install uv
39+
uses: astral-sh/[email protected]
40+
with:
41+
version: ${{ env.UV_VERSION }}
42+
43+
- name: 🐍 Set up Python ${{ matrix.python-version }}
44+
run: uv python install ${{ matrix.python-version }}
45+
46+
- name: 📦 Install the project
47+
run: uv sync --python ${{ matrix.python-version }} --all-extras
48+
49+
- name: 📜 Show uv.lock
50+
run: cat uv.lock
51+
52+
- name: 🧪 Check tests
53+
run: make py-check-tests
54+
55+
- name: 📝 Check types
56+
run: make py-check-types
57+
58+
- name: 📐 Check formatting
59+
run: make py-check-format

.github/workflows/py-release.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: py-release.yaml
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
UV_VERSION: "0.7.x"
9+
PYTHON_VERSION: 3.13
10+
11+
jobs:
12+
py-release:
13+
name: Build and release Python package
14+
runs-on: ubuntu-latest
15+
16+
# Python release tags start with "py/v*"
17+
if: startsWith(github.ref, 'refs/tags/py/v')
18+
19+
environment:
20+
name: pypi
21+
url: https://pypi.org/project/shinychat/
22+
23+
permissions: # for trusted publishing
24+
id-token: write
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: 🚀 Install uv
30+
uses: astral-sh/setup-uv@v3
31+
with:
32+
version: ${{ env.UV_VERSION }}
33+
34+
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
35+
run: uv python install ${{ env.PYTHON_VERSION }}
36+
37+
- name: 📦 Install the project
38+
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras
39+
40+
- name: 🧪 Check tests
41+
run: make py-check-tests
42+
43+
- name: 📝 Check types
44+
run: make py-check-types
45+
46+
- name: 📐 Check formatting
47+
run: make py-check-format
48+
49+
- name: 🧳 Build package
50+
run: uv build
51+
52+
# TODO: https://pypi.org/manage/project/shinychat/settings/publishing/
53+
- name: 🚢 Publish release on PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/quartodoc.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
paths:
6+
- "docs/**/*"
7+
- "pkg-py/**/*"
8+
- .github/workflows/quartodoc.yaml
9+
workflow_dispatch:
10+
11+
name: quartodoc.yaml
12+
13+
permissions:
14+
contents: write
15+
16+
env:
17+
UV_VERSION: "0.7.x"
18+
PYTHON_VERSION: 3.13
19+
QUARTO_VERSION: 1.7.31
20+
21+
jobs:
22+
docs-publish:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # full history needed for correct versioning of py pkg
30+
31+
- name: 🔵 Set up Quarto
32+
uses: quarto-dev/quarto-actions/setup@v2
33+
with:
34+
version: ${{ env.QUARTO_VERSION }}
35+
36+
- name: 🚀 Install uv
37+
uses: astral-sh/[email protected]
38+
with:
39+
version: ${{ env.UV_VERSION }}
40+
41+
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
42+
run: uv python install ${{ env.PYTHON_VERSION }}
43+
44+
- name: 📦 Install shinychat and dependencies
45+
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras
46+
47+
- name: 🔌 Activate venv
48+
run: |
49+
source .venv/bin/activate
50+
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
51+
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
52+
53+
- name: 🏭 Update Python docs
54+
run: |
55+
make py-docs-api
56+
quarto render pkg-py/docs
57+
58+
- name: 🚢 Deploy to GitHub pages
59+
if: github.event_name != 'pull_request'
60+
uses: JamesIves/[email protected]
61+
with:
62+
clean: false
63+
folder: docs
64+
branch: gh-pages
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: verify-js-built.yaml
2+
3+
on:
4+
push:
5+
branches: ["main", "rc-*"]
6+
paths:
7+
- "js/**/*"
8+
- .github/workflows/verify-js-built.yaml
9+
pull_request:
10+
paths:
11+
- "js/**/*"
12+
- .github/workflows/verify-js-built.yaml
13+
14+
jobs:
15+
verify_js_built:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: 🔎 Extract node version from .nvmrc
24+
id: nvm
25+
working-directory: js
26+
run: |
27+
echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
28+
29+
- name: 🟡 Use Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "${{ steps.nvm.outputs.version }}"
33+
34+
- name: 🆙 Install dependencies
35+
run: make js-setup-ci
36+
env:
37+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
38+
39+
- name: 🏭 Build
40+
run: make js-build
41+
42+
- name: 🧐 Check for uncommitted changes
43+
run: |
44+
if [[ `git status --porcelain` ]]; then
45+
git diff
46+
echo "Uncommitted changes found. Please commit any changes that result from 'make js-setup-ci js-build'."
47+
exit 1
48+
else
49+
echo "No uncommitted changes found."
50+
fi
51+
working-directory: js

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
.RData
44
.Ruserdata
55
.Renviron
6-
docs
6+
.venv
7+
docs/r
8+
docs/py
79
_dev
10+
uv.lock
11+
.coverage
12+
README.html
13+
README_files
814
shiny_bookmarks

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"Posit.air-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"charliermarsh.ruff",
6+
"esbenp.prettier-vscode"
7+
]
8+
}

.vscode/settings.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"[r]": {
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "Posit.air-vscode"
5+
},
6+
"[python]": {
7+
"editor.formatOnSave": true,
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll": "explicit",
10+
"source.organizeImports": "explicit"
11+
},
12+
"editor.defaultFormatter": "charliermarsh.ruff"
13+
},
14+
"[typescript]": {
15+
"editor.formatOnSave": true,
16+
"editor.defaultFormatter": "esbenp.prettier-vscode"
17+
},
18+
"[javascript]": {
19+
"editor.formatOnSave": true,
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
},
22+
"editor.codeActionsOnSave": {
23+
"source.fixAll.eslint": "always"
24+
},
25+
"eslint.validate": [
26+
"javascript",
27+
"typescript",
28+
"jsx",
29+
"tsx"
30+
],
31+
"quarto.path": "~/.local/share/qvm/versions/v1.7.31/bin/quarto",
32+
"cSpell.words": [
33+
"shinychat"
34+
],
35+
"python.testing.pytestArgs": [
36+
"pkg-py"
37+
],
38+
"python.testing.unittestEnabled": false,
39+
"python.testing.pytestEnabled": true
40+
}

LICENSE

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1-
YEAR: 2024
2-
COPYRIGHT HOLDER: Posit Software, PBC
1+
# MIT License
2+
3+
Copyright (c) 2024 Posit Software, PBC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)