Skip to content

Commit

Permalink
Migrate to a monorepo, and merge devfaq-api and devfaq-www
Browse files Browse the repository at this point in the history
  • Loading branch information
typeofweb committed Jun 9, 2020
1 parent 34b89eb commit f6e7775
Show file tree
Hide file tree
Showing 261 changed files with 15,090 additions and 789 deletions.
22 changes: 20 additions & 2 deletions packages/www/.all-contributorsrc → .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName": "devfaq-www",
"projectName": "devfaq",
"projectOwner": "typeofweb",
"repoType": "github",
"repoHost": "https://github.com",
Expand All @@ -9,7 +9,7 @@
"imageSize": 100,
"commit": true,
"commitConvention": "gitmoji",
"contributors": [
"contributors": [
{
"login": "mmiszy",
"name": "Michał Miszczyszyn",
Expand Down Expand Up @@ -76,6 +76,24 @@
"contributions": [
"code"
]
},
{
"login": "D0man",
"name": "Kuba Domański",
"avatar_url": "https://avatars2.githubusercontent.com/u/22179216?v=4",
"profile": "https://github.com/D0man",
"contributions": [
"review"
]
},
{
"login": "kbkk",
"name": "Jakub Kisielewski",
"avatar_url": "https://avatars3.githubusercontent.com/u/6276426?v=4",
"profile": "https://github.com/kbkk",
"contributions": [
"review"
]
}
],
"contributorsPerLine": 7,
Expand Down
57 changes: 57 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# version: 2.1
# orbs:
# node: circleci/node@1.1.6

# jobs:
# www:
# docker:
# - image: circleci/node:12-browsers
# steps:
# - run: |
# if [ "$CIRCLE_BRANCH" = "develop" ] || [ "$CIRCLE_BRANCH" = "master" ]; then
# circleci-agent step halt
# fi

# - checkout
# - node/with-cache:
# steps:
# - run: yarn install --frozen-lockfile

# - run: yarn get-base-branch
# - run: git status
# - run: yarn workspace www build > analyze.next
# - run: cat analyze.next
# - run: yarn create-size && mv size-snapshot.json /tmp/current-size-snapshot.json
# - run: rm analyze.next && rm -rf .next

# - run: git fetch && git checkout $(cat /tmp/.basebranch) && git reset --hard origin/$(cat /tmp/.basebranch)
# - run: git status
# - run: yarn install --frozen-lockfile
# - run: yarn workspace www build > analyze.next
# - run: cat analyze.next
# - run: mv analyze.next /tmp/

# - run: git fetch && git checkout $CIRCLE_BRANCH && git reset --hard origin/$CIRCLE_BRANCH
# - run: git status
# - run: yarn install --frozen-lockfile

# - run: mv /tmp/analyze.next ./
# - run: yarn create-size && mv size-snapshot.json previous-size-snapshot.json
# - run: mv /tmp/current-size-snapshot.json ./

# # - run: mkdir -p /tmp/lighthouse/
# - run: yarn workspace www danger ci

# - store_artifacts:
# path: ./current-size-snapshot.json
# # - store_artifacts:
# # path: /tmp/lighthouse

# workflows:
# www:
# jobs:
# - www:
# filters:
# branches:
# ignore:
# - /dependabot\/*/
File renamed without changes.
10 changes: 6 additions & 4 deletions packages/www/.eslintrc → .eslintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": [],
"extends": ["react-app", "prettier", "plugin:import/typescript"],
"extends": ["prettier", "plugin:import/typescript"],
"rules": {
"no-const-assign": "error",
"import/no-anonymous-default-export": "error",
"import/dynamic-import-chunkname": "error",
"import/order": ["error", { "newlines-between": "always", "alphabetize": { "order": "asc" } }],
"import/no-duplicates": "error",
"import/no-cycle": "error",
"react-hooks/exhaustive-deps": ["error", { "additionalHooks": "useCustomCompareMemo" }],
"@typescript-eslint/no-unused-vars": 0,
"jsx-a11y/anchor-is-valid": 0
"@typescript-eslint/no-unused-vars": "off"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Deploy
name: Deploy to staging and production

on:
push:
branches: [develop, master]
branches: [master, develop]

jobs:
deploy:
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/test-PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Test and Build

on:
pull_request:
branches: [develop, master]

jobs:
test_www:
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- uses: marceloprado/has-changed-path@master
id: changed-www
with:
paths: apps/www

- name: Read .nvmrc
if: steps.changed-www.outputs.changed == 'true'
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js
if: steps.changed-www.outputs.changed == 'true'
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"

- name: Get yarn cache directory path
if: steps.changed-www.outputs.changed == 'true'
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Node.js modules
if: steps.changed-www.outputs.changed == 'true'
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.OS }}-
- name: Install dependencies
if: steps.changed-www.outputs.changed == 'true'
run: yarn workspace www install --frozen-lockfile

- name: Run tests
if: steps.changed-www.outputs.changed == 'true'
run: yarn workspace www test

- name: Run build
if: steps.changed-www.outputs.changed == 'true'
run: yarn workspace www build

test_api:
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- uses: marceloprado/has-changed-path@master
id: changed-api
with:
paths: apps/api

- name: Setup PostgreSQL
if: steps.changed-api.outputs.changed == 'true'
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql version: 12-alpine
postgresql db: database_development
postgresql user: postgres
postgresql password: -api2018

- name: Read .nvmrc
if: steps.changed-api.outputs.changed == 'true'
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js
if: steps.changed-api.outputs.changed == 'true'
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Get yarn cache directory path
if: steps.changed-api.outputs.changed == 'true'
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Node.js modules
if: steps.changed-api.outputs.changed == 'true'
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.OS }}-
- name: Install dependencies
if: steps.changed-api.outputs.changed == 'true'
run: yarn workspace api install --frozen-lockfile

- name: Run tests
if: steps.changed-api.outputs.changed == 'true'
run: yarn workspace api test

- name: Run build for dependabot
if: steps.changed-api.outputs.changed == 'true' && (github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
run: yarn workspace api build
18 changes: 12 additions & 6 deletions packages/api/.gitignore → .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
npm-debug.log
.next
out
previous-size-snapshot.json
current-size-snapshot.json
size-snapshot.json
analyze.next
.deployment-url
.basebranch
package-lock.json


node_modules
.tmp
.idea
.idea/
.DS_Store
.env
.version
dist
.vscode
.history

# Logs
Expand Down Expand Up @@ -69,7 +78,4 @@ jspm_packages/
.env
.env.dev

package-lock.json

*.tsbuildinfo
.version
File renamed without changes.
File renamed without changes.
15 changes: 13 additions & 2 deletions packages/www/.vscode/settings.json → .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
".next": true
".next": true,
"**/dist": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "relative",
Expand All @@ -29,5 +30,15 @@
"titleBar.inactiveBackground": "#401886",
"titleBar.activeForeground": "#ffffff",
"titleBar.inactiveForeground": "#ffffff"
}
},
"tslint.autoFixOnSave": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/dist": true
},
"prettier.configPath": "./.prettierrc"
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DevFAQ

![Test and Build](https://github.com/typeofweb/devfaq/workflows/Test%20and%20Build/badge.svg) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=typeofweb_devfaq&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=typeofweb_devfaq) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftypeofweb%2Fdevfaq.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftypeofweb%2Fdevfaq?ref=badge_shield) [![Discord](https://img.shields.io/discord/440163731704643589?color=738ADB&label=Discord&logo=discord&logoColor=white)](https://discord.typeofweb.com/)


## License

AGPL 3.0

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftypeofweb%2Fdevfaq.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftypeofweb%2Fdevfaq?ref=badge_large)
File renamed without changes.
13 changes: 13 additions & 0 deletions apps/api/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PORT=3002
DB_USERNAME=postgres
DB_PASSWORD=-api2018
DB_NAME=database_development
DB_HOSTNAME=127.0.0.1
SENTRY_DSN=

COOKIE_DOMAIN="devfaq.localhost"
COOKIE_PASSWORD="Xj-#?B#f+1#agiD8QiQvh=RLhy;+Ybj|/+f#|KPH5bs20w<e1:K_m{o>^pN@X]q1"

GITHUB_CLIENT_ID=e65b7b90cd7d2a85acd8
GITHUB_CLIENT_SECRET=30087b1687598ce76ffa30ac5b6d3a45a7da9a17
GITHUB_PASSWORD="g-X,-/O7oJ[EWVvE#*aK*!UKDS/zoudbEn!1T+`Ud|n(25EU/*gO::6QnffK+IZ`"
15 changes: 15 additions & 0 deletions apps/api/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"root": false,
"extends": ["plugin:import/errors"],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
},
"overrides": [
{
"files": ["src/models/*.ts"],
"rules": {
"import/no-cycle": "off"
}
}
]
}
File renamed without changes.
1 change: 1 addition & 0 deletions apps/api/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
26 changes: 13 additions & 13 deletions packages/api/CODE_OF_CONDUCT.md → apps/api/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f6e7775

Please sign in to comment.