Skip to content

Commit

Permalink
chore: move to monorepo (#296)
Browse files Browse the repository at this point in the history
* chore: use pnpm

* install in docker

* use overrides

* restructure

* acc builds?

* type cast

* remove top level .next.env.d.ts

* fix build

* remove extra space

* ensure we are running post/pre scripts

* update website integriy check script

* feedback

* Update website/package.json

Co-authored-by: Dimitri POSTOLOV <[email protected]>

* remove package manager

* chore: add remark-frontmatter

* chore: add remark-mdx-frontmatter

* fix: deps

* move eslint config to root

* remove sitemap xml from public

---------

Co-authored-by: Dimitri POSTOLOV <[email protected]>
  • Loading branch information
saihaj and Dimitri POSTOLOV authored Mar 9, 2023
1 parent c338320 commit 310d102
Show file tree
Hide file tree
Showing 482 changed files with 680 additions and 370 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/website-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
run: pnpm build

- name: Compare
run: git diff origin/${{ github.base_ref }}.. -- route-lockfile.txt
run: git diff origin/${{ github.base_ref }}.. -- website/route-lockfile.txt

- name: Diff to file
if: always()
id: diff_result
run: |
echo "result<<EOF" >> $GITHUB_OUTPUT
echo "$(git diff origin/${{ github.base_ref }}.. -- route-lockfile.txt)" >> $GITHUB_OUTPUT
echo "$(git diff origin/${{ github.base_ref }}.. -- website/route-lockfile.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: Publish a message
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# dependencies
/node_modules
node_modules/
/.pnp
.pnp.js
.yalc
Expand Down Expand Up @@ -39,4 +39,4 @@ yarn-error.log*

.idea/

public/sitemap*.xml
*/public/sitemap*.xml
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
FROM node:18-alpine as builder

ENV PNPM_HOME="/usr/bin"

RUN apk add --no-cache git
RUN npm install -g pnpm

WORKDIR /app

# copy package and lock files first for better caching
COPY ./package.json /app/package.json
COPY ./pnpm-lock.yaml /app/pnpm-lock.yaml
COPY . .

# install the packages
RUN pnpm install --frozen-lockfile --ignore-scripts

# copy the rest
COPY . .

RUN pnpm build
RUN pnpm export

Expand Down
60 changes: 8 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@graphprotocol/docs",
"version": "1.0.0",
"packageManager": "[email protected]",
"name": "the-graph-docs-monorepo",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"dev": "next dev",
"build": "rm -rf .next && next build",
"postbuild": "next-sitemap --config next-sitemap.config.cjs && node scripts/sitemap-ci.mjs",
"start": "next start",
"export": "rm -rf out && next export -o out/docs",
"build": "pnpm -r build",
"start": "pnpm --filter @graphprotocol/docs start",
"export": "pnpm --filter @graphprotocol/docs export",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier:check && pnpm typecheck",
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.mjs && pnpm prettier && pnpm typecheck",
"prettier": "prettier . --write",
Expand All @@ -21,55 +19,13 @@
"pre-commit": "lint-staged --concurrent false",
"pre-push": "pnpm build"
},
"dependencies": {
"@docsearch/react": "^3.3.3",
"@edgeandnode/components": "^27.0.0",
"@emotion/react": "^11.10.6",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@next/mdx": "^13.2.3",
"@radix-ui/react-collapsible": "1.0.1",
"@radix-ui/react-popover": "^1.0.4",
"@radix-ui/react-visually-hidden": "^1.0.1",
"@reach/auto-id": "^0.18.0",
"lodash": "^4.17.21",
"mixpanel-browser": "^2.45.0",
"next": "^13.2.3",
"next-seo": "^5.15.0",
"next-sitemap": "^4.0.1",
"prism-react-renderer": "^1.3.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intersection-observer": "^9.4.3",
"react-use": "^17.4.0",
"remark-gfm": "^3.0.1",
"theme-ui": "^0.15.5"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@edgeandnode/eslint-config": "^1.3.1",
"@sindresorhus/slugify": "^2.2.0",
"@svgr/webpack": "^6.5.1",
"@types/color": "^3.0.3",
"@types/lodash": "^4.14.191",
"@types/mixpanel-browser": "^2.38.1",
"@types/node": "^18.14.5",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"acorn": "^8.8.2",
"acorn-jsx": "^5.3.2",
"eslint": "^8.35.0",
"fast-xml-parser": "^4.1.3",
"@edgeandnode/eslint-config": "^1.3.0",
"eslint": "^8.34.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"path": "^0.12.7",
"prettier": "^2.8.4",
"remark-frontmatter": "^4.0.1",
"remark-mdx-frontmatter": "^2.1.1",
"serialize-as-code": "^2.0.2",
"typescript": "4.9.5",
"unist-util-visit": "^4.1.2",
"url": "^0.11.0"
"typescript": "4.9.5"
},
"pnpm": {
"overrides": {
Expand Down
Loading

0 comments on commit 310d102

Please sign in to comment.