Skip to content

Package for sharing #76

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 7 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix issue with dotenv in build
  • Loading branch information
ShMcK committed Jan 19, 2020
commit a854eb2081124519a457ae0b8dbcede26a332aed
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,23 @@
"watch": "tsc -watch -p ./"
},
"dependencies": {
"@types/chokidar": "^2.1.3",
"chokidar": "^3.3.0",
"dotenv": "^8.2.0",
"jsdom": "^15.2.1"
},
"devDependencies": {
"@types/assert": "^1.4.3",
"@types/chokidar": "^2.1.3",
"@types/dotenv": "^8.2.0",
"@types/glob": "^7.1.1",
"@types/jest": "^24.0.25",
"@types/jsdom": "^12.2.4",
"@types/node": "^13.1.6",
"@typescript-eslint/eslint-plugin": "^2.15.0",
"@typescript-eslint/parser": "^2.15.0",
"assert": "^2.0.0",
"concurrently": "^5.0.1",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-prettier": "^3.1.2",
"glob": "^7.1.6",
"graphql": "^14.5.8",
"mocha": "^6.2.2",
"prettier": "^1.19.1",
"ts-jest": "^24.3.0",
"typescript": "^3.7.4",
Expand Down
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Environment {
}

const environment: Environment = {
LOG: (process.env.LOG || '').toLowerCase() === 'test',
LOG: (process.env.LOG || '').toLowerCase() === 'true',
}

export default environment
55 changes: 27 additions & 28 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"outDir": "build",
"lib": ["es2018", "dom"],
"sourceMap": true,
"rootDir": "src",
"baseUrl": "src",
"strict": true /* enable all strict type-checking options */,
/* Additional Checks */
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"paths": {
"typings": ["../typings/index.d.ts"],
"typings/graphql": ["../typings/graphql.d.ts"],
"@api": ["services/api/index"],
"@gql/*": ["services/api/gql/*"]
},
"allowJs": true
},
"exclude": ["node_modules", ".vscode-test", "build", "resources", "web-app", "*.js", "*.test.ts"]
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"outDir": "build",
"lib": ["es2018", "dom"],
"sourceMap": true,
"rootDir": "src",
"baseUrl": "src",
"strict": true /* enable all strict type-checking options */,
/* Additional Checks */
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"paths": {
"typings": ["../typings/index.d.ts"],
"typings/graphql": ["../typings/graphql.d.ts"]
},
"allowJs": true,
"removeComments": true
},
"exclude": ["node_modules", ".vscode-test", "build", "resources", "web-app", "*.js", "*.test.ts"]
}
21 changes: 8 additions & 13 deletions web-app/src/environment.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
interface Environment {
GQL_URI: string
DEBUG: boolean
}

// validate .env
const requiredKeys = ['REACT_APP_GQL_URI']
for (const required of requiredKeys) {
if (!process.env[required]) {
throw new Error(`Missing Environmental Variables: ${required}`)
}
}
// const requiredKeys = ['REACT_APP_GQL_URI']
// for (const required of requiredKeys) {
// if (!process.env[required]) {
// throw new Error(`Missing Environmental Variables: ${required}`)
// }
// }

export const GQL_URI = process.env.REACT_APP_GQL_URI || ''
export const DEBUG = (process.env.REACT_APP_DEBUG || '').toLowerCase() === 'true'
export const GQL_URI: string = process.env.REACT_APP_GQL_URI || 'https://33mf420q4m.execute-api.us-west-2.amazonaws.com/stage/api-stage'
export const DEBUG: boolean = (process.env.REACT_APP_DEBUG || '').toLowerCase() === 'true'