π¨βπ» let's simply set up JavaScript development environment
Required | Description |
---|---|
Git | We follow the GitHub Flow |
Node.js | 10.16.0 LTS |
Yarn | 1.16.0 or above |
The project manages the version of node through nvm
.
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ command -v nvm
$ nvm install 10.16.0
$ which node
$ npm install -g yarn
In the project root as follows are performed through the .nvmrc
$ nvm use
...
$ nvm use
$ yarn install
$ yarn test
$ mkdir awesome-javascript
$ cd awesome-javascript
$ git init
...
$ git remote add origin https://github.com/${github_id}/awesome-javascript
$ git remote -v
origin https://github.com/${github_id}/awesome-javascript (fetch)
origin https://github.com/${github_id}/awesome-javascript (push)
$ git checkout -b devops/github-templates
$ mkdir .github
$ touch .github/PULL_REQUEST_TEMPLATE.md # Create pull request template
$ cd .github
$ mkdir ISSUE_TEMPLATE
$ touch .github/bug_report.md # Create bug report template
$ touch .github/feature_request.md # Create feature request template
$ git commit -m 'chore: create issue & pull request template'
$ git push -u origin devops/github-templates
- Manually creating a single issue template for your repository
- Creating a pull request template for your repository
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ nvm install 10.15.3
$ node -v && npm -v
v10.15.3
6.4.1
$ npm install yarn -g
$ yarn init
yarn init v1.6.0
question name (awesome-javascript):
question version (1.0.0):
...
success Saved package.json
Done in 5.97s.
package.json
{
"name": "awesome-javascript",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/dl0312/awesome-javascript",
"author": "Geon Lee <[email protected]>",
"license": "MIT"
}
add node-fetch
module with yarn add node-fetch
for HTTP request
$ yarn add node-fetch
package.json
{
...
"license": "MIT",
"dependencies": {
"node-fetch": "^2.6.0"
}
}
yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
node-fetch@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
MAJOR version
when you make incompatible API changes,MINOR version
when you add functionality in a backwards-compatible manner, andPATCH version
when you make backwards-compatible bug fixes.
- Semantic Versioning
- npm package.jsonμμ νΈλ(~) λμ μΊλΏ(^) μ¬μ©νκΈ°
- npm-package.json
- yarn.lock
$ echo "node_modules/" > .gitignore
$ git add .
$ git checkout -b issue/1
$ git commit -m 'Create project with Yarn'
$ git push -u origin issue/1
$ mkdir __tests__ lib
$ touch __tests__/github.test.js
$ touch lib/github.js
$ yarn test
- Verification of Code Convention with ESLint
- Automate testing with best practices