Skip to content
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

a new project template for Express 4 (connect middleware is now splitted into several modules) #162

Closed
1 of 2 tasks
paulvi opened this issue Sep 15, 2014 · 10 comments
Closed
1 of 2 tasks

Comments

@paulvi
Copy link
Member

paulvi commented Sep 15, 2014

discussion started in #161

As far as I remember, Express 4 has other way to create new project

  • TODO read docs,
  • make option in wizard about what executable to call
@dwwaddell
Copy link

A common option in creating a project is the "-e" which uses ejs instead of Jade:
express --help
Usage: express [options] [dir]
Options:
-h, --help output usage information
-V, --version output the version number
-e, --ejs add ejs engine support (defaults to jade)
--hbs add handlebars engine support
-H, --hogan add hogan.js engine support
-c, --css add stylesheet support (less|stylus|compass) (defaults to plain css)
-f, --force force on non-empty directory

@paulvi
Copy link
Member Author

paulvi commented Sep 15, 2014

From http://expressjs.com/guide.html "Using express(1) to generate an app"

$ npm install -g express-generator

then it is identical to what was before

the option is not mentioned at http://expressjs.com/guide.html

--hbs add handlebars engine support

@ghost
Copy link

ghost commented Sep 15, 2014

Thank's @paulvi: I was curious to understand how the 3.2.6 express project generator is working. About express 4.9.0 - is it possible to provide express-generator npm module within Nodeclipse to be run with options from IDE in order to create a new express 4 project in Nodeclipse?

@paulvi
Copy link
Member Author

paulvi commented Sep 15, 2014

As I see now, no changes are needed, but user needs to insure that he/she has run

$ npm install -g express-generator

so that he generated newer 4.x version

(When I was looking at express 3 months before, there was a mess with new express-generator using different executable name and syntax. Now it looks like version compatible).

@ghost
Copy link

ghost commented Sep 15, 2014

Some simple hack like firing a $ express -V and parsing the return value should be enough to verify the module was installed globally and that it's version number is supported by the IDE.

If it was not installed (or if the version number was too old/recent may be?) then IDE notifies user the npm module should be (re)installed first.

On a larger scale, I think using express-generator like this would make a lot of sense in a longer run has it would reduce the maintenance burden on Nodeclipse: next time upgrading express in Nodeclipse would be about upgrading express-generator from NPM — hopefully...

@paulvi
Copy link
Member Author

paulvi commented Sep 16, 2014

Things get blurred when looking at existing code
https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L105-109

There is hidden EXPRESS_VERSION preference, but I don't really follow logic.
It was written by @tomotaro1065 more than a ear ago.

Making it all straight need some time (about half a day), but I don't plan to spend time for Express that I don't use. At least alone... If we can agree to push it out together, I would sign up, even if you won't code.

@ghost
Copy link

ghost commented Sep 16, 2014

I would not change the existing one but add a brand new Express 4 project type and Run As procedures.

I mean: creating Express 3 project should remain an option as some dev out there would still need it for a while.

Therefore we have two options:

1 - select Express version from the project creation panel then fork to a version specific project generation procedure depending on the selected Express version,

2 - leave the existing one untouched only to add a brand new project type for Express 4 that would fork to a new project generation procedure directly from menu selection.

For myself I would prefer that latter one as we don't know how long 3.x will survive (easier to get rid of it when the time will come if they remain unbound) and because it works around the usual legacy issues like this EXPRESS_VERSION constant like value initialized we don't know how / where.

As I said above there is a more subtle way to find out current express version nowadays — the main issue being about interacting with a shell from Java code, in my understanding.

I'm not a Java developer so coding it myself would not really make much sense but I could help other ways — just let me know how.

@paulvi
Copy link
Member Author

paulvi commented Sep 16, 2014

First, I don't like creating GUI solution for some specific versions of specific frameworks.

FYI, some parts would be like executing from command line, see https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L176-190

@paulvi
Copy link
Member Author

paulvi commented Sep 25, 2014

As answered on
http://stackoverflow.com/questions/26007228/how-to-update-express-js-template-in-nodeclipse
2 steps are enough:

  1. get latest express-generator installed

    npm install -g express-generator

it would add express executable with the same params but for 4.x version of express

2 .Then Eclipse Nodeclipse preferences should be updated, e.g.

C:\Users\yourusername\AppData\Roaming\npm\node_modules\express-generator\bin\express

@paulvi paulvi added this to the 0.17 Express 4.x milestone Sep 25, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants