Skip to content

Commit

Permalink
HTML Sanitize (#21)
Browse files Browse the repository at this point in the history
* new package

* adding a deep merge function

* adding typed result

* using result from @charliewilco/toolkit

* adding new sanitizer

* progress on parser

* Changes to the code to get tests passing (#20)

* adding new rc files

---------

Co-authored-by: Jacob Foster <[email protected]>
  • Loading branch information
charliewilco and shadyendless committed Feb 21, 2023
1 parent b7b8401 commit 1b62723
Show file tree
Hide file tree
Showing 41 changed files with 13,749 additions and 13,976 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ brew install postgres@14 node

### Node

Make sure you're using `16.x` because [Vercel](https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version) currently lists their default runtime as that version. This project uses [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) & [Turborepo](https://turborepo.org/) and setup is simple:
Make sure you're using `18.x` because [Vercel](https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version) currently lists their default runtime as that version. This project uses [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) & [Turborepo](https://turborepo.org/) and setup is simple:

```
npm install
Expand Down Expand Up @@ -75,18 +75,28 @@ _NOTE_: Running this command will also clear the database of all existing data.

## Project Structure

### Available Scripts
### Commands

| command | description |
| ------------------ | ---------------------------------------------------------------- |
| `npm run build` | Runs build in each workspace |
| `npm test` | Executes the tests in each workspace |
| `npm run clean` | Clears out specific cache directories |
| `npm run generate` | Generates types from the GraphQL documents for server and client |
| `npm run dev` | Run all projects in development mode |
| `npm run e2e` | Kick of integration tests |

### Scripts

Quality of life project scripts found in:

- `/scripts/*.mjs`

Use `.mjs` with `// @ts-check` at the top of the file.

### Application

- `/apps/browser-extension`: Chrome browser extension, uses Preact and Parcel recipes
- `/apps/browser-extension`: Chrome browser extension, uses React and Parcel recipes
- `/apps/graphql`: GraphQL server uses Apollo Server
- `/apps/ui`: Web application uses Next.js and TailwindCSS

Expand All @@ -95,6 +105,22 @@ Each project contains
- `/apps/<project>/src/*`: source code
- `/apps/<project>/test/*`: all unit tests

### Packages

- `/packages/rsskit`: Converts RSS to JSON
- `/packages/html-sweeper`: Returns safe HTML to render
- `/packages/graphql-date-ts`: Custom date scalar for GQL
- `/packages/graphql-depth-limit`: TS port of `graphql-depth-limit`

Each project contains

- `/packages/<project>/src/*`: source code
- `/packages/<project>/test/*`: all unit tests

### End-to-end Tests

- `/e2e`: Built with [Playwright](https://playwright.dev/)

### Repository

- `/docs`: Documentation in markdown
Expand Down
8 changes: 4 additions & 4 deletions apps/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
"@rollup/plugin-graphql": "^2.0.2",
"@rollup/plugin-run": "^3.0.1",
"@rollup/plugin-typescript": "^11.0.0",
"@types/jest": "^29.2.5",
"@types/jest": "^29.2.6",
"@types/node": "^18.11.18",
"babel-jest": "^29.3.1",
"cuid": "^2.1.8",
"jest": "^29.3.1",
"prisma": "^4.8.1",
"prisma": "^4.9.0",
"rollup": "^3.10.0",
"ts-jest": "^29.0.4",
"ts-jest": "^29.0.5",
"typescript": "^4.9.4"
},
"dependencies": {
"@apollo/server": "^4.3.0",
"@graphql-tools/schema": "^9.0.13",
"@graphql-tools/utils": "^9.1.4",
"@prisma/client": "^4.8.1",
"@prisma/client": "^4.9.0",
"@reubin/graphql-date-ts": "*",
"@reubin/rsskit": "*",
"@types/base-64": "^1.0.0",
Expand Down
3 changes: 3 additions & 0 deletions apps/ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
6 changes: 6 additions & 0 deletions apps/ui/.postcssrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
}
}
24 changes: 8 additions & 16 deletions apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest --verbose",
"types": "tsc --noEmit --pretty"
},
"dependencies": {
"@apollo/client": "^3.7.3",
"@headlessui/react": "^1.7.7",
"@next/env": "^13.1.2",
"@next/font": "^13.1.2",
"@next/env": "^13.1.4",
"@next/font": "^13.1.4",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
Expand All @@ -21,15 +22,15 @@
"fathom-client": "^3.5.0",
"graphql-request": "^5.1.0",
"graphql-tag": "^2.12.6",
"lucide-react": "^0.101.0",
"next": "^13.1.2",
"lucide-react": "^0.105.0",
"next": "^13.1.4",
"postcss": "^8.4.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-fast-compare": "^3.2.0",
"sharp": "^0.31.3",
"swr": "^1.3.0",
"tailwindcss": "^3.2.1",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.4",
"universal-cookie": "^4.0.4",
"valtio": "^1.8.2",
Expand All @@ -39,23 +40,14 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.2.5",
"@types/jest": "^29.2.6",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"eslint": "^8.31.0",
"eslint-config-next": "^13.1.2",
"eslint-config-next": "^13.1.4",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"msw": "^0.49.2"
},
"eslintConfig": {
"extends": "next/core-web-vitals"
},
"postcss": {
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
}
}
}
6 changes: 5 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
"deps": "playwright install --with-deps",
"codegen": "playwright codegen localhost:3000"
},
"dependencies": {
"@reubin/ui": "*",
"@reubin/graphql": "*"
},
"devDependencies": {
"cuid": "^2.1.8",
"@playwright/test": "^1.29.1",
"typescript": "^4.8.4"
"typescript": "^4.9.4"
}
}
Loading

1 comment on commit 1b62723

@vercel
Copy link

@vercel vercel bot commented on 1b62723 Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.