Skip to content

Code Review 12/12/2018 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"ramda",
"styled-components"
]
}
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_SITE_ID=9fce0622-2675-4553-9d18-c5c89da086fc
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
Expand Down
7 changes: 7 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
]
}
28 changes: 10 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"apollo-boost": "^0.1.20",
"apollo-cache-inmemory": "^1.3.10",
"apollo-client": "^2.4.6",
"apollo-client-preset": "^1.0.8",
"apollo-link": "^1.2.3",
"apollo-link-context": "^1.0.7",
"apollo-link-error": "^1.1.1",
"apollo-link-http": "^1.5.5",
"apollo-link-rest": "^0.6.0",
"apollo-link-state": "^0.4.2",
"apollo-utilities": "^1.0.26",
"axios": "^0.18.0",
"classnames": "^2.2.6",
"date-fns": "^1.29.0",
"deep-equal": "^1.0.1",
"graphql": "^14.0.2",
"graphql-anywhere": "^4.1.23",
Expand All @@ -27,18 +22,14 @@
"ramda": "^0.25.0",
"react": "^16.7.0-alpha.2",
"react-apollo": "^2.1.2",
"react-cache": "^2.0.0-alpha.1",
"react-dom": "^16.7.0-alpha.2",
"react-router-dom": "^4.3.1",
"react-scripts": "^2.1.1",
"react-virtualized": "^9.21.0",
"recompose": "^0.30.0",
"semver": "^5.6.0",
"shallow-equal": "^1.0.0",
"styled-components": "^4.1.1",
"styled-system": "^2.2.1",
"utility-types": "^2.1.0",
"uuid": "^3.3.2"
"utility-types": "^2.1.0"
},
"devDependencies": {
"@babel/core": "^7.2.0",
Expand All @@ -48,7 +39,6 @@
"@storybook/addons": "^4.0.12",
"@storybook/cli": "^4.0.12",
"@storybook/react": "^4.0.12",
"@types/classnames": "^2.2.6",
"@types/deep-equal": "^1.0.1",
"@types/graphql": "^14.0.3",
"@types/jest": "^23.3.10",
Expand All @@ -58,21 +48,25 @@
"@types/react-dom": "^16.0.9",
"@types/react-router-dom": "^4.3.1",
"@types/react-virtualized": "^9.18.7",
"@types/recompose": "^0.27.0",
"@types/storybook__react": "^4.0.0",
"@types/styled-components": "^4.1.0",
"@types/styled-system": "^3.0.6",
"@types/uuid": "^3.4.4",
"apollo": "^2.1.3",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.4",
"babel-plugin-ramda": "^1.6.3",
"babel-plugin-styled-components": "^1.9.4",
"husky": "^1.1.3",
"jest": "^23.6.0",
"lint-staged": "^8.0.4",
"prettier": "^1.15.1",
"prettier-standard": "^8.0.1",
"react-docgen-typescript-webpack-plugin": "^1.1.0",
"rimraf": "^2.6.2",
"stylelint": "^9.9.0",
"stylelint-config-recommended": "^2.1.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.5.1",
"ts-jest": "^23.10.5",
"ts-loader": "^5.3.1",
"tslint": "^5.11.0",
Expand Down Expand Up @@ -104,12 +98,10 @@
}
},
"lint-staged": {
"*.ts": [
"prettier-standard",
"git add"
],
"*.tsx": [
"*.{ts,tsx}": [
"prettier-standard",
"tslint --fix",
"stylelint --fix",
"git add"
]
},
Expand Down
7 changes: 0 additions & 7 deletions src/components/Table/Table.css

This file was deleted.

3 changes: 3 additions & 0 deletions src/config/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const NODE_ENV = process.env.NODE_ENV
export const PUBLIC_URL = process.env.PUBLIC_URL
export const REACT_APP_SITE_ID = process.env.REACT_APP_SITE_ID
5 changes: 1 addition & 4 deletions src/config/resolvers/Query/libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import {
Repository,
Repository_object_Blob_package_dependencies
} from '../../../data/Repository/__generated-types/Repository'
import identity from 'ramda/es/identity'
import { identity, defaultTo, compose, path } from 'ramda'
import { InMemoryCache } from 'apollo-cache-inmemory'
import compose from 'ramda/es/compose'
import defaultTo from 'ramda/es/defaultTo'
import path from 'ramda/es/path'
import { NodeLibrary } from '../../../data/Library/__generated-types/NodeLibrary'

export default async (
Expand Down
5 changes: 2 additions & 3 deletions src/data/Auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
ChangeToken,
ChangeTokenVariables
} from './__generated-types/ChangeToken'
import { REACT_APP_SITE_ID } from '../../config/env'

const options =
process.env.NODE_ENV === 'development'
? { site_id: process.env.REACT_APP_SITE_ID }
: {}
process.env.NODE_ENV === 'development' ? { site_id: REACT_APP_SITE_ID } : {}

const authenticator = new Netlify(options)

Expand Down
2 changes: 1 addition & 1 deletion src/data/Library/__generated-types/LibrariesQuery.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.

import { Department, RangeInput } from './../../__generated-types'
import { Department, RangeInput } from '../../__generated-types'

// ====================================================
// GraphQL query operation: LibrariesQuery
Expand Down
4 changes: 1 addition & 3 deletions src/data/Library/methods.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import defaultTo from 'ramda/es/defaultTo'
import path from 'ramda/es/path'
import compose from 'ramda/es/compose'
import { defaultTo, path, compose } from 'ramda'
import { Department } from '../__generated-types'
import { fetchPackages } from '../../utils/npms'
import {
Expand Down
2 changes: 0 additions & 2 deletions src/react-app-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare namespace NodeJS {
interface ProcessEnv {
REACT_APP_GITHUB_CLIENT_ID: string
REACT_APP_GITHUB_CLIENT_SECRET: string
REACT_APP_SITE_ID: string
}
}
4 changes: 2 additions & 2 deletions src/utils/removeUnusedVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from 'graphql'

import { cloneDeep, getOperationDefinitionOrDie } from 'apollo-utilities'
import prop from 'ramda/es/prop'
import { prop } from 'ramda'

export default function removeUnusedArguments (
query: DocumentNode
Expand All @@ -23,7 +23,7 @@ export default function removeUnusedArguments (
const nextVariablesDefinitions = definitions.variableDefinitions.filter(
({ variable }) => variables.has(variable.name.value)
)
// readonly shit
// readonly shit
;(definitions.variableDefinitions as any) = nextVariablesDefinitions
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/toDepartment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Department } from '../data/__generated-types'
import toUpper from 'ramda/es/toUpper'
import { toUpper } from 'ramda'

const toDepartment = (str: string) => {
if (typeof str !== 'string') throw new TypeError(`${str} is not a string`)
Expand Down
9 changes: 0 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"compilerOptions": {
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"declaration": false,
"noImplicitAny": true,
"noImplicitReturns": false,
"noImplicitThis": true,
"suppressImplicitAnyIndexErrors": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"module": "esnext",
"target": "esnext",
"jsx": "preserve",
"lib": [
"es5",
"es6",
"es2017",
"dom"
],
Expand All @@ -24,12 +18,9 @@
"allowUnreachableCode": true,
"allowUnusedLabels": true,
"allowSyntheticDefaultImports": true,
"diagnostics": false,
"esModuleInterop": true,
"listEmittedFiles": false,
"noUnusedLocals": true,
"strict": true,
"stripInternal": true,
"resolveJsonModule": true,
"pretty": true,
"allowJs": true,
Expand Down
3 changes: 1 addition & 2 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
]
},
"rules": {
"no-unused-variable": false,
"ordered-imports": false,
"interface-name": false,
"no-submodule-imports": false,
Expand All @@ -26,6 +25,6 @@
"jsx-no-multiline-js": false,
"jsx-no-lambda": false,
"no-empty-interface": false,
"no-implicit-dependencies": false
"no-implicit-dependencies": [true, ["~"]]
}
}
Loading