Skip to content

Commit 42f4ab3

Browse files
committed
potentially working publishing workflow
1 parent 1797ba2 commit 42f4ab3

File tree

14 files changed

+71
-36
lines changed

14 files changed

+71
-36
lines changed

.github/workflows/.hatch-run.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
job-name:
77
required: true
88
type: string
9-
hatch-run:
9+
run-cmd:
1010
required: true
1111
type: string
1212
runs-on:
@@ -43,10 +43,10 @@ jobs:
4343
with:
4444
python-version: ${{ matrix.python-version }}
4545
- name: Install Python Dependencies
46-
run: pip install hatch poetry
46+
run: pip install --upgrade pip hatch uv
4747
- name: Run Scripts
4848
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.node-auth-token }}
50-
PYPI_USERNAME: ${{ secrets.pypi-username }}
51-
PYPI_PASSWORD: ${{ secrets.pypi-password }}
52-
run: hatch run ${{ inputs.hatch-run }}
49+
NPM_CONFIG_TOKEN: ${{ secrets.node-auth-token }}
50+
HATCH_INDEX_USER: ${{ secrets.pypi-username }}
51+
HATCH_INDEX_AUTH: ${{ secrets.pypi-password }}
52+
run: ${{ inputs.run-cmd }}

.github/workflows/publish.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@ on:
55
types: [published]
66

77
jobs:
8-
publish:
8+
publish-reactpy:
9+
if: startsWith(github.event.release.name, 'reactpy ')
910
uses: ./.github/workflows/.hatch-run.yml
1011
with:
11-
job-name: "publish"
12-
hatch-run: "publish"
12+
job-name: "Publish to PyPI"
13+
run-cmd: "hatch build --clean && hatch publish --yes"
1314
secrets:
14-
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
1515
pypi-username: ${{ secrets.PYPI_USERNAME }}
1616
pypi-password: ${{ secrets.PYPI_PASSWORD }}
17+
18+
publish-reactpy-client:
19+
if: startsWith(github.event.release.name, '@reactpy/client ')
20+
uses: ./.github/workflows/.hatch-run.yml
21+
with:
22+
job-name: "Publish to NPM"
23+
run-cmd: "hatch run javascript:publish_reactpy_client"
24+
secrets:
25+
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
26+
27+
publish-event-to-object:
28+
if: startsWith(github.event.release.name, 'event-to-object ')
29+
uses: ./.github/workflows/.hatch-run.yml
30+
with:
31+
job-name: "Publish to NPM"
32+
run-cmd: "hatch run javascript:publish_event_to_object"
33+
secrets:
34+
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}

docs/source/about/changelog.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Changelog
1818
Unreleased
1919
----------
2020

21-
Nothing (yet)!
21+
**Changed**
22+
23+
- Substitute ``react`` rendering on the client with ``preact``.
2224

2325
v1.1.0
2426
------

pyproject.toml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,44 @@ type_check = "mypy --strict src/reactpy"
164164
detached = true
165165

166166
[tool.hatch.envs.javascript.scripts]
167-
check = ['bun install --cwd "src/js"', 'bun run --cwd "src/js" check']
167+
check = [
168+
'bun install --cwd "src/js"',
169+
'bun run --cwd "src/js" lint',
170+
'bun run --cwd "src/js/packages/event-to-object" checkTypes',
171+
'bun run --cwd "src/js/packages/@reactpy/client" checkTypes',
172+
'bun run --cwd "src/js/packages/@reactpy/app" checkTypes',
173+
]
168174
fix = ['bun install --cwd "src/js"', 'bun run --cwd "src/js" format']
175+
test = [
176+
'bun install --cwd "src/js"',
177+
'bun run --cwd "src/js/packages/event-to-object" test',
178+
]
169179
build = [
170180
'hatch run "src/build_scripts/clean_js_dir.py"',
171-
'hatch run javascript:build_packages',
181+
'hatch run javascript:build_event_to_object',
182+
'hatch run javascript:build_client',
172183
'hatch run javascript:build_app',
173184
]
174-
build_packages = [
175-
'bun install --cwd "src/js"',
185+
build_event_to_object = [
176186
'bun install --cwd "src/js/packages/event-to-object"',
177-
'bun install --cwd "src/js/packages/@reactpy/client"',
178187
'bun run --cwd "src/js/packages/event-to-object" build',
188+
]
189+
build_client = [
190+
'bun install --cwd "src/js/packages/@reactpy/client"',
179191
'bun run --cwd "src/js/packages/@reactpy/client" build',
180192
]
181193
build_app = [
182194
'bun install --cwd "src/js/packages/@reactpy/app"',
183195
'bun run --cwd "src/js/packages/@reactpy/app" build',
184196
]
197+
publish_event_to_object = [
198+
'hatch run javascript:build_event_to_object',
199+
'cd "src/js/packages/event-to-object" && bun publish --access public',
200+
]
201+
publish_client = [
202+
'hatch run javascript:build_client',
203+
'cd "src/js/packages/@reactpy/client" && bun publish --access public',
204+
]
185205

186206
#########################
187207
# >>> Generic Tools <<< #

src/js/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
tsconfig.tsbuildinfo
22
packages/**/package-lock.json
33
**/dist/*
4+
node_modules
5+
*.tgz

src/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"license": "MIT",
1010
"scripts": {
11-
"check": "prettier --check . && eslint",
11+
"lint": "prettier --check . && eslint",
1212
"format": "prettier --write . && eslint --fix"
1313
}
1414
}
32 Bytes
Binary file not shown.

src/js/packages/@reactpy/app/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
},
1010
"devDependencies": {
1111
"@types/react": "^17.0",
12-
"@types/react-dom": "^17.0"
12+
"@types/react-dom": "^17.0",
13+
"typescript": "^5.7.3"
1314
},
1415
"scripts": {
15-
"build": "bun build \"src/index.ts\" --outdir \"dist\" --minify --sourcemap=linked"
16+
"build": "bun build \"src/index.ts\" --outdir \"dist\" --minify --sourcemap=linked",
17+
"checkTypes": "tsc --noEmit"
1618
}
1719
}

src/js/packages/@reactpy/client/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.
434 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)