GithubHelp home page GithubHelp logo

props or just variable about generator-node HOT 15 CLOSED

yeoman avatar yeoman commented on August 16, 2024
props or just variable

from generator-node.

Comments (15)

hemanth avatar hemanth commented on August 16, 2024

I would vote for all props.

from generator-node.

hueitan avatar hueitan commented on August 16, 2024

One question.

How do I support variable like safeSlugname ? That's not from props.

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

In what scenario it won't be from props? As of now it's slugified props.name

from generator-node.

hueitan avatar hueitan commented on August 16, 2024

safeSlugname is original from slugname which is from the props

But sometimes we need other variables which are not being given by user in props

In my opinion, maybe variable is cool enough.

In the template, we don't need <% props.xxxx %> props again. Just use <% xxxx %>

But we need to assign the variable from props in the index.js, that's the trouble works.

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

In that case the variables are a good solution.

What says @sindresorhus @SBoudrias ?

from generator-node.

hueitan avatar hueitan commented on August 16, 2024

Total 10 props, I think more than 10 will cause dislike 😢

var prompts = [{
      name: 'description',
      message: 'Description',
      default: 'The best module ever.'
    }, {
      name: 'homepage',
      message: 'Homepage'
    }, {
      name: 'license',
      message: 'License',
      default: 'MIT'
    }, {
      name: 'githubUsername',
      message: 'GitHub username'
    }, {
      name: 'authorName',
      message: 'Author\'s Name'
    }, {
      name: 'authorEmail',
      message: 'Author\'s Email'
    }, {
      name: 'authorUrl',
      message: 'Author\'s Homepage'
    }, {
      name: 'keywords',
      message: 'Key your keywords (comma to split)'
    }, {
      name: 'cli',
      message: 'Do you need cli tools?',
      default: 'yes'
    }, {
      name: 'browser',
      message: 'Do you need browserify?',
      default: 'yes'
    }];

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

We could just stick on the github user name or author name and skip email and URL?

from generator-node.

hueitan avatar hueitan commented on August 16, 2024

I think email is still needed.
But url and author name can retrieve from user name

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

👍 So be it?

Update: @huei90 Lets reduce it to bare minimal.

from generator-node.

faustman avatar faustman commented on August 16, 2024

Hi guys,
how your affairs with this task?

I want fix some trailing spaces in package.json.
Should I wait when you finish this task?

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

@faustman Go ahead, this is yet to be finalized.

from generator-node.

hueitan avatar hueitan commented on August 16, 2024

@faustman Go Ahead!

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

@huei90 If you notice the latest _package.json expect keywords all of them are props.

from generator-node.

faustman avatar faustman commented on August 16, 2024

no action from me,
no more trailing spaces since 6adf1f4

from generator-node.

hemanth avatar hemanth commented on August 16, 2024

👍

from generator-node.

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.