Comments (22)
So I talked with Kamil and I'm going to start working on the nest CLI. What are you guys' thoughts on this for starters?
examples commands:
nest create my-new-app
// generates a new Nest application in the current folder (path is an optional second parameter)
nest g module users
// generates users folder and users.module.ts
nest g controller UsersController ./users/users.controller.ts
// creates the users/users.service.ts file, would be usersController.ts by default
nest g component UsersService ./users/users.service.ts
// creates the users/users.service.ts file, would be usersService.ts by default
nest serve --p 8090
// serves the nest app at port 8090, probably use 8080 by default
nest build
// compiles the typescript .. somewhere
from nest.
Maybe like the angular cli create Controller / Services (Component)
from nest.
I created a repo here https://github.com/nestjs/nest-cli. Still very much a work in progress, but wanted to make it open.
I could use some help with the build/serve pieces of anyone is interested in that. I am working on the piece to create new projects and assets.
I think we can close this ticket and move discussion to the new repo.
from nest.
Definitely agree with this. Laravel's Artisan CMD is fantastic and would be a great tool to look at for inspiration.
from nest.
Hi guys!
Thanks for your involvement. About CLI, I think we should consider those commands (@KerryRitter, I used your proposals) :
nest create my-new-app
// generates a new Nest application in the current folder (path is an optional second parameter)
nest g module users
// generates users folder and users.module.ts
nest g controller users ./users/users.controller.ts
// creates the users/users.controller.ts file (UsersController class), would be users.controller.ts by default
nest g component UsersService ./users/users.service.ts
// creates the users/users.service.ts file (UsersService class), would be users.service.ts by default
nest g middleware users ./users/users.middleware.ts
// creates the users/users.middleware.ts file (UsersMiddleware), would be users.middleware by default
nest g gateway users ./users/users.gateway.ts
// creates the users/users.gateway.ts file (UsersGateway), would be users.gateway by default
nest g gateway-middleware users ./users/users.middleware.ts
// or maybe just nest g middleware with additional flag? (-g?)
// creates the users/users.middleware.ts file (UsersMiddleware), would be users.middleware by default
nest g filter users ./users/users.filter.ts
// creates the users/users.filter.ts file (UsersExceptionsFilter), would be users.filter by default
nest serve --p 8090
// serves the nest app at port 8090, probably use 8080 by default
nest build
// compiles the typescript .. somewhere
Also - we have to remember that someone might want to use Nest without TypeScript (so we need 2 ways of build, serve and create app). About testing framework - I agree that it should be a standardised way to run tests. From my point of view - jasmine could be a best choice. What do you think?
from nest.
Made this. Think it could be nice looking for when we have a CLI tool.
Think this could go in when we use nest -v, similar to angular? If so, any preferences on which one? (I prefer first one)
____ ___ ___ ______ ___ ________
/ \ / /_______ ______ __/ /_ / ____) / / (___ ___}
/ /\ \ / // ___ \ / ____)(__ __} / / / / / /
/ / \ \ / // (___) \ / /___ / / / / / / / /
/ / \ \/ /( ________/ \___ \ / / / / / / / /
/ / \ / \ \______ ____/ / / /_ / /___ / /__ __/ /__
/__/ \__/ \_______}{______/ \____} \______}/______}(_______}
______ ____ ___ ______ ___ _______
| \ | | __| |__ / _____)| | (__ ___}
| |\ \ | | ______ ______(__ __} | / | | | |
| | \ \ | | / ___ \ | ____) | | | | | | | |
| | \ \ | || (___) \| (____ | | | | | | | |
| | \ \| || ______/|____ | | | | | | | | |
| | \ || \____ ____) | | \___ | |_____ | |____ __| |__
|__| \____| \______} {______/ \_____} \______}|______}(_______}
from nest.
For the ones who want to develop the CLI tool look at Caporal.js !
https://github.com/mattallty/Caporal.js
I think this could be a great framework to expose the CLI actions
from nest.
totally agree, a CLI tool similar to ng-cli would be great. Do we need to get some core requirements down for what this should be able to do? Happy to help in any way, even if its just organising stuff
from nest.
I'm using Caporal per @thomrick's suggestion - it's fantastic to get rolling.
If you'd like to help, I could use a hand with a good build process on compiling the app and serving the app. I following Ionic's method of using git repos to initialize apps and will look at how Angular CLI does the asset generation.
I am planning on working with Kamil + other contributors to get a proper repo setup but i can make one on my account in the meantime.
from nest.
@KerryRitter - I can give you a hand with the CI/CD related work, first decade in software was in devops.
from nest.
Ahh. Right. Es6. How should we do that? Suffix everything with "es" or "ts"? Perhaps a nest.config.json?
I agree with the proposal - all looks good to me.
from nest.
@Mark-McCracken, organization profile is already created @nestjs. I am a little bit busy right now, there is a lot of things to do so I'll update each informations when I am free. At the same time, I am working on simple page with urls to github profile & documentation.
from nest.
Could you specify what such a CLI should do? You mean it should have component, controller, basic project generating script?
from nest.
This project seems really promising. I'd love to see something like @angular/cli to start a new project and generate files to lower the bar to get started with this :D
from nest.
I agree with @Mark-McCracken and @lholznagel. For scaffolding stuff, generate new components, controllers etc... we can do something similar as @angular/cli bearing in mind that the syntax is quite similar.
from nest.
Absolutely 100% agree!
Was going to post exactly this tomorrow afternoon.
Totally agree with format and commands, should be able to have simple one liners to
Generate new components/controllers/entire app
Run the server.
I think there should also be a nest test command, to run all of the tests, I think testability should have a reasonably strong focus in that there's a straightforward, standardised way to run tests, perhaps with Jasmine.
Would love to contribute to this, shall I put together some requirements maybe? Think we need a new repo for this.
Also think we can lean heavily on the work done by the angular cli team, as a lot of this will be fairly similar
from nest.
Hey @KerryRitter !
Fantastic command documentation !
The Nest-CLI repo has been created yet ?
Where is it ?
Can I bring my contribution on it ?
from nest.
There isn't one yet, but I can open up a repo tomorrow and push up what I have. Contributions are certainly welcome!
from nest.
Sounds great!
Think everyone would be pretty happy with Jasmine, angular uses it as theirs, can't see anyone complaining.
Personally, I don't think many people will want to use it without JavaScript, the Type system and experimental decorators are some of the biggest draws for me,
but by all means if I'm wrong here, keep going with JS aspects.
I've been using
tsc -w
in one terminal window, and using
nodemon index.js
in another, and literally can't explain how awesome it is to quickly switch to postman and see your changes already implemented and run!
If anyone has made a start on this project, I think perhaps it might be a good idea to move it to an organisation repo like angulars. Just seen Kamil's post on the evangelism issue, so this seems like the go ahead method :)
from nest.
Does someone wanna set this up?
from nest.
Thanks @KerryRitter, can't wait to see more
from nest.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from nest.
Related Issues (20)
- Hyphens in parameters silently fail HOT 4
- Improve documentation on @Injectable() HOT 2
- Log is not auto-flushed on error during initialization HOT 1
- Middleware not executed when using `exclude` in `setGlobalPrefix` HOT 1
- The use of SetMetadata custom decorators does not take effect HOT 13
- NestJS HttpException class returns success status when status is undefined HOT 4
- NestJs DI `useFactory` ignores property dependencies HOT 1
- I can't use two kafka client in one nest.js server to consume other topics. HOT 1
- Support using `@Inject()` decorator factory with no args on constructor-based injections
- Add CLI options to make the testing, linting, and formatting configurations optional. HOT 1
- @nestjs/microservices: RabbitMQ connection options not passed to amqp-connection-manager HOT 2
- 我有一个问题,关于依赖注入和模块导入的 HOT 1
- [chore] drop dev. dependencies that are leading to errors on running `npm install` in this repo HOT 6
- Support for Multiple HTTP Methods on the function HOT 3
- Cannot read properties of undefined (reading 'constructor') HOT 3
- Nest can't resolve dependencies of the DiscoveryService (?). Please make sure that the argument ModulesContainer at index [0] HOT 11
- I have a question about dependency injection and module import HOT 1
- Supply time to TypeOrmLogger.logQuery() HOT 1
- TCP.onStreamRead (node:internal/stream_base_commons:217:20) HOT 1
- RabbitMQ Bug Microservices HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nest.