Skip to content

Commit 4369a3f

Browse files
committed
refactor: new project structure
1 parent 13323ee commit 4369a3f

File tree

426 files changed

+7010
-5501
lines changed

Some content is hidden

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

426 files changed

+7010
-5501
lines changed

.DS_Store

8 KB
Binary file not shown.

.circleci/config.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defaults: &defaults
55
- image: circleci/redis
66
ports:
77
- '6379:6379'
8-
- image: postgres:9.6
8+
- image: postgres:12
99
environment:
1010
POSTGRES_HOST_AUTH_METHOD: trust
1111
ports:
@@ -35,6 +35,7 @@ jobs:
3535
name: Install js dependencies
3636
command: |
3737
yarn install --frozen-lockfile
38+
yarn build
3839
- save_cache:
3940
key: yarn-sha-{{ checksum "yarn.lock" }}
4041
paths:
@@ -57,7 +58,7 @@ jobs:
5758
environment:
5859
NODE_ENV: test
5960
command: |
60-
yarn api:db:reset
61+
yarn setup
6162
yarn test --ci
6263
test_misc:
6364
<<: *defaults
@@ -71,14 +72,6 @@ jobs:
7172
command: |
7273
sudo apt-get update
7374
sudo apt-get install postgresql postgresql-contrib
74-
- run:
75-
name: Can run the seeds
76-
environment:
77-
NODE_ENV: test
78-
command: |
79-
yarn api:db:reset
80-
yarn knex seed:run
81-
yarn api:db:truncate
8275
- run:
8376
name: Can run argos
8477
command: yarn argos

.eslintignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/lib/
2-
/sandbox/
3-
/server/static/
1+
apps/*/lib/
2+
apps/*/dist/
3+
package.json
44
node_modules/
5+
/public/

.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"root": true,
3-
"extends": ["smooth", "smooth/project", "smooth/react"],
3+
"extends": ["smooth", "smooth/react"],
44
"rules": {
55
"react/no-unescaped-entities": "off",
66
"react/forbid-prop-types": "off",
@@ -13,7 +13,7 @@
1313
"settings": {
1414
"import/resolver": {
1515
"node": {
16-
"paths": ["src/review"]
16+
"paths": []
1717
}
1818
}
1919
}

.gitignore

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
*.log
2-
.env
3-
.eslintcache
4-
/.volume
5-
/lib/
6-
/server/static/
1+
apps/*/lib/
2+
apps/*/dist/
73
node_modules/
4+
/public/

.prettierignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/lib/
2-
/sandbox/
3-
/server/static/
1+
apps/*/lib/
2+
apps/*/dist/
43
package.json
54
node_modules/
5+
/public/

Procfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
release: ./scripts/release.sh
2-
web: TRACE_SERVICE_NAME=web ./src/scripts/heroku-node-settings.sh lib/server/workers/web.js
3-
buildAndSynchronize: TRACE_SERVICE_NAME=buildAndSynchronize ./src/scripts/heroku-node-settings.sh lib/server/workers/buildAndSynchronize.js
4-
screenshotDiff: TRACE_SERVICE_NAME=screenshotDiff ./src/scripts/heroku-node-settings.sh lib/server/workers/screenshotDiff.js
2+
web: ./scripts/heroku-node-settings.sh ./node_modules/.bin/argos-web
3+
buildAndSynchronize: ./scripts/heroku-node-settings.sh ./node_modules/.bin/argos-build-and-synchronize
4+
screenshotDiff: ./scripts/heroku-node-settings.sh ./node_modules/.bin/argos-screenshot-diff

Procfile.dev

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
web: nodemon src/server/workers/web.js
2-
buildAndSynchronize: nodemon src/server/workers/buildAndSynchronize.js
3-
screenshotDiff: nodemon src/server/workers/screenshotDiff.js
1+
release: ./scripts/release.sh
2+
web: nodemon ./node_modules/.bin/argos-web
3+
buildAndSynchronize: nodemon ./node_modules/.bin/argos-build-and-synchronize
4+
screenshotDiff: nodemon ./node_modules/.bin/argos-screenshot-diff

apps/app/.babelrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"presets": [
3+
"@babel/preset-react",
4+
[
5+
"@babel/preset-env",
6+
{
7+
"loose": true,
8+
"targets": {
9+
"node": "current"
10+
}
11+
}
12+
]
13+
],
14+
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": true }]]
15+
}

apps/app/.eslintrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"import/no-extraneous-dependencies": "off"
4+
}
5+
}

apps/app/package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@argos-ci/app",
3+
"version": "2.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "webpack-dev-server",
7+
"build": "NODE_ENV=production webpack"
8+
},
9+
"sideEffects": false,
10+
"devDependencies": {
11+
"@apollo/react-hooks": "^3.1.3",
12+
"@argos-ci/config": "2.0.0",
13+
"@sentry/browser": "^5.14.2",
14+
"@smooth-ui/core-sc": "^11.1.5",
15+
"@xstyled/styled-components": "^1.17.0",
16+
"apollo-boost": "^0.4.7",
17+
"assets-webpack-plugin": "^3.9.10",
18+
"core-js": "^3.6.4",
19+
"file-loader": "^5.1.0",
20+
"graphql-tag": "^2.10.3",
21+
"image-webpack-loader": "^6.0.0",
22+
"json-loader": "^0.5.7",
23+
"lodash": "^4.17.15",
24+
"moment": "^2.24.0",
25+
"raw-loader": "^4.0.0",
26+
"react": "^16.13.0",
27+
"react-dom": "^16.13.0",
28+
"react-helmet": "^5.2.1",
29+
"react-icons": "^3.9.0",
30+
"react-markdown": "^4.3.1",
31+
"react-router-dom": "^5.1.2",
32+
"react-tooltip": "^4.1.2",
33+
"reakit": "^1.0.0-beta.16",
34+
"store": "^2.0.12",
35+
"styled-components": "^5.0.1",
36+
"webpack": "^4.42.0",
37+
"webpack-cli": "^3.3.11",
38+
"webpack-dev-server": "^3.10.3"
39+
}
40+
}

src/review/App.js apps/app/src/App.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import React from 'react'
22
import { Helmet } from 'react-helmet'
33
import { BrowserRouter, Route, Switch } from 'react-router-dom'
44
import { Normalize } from '@smooth-ui/core-sc'
5-
import { ScrollToTop, GoogleAnalytics } from 'containers/Router'
6-
import { AuthInitializer } from 'containers/Auth'
7-
import { ApolloInitializer } from 'containers/Apollo'
8-
import { ThemeInitializer } from 'containers/Theme'
9-
import { UserInitializer } from 'containers/User'
10-
import { SyncAlertBar } from 'containers/SyncAlertBar'
11-
import { AppNavbar } from 'containers/AppNavbar'
12-
import { AppFooter } from 'containers/AppFooter'
13-
import { Home } from 'pages/Home'
14-
import { Owner } from 'pages/Owner'
15-
import { ErrorPage } from 'pages/ErrorPage'
16-
import { Repository } from 'pages/Repository'
17-
import { NotFound } from 'pages/NotFound'
18-
import Privacy from 'pages/Privacy.md'
19-
import Terms from 'pages/Terms.md'
20-
import Security from 'pages/Security.md'
5+
import { ScrollToTop, GoogleAnalytics } from './containers/Router'
6+
import { AuthInitializer } from './containers/Auth'
7+
import { ApolloInitializer } from './containers/Apollo'
8+
import { ThemeInitializer } from './containers/Theme'
9+
import { UserInitializer } from './containers/User'
10+
import { SyncAlertBar } from './containers/SyncAlertBar'
11+
import { AppNavbar } from './containers/AppNavbar'
12+
import { AppFooter } from './containers/AppFooter'
13+
import { Home } from './pages/Home'
14+
import { Owner } from './pages/Owner'
15+
import { ErrorPage } from './pages/ErrorPage'
16+
import { Repository } from './pages/Repository'
17+
import { NotFound } from './pages/NotFound'
18+
import Privacy from './pages/Privacy.md'
19+
import Terms from './pages/Terms.md'
20+
import Security from './pages/Security.md'
2121

2222
import {
2323
GlobalStyle,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/review/components/Beast.js apps/app/src/components/Beast.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable max-len */
2-
31
import React from 'react'
42

53
export function Beast(props) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/review/components/ProductHeader.js apps/app/src/components/ProductHeader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import styled from '@xstyled/styled-components'
33
import { Text, Box } from '@smooth-ui/core-sc'
4-
import { LayoutBody } from 'components/LayoutBody'
4+
import { LayoutBody } from './LayoutBody'
55

66
const HeaderContainer = styled.box`
77
min-height: 300;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
export * from './AlertBar'
22
export * from './Avatar'
3+
export * from './Beast'
34
export * from './BrandLogo'
4-
export * from './Catch'
55
export * from './Card'
6+
export * from './Catch'
67
export * from './Code'
78
export * from './Container'
89
export * from './Footer'
910
export * from './GlobalStyle'
1011
export * from './Header'
1112
export * from './Layout'
13+
export * from './LayoutBody'
1214
export * from './Link'
1315
export * from './Loader'
1416
export * from './Markdown'
1517
export * from './Menu'
1618
export * from './Navbar'
1719
export * from './ProductHeader'
20+
export * from './ScrollView'
1821
export * from './SmoothCodeLogo'
1922
export * from './Tab'
2023
export * from './Text'

src/configBrowser.js apps/app/src/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ function walk(obj, path, initializeMissing = false) {
2121
}
2222

2323
export default {
24-
get: key => (global.clientData ? walk(global.clientData.config, key) : null),
24+
get: key => (window.clientData ? walk(window.clientData.config, key) : null),
2525
}
File renamed without changes.

src/review/containers/AppFooter.js apps/app/src/containers/AppFooter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react'
22
import { Link } from 'react-router-dom'
3+
import { useColorMode } from '@xstyled/styled-components'
34
import {
45
Footer,
56
FooterBody,
67
FooterPrimary,
78
FooterSecondary,
89
FooterLink,
910
SmoothCodeLogo,
10-
} from 'components'
11-
import { useColorMode } from '@xstyled/styled-components'
11+
} from '../components'
1212

1313
export function AppFooter() {
1414
const [colorMode] = useColorMode()

src/review/containers/AppNavbar.js apps/app/src/containers/AppNavbar.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import {
99
useMenuState,
1010
} from '@smooth-ui/core-sc'
1111
import { useColorMode } from '@xstyled/styled-components'
12-
import configBrowser from 'configBrowser'
1312
import { FaGithub } from 'react-icons/fa'
13+
import config from '../config'
1414
import {
1515
NavbarSecondary,
1616
NavbarBrandLink,
1717
Navbar,
1818
NavbarBrand,
1919
BrandLogo,
20-
} from 'components'
21-
import { OwnerAvatar } from 'containers/OwnerAvatar'
20+
} from '../components'
21+
import { OwnerAvatar } from './OwnerAvatar'
2222
import { useUser } from './User'
2323

2424
// eslint-disable-next-line react/forbid-foreign-prop-types
@@ -51,7 +51,7 @@ function UserMenu({ user }) {
5151
<MenuItem
5252
{...menu}
5353
forwardedAs="a"
54-
href={configBrowser.get('github.applicationUrl')}
54+
href={config.get('github.applicationUrl')}
5555
target="_blank"
5656
rel="noopener noreferrer"
5757
>
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/review/containers/StatusIcon.js apps/app/src/containers/StatusIcon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Box } from '@xstyled/styled-components'
33
import { FaTimes, FaCheck, FaDotCircle } from 'react-icons/fa'
4-
import { getStatusColor } from 'modules/build'
4+
import { getStatusColor } from '../modules/build'
55

66
export function StatusIcon({ status, ...props }) {
77
const buildColor = getStatusColor(status)
File renamed without changes.

src/review/containers/SyncAlertBar.js apps/app/src/containers/SyncAlertBar.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Button, Box } from '@smooth-ui/core-sc'
3-
import { AlertBar, AlertBarBody, Loader } from 'components'
4-
import { isUserSyncing } from 'modules/user'
3+
import { AlertBar, AlertBarBody, Loader } from '../components'
4+
import { isUserSyncing } from '../modules/user'
55
import { useUser, useRefetchUser } from './User'
66

77
const REFETCH_DELAY = 1000
File renamed without changes.
File renamed without changes.

src/review/main.js apps/app/src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import 'core-js'
22
import React from 'react'
33
import { render } from 'react-dom'
44
import * as Sentry from '@sentry/browser'
5-
import configBrowser from 'configBrowser'
5+
import config from './config'
66
import { App } from './App'
77

88
if (process.env.NODE_ENV === 'production') {
99
Sentry.init({
10-
dsn: configBrowser.get('sentry.clientDsn'),
11-
environment: configBrowser.get('sentry.environment'),
12-
release: configBrowser.get('releaseVersion'),
10+
dsn: config.get('sentry.clientDsn'),
11+
environment: config.get('sentry.environment'),
12+
release: config.get('releaseVersion'),
1313
})
1414
}
1515

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

src/review/pages/Documentation.js apps/app/src/pages/Documentation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Helmet } from 'react-helmet'
33
import { Link } from 'react-router-dom'
4-
import { Container, FadeLink } from 'components'
4+
import { Container, FadeLink } from '../components'
55

66
export function Documentation() {
77
return (

src/review/pages/ErrorPage.js apps/app/src/pages/ErrorPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Helmet } from 'react-helmet'
33
import { Link } from 'react-router-dom'
4-
import { Container, FadeLink } from 'components'
4+
import { Container, FadeLink } from '../components'
55

66
export function ErrorPage() {
77
return (
File renamed without changes.

src/review/pages/NotFound.js apps/app/src/pages/NotFound.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
CardBody,
1010
CardText,
1111
FadeLink,
12-
} from 'components'
12+
} from '../components'
1313

1414
export function NotFound() {
1515
return (

src/review/pages/Owner/Repositories.js apps/app/src/pages/Owner/Repositories.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React from 'react'
22
import gql from 'graphql-tag'
33
import { Link } from 'react-router-dom'
44
import styled, { Box, th } from '@xstyled/styled-components'
5-
import { Query } from 'containers/Apollo'
65
import Tooltip from 'react-tooltip'
76
import { GoRepo } from 'react-icons/go'
8-
import { StatusIcon } from 'containers/StatusIcon'
97
import moment from 'moment'
8+
import { Query } from '../../containers/Apollo'
9+
import { StatusIcon } from '../../containers/StatusIcon'
1010
import {
1111
Container,
1212
Card,
@@ -15,8 +15,8 @@ import {
1515
CardBody,
1616
FadeLink,
1717
Text,
18-
} from 'components'
19-
import { getStatusColor } from 'modules/build'
18+
} from '../../components'
19+
import { getStatusColor } from '../../modules/build'
2020
import { useOwner } from './OwnerContext'
2121

2222
const Stat = styled.div`

0 commit comments

Comments
 (0)