Skip to content

Commit

Permalink
Merge pull request #786 from MuckRock/765-authors
Browse files Browse the repository at this point in the history
AUTHORS and README
  • Loading branch information
eyeseast authored Oct 21, 2024
2 parents ee76efa + 9116fb0 commit 15fde5b
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 89 deletions.
34 changes: 34 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# AUTHORS

DocumentCloud was created in 2009 through generous funding from the Knight Foundation. The following is a work-in-progress list of the people who've built, maintained and/or contributed to the platform and its components:

- Adam Hooper, [@adamhooper](https://github.com/adamhooper)
- Al Shaw, [@ashaw](https://github.com/ashaw)
- Alan McLean, [@amclean](https://github.com/amclean)
- Allan Lasser, [@allanlasser](https://github.com/allanlasser)
- Amanda Hickman, [@amandabee](https://github.com/amandabee)
- Anthony DeBarros, [@anthonydb](https://github.com/anthonydb)
- Ben Koski, [@bkoski](https://github.com/bkoski)
- Ben Welsh, [@palewire](https://github.com/palewire)
- Chris Amico, [@eyeseast](https://github.com/eyeseast)
- Clay Selby, [@cometman](https://github.com/cometman)
- Dan Nguyen, [@dannguyen](https://github.com/dannguyen)
- Danny DeBelius, [@dannydb](https://github.com/dannydb)
- Danny Povolotski, [@israelidanny](https://github.com/israelidanny)
- David Lemayian, [@DavidLemayian](https://github.com/DavidLemayian)
- Dylan Freedman, [@freedmand](https://github.com/freedmand)
- Emily Yount, [@emilyyount](https://github.com/emilyyount)
- Ivar Vong, [@ivarvong](https://github.com/ivarvong)
- Jérémie Parker, [@p-j](https://github.com/p-j)
- Jeremy Ashkenas, [@jashkenas](https://github.com/jashkenas)
- Justin Reese, [@reefdog](https://github.com/reefdog)
- Lauren Grandestaff, [@lgrandestaff](https://github.com/lgrandestaff)
- Mike Adler, [@adler](https://github.com/adler)
- Mitchell Kotler, [@mitchelljkotler](https://github.com/mitchelljkotler)
- Nathan Stitt, [@nathanstitt](https://github.com/nathanstitt)
- Nick Loadholtes, [@nloadholtes](https://github.com/nloadholtes)
- Samantha Sunne, [@samanthasunne](https://github.com/samanthasunne)
- Samuel Clay, [@samuelclay](https://github.com/samuelclay)
- Sanjin [@duckduckgrayduck](https://github.com/duckduckgrayduck)
- Ted Han, [@knowtheory](https://github.com/knowtheory)
- Tim Caswell, [@creationix](https://github.com/creationix)
26 changes: 4 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
install:
npm ci
docker volume create nodemodules && docker compose -f local.builder.yml run --rm install

install-ci:
docker volume create nodemodules && docker compose -f local.builder.yml run --rm install-ci

npmlist:
docker compose -f local.builder.yml run --rm npmlist

build:
docker compose -f local.builder.yml run --rm build

build-staging:
docker compose -f local.builder.yml run --rm build_staging

build-browser-test:
docker compose -f local.builder.yml build browser-test

dev:
docker compose -f local.yml up documentcloud_frontend

dev-app:
docker compose -f local.yml up documentcloud_frontend_app

dev-embed:
docker compose -f local.yml up documentcloud_frontend_embed

down:
docker compose -f local.yml down

build-serve:
docker compose -f local.yml up documentcloud_frontend_build

build-analyze:
docker compose -f local.yml up documentcloud_frontend_analyze

prettier-check:
prettier --check --plugin-search-dir=. src

prettier:
prettier --write --plugin-search-dir=. src

clean:
# delete Webpack chunks
@echo deleting Webpack chunks
rm -f public/index.html public/[0-9]*.*.* public/bundle.*.js public/bundle.*.css public/bundle.*.txt public/*.map public/*.*.js
rm -rf public/assets public/notes public/viewer public/embed
@echo deleting built files
rm -rf build .svelte-kit .netlify playwright-report
58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The main frontend for DocumentCloud, written in [SvelteKit](https://kit.svelte.d

This project depends on both [Squarelet](https://github.com/muckrock/squarelet) and the [DocumentCloud (Django)](https://github.com/muckrock/documentcloud). Follow the steps in their READMEs before setting up this project.

In order to install dependencies inside the Docker container, run:
In order to install dependencies inside the Docker container and on your host machine, run:

```bash
make install
Expand All @@ -20,8 +20,6 @@ Once the node modules have been installed, start the app with:
make dev
```

**Warning:** Don't just run `docker compose up` like you would with some of the other repos. The containers listed in `local.yml` aren't intended to be run simultaneously.

Set up your hosts:

```bash
Expand All @@ -32,11 +30,7 @@ Once everything is up and running, you should be able to see the website live at

## Building for production

Run `make build` to build the production version of the app. The project will be output in the `dist` directory.

## Architecture

See the [Wiki](https://github.com/MuckRock/documentcloud-frontend/wiki) for information on the DocumentCloud architecture.
Run `make build` to build the production version of the app. The project will be output in the `build` directory. (This happens on Netlify and during Github Actions automatically.)

## Browser support

Expand Down Expand Up @@ -65,8 +59,7 @@ Run the relevant `npm install ...` command and then get the change mirrored on t

Run unit tests with `npm run test:unit`. Running `npm run test:watch` will re-run tests as code changes.

We use snapshots for testing component rendering. After updating Svelte components or styles, snapshot tests may fail if they're not updated.
To update snapshots, run `npm run test:unit -- -u`.
We use snapshots for testing component rendering. After updating Svelte components or styles, snapshot tests may fail if they're not updated. To update snapshots, run `npm run test:unit -- -u`.

### Browser tests

Expand All @@ -78,29 +71,34 @@ Run `npm run test:browser` in another terminal. This will run Playwright using C

### Development

The functional tests are organized like this:
The functional tests are colocated with the files they test, like this:

```
tests
├── README.md
├── anonymous
│ ├── manager
│ │ └── app.spec.js
│ ├── pages
│ │ └── home.spec.js
│ └── viewer
│ └── document.spec.js
└── fixtures
├── Small pdf.pdf
├── development.json
├── production.json
├── staging.json
└── the-nature-of-the-firm-CPEC11.pdf
src/lib/api/
├── accounts.ts
├── addons.ts
├── collaborators.ts
├── documents.ts
├── embed.ts
├── feedback.ts
├── flatpages.ts
├── notes.ts
├── projects.ts
├── sections.ts
├── tests
│ ├── accounts.test.ts
│ ├── addons.test.ts
│ ├── collaborators.test.ts
│ ├── documents.test.ts
│ ├── embed.test.ts
│ ├── flatpages.test.ts
│ ├── notes.test.ts
│ ├── projects.test.ts
│ └── sections.test.ts
└── types.d.ts
```

Tests are organized around major parts of the codebase -- `manager`, `pages` and `viewer`. Tests under `anonymous` don't use an authenticated user.

Tests rely on specific docouments available in each environment, which will have different URLs, so lists of known documents are provided in `development.json`, `staging.json` and `production.json`. Those correspond to the `NODE_ENV` environment variable.
Component tests use the [Svelte Testing Library](https://testing-library.com/docs/svelte-testing-library/intro/) and are also colocated near the components they test, usually in a `tests` folder.

## Legacy embed scripts

Expand All @@ -120,7 +118,7 @@ To run the Storybook dev server:
npm run storybook
```

To set and manage your Node version, you can use [NVM](https://github.com/nvm-sh/nvm):
To set and manage your Node version, you can use [NVM](https://github.com/nvm-sh/nvm) or [nodenv](https://github.com/nodenv/nodenv):

```sh
node -v
Expand Down
38 changes: 1 addition & 37 deletions local.builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ services:
install:
extends:
service: base
command: npm i && npm audit fix
command: npm ci && npm audit fix
environment:
- NODE_ENV=development

install-ci:
extends:
service: base
command: npm ci

npmlist:
extends:
service: base
Expand Down Expand Up @@ -49,23 +44,6 @@ services:
aliases:
- www.dev.documentcloud.org

build_staging:
extends:
service: base
command: npm run build-staging
networks:
default:
aliases:
- www.dev.documentcloud.org
squarelet_default:
aliases:
- www.dev.documentcloud.org

create-bundles:
extends:
service: base
command: npm run create-bundles

# TODO: Specify that base must be running first.
browser-test:
build:
Expand All @@ -81,20 +59,6 @@ services:
- NODE_ENV=test
command: ./browser-test-all.sh

browser-test-staging:
build:
dockerfile: browser-test.Dockerfile
networks:
default:
aliases:
- www.dev.documentcloud.org
squarelet_default:
aliases:
- www.dev.documentcloud.org
environment:
- NODE_ENV=staging
command: ./browser-test-all.sh

volumes:
nodemodules:
external: true
Expand Down

0 comments on commit 15fde5b

Please sign in to comment.