Skip to content
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

chore: update tests to use site-generator-beta #235

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 0 additions & 27 deletions .github/workflows/publish.yaml

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: python:3.8
container: node:20
steps:
- uses: actions/checkout@v3
- name: Install the site-generator
run: pip install -r requirements.txt
- name: Build the site.
run: aep-site-gen . /out
- name: Generate all static pages, and build site.
run: ./scripts/build.sh
72 changes: 7 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,76 +42,18 @@ Some tips:
## Development Environment

If you are contributing AEP content (rather than code) and want to be able to
view it in your browser, the easiest way to do so is to run the provided
development server.
view it in your browser, the easiest way to do so is to run the site-generator
script.

We use [GitHub Pages][1] to make this documentation available, and a specific
[site generator][2] to build the site.

If you have [Docker][3] installed, clone this repository and run the `serve.sh`
file at the root of the repository. This script does two things:
Run `./scripts/serve.sh` to:

- It builds the provided Docker image (unless you already have it) and tags it
as `aep-site`.
- It runs the `aep-site` image.

The development server uses port 4000; point your web browser to
`http://localhost:4000`, and you should see the site.

**Note:** After building the Docker image for the first time, you may
experience issues if Python dependencies change underneath you. If this
happens, remove your Docker image (`docker rmi aep-site`) and run `serve.sh`
again.

### Arguments

Any arguments provided to `serve.sh` (or `docker run`) are forwarded (however,
the current site generator does not honor any; this may change in the future).
- clone the site-generator repository.
- run the appropriate npm commands.
- begin the dev server at port 4321.

### Hot reloading

The development server recognizes when files change (including static files)
and local changes will be automatically reflected in your browser upon reload.

### Local Installation

It is possible to run the development server locally also. The general gist of
how to do so correctly is:

- Install Python 3.8 if you do not already have it (direct install is fine, but
[pyenv][5] is probably the best way if you have other Python projects).
- Create a Python 3.8 [venv][6]. Once it is created, activate it in your shell
(`source path/to/venv/bin/activate`).
- `pip install git+https://github.com/aep-dev/site-generator.git`
- `aep-site-serve .`

## Contributor License Agreement

Signing a Contributor License Agreement (CLA) is not required at this time.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

### Formatting

We use [prettier][4] to format Markdown, JavaScript, and (most) HTML, in order
to ensure a consistent style throughout our source. You can add prettier as a
plugin in most development environments.

Once it is installed, you can fix formatting by running the following in the
root aep.dev directory:

```sh
prettier -w .
```

[1]: https://pages.github.com/
[2]: https://github.com/aep-dev/site-generator
[3]: https://docker.com/
[4]: https://prettier.io/
[5]: https://github.com/pyenv/pyenv
[6]: https://docs.python.org/3/library/venv.html
The development server currently does not support hot reloading.
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

18 changes: 18 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -x
export AEP_LOCATION="${PWD}"
export SG_DIRECTORY="/tmp/site-generator-beta"
export AEP_LINTER_LOC="${SG_DIRECTORY}/api-linter"
if [ ! -d "${SG_DIRECTORY}" ]; then
git clone https://github.com/aep-dev/site-generator-beta.git "${SG_DIRECTORY}"
fi

if [ ! -d "${AEP_LINTER_LOC}" ]; then
git clone https://github.com/aep-dev/api-linter.git "${AEP_LINTER_LOC}"
fi
cd "${SG_DIRECTORY}" || exit
# make rules / website folder
mkdir -p src/content/docs/tooling/linter/rules
mkdir -p src/content/docs/tooling/website
npm install
npm run generate
4 changes: 4 additions & 0 deletions scripts/serve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -x
. ./scripts/build.sh
npm run preview
38 changes: 0 additions & 38 deletions serve.sh

This file was deleted.

Loading