Skip to content

Commit f6e7775

Browse files
committed
Migrate to a monorepo, and merge devfaq-api and devfaq-www
1 parent 34b89eb commit f6e7775

File tree

261 files changed

+15090
-789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+15090
-789
lines changed

packages/www/.all-contributorsrc renamed to .all-contributorsrc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projectName": "devfaq-www",
2+
"projectName": "devfaq",
33
"projectOwner": "typeofweb",
44
"repoType": "github",
55
"repoHost": "https://github.com",
@@ -9,7 +9,7 @@
99
"imageSize": 100,
1010
"commit": true,
1111
"commitConvention": "gitmoji",
12-
"contributors": [
12+
"contributors": [
1313
{
1414
"login": "mmiszy",
1515
"name": "Michał Miszczyszyn",
@@ -76,6 +76,24 @@
7676
"contributions": [
7777
"code"
7878
]
79+
},
80+
{
81+
"login": "D0man",
82+
"name": "Kuba Domański",
83+
"avatar_url": "https://avatars2.githubusercontent.com/u/22179216?v=4",
84+
"profile": "https://github.com/D0man",
85+
"contributions": [
86+
"review"
87+
]
88+
},
89+
{
90+
"login": "kbkk",
91+
"name": "Jakub Kisielewski",
92+
"avatar_url": "https://avatars3.githubusercontent.com/u/6276426?v=4",
93+
"profile": "https://github.com/kbkk",
94+
"contributions": [
95+
"review"
96+
]
7997
}
8098
],
8199
"contributorsPerLine": 7,

.circleci/config.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# version: 2.1
2+
# orbs:
3+
# node: circleci/node@1.1.6
4+
5+
# jobs:
6+
# www:
7+
# docker:
8+
# - image: circleci/node:12-browsers
9+
# steps:
10+
# - run: |
11+
# if [ "$CIRCLE_BRANCH" = "develop" ] || [ "$CIRCLE_BRANCH" = "master" ]; then
12+
# circleci-agent step halt
13+
# fi
14+
15+
# - checkout
16+
# - node/with-cache:
17+
# steps:
18+
# - run: yarn install --frozen-lockfile
19+
20+
# - run: yarn get-base-branch
21+
# - run: git status
22+
# - run: yarn workspace www build > analyze.next
23+
# - run: cat analyze.next
24+
# - run: yarn create-size && mv size-snapshot.json /tmp/current-size-snapshot.json
25+
# - run: rm analyze.next && rm -rf .next
26+
27+
# - run: git fetch && git checkout $(cat /tmp/.basebranch) && git reset --hard origin/$(cat /tmp/.basebranch)
28+
# - run: git status
29+
# - run: yarn install --frozen-lockfile
30+
# - run: yarn workspace www build > analyze.next
31+
# - run: cat analyze.next
32+
# - run: mv analyze.next /tmp/
33+
34+
# - run: git fetch && git checkout $CIRCLE_BRANCH && git reset --hard origin/$CIRCLE_BRANCH
35+
# - run: git status
36+
# - run: yarn install --frozen-lockfile
37+
38+
# - run: mv /tmp/analyze.next ./
39+
# - run: yarn create-size && mv size-snapshot.json previous-size-snapshot.json
40+
# - run: mv /tmp/current-size-snapshot.json ./
41+
42+
# # - run: mkdir -p /tmp/lighthouse/
43+
# - run: yarn workspace www danger ci
44+
45+
# - store_artifacts:
46+
# path: ./current-size-snapshot.json
47+
# # - store_artifacts:
48+
# # path: /tmp/lighthouse
49+
50+
# workflows:
51+
# www:
52+
# jobs:
53+
# - www:
54+
# filters:
55+
# branches:
56+
# ignore:
57+
# - /dependabot\/*/
File renamed without changes.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2+
"root": true,
23
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"sourceType": "module"
6+
},
37
"plugins": [],
4-
"extends": ["react-app", "prettier", "plugin:import/typescript"],
8+
"extends": ["prettier", "plugin:import/typescript"],
59
"rules": {
610
"no-const-assign": "error",
711
"import/no-anonymous-default-export": "error",
812
"import/dynamic-import-chunkname": "error",
913
"import/order": ["error", { "newlines-between": "always", "alphabetize": { "order": "asc" } }],
1014
"import/no-duplicates": "error",
1115
"import/no-cycle": "error",
12-
"react-hooks/exhaustive-deps": ["error", { "additionalHooks": "useCustomCompareMemo" }],
13-
"@typescript-eslint/no-unused-vars": 0,
14-
"jsx-a11y/anchor-is-valid": 0
16+
"@typescript-eslint/no-unused-vars": "off"
1517
}
1618
}

packages/api/.github/workflows/deploy.yml renamed to .github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Deploy
1+
name: Deploy to staging and production
22

33
on:
44
push:
5-
branches: [develop, master]
5+
branches: [master, develop]
66

77
jobs:
88
deploy:

.github/workflows/test-PR.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Test and Build
2+
3+
on:
4+
pull_request:
5+
branches: [develop, master]
6+
7+
jobs:
8+
test_www:
9+
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 100
16+
17+
- uses: marceloprado/has-changed-path@master
18+
id: changed-www
19+
with:
20+
paths: apps/www
21+
22+
- name: Read .nvmrc
23+
if: steps.changed-www.outputs.changed == 'true'
24+
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
25+
id: nvm
26+
- name: Use Node.js
27+
if: steps.changed-www.outputs.changed == 'true'
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: "${{ steps.nvm.outputs.NVMRC }}"
31+
32+
- name: Get yarn cache directory path
33+
if: steps.changed-www.outputs.changed == 'true'
34+
id: yarn-cache-dir-path
35+
run: echo "::set-output name=dir::$(yarn cache dir)"
36+
37+
- name: Cache Node.js modules
38+
if: steps.changed-www.outputs.changed == 'true'
39+
uses: actions/cache@v1
40+
with:
41+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
42+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-yarn-
45+
${{ runner.OS }}-
46+
47+
- name: Install dependencies
48+
if: steps.changed-www.outputs.changed == 'true'
49+
run: yarn workspace www install --frozen-lockfile
50+
51+
- name: Run tests
52+
if: steps.changed-www.outputs.changed == 'true'
53+
run: yarn workspace www test
54+
55+
- name: Run build
56+
if: steps.changed-www.outputs.changed == 'true'
57+
run: yarn workspace www build
58+
59+
test_api:
60+
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
with:
66+
fetch-depth: 100
67+
68+
- uses: marceloprado/has-changed-path@master
69+
id: changed-api
70+
with:
71+
paths: apps/api
72+
73+
- name: Setup PostgreSQL
74+
if: steps.changed-api.outputs.changed == 'true'
75+
uses: Harmon758/postgresql-action@v1.0.0
76+
with:
77+
postgresql version: 12-alpine
78+
postgresql db: database_development
79+
postgresql user: postgres
80+
postgresql password: -api2018
81+
82+
- name: Read .nvmrc
83+
if: steps.changed-api.outputs.changed == 'true'
84+
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
85+
id: nvm
86+
- name: Use Node.js
87+
if: steps.changed-api.outputs.changed == 'true'
88+
uses: actions/setup-node@v1
89+
with:
90+
node-version: "${{ steps.nvm.outputs.NVMRC }}"
91+
- name: Get yarn cache directory path
92+
if: steps.changed-api.outputs.changed == 'true'
93+
id: yarn-cache-dir-path
94+
run: echo "::set-output name=dir::$(yarn cache dir)"
95+
96+
- name: Cache Node.js modules
97+
if: steps.changed-api.outputs.changed == 'true'
98+
uses: actions/cache@v1
99+
with:
100+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
101+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
102+
restore-keys: |
103+
${{ runner.os }}-yarn-
104+
${{ runner.OS }}-
105+
106+
- name: Install dependencies
107+
if: steps.changed-api.outputs.changed == 'true'
108+
run: yarn workspace api install --frozen-lockfile
109+
110+
- name: Run tests
111+
if: steps.changed-api.outputs.changed == 'true'
112+
run: yarn workspace api test
113+
114+
- name: Run build for dependabot
115+
if: steps.changed-api.outputs.changed == 'true' && (github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
116+
run: yarn workspace api build

packages/api/.gitignore renamed to .gitignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
npm-debug.log
2+
.next
3+
out
4+
previous-size-snapshot.json
5+
current-size-snapshot.json
6+
size-snapshot.json
7+
analyze.next
8+
.deployment-url
9+
.basebranch
10+
package-lock.json
11+
12+
113
node_modules
214
.tmp
315
.idea
4-
.idea/
516
.DS_Store
6-
.env
717
.version
818
dist
9-
.vscode
1019
.history
1120

1221
# Logs
@@ -69,7 +78,4 @@ jspm_packages/
6978
.env
7079
.env.dev
7180

72-
package-lock.json
73-
7481
*.tsbuildinfo
75-
.version
File renamed without changes.
File renamed without changes.

packages/www/.vscode/settings.json renamed to .vscode/settings.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"search.exclude": {
1818
"**/node_modules": true,
1919
"**/bower_components": true,
20-
".next": true
20+
".next": true,
21+
"**/dist": true
2122
},
2223
"typescript.tsdk": "node_modules/typescript/lib",
2324
"typescript.preferences.importModuleSpecifier": "relative",
@@ -29,5 +30,15 @@
2930
"titleBar.inactiveBackground": "#401886",
3031
"titleBar.activeForeground": "#ffffff",
3132
"titleBar.inactiveForeground": "#ffffff"
32-
}
33+
},
34+
"tslint.autoFixOnSave": true,
35+
"files.exclude": {
36+
"**/.git": true,
37+
"**/.svn": true,
38+
"**/.hg": true,
39+
"**/CVS": true,
40+
"**/.DS_Store": true,
41+
"**/dist": true
42+
},
43+
"prettier.configPath": "./.prettierrc"
3344
}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# DevFAQ
2+
3+
![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/)
4+
5+
6+
## License
7+
8+
AGPL 3.0
9+
10+
[![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.

apps/api/.env.dev

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PORT=3002
2+
DB_USERNAME=postgres
3+
DB_PASSWORD=-api2018
4+
DB_NAME=database_development
5+
DB_HOSTNAME=127.0.0.1
6+
SENTRY_DSN=
7+
8+
COOKIE_DOMAIN="devfaq.localhost"
9+
COOKIE_PASSWORD="Xj-#?B#f+1#agiD8QiQvh=RLhy;+Ybj|/+f#|KPH5bs20w<e1:K_m{o>^pN@X]q1"
10+
11+
GITHUB_CLIENT_ID=e65b7b90cd7d2a85acd8
12+
GITHUB_CLIENT_SECRET=30087b1687598ce76ffa30ac5b6d3a45a7da9a17
13+
GITHUB_PASSWORD="g-X,-/O7oJ[EWVvE#*aK*!UKDS/zoudbEn!1T+`Ud|n(25EU/*gO::6QnffK+IZ`"

apps/api/.eslintrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"root": false,
3+
"extends": ["plugin:import/errors"],
4+
"rules": {
5+
"@typescript-eslint/no-unused-vars": "off"
6+
},
7+
"overrides": [
8+
{
9+
"files": ["src/models/*.ts"],
10+
"rules": {
11+
"import/no-cycle": "off"
12+
}
13+
}
14+
]
15+
}
File renamed without changes.

apps/api/.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

packages/api/CODE_OF_CONDUCT.md renamed to apps/api/CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

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

2323
Examples of unacceptable behavior by participants include:
2424

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

3434
## Our Responsibilities
3535

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)