-
-
Notifications
You must be signed in to change notification settings - Fork 359
App Skeleton using Next.js, Node/Express, React #78
Changes from 21 commits
2289b3b
c7219dc
a15d9ad
6753c6d
a809c58
5c148b6
81dc4ad
8e8dd6b
f95841a
919ba98
8075dc4
e9f9853
cf502e5
54d4c99
9511365
23cb967
d26ed0c
fedb1c1
dce1d61
977c6c5
996eb57
4d2cdd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"presets": ["next/babel"], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": ["."], | ||
"alias": { | ||
"client": "./client", | ||
"server": "./server" | ||
} | ||
} | ||
] | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.next/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier/@typescript-eslint", | ||
"plugin:prettier/recommended" | ||
], | ||
"plugins": ["react", "@typescript-eslint", "prettier"], | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"prettier/prettier": ["error", { "singleQuote": true }], | ||
"@typescript-eslint/explicit-function-return-type": 0, | ||
"react/display-name": 0, | ||
"@typescript-eslint/no-explicit-any": 0 | ||
}, | ||
"settings": { | ||
"react": { | ||
"pragma": "React", | ||
"version": "detect" | ||
} | ||
}, | ||
"parser": "@typescript-eslint/parser" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as React from 'react'; | ||
|
||
export default () => <div>This is an imported component</div>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import { SomeComponent } from 'client/components/'; | ||
|
||
describe('SomeComponent', () => { | ||
it('should render text', () => { | ||
const { getByText } = render(<SomeComponent />); | ||
expect(getByText('This is an imported component')).toBeDefined(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SomeComponent from './SomeComponent'; | ||
|
||
export { SomeComponent }; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
version: '3.7' | ||||||
services: | ||||||
app: | ||||||
image: node:10-alpine | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the "end product" of this project is a Docker container, how about geting started on creating a Dockerfile for it - instead of defining configurations within Docker Compose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (copied from discord) docker-compose will really shine when we add additional images, e.g. for postgres or redis or any other service we might need. i think dockerfiles are really only necessary if we're adding special config to a base image (at the moment the base node10 image should be sufficient for what we need) but also, a dockerfile is probably a good idea for setup including There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, in future we will add many dependencies which then require |
||||||
command: 'npm run dev' | ||||||
working_dir: /usr/chapter/ | ||||||
volumes: | ||||||
- data:/usr/chapter/ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Styling - matching the path of the other service's volume There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've gone ahead and removed all remaining tailing slashed in PR his original pr |
||||||
ports: | ||||||
- '8000:8000' | ||||||
speccy: | ||||||
image: node:10-alpine | ||||||
command: 'npm run speccy:watch' | ||||||
working_dir: /usr/chapter/ | ||||||
volumes: | ||||||
- data:/usr/chapter | ||||||
ports: | ||||||
- '8001:8001' | ||||||
volumes: | ||||||
data: | ||||||
driver_opts: | ||||||
type: bind | ||||||
o: bind | ||||||
device: ${PWD}/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
|
||
module.exports = { | ||
webpack(config, options) { | ||
config.resolve.alias.client = './client'; | ||
config.resolve.alias.server = './server'; | ||
config.plugins.push(new ForkTsCheckerWebpackPlugin()); | ||
return config; | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"ignore": [ | ||
".git", | ||
"node_modules", | ||
".next" | ||
], | ||
"watch": [ | ||
"server" | ||
], | ||
"exec": "npm run dev", | ||
"ext": "js,ts" | ||
} | ||
timmyichen marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
17.12 is outdated, 19.03 is the current version. This link ☝️ always goes to the latest.