Skip to content

Task 1: Npm modules#1

Open
aleksandra-sturova wants to merge 3 commits intomasterfrom
task-1-npm
Open

Task 1: Npm modules#1
aleksandra-sturova wants to merge 3 commits intomasterfrom
task-1-npm

Conversation

@aleksandra-sturova
Copy link
Owner

@@ -0,0 +1,7 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is purpose of using eslint?
It would be better to define pre-commit hook that will run eslint for avoiding non-codestyle code in repo.
Take a look pre-commit lib, please.
If you would like to implement it, just do it 😄
If not just skip this comment.

FYI: Using eslint is out of scope homework task and will no be estimate.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added =)
Not sure that I've done everything right, but anyway looks like it works!

README.md Outdated
@@ -1 +1,4 @@
# node-js-course

## npm install

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All code should be into code blocks.
Use code blocks, please
code-blocks

FYI: # using via header. headers

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thx

package.json Outdated
"name": "node-js-course",
"version": "1.0.0",
"description": "",
"main": "index.js",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to application entry point, please

FYI: ./dist/app.js

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thx

package.json Outdated
},
"homepage": "https://github.com/sasha-klimashevich/node-js-course#readme",
"dependencies": {
"babel-cli": "^6.26.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all ^, please

FYI: The npm creates package-lock.json. But if user uses npm less than 5 version. The ^ effects to download up-to-date from resource. It might be problem for running application.
using-a-package

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thx

package.json Outdated
"dependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-preset-env": "^1.6.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babel's module should not be in dependencies section. They should be in devDep.
Check what modules should in devDep section, please

FYI: dependencies-vs-devdependencies

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thx

src/app.js Outdated

console.log(data.name);

new models.User();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { User, Product } from './models';

Why not?
In this way we can make influence what a bundle will contain.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.
Done!

package.json Outdated
"scripts": {
"prestart": "babel src -d dist",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon ./dist/app.js"
Copy link

@vladislavkovaliov vladislavkovaliov Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ./node_modules/.bin/nodemon ./dist/app.js, please

FYI: If this case i need install nodemon globally, but if i don't wish install it globally. A case above provides us to avoid this issue.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thx
Well.. I don't have nodemon installed globally and this command worked for me. What's the difference ?

"description": "",
"main": "index.js",
"scripts": {
"prestart": "babel src -d dist",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use prestart, using nodemon doen't make sence. (will be discussed fbf)

@vladislavkovaliov
Copy link

vladislavkovaliov commented Apr 22, 2018

When comments will be fixed write done after each, please.
DON'T MERGE PR, PLEASE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants