Base structure for monorepo

This commit is contained in:
Abhishek Gahlot 2020-08-17 20:04:10 +05:30
parent f53512c6d4
commit d87613399e
74 changed files with 6812 additions and 244 deletions

4
.gitignore vendored
View File

@ -31,3 +31,7 @@ yarn-error.log*
.env.production.local
pages/App.css
# Monorepo packages Node Modules
packages/portal/node_modules
packages/create-portal-app/node_modules

7
lerna.json Normal file
View File

@ -0,0 +1,7 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"version": "0.0.0"
}

View File

@ -1,82 +1,7 @@
{
"name": "frontend-v3",
"version": "0.1.0",
"name": "root",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"cypress:open": "cypress open",
"cypress:ci": "cypress run --config video=false",
"e2e": "cypress run",
"format": "prettier --single-quote --write .",
"pre-commit": "yarn lint:fix && prettier --single-quote --write",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "yarn lint --fix"
},
"dependencies": {
"@apollo/client": "^3.0.2",
"@apollo/react-hooks": "^3.1.5",
"@fullhuman/postcss-purgecss": "^2.3.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-rest": "0.7.3",
"apollo-server-testing": "^2.16.0",
"bytes": "^3.1.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-15": "^1.4.1",
"graphql": "^15.1.0",
"graphql-anywhere": "^4.2.7",
"graphql-tag": "^2.10.3",
"html-react-parser": "^0.13.0",
"markdown-it": "^11.0.0",
"next": "9.4.2",
"qs": "^6.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"slugify": "^1.4.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^10.0.4",
"@types/jest": "^25.2.3",
"@types/react": "^16.9.35",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"autoprefixer": "^9.8.6",
"babel-jest": "^26.0.1",
"babel-plugin-graphql-tag": "^2.5.0",
"cypress": "^4.8.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8",
"husky": ">=4",
"jest": "^26.1.0",
"lint-staged": ">=10",
"nock": "^12.0.3",
"npm-run-all": "^4.1.5",
"postcss-cli": "^7.1.1",
"postcss-import": "^12.0.1",
"postcss-preset-env": "6.7.0",
"prettier": "^2.0.5",
"react-test-renderer": "^16.13.1",
"tailwindcss": "^1.4.6",
"typescript": "^3.9.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx,js,jsx,css,html,md}": "yarn pre-commit"
"lerna": "^3.22.1"
}
}

View File

@ -15,20 +15,20 @@ Live DEMO: https://portal.datopian1.now.sh
## Features
* 🗺️ Unified sites: present data and content in one seamless site, pulling datasets from a DMS (e.g. CKAN) and content from a CMS (e.g. wordpress) with a common internal API.
* 👩‍💻 Developer friendly: built with familiar frontend tech Javascript, React etc
* 🔋 Batteries included: Full set of portal components out of the box e.g. catalog search, dataset showcase, blog etc.
* 🎨 Easy to theme and customize: installable themes, use standard CSS and React+CSS tooling. Add new routes quickly.
* 🧱E Extensible: quickly extend and develop/import your own React components
* 📝 Well documented: full set of documentation plus the documentation of NextJS and Apollo.
- 🗺️ Unified sites: present data and content in one seamless site, pulling datasets from a DMS (e.g. CKAN) and content from a CMS (e.g. wordpress) with a common internal API.
- 👩‍💻 Developer friendly: built with familiar frontend tech Javascript, React etc
- 🔋 Batteries included: Full set of portal components out of the box e.g. catalog search, dataset showcase, blog etc.
- 🎨 Easy to theme and customize: installable themes, use standard CSS and React+CSS tooling. Add new routes quickly.
- 🧱E Extensible: quickly extend and develop/import your own React components
- 📝 Well documented: full set of documentation plus the documentation of NextJS and Apollo.
### For developers
* 🏗 Build with modern, familiar frontend tech such as Javascript and React.
* 🚀 NextJS framework: so everything in NextJS for free React, SSR, static site generation, huge number of examples and integrations etc.
* SSR => unlimited number of pages, SEO etc whilst still using React.
* Static Site Generation (SSG) (good for small sites) => ultra-simple deployment, great performance and lighthouse scores etc
* 📋 Typescript support
- 🏗 Build with modern, familiar frontend tech such as Javascript and React.
- 🚀 NextJS framework: so everything in NextJS for free React, SSR, static site generation, huge number of examples and integrations etc.
- SSR => unlimited number of pages, SEO etc whilst still using React.
- Static Site Generation (SSG) (good for small sites) => ultra-simple deployment, great performance and lighthouse scores etc
- 📋 Typescript support
## Getting Started
@ -240,9 +240,9 @@ yarn run e2e
### Architecture
* Language: Javascript
* Framework: NextJS - https://nextjs.org/
* Data layer API: GraphQL using Apollo. So controllers access data using GraphQL “gatsby like”
- Language: Javascript
- Framework: NextJS - https://nextjs.org/
- Data layer API: GraphQL using Apollo. So controllers access data using GraphQL “gatsby like”
### Key Pages

View File

@ -0,0 +1,87 @@
{
"name": "portal-main",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/datopian/portal#readme",
"directories": {
"test": "__tests__"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"cypress:open": "cypress open",
"cypress:ci": "cypress run --config video=false",
"e2e": "cypress run",
"format": "prettier --single-quote --write .",
"pre-commit": "yarn lint:fix && prettier --single-quote --write",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "yarn lint --fix"
},
"dependencies": {
"@apollo/client": "^3.0.2",
"@apollo/react-hooks": "^3.1.5",
"@fullhuman/postcss-purgecss": "^2.3.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-rest": "0.7.3",
"apollo-server-testing": "^2.16.0",
"bytes": "^3.1.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-15": "^1.4.1",
"graphql": "^15.1.0",
"graphql-anywhere": "^4.2.7",
"graphql-tag": "^2.10.3",
"html-react-parser": "^0.13.0",
"markdown-it": "^11.0.0",
"next": "9.4.2",
"qs": "^6.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"slugify": "^1.4.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^10.0.4",
"@types/jest": "^25.2.3",
"@types/react": "^16.9.35",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"autoprefixer": "^9.8.6",
"babel-jest": "^26.0.1",
"babel-plugin-graphql-tag": "^2.5.0",
"cypress": "^4.8.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8",
"husky": ">=4",
"jest": "^26.1.0",
"lerna": "^3.22.1",
"lint-staged": ">=10",
"nock": "^12.0.3",
"npm-run-all": "^4.1.5",
"postcss-cli": "^7.1.1",
"postcss-import": "^12.0.1",
"postcss-preset-env": "6.7.0",
"prettier": "^2.0.5",
"react-test-renderer": "^16.13.1",
"tailwindcss": "^1.4.6",
"typescript": "^3.9.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx,js,jsx,css,html,md}": "yarn pre-commit"
}
}

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 408 B

File diff suppressed because it is too large Load Diff