Skip to content

Documentation Rewrite #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4b72903
reorganize docs
rmorshea Oct 19, 2021
7c43fbe
docs reorganization
rmorshea Oct 20, 2021
668fab8
restructure after seeing new react docs
rmorshea Oct 23, 2021
6315abc
one more round of organization
rmorshea Oct 26, 2021
2f677c3
finally start using MyST
rmorshea Oct 27, 2021
efb646a
minor improvements to landing page
rmorshea Oct 28, 2021
33a2d95
being "getting started" section and add sample app
rmorshea Nov 7, 2021
100c41f
start on installation section
rmorshea Nov 7, 2021
31283c8
start writing install/running sections
rmorshea Nov 9, 2021
d66b93b
mostly finish getting-started
rmorshea Nov 9, 2021
ea224bc
finish getting started section
rmorshea Nov 9, 2021
57cafec
more minor improvements
rmorshea Nov 10, 2021
380f3b1
start writing creating interfaces section
rmorshea Nov 10, 2021
e224463
misc changes
rmorshea Nov 11, 2021
714f820
misc progress on your first component section
rmorshea Nov 11, 2021
9c7b7f6
allow example to be organized into folders
rmorshea Nov 12, 2021
ea5f4ff
misc changes following review
rmorshea Nov 13, 2021
0bed22d
simplify HTML with IDOM section
rmorshea Nov 13, 2021
182d3b1
improve your first component section
rmorshea Nov 14, 2021
766821f
finish off your firt component section
rmorshea Nov 15, 2021
431de63
finish off creating interfaces main content
rmorshea Nov 16, 2021
7402a71
finish off creating-interfaces
rmorshea Nov 16, 2021
229329f
add mountWithLayoutServer client func
rmorshea Nov 16, 2021
aea51cb
add inital work for responding to events
rmorshea Nov 16, 2021
d79962e
finish up responding to events section
rmorshea Nov 17, 2021
50422ef
add index section for responding to events
rmorshea Nov 17, 2021
30067ab
misc improvements + start on component state doc
rmorshea Nov 17, 2021
73d3e17
fix misc refs in docs
rmorshea Nov 17, 2021
f5b6fa8
allow examples to be organized in directory
rmorshea Nov 17, 2021
f65a294
make progress on components with state
rmorshea Nov 18, 2021
bfdf612
work on intro to state section
rmorshea Nov 19, 2021
18d6b3a
finish up the tabs
rmorshea Nov 20, 2021
4aca6db
finish off components with state section
rmorshea Nov 20, 2021
66ade15
add test for new event handler behavior
rmorshea Nov 20, 2021
15f4ed4
try to get tests passing again
rmorshea Nov 20, 2021
36e448b
update selenium find_element_* usages
rmorshea Nov 20, 2021
946a598
do not use SO_REUSEADDR when testing
rmorshea Nov 20, 2021
b5b9ca4
fix title underlines
rmorshea Nov 20, 2021
8c3a95a
fix doctests
rmorshea Nov 20, 2021
91c244d
fix more selenium find_element_by_* usages
rmorshea Nov 20, 2021
0edc111
actually remove deprecated selenium usages
rmorshea Nov 20, 2021
2e59dd2
rename Server proto to ServerType + test_sample
rmorshea Nov 20, 2021
c567ccb
fix docs docker + docs type annotation
rmorshea Nov 20, 2021
cae8ea7
finishing touches
rmorshea Nov 20, 2021
496bcd1
fix up docker image
rmorshea Nov 21, 2021
bff7e1d
fix false possitive key warning
rmorshea Nov 21, 2021
64a38d5
start marking sections as under construction
rmorshea Nov 23, 2021
a0c0ffd
add more construction signs
rmorshea Nov 24, 2021
f8b0b99
fix force update in example loader
rmorshea Nov 24, 2021
1c1e573
add some diagrams for state as snapshot
rmorshea Dec 5, 2021
6335666
try and make examples load relative to current file
rmorshea Dec 5, 2021
9e45531
allow example to live closer to content
rmorshea Dec 5, 2021
632f968
rename files and directive names
rmorshea Dec 5, 2021
6eb9631
add send_message ex
rmorshea Dec 5, 2021
e35c8ad
add more to state as snapshot
rmorshea Dec 5, 2021
f0960ba
finish off state as a snapshot
rmorshea Dec 7, 2021
f12a207
finish multiple state updates
rmorshea Dec 7, 2021
e6bd55e
black updated and rerun
rmorshea Dec 7, 2021
4b523ae
final touches
rmorshea Dec 8, 2021
4c5659d
make misc corrections
rmorshea Dec 13, 2021
fbe5edb
go back to old card grid
rmorshea Dec 13, 2021
7bd0449
make text searchable
rmorshea Dec 13, 2021
a8d308f
simplify CI scripts
rmorshea Dec 14, 2021
31ecfd7
misc docs improvements
rmorshea Dec 14, 2021
b011c3e
log if running in CI
rmorshea Dec 14, 2021
d512a92
run external for npm install latest
rmorshea Dec 14, 2021
26375b3
improve log message
rmorshea Dec 14, 2021
6e7314d
do not test 3.10 yet
rmorshea Dec 14, 2021
6a88c7a
fix prettier label
rmorshea Dec 14, 2021
d02376a
remove requireents from manifest
rmorshea Dec 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify CI scripts
  • Loading branch information
rmorshea committed Dec 14, 2021
commit a8d308fa75d67c8020358019162f656b387f5ea5
77 changes: 25 additions & 52 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,28 @@ on:
- cron: "0 0 * * *"

jobs:
test-python:
test-python-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-chromedriver@master
- uses: actions/setup-node@v2-beta
with:
node-version: "14.x"
node-version: "14"
- name: Use Latest Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install latest NPM
run: |
npm install -g npm@7.22.0
npm --version
python-version: "3.10"
- name: Install Python Dependencies
run: pip install -r requirements/test-run.txt
- name: Run Tests
run: nox -s test -- --headless
test-python-versions:
env: {"CI": "true"}
run: nox -s test_python_suite -- --headless
test-python-environments:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand All @@ -47,60 +44,36 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install latest NPM
run: |
npm install -g npm@7.22.0
npm --version
- name: Install Python Dependencies
run: pip install -r requirements/test-run.txt
- name: Run Tests
run: nox -s test_short -- --headless --no-cov
test-javascript:
env: {"CI": "true"}
run: nox -s test_python -- --headless --no-cov
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v2-beta
with:
node-version: "14"
- name: Install latest NPM
run: |
npm install -g npm@7.22.0
npm --version
- name: Test Javascript
working-directory: ./src/client
run: |
npm install
npm test
npm run build
test-documentation-image:
runs-on: ubuntu-latest
steps:
- name: Check out src from Git
uses: actions/checkout@v2
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Build Docker Image
run: docker build . --file docs/Dockerfile
test-build-package:
- name: Use Latest Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Python Dependencies
run: pip install -r requirements/test-run.txt
- name: Run Tests
env: {"CI": "true"}
run: nox -s test_docs
test-javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: "14"
- name: Use Latest Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install latest NPM
run: |
npm install -g npm@7.22.0
npm --version
- name: Install Python Dependencies
run: |
pip install --upgrade pip
pip install -r requirements/build-pkg.txt
- name: Test Build Creation
run: python setup.py bdist_wheel sdist
run: pip install -r requirements/test-run.txt
- name: Run Tests
env: {"CI": "true"}
run: nox -s test_javascript
3 changes: 3 additions & 0 deletions docs/source/developing-idom/contributor-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ In order to develop IDOM locally you'll first need to install the following:
* - NPM >= 7.13
- https://docs.npmjs.com/try-the-latest-stable-version-of-npm

* - Docker
- https://docs.docker.com/get-docker/

.. note::

NodeJS distributes a version of NPM, but you'll want to get the latest
Expand Down
136 changes: 105 additions & 31 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re
from pathlib import Path
from typing import Any, Callable
from typing import Any, Callable, TypeVar

import nox
from nox.sessions import Session
Expand All @@ -13,22 +13,56 @@
ROOT = Path(__file__).parent
SRC = ROOT / "src"
POSARGS_PATTERN = re.compile(r"^(\w+)\[(.+)\]$")
TRUE_VALUES = {"true", "True", "TRUE", "1"}


def apply_standard_pip_upgrades(
function: Callable[[Session], Any]
) -> Callable[[Session], Any]:
@functools.wraps(function)
def wrapper(session: Session) -> None:
session.install("--upgrade", "pip", "setuptools", "wheel")
return function(session)
_Return = TypeVar("_Return")

return wrapper

def do_first(
first_session_func: Callable[[Session], None]
) -> Callable[[Callable[[Session], _Return]], Callable[[Session], _Return]]:
"""Decorator for functions defining session actions that should happen first

>>> @do_first
>>> def setup(session):
>>> ... # do some setup
>>>
>>> @setup
>>> def the_actual_session(session):
>>> ... # so actual work

This makes it quick an easy to define common setup actions.
"""

def setup(
second_session_func: Callable[[Session], _Return]
) -> Callable[[Session], _Return]:
@functools.wraps(second_session_func)
def wrapper(session: Session) -> Any:
first_session_func(session)
return second_session_func(session)

return wrapper

return setup


@do_first
def apply_standard_pip_upgrades(session: Session) -> None:
session.install("--upgrade", "pip")


@do_first
def install_latest_npm_in_ci(session: Session) -> None:
if os.environ.get("CI") in TRUE_VALUES:
session.run("npm", "install", "-g", "npm@latest")


@nox.session(reuse_venv=True)
@apply_standard_pip_upgrades
def format(session: Session) -> None:
"""Auto format Python and Javascript code"""
# format Python
install_requirements_file(session, "check-style")
session.run("black", ".")
Expand Down Expand Up @@ -58,6 +92,7 @@ def example(session: Session) -> None:


@nox.session(reuse_venv=True)
@install_latest_npm_in_ci
@apply_standard_pip_upgrades
def docs(session: Session) -> None:
"""Build and display documentation in the browser (automatically reloads on change)"""
Expand Down Expand Up @@ -115,23 +150,31 @@ def docs_in_docker(session: Session) -> None:
def test(session: Session) -> None:
"""Run the complete test suite"""
session.notify("test_python", posargs=session.posargs)
session.notify("test_types")
session.notify("test_style")
session.notify("test_docs")
session.notify("test_javascript")


@nox.session
def test_short(session: Session) -> None:
"""Run a shortened version of the test suite"""
session.notify("test_python", posargs=session.posargs)
session.notify("test_docs")
session.notify("test_javascript")
def test_python(session: Session) -> None:
"""Run all Python checks"""
session.notify("test_python_suite", posargs=session.posargs)
session.notify("test_python_types")
session.notify("test_python_style")
session.notify("test_python_build")


@nox.session
def test_javascript(session: Session) -> None:
"""Run all Javascript checks"""
session.notify("test_javascript_suite")
session.notify("test_javascript_build")
session.notify("test_javascript_style")


@nox.session
@install_latest_npm_in_ci
@apply_standard_pip_upgrades
def test_python(session: Session) -> None:
def test_python_suite(session: Session) -> None:
"""Run the Python-based test suite"""
session.env["IDOM_DEBUG_MODE"] = "1"
install_requirements_file(session, "test-env")
Expand All @@ -149,8 +192,8 @@ def test_python(session: Session) -> None:

@nox.session
@apply_standard_pip_upgrades
def test_types(session: Session) -> None:
"""Perform a static type analysis of the codebase"""
def test_python_types(session: Session) -> None:
"""Perform a static type analysis of the Python codebase"""
install_requirements_file(session, "check-types")
install_requirements_file(session, "pkg-deps")
install_requirements_file(session, "pkg-extras")
Expand All @@ -159,8 +202,8 @@ def test_types(session: Session) -> None:

@nox.session
@apply_standard_pip_upgrades
def test_style(session: Session) -> None:
"""Check that style guidelines are being followed"""
def test_python_style(session: Session) -> None:
"""Check that Python style guidelines are being followed"""
install_requirements_file(session, "check-style")
session.run("flake8", "src/idom", "tests", "docs")
black_default_exclude = r"\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist"
Expand All @@ -176,6 +219,15 @@ def test_style(session: Session) -> None:

@nox.session
@apply_standard_pip_upgrades
def test_python_build(session: Session) -> None:
"""Test whether the Python package can be build for distribution"""
install_requirements_file(session, "build-pkg")
session.run("python", "setup.py", "bdist_wheel", "sdist")


@nox.session
@install_latest_npm_in_ci
@apply_standard_pip_upgrades
def test_docs(session: Session) -> None:
"""Verify that the docs build and that doctests pass"""
install_requirements_file(session, "build-docs")
Expand All @@ -192,19 +244,47 @@ def test_docs(session: Session) -> None:
"docs/build",
)
session.run("sphinx-build", "-b", "doctest", "docs/source", "docs/build")
# ensure docker image build works too
session.run("docker", "build", ".", "--file", "docs/Dockerfile", external=True)


@nox.session
def test_javascript(session: Session) -> None:
"""Run the Javascript-based test suite and ensure it bundles succesfully"""
@do_first
@install_latest_npm_in_ci
def setup_client_env(session: Session) -> None:
session.chdir(SRC / "client")
session.run("npm", "install", external=True)


@nox.session
@setup_client_env
def test_javascript_suite(session: Session) -> None:
"""Run the Javascript-based test suite and ensure it bundles succesfully"""
session.run("npm", "run", "test", external=True)


@nox.session
@setup_client_env
def test_javascript_build(session: Session) -> None:
"""Run the Javascript-based test suite and ensure it bundles succesfully"""
session.run("npm", "run", "test", external=True)


@nox.session
@setup_client_env
def test_javascript_style(session: Session) -> None:
"""Check that Javascript style guidelines are being followed"""
session.run("npm", "run", "check-format", external=True)


@nox.session
def build_js(session: Session) -> None:
"""Build javascript client code"""
session.chdir(SRC / "client")
session.run("npm", "run", "build", external=True)


@nox.session
def tag(session: Session):
def tag(session: Session) -> None:
"""Create a new git tag"""
try:
session.run(
Expand Down Expand Up @@ -265,12 +345,6 @@ def update_version(session: Session) -> None:
session.install("-e", ".")


@nox.session
def build_js(session: Session) -> None:
session.chdir(SRC / "client")
session.run("npm", "run", "build", external=True)


@nox.session(reuse_venv=True)
def latest_pull_requests(session: Session) -> None:
"""A basic script for outputing changelog info"""
Expand Down
3 changes: 2 additions & 1 deletion src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"build": "snowpack build",
"format": "npm --workspaces run format",
"publish": "npm --workspaces publish",
"test": "npm --workspaces test"
"test": "npm --workspaces test",
"check-format": "npm --workspaces run check-format"
},
"version": "0.33.3",
"workspaces": [
Expand Down
1 change: 1 addition & 0 deletions src/client/packages/idom-app-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"scripts": {
"format": "prettier --write ./src",
"check-format": "prettier --check ./src",
"test": "echo 'no tests'"
},
"version": "0.33.3"
Expand Down
1 change: 1 addition & 0 deletions src/client/packages/idom-client-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"scripts": {
"format": "prettier --write ./src",
"check-format": "prettier --check ./src",
"test": "uvu tests"
},
"type": "module",
Expand Down