Skip to content

Commit d4f9252

Browse files
committed
reintroduce source from main branch
1 parent 67652fa commit d4f9252

335 files changed

Lines changed: 68141 additions & 125 deletions

File tree

Some content is hidden

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

‎.github/FUNDING.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: [rmorshea]
3+
github: [archmonger, rmorshea]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username

‎.github/pull_request_template.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
## Issues
1+
## Description
22

3-
<!-- Link the issues this change resolves, or describe them -->
3+
<!-- A summary of the changes. -->
44

5-
## Summary
5+
## Checklist
66

7-
<!-- Describe how these changes resolve the aforementioned issues -->
7+
Please update this checklist as you complete each item:
88

9-
## Checklist
9+
- [ ] Tests have been developed for bug fixes or new functionality.
10+
- [ ] The changelog has been updated, if necessary.
11+
- [ ] Documentation has been updated, if necessary.
12+
- [ ] GitHub Issues closed by this PR have been linked.
1013

11-
- [ ] Tests have been included for all bug fixes or added functionality.
12-
- [ ] The `changelog.rst` has been updated with any significant changes.
14+
<sub>By submitting this pull request I agree that all contributions comply with this project's open source license(s).</sub>

‎.github/workflows/.hatch-run.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: hatch-run
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
job-name:
7+
required: true
8+
type: string
9+
run-cmd:
10+
required: true
11+
type: string
12+
runs-on:
13+
required: false
14+
type: string
15+
default: '["ubuntu-latest"]'
16+
python-version:
17+
required: false
18+
type: string
19+
default: '["3.x"]'
20+
secrets:
21+
node-auth-token:
22+
required: false
23+
24+
jobs:
25+
hatch:
26+
name: ${{ format(inputs.job-name, matrix.python-version, matrix.runs-on) }}
27+
strategy:
28+
matrix:
29+
python-version: ${{ fromJson(inputs.python-version) }}
30+
runs-on: ${{ fromJson(inputs.runs-on) }}
31+
runs-on: ${{ matrix.runs-on }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- if: runner.os == 'Windows'
35+
name: Cache Playwright Install
36+
uses: actions/cache@v5
37+
with:
38+
path: C:\Users\runneradmin\AppData\Local\ms-playwright\
39+
key: ${{ runner.os }}-playwright
40+
# FIXME: Temporarily added setup-node to fix lack of "Trusted Publishing" in Bun
41+
# Ref: https://github.com/oven-sh/bun/issues/15601
42+
- uses: actions/setup-node@v6
43+
with:
44+
node-version: 24
45+
registry-url: https://registry.npmjs.org/
46+
- uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: latest
49+
- name: Use Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
cache: "pip"
54+
- name: Install Python Dependencies
55+
run: pip install hatch
56+
- name: Run Scripts
57+
env:
58+
NPM_CONFIG_TOKEN: ${{ secrets.node-auth-token }}
59+
run: ${{ inputs.run-cmd }}

‎.github/workflows/check.yml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
schedule:
11+
- cron: "0 0 * * 0"
12+
13+
jobs:
14+
test-python-coverage:
15+
uses: ./.github/workflows/.hatch-run.yml
16+
with:
17+
job-name: "python-{0}"
18+
# Retries needed because GitHub workers sometimes lag enough to crash parallel workers
19+
run-cmd: "hatch test --parallel --cover --retries 10"
20+
lint-python:
21+
uses: ./.github/workflows/.hatch-run.yml
22+
with:
23+
job-name: "python-{0}"
24+
run-cmd: "hatch fmt src/reactpy --check && hatch run python:type_check"
25+
test-python:
26+
uses: ./.github/workflows/.hatch-run.yml
27+
with:
28+
job-name: "python-{0} {1}"
29+
run-cmd: "hatch test --parallel --retries 10"
30+
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
31+
python-version: '["3.11", "3.12", "3.13", "3.14"]'
32+
test-documentation:
33+
# Temporarily disabled while we transition from Sphinx to MkDocs
34+
# https://github.com/reactive-python/reactpy/pull/1052
35+
if: 0
36+
uses: ./.github/workflows/.hatch-run.yml
37+
with:
38+
job-name: "python-{0}"
39+
run-cmd: "hatch run docs:check"
40+
python-version: '["3.11"]'
41+
test-javascript:
42+
uses: ./.github/workflows/.hatch-run.yml
43+
with:
44+
job-name: "{1}"
45+
run-cmd: "hatch run javascript:test"
46+
lint-javascript:
47+
uses: ./.github/workflows/.hatch-run.yml
48+
with:
49+
job-name: "{1}"
50+
run-cmd: "hatch run javascript:check"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: codeql
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: "43 3 * * 3"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["javascript", "python"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37+
# Learn more:
38+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v2
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

‎.github/workflows/publish.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read # Required to checkout the code
9+
id-token: write # Required to sign the NPM publishing statements
10+
11+
jobs:
12+
publish-reactpy:
13+
if: startsWith(github.event.release.name, 'reactpy ') || startsWith(github.event.release.tag_name, 'reactpy-')
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: 24
20+
registry-url: https://registry.npmjs.org/
21+
- uses: oven-sh/setup-bun@v2
22+
with:
23+
bun-version: latest
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.13"
27+
cache: "pip"
28+
- name: Install Python Dependencies
29+
run: pip install hatch
30+
- name: Build Python Package
31+
run: hatch build --clean
32+
- name: Publish to PyPI (Trusted Publishing)
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
35+
publish-reactpy-client:
36+
if: startsWith(github.event.release.name, '@reactpy/client ') || startsWith(github.event.release.tag_name, '@reactpy/client-')
37+
uses: ./.github/workflows/.hatch-run.yml
38+
with:
39+
job-name: "Publish to NPM"
40+
run-cmd: "hatch run javascript:publish_client"

‎.gitignore‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# --- Build Artifacts ---
2-
src/reactpy/static/index.js*
2+
src/reactpy/static/*.js*
33
src/reactpy/static/morphdom/
44
src/reactpy/static/pyscript/
5+
src/reactpy/static/wheels/
6+
src/js/**/*.tgz
7+
src/js/**/LICENSE
58

69
# --- Jupyter ---
710
*.ipynb_checkpoints
@@ -45,7 +48,4 @@ pip-wheel-metadata
4548

4649
# --- JS ---
4750
node_modules
48-
*.tsbuildinfo
4951

50-
# --- Docs build output ---
51-
docs/site/

‎.pre-commit-config.yaml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,32 @@ repos:
33
hooks:
44
- id: lint-py-fix
55
name: Fix Python Lint
6-
entry: hatch run lint-py --fix
7-
language: system
8-
pass_filenames: false
9-
- repo: local
10-
hooks:
11-
- id: lint-py-check
12-
name: Check Python Lint
136
entry: hatch run lint-py
147
language: system
8+
args: [--fix]
159
pass_filenames: false
10+
files: \.py$
1611
- repo: local
1712
hooks:
1813
- id: lint-js-fix
1914
name: Fix JS Lint
2015
entry: hatch run lint-js --fix
2116
language: system
2217
pass_filenames: false
18+
files: \.(js|jsx|ts|tsx)$
19+
- repo: local
20+
hooks:
21+
- id: lint-py-check
22+
name: Check Python Lint
23+
entry: hatch run lint-py
24+
language: system
25+
pass_filenames: false
26+
files: \.py$
2327
- repo: local
2428
hooks:
2529
- id: lint-js-check
2630
name: Check JS Lint
2731
entry: hatch run lint-py
2832
language: system
2933
pass_filenames: false
34+
files: \.(js|jsx|ts|tsx)$

‎.prettierrc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"proseWrap": "never",
3+
"trailingComma": "all",
4+
"endOfLine": "auto"
5+
}

0 commit comments

Comments
 (0)