Skip to content
Draft
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
18 changes: 12 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Install pnpm and dependencies
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Lint
run: npm run lint:check
run: pnpm lint:check
test:
runs-on: ubuntu-22.04
steps:
Expand All @@ -29,7 +32,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Install pnpm and dependencies
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Test
run: npm run test:unit
run: pnpm test:unit
10 changes: 5 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint:list || echo 'Files listed above will be reformatted and staged.'
npm run lint:staged
npm run lint:check
npm run typecheck
npm run test:unit
pnpm lint:list || echo 'Files listed above will be reformatted and staged.'
pnpm lint:staged
pnpm lint:check
pnpm typecheck
pnpm test:unit
1 change: 1 addition & 0 deletions .lintstagedrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{'*': 'prettier-eslint --write'}
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
coverage
dist
node_modules
package-lock.json
pnpm-lock.yaml
site
.env
33 changes: 22 additions & 11 deletions doc/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,20 @@ Boulder Experimental Mathematics Lab.)
3. If you don't have [NodeJS](https://nodejs.org/en/) installed, install it.
NodeJS allows you to run JavaScript outside of a web browser. We use it in
our front end code base.
4. If you don't have [Python 3](https://www.python.org/) installed, install
4. You need to make sure that you have the [pnpm](https://pnpm.io/) package
manager installed and that it is at least version 7.17.1. Try executing the
command `pnpm --version` in your shell. If it tells you that pnpm is not
found, you need to [install it](https://pnpm.io/installation). If it finds
the command and reports a version earlier than 7.17.1, you need to update
it. (How you do this depends on how you installed pnpm. See the
[installation page](https://pnpm.io/installation) for guidance. If you used
`corepack` to install pnpm, there are explicit update instructions on that
page. If you installed via the `curl` command listed there, you can simply
reinstall the same way. If you installed pnpm by some other means, you will
need to find the proper way to update your installation.)
5. If you don't have [Python 3](https://www.python.org/) installed, install
it. We use Python in frontscope for our documentation site.
5. Make sure you have a `venv` module by running the following command:
6. Make sure you have a `venv` module by running the following command:
```sh
python3 -m venv -h
```
Expand All @@ -55,10 +66,10 @@ Boulder Experimental Mathematics Lab.)
commands you run are run using the dependencies in the virutal
environment, and not the dependencies you installed elsewhere on your
computer.
6. Somewhere on your computer, make a directory where you can keep Numberscope
7. Somewhere on your computer, make a directory where you can keep Numberscope
code. I like to put a directory called `Code` in my home directory. You can
call this whatever you want.
7. If you plan to submit new code to become part of Numberscope at some time
8. If you plan to submit new code to become part of Numberscope at some time
in the future, _you must_ "fork" (make your own copy of) the repository:
- Go to https://github.com/numberscope/frontscope.
- Click the "Fork" button (in the upper right as of this writing) and then
Expand All @@ -78,23 +89,23 @@ Boulder Experimental Mathematics Lab.)
If you have trouble, read
[this doc](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
or ping someone for help.
8. Go to the newly cloned `frontscope` directory and install the dependencies:
9. Go to the newly cloned `frontscope` directory and install the dependencies:
```sh
cd frontscope
npm install
pnpm install
```
You need NodeJS installed to do this.
9. Run the development server (this runs a local copy of Numberscope on your
computer so you can interact with the webpage):
10. Run the development server (this runs a local copy of Numberscope on your
computer so you can interact with the webpage):
```sh
npm run dev
pnpm dev
```
This should print a link that you can open in the browser. Open it and see
if Numberscope seems to be working.
10. If you plan on contributing code to Numberscope, _you must_ work in your
11. If you plan on contributing code to Numberscope, _you must_ work in your
fork on a dedicated feature branch. To learn how to create a branch, see
[this doc](./working-with-git-and-github.md#create-a-branch).
11. Finally, before you start changing code, please read
12. Finally, before you start changing code, please read
[our docs on submitting a pull request](../CONTRIBUTING.md#submit-a-pull-request).

See [the doc on running from source](./running-from-source.md) for more
Expand Down
16 changes: 8 additions & 8 deletions doc/pull-request-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The PR submitter should:
- Write or supplement test(s) for the file(s) you touch in your PR.
- Make sure Numberscope runs properly, including former supposedly
unmodified behaviors and newly implemented ones. In particular, run it via
'npm run dev' and with the browser console open and make sure there are no
'pnpm dev' and with the browser console open and make sure there are no
log messages from Numberscope code, warnings, or errors.
- Read over the reviewer checklist and try to make sure in advance that your
code is going to proceed as smoothly through the review as possible.
Expand All @@ -23,19 +23,19 @@ The PR submitter should:

- All new or changed features are appropriately documented.
- Tests are appropriately modified for all new or changed features.
- The PR is passing lint by running `npm run lint`. There should be no
changed files and no warnings/errors.
- The PR builds by running `npm run build`. (This also checks type
- The PR is passing lint by running `pnpm lint`. There should be no changed
files and no warnings/errors.
- The PR builds by running `pnpm build`. (This also checks type
correctness.) There should be no errors, and for now the only allowed
warning is the one about some assets being too big.
- The PR passes all tests. Right now (Oct. 2022), just by running
`npm run test:unit`.
`pnpm test:unit`.
- Numberscope runs properly -- basically the same check as on the submitter
list, but be sure to exercise as many randomly selected behaviors as you
have time for, definitely including but not limited to the ones nominally
affected by the PR. This should be done in `npm run preview` mode after a
affected by the PR. This should be done in `pnpm preview` mode after a
successful build.
- At the end of the review process, before merging, add a commit to update
the
["Contributors" section of the "About" document](../about.md#contributors)
to include the submitter's name, if it is not already present.
["Contributors" section of the "About" document](about.md#contributors) to
include the submitter's name, if it is not already present.
7 changes: 4 additions & 3 deletions doc/running-from-source.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Setting up to run from source

1. Prerequisites: To install and run properly, `frontscope` needs
[Git](https://git-scm.com/), [Node.js](https://nodejs.org/en/), and
[Git](https://git-scm.com/), [Node.js](https://nodejs.org/en/), the
[pnpm](https://pnpm.io/) package manager (version 7.17.1 or later), and
[Python](https://www.python.org/) (version 3.5 or later) with a working
"[venv](https://docs.python.org/3/library/venv.html)" module. If any of
these are not present on your system, install them. It's very likely you
Expand All @@ -27,7 +28,7 @@
remember to delete your `.env.local` or move it out of the way.)
4. Install dependencies:
```sh
npm install
pnpm install
```
(This command also installs Git hooks using
[Husky](https://github.com/typicode/husky). For a comprehensive list of
Expand All @@ -36,7 +37,7 @@
5. Compile and start a server running frontscope, with hot-reloading for
development:
```sh
npm run dev
pnpm dev
```
The output of this command will provide instructions for connecting to the
new running instance of frontscope with your browser.
Expand Down
15 changes: 0 additions & 15 deletions doc/working-with-pm.md

This file was deleted.

4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nav:
- Contributing:
- CONTRIBUTING.md
- doc/onboarding.md
- doc/working-with-pm.md
- package.md
- doc/working-with-git-and-github.md
- doc/gitting-it-right.md
- doc/code-principles.md
Expand Down Expand Up @@ -51,7 +51,7 @@ plugins:
terminate: '<!-- CUT HERE -->'
merge_docs_dir: false
semiliterate:
- pattern: '\.ts' # Standard in-code markup
- pattern: '\.(?:ts|json5)' # Standard in-code markup
extract:
start: '^\s*/\*\*+\W?md\b' # Opening like /** md
stop: '^\s*\*\*/\s*$' # closing **/ by itself on a line
Expand Down
Loading