Giter Site home page Giter Site logo

Express CLI about discussions HOT 20 OPEN

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024 2
Express CLI

from discussions.

Comments (20)

crandmck avatar crandmck commented on April 27, 2024 3

For context, express-generator gets less than 9k downloads weekly currently. Which is not zero, but effectively rounds to it when you consider express gets 29 million downloads per week.

Obviously, Express itself is extremely popular--no one is going to argue with that, but aren't "downloads" of express/express here (i.e. from npm stats) counted every time anyone does an npm/npx update or install of any app with an Express dependency? OTOH, express-generator is a CLI build-time tool, so those are actual installations of the CLI (not run-time deps), which makes the two statistics not really comparable. I'm no npm expert, so perhaps I'm misunderstanding this?

Anyway, I don't think we should get too hung up on the numbers of downloads. I just want to second what @wesleytodd said:

Even if we get the most simple setup, I think the value of a generator for new users cannot be over stated. It is much different to say "create a file and copy this" vs npm init express.

I think having a easy tool for new users is very valuable, even if intermediate to advanced devs don't use it and it doesn't cover many use cases. As long as it covers some basic use cases and patterns, it has value IMO.

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024 1

@wesleytodd I completely agree, and I would also like to join the Express team in creating and maintaining the brand-new CLI package. In the meantime, I am preparing some initial requirements and would like to share them with you here when it's done.

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024 1

Even if we get the most simple setup, I think the value of a generator for new users cannot be over stated. It is much different to say "create a file and copy this" vs npm init express.

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024 1

what is this referring to?

package managers have a feature to download and execute packages with the naming pattern create-. For example:

$ npm init express

Will find the package create-express or @express/create and will run the properly named bin script just like npx would.

The most famous example of this is create-react-app.

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024 1

such as whether you want to set up a Git repository and which package manager you prefer to use, among other things etc.

And then for this part, I think we should use the pattern I have been working out here: pkgjs/create-pkg#7

Exactly, I also think the same way. We should use this pattern to provide a better DX, and I am also willing and passionate to contribute as a member. 😊

from discussions.

jonchurch avatar jonchurch commented on April 27, 2024 1

I think gathering requirements is the stage we are in right now. The idea of having express itself expose a bin so we can do npx express <something> is interesting to me, but is a big departure from how things are now.

For context, express-generator gets less than 9k downloads weekly currently. Which is not zero, but effectively rounds to it when you consider express gets 29 million downloads per week. Meaning, I don't think the generator is holding back any users, or presenting them with issues we need to address with priority. It certainly doesn't seem to be harming adoption!

I'd love to see a proposal of what problems a CLI would solve (I think there are many it could tackle!), and the actual implementation of it being an npm init or npx express pattern is a detail which is tangential to those problems we'd want to solve.

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024 1

The idea of having express itself expose a bin so we can do npx express is interesting to me, but is a big departure from how things are now.

I personally am opposed to this at first glance. I will hold that weakly, but also I think the package we ship to prod servers should not include more than the requirements for runtime.

For context, express-generator gets less than 9k downloads weekly currently.

Yeah this is more of an indication of it's failure to be updated than it's usefulness in general imo.

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024 1

@crandmck Yup, I totally agree with you. It is a valuable tool for new users. Of course, we don't have to cover every use case, but we should include all the basic operations like creating a route, using middleware with CLI, etc. Although it may sound like no one uses these commands except for npm express init but I think it's a great value addition.

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024

Hey! I agree. We have the generator package but it is quite old and doesn't follow the create-* pattern which the package managers support either. I think it would be awesome change the name of that, but that likely might mean a full rewrite. Maybe the next best steps here are to list the requirements?

from discussions.

jonchurch avatar jonchurch commented on April 27, 2024

I previously was excited about the idea of having the cli generator, but see the value less now. Id be interested to see your ideas about what it should do.

Express is so lean that Im not certain what we would need to scaffold for folks. Previously the generator focused on scaffolding a server side rendered static html site using view engines. That's not as relevant today.

Call it a lack of imagination on my part, but before you begin work @waleedtariq109 can you give an idea of what your vision is for a cli package?

from discussions.

UlisesGascon avatar UlisesGascon commented on April 27, 2024

Express is so lean that Im not certain what we would need to scaffold for folks. Previously the generator focused on scaffolding a server side rendered static html site using view engines. That's not as relevant today.

AFAIK, with the current roadmap, I share this vision too. But here's a random idea from my side: what if we just offer a CLI that lists all the projects in the current example folder and allows you to choose one of them to start a project? This way, you actually have tons of options out of the box. Maybe I'm going too far; it's just an idea.

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024

@jonchurch I've been preparing the initial proposal, and when it's ready, I'd be happy to share it here as it also reflects my vision for the CLI.

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024

@wesleytodd @jonchurch
Just to provide a brief overview of my thoughts: Instead of installing Express using npm i express, it's recommended to use the Express CLI for scaffolding the project. The official way to do this is by executing the command npx express init my-app. This command will initialize an Express app. Additionally, it will prompt you with a few questions before initializing the app, such as whether you want to set up a Git repository and which package manager you prefer to use, among other things etc.

This has to be the Offical way of express

from discussions.

ctcpip avatar ctcpip commented on April 27, 2024

follow the create-* pattern which the package managers support

what is this referring to?

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024

The official way to do this is by executing the command npx express init my-app

I would prefer we document both that and npm init express

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024

such as whether you want to set up a Git repository and which package manager you prefer to use, among other things etc.

And then for this part, I think we should use the pattern I have been working out here: pkgjs/create-pkg#7

from discussions.

jonchurch avatar jonchurch commented on April 27, 2024

@ctcpip see the npm init docs: https://docs.npmjs.com/cli/v8/commands/npm-init

from discussions.

waleedtariq109 avatar waleedtariq109 commented on April 27, 2024

@wesleytodd I think we have to start working on gathering the requirements, or is it too early?

from discussions.

wesleytodd avatar wesleytodd commented on April 27, 2024

Not too early at all! I think my personal focus is on the pressing work around v5, security, governance, and LTS strategy but that doesn't block anything. Just might mean I personally cannot help much yet. I think updating this issue to be that requirements and plan would be good. Or if this conversation is already too long you could do it as a new issue.

from discussions.

jonchurch avatar jonchurch commented on April 27, 2024

It is indeed trending downward, peaked at around 800k/year back in 2018 ish if these numbers are accurate:

Screenshot 2024-02-28 at 1 34 18 PM

from discussions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.