This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258882

Summary: Some Enhancement / Dependencies for Node.js development
Product: javascript Reporter: raliclo
Component: Node.jsAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal CC: tmysik
Priority: P3    
Version: 8.1   
Hardware: Macintosh   
OS: Mac OS X   
URL: https://github.com/pugjs
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: IDE log

Description raliclo 2016-04-18 02:57:10 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Mac OS X version 10.11.4 running on x86_64
Java; VM; Vendor = 1.8.0_77
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.77-b03

Reproducibility: Happens every time

Upgrade Notes :
1. Jade.js has been renamed to pug.js , all file extension shall be changed to pug.
2. More default dependencies in template.
3. Developer dependencies shall add "shell.js", "concurrently.js", "nconf.js"
These three tools will help developers to run linux/windows commands in multi threads, 
and also help in dependency injection.


STEPS:

Upgrades : 
Template files under views : 
 error.jade -> error.pug
 index.jade -> index.jade
 layout.pug -> layout.pug

Package.json : line13 
    "pug": "^2.0.0-alpha3",

Other suggested improvements in package.json 

1.  devDependencies: 
  "devDependencies": {
    "concurrently": "^2.0.0", // for multi-threads programming 
    "shelljs":"^0.6.0" //  for unix shell command execution and integration 
  }
# Other Developer Dependencies (Connect Support):
// Reference : https://github.com/senchalabs/connect
    "connect-mongo" : "^1.1.0", // used as mongodb session store

2. More default dependencies

#express session control : 
// Reference : https://glebbahmutov.com/blog/express-sessions/
    "express": "^4.9.5",
    "express-session": "^1.8.2",  // used as express session manager
    "session-file-store" : "^0.2.0" , // used as local file session configuration 
    "compression" : "^1.6.1" // used as middle ware to compress response to reduce internet traffic 
    "finalhandler" : "^0.4.1" // used as middle-ware design pattern's finalhandler, without next().

#Connect/Express middle-wares
    "winston": "^2.1.0", 
    "morgan": "~1.6.1"

#server side logging :
    "express-useragent": "0.2.4",  // used to find out client's browser agent. , https://github.com/biggora/express-useragent
     "ip": "1.1.2", // used to find out client's ip info , https://github.com/indutny/node-ip

ACTUAL:
 The parser cannot highlight files in pug extension correctly.

EXPECTED:
 The pug/jade parser shall be supported with the same highlights after this change.


nconf example : 
Prerequsite : enter node REPL shell first 
// config.json is placed under ./conf 
// database {
// "host":"localhost",
// "port":"1234"
// }

var nconf = require('nconf');
 nconf.file('dbconn', {
    file: 'config.json',
    dir: './',
    search: true
  });

var db = nconf.get('database');
// undefined
db
// { host: '127.0.0.1', port: 5984 }

// shell.js example : 
// https://www.npmjs.com/package/shelljs
// concurrently example : 
// https://www.npmjs.com/package/concurrently
Comment 1 raliclo 2016-04-18 02:57:16 UTC
Created attachment 159297 [details]
IDE log