Skip to content

Commit bd7f40d

Browse files
committed
prep work to get CI working
1 parent d65bc81 commit bd7f40d

File tree

22 files changed

+146
-81
lines changed

22 files changed

+146
-81
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ max_line_length = 120
1717
[*.md]
1818
indent_size = 4
1919

20+
[*.yml]
21+
indent_size = 4
22+
2023
[*.html]
2124
max_line_length = off
2225

.github/workflows/.hatch-run.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ on:
99
hatch-run:
1010
required: true
1111
type: string
12-
runs-on-array:
12+
runs-on:
1313
required: false
1414
type: string
1515
default: '["ubuntu-latest"]'
16-
python-version-array:
16+
python-version:
1717
required: false
1818
type: string
1919
default: '["3.x"]'
20-
node-registry-url:
21-
required: false
22-
type: string
23-
default: ""
2420
secrets:
2521
node-auth-token:
2622
required: false
@@ -34,17 +30,14 @@ jobs:
3430
name: ${{ format(inputs.job-name, matrix.python-version, matrix.runs-on) }}
3531
strategy:
3632
matrix:
37-
python-version: ${{ fromJson(inputs.python-version-array) }}
38-
runs-on: ${{ fromJson(inputs.runs-on-array) }}
33+
python-version: ${{ fromJson(inputs.python-version) }}
34+
runs-on: ${{ fromJson(inputs.runs-on) }}
3935
runs-on: ${{ matrix.runs-on }}
4036
steps:
4137
- uses: actions/checkout@v4
42-
- uses: actions/setup-node@v4
38+
- uses: oven-sh/setup-bun@v2
4339
with:
44-
node-version: "23.x"
45-
registry-url: ${{ inputs.node-registry-url }}
46-
- name: Pin NPM Version
47-
run: npm install -g npm@8.19.3
40+
bun-version: latest
4841
- name: Use Python ${{ matrix.python-version }}
4942
uses: actions/setup-python@v5
5043
with:

.github/workflows/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
with:
2727
job-name: "python-{0} {1}"
2828
hatch-run: "test-py --no-cov"
29-
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
30-
python-version-array: '["3.9", "3.10", "3.11"]'
29+
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
30+
python-version: '["3.9", "3.10", "3.11"]'
3131
test-docs:
3232
uses: ./.github/workflows/.hatch-run.yml
3333
with:
3434
job-name: "python-{0}"
3535
hatch-run: "test-docs"
3636
# as of Dec 2023 lxml does have wheels for 3.12
3737
# https://bugs.launchpad.net/lxml/+bug/2040440
38-
python-version-array: '["3.11"]'
38+
python-version: '["3.11"]'
3939
test-js:
4040
uses: ./.github/workflows/.hatch-run.yml
4141
with:

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: deploy-docs
52

63
on:

.github/workflows/publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflows will upload a Javscript Package using NPM to npmjs.org when a release is created
2-
# For more information see: https://docs.github.com/en/actions/guides/publishing-nodejs-packages
3-
41
name: publish
52

63
on:
@@ -13,7 +10,6 @@ jobs:
1310
with:
1411
job-name: "publish"
1512
hatch-run: "publish"
16-
node-registry-url: "https://registry.npmjs.org"
1713
secrets:
1814
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
1915
pypi-username: ${{ secrets.PYPI_USERNAME }}

pyproject.toml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,14 @@ log_cli_level = "INFO"
128128

129129
[tool.hatch.envs.default.scripts]
130130
test-cov = "playwright install && coverage run -m pytest {args:tests}"
131-
cov-report = [
132-
# "- coverage combine",
133-
"coverage report",
134-
]
131+
cov-report = ["coverage report"]
135132
cov = ["test-cov {args}", "cov-report"]
136133

137134
[tool.hatch.envs.default.env-vars]
138135
REACTPY_DEBUG_MODE = "1"
139136

140137
################################
141-
# >>> Hatch Lint Scripts <<< #
138+
# >>> Hatch Python Scripts <<< #
142139
################################
143140

144141
[tool.hatch.envs.lint]
@@ -157,12 +154,26 @@ extra-dependencies = [
157154
"types-requests",
158155
]
159156

160-
[tool.hatch.envs.lint.scripts]
161-
types = "mypy --strict reactpy"
162-
all = ["types"]
157+
[tool.hatch.envs.python.scripts]
158+
# TODO: Replace mypy with pylint
159+
type_check = "mypy --strict src/reactpy"
160+
161+
############################
162+
# >>> Hatch JS Scripts <<< #
163+
############################
164+
165+
[tool.hatch.envs.javascript]
166+
detached = true
163167

164-
[tool.hatch.envs.publish]
165-
extra-dependencies = ["semver >=2, <3", "twine", "pre-commit"]
168+
[tool.hatch.envs.javascript.scripts]
169+
check = [
170+
'bun install --cwd "src/js" --frozen-lockfile',
171+
'bun run --cwd "src/js" check',
172+
]
173+
fix = [
174+
'bun install --cwd "src/js" --frozen-lockfile',
175+
'bun run --cwd "src/js" format',
176+
]
166177

167178
#########################
168179
# >>> Generic Tools <<< #

src/js/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tsconfig.tsbuildinfo
22
packages/**/package-lock.json
3-
dist
3+
**/dist/*

src/js/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"license": "MIT",
32
"devDependencies": {
43
"@typescript-eslint/eslint-plugin": "^5.58.0",
54
"@typescript-eslint/parser": "^5.58.0",
65
"eslint": "^8.38.0",
76
"eslint-plugin-react": "^7.32.2",
87
"prettier": "^3.0.0-alpha.6"
8+
},
9+
"license": "MIT",
10+
"scripts": {
11+
"check": "prettier --check . && eslint",
12+
"format": "prettier --write . && eslint --fix"
913
}
1014
}
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"author": "Ryan Morshead",
3-
"license": "MIT",
42
"name": "@reactpy/app",
5-
"description": "Main entry point for ReactPy.",
3+
"description": "ReactPy's client-side entry point. This is strictly for internal use and is not designed to be distributed.",
4+
"license": "MIT",
65
"dependencies": {
76
"@reactpy/client": "^0.3.2",
87
"event-to-object": "^0.1.2",
@@ -11,9 +10,5 @@
1110
"devDependencies": {
1211
"@types/react": "^17.0",
1312
"@types/react-dom": "^17.0"
14-
},
15-
"repository": {
16-
"type": "git",
17-
"url": "https://github.com/reactive-python/reactpy"
1813
}
1914
}

src/js/packages/@reactpy/app/src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ function app(element: HTMLElement) {
1111
mount(element, client);
1212
}
1313

14-
let element = document.getElementById("app");
15-
if (element){
14+
const element = document.getElementById("app");
15+
if (element) {
1616
app(element);
17-
}
18-
else {
17+
} else {
1918
console.error("Element with id 'app' not found");
2019
}

0 commit comments

Comments
 (0)