plone / create-volto-app

Set up the Volto with a single command
MIT License
9 stars 3 forks source link

.gitignore is not added to the npm package #5

Closed sneridagh closed 5 years ago

sneridagh commented 5 years ago

Then in the resultant folder that create-volto-app creates, the file is missing, so if you do a git init the node_modules and all gets in.

Investigating this, it's a default behavior that packagers have to workaround, by using the script (create-volto-app) to copying the original .gitignore over (as an extra step) after the boilerplate is placed.

@nileshgulia1 Can you please take care of it?

davilima6 commented 5 years ago

Hi! It seems I have a different behavior, can't init at all:

$ git init
fatal: not a git repository: /Users/davi/plone/my-volto-app/../.git/modules/volto-starter-kit
$ git st
fatal: not a git repository: /Users/davi/plone/my-volto-app/../.git/modules/volto-starter-kit

After installing with npx @plone/create-volto-app my-volto-app (6.8.0)

nileshgulia1 commented 5 years ago

I don't think we even want to git init the generated repo. create-volto-app generates a .git file anyway with a .gitignore. Problem is that whenever we publish npm renames the . gitignore to .npmignore. -cc @sneridagh

On Tue, Feb 19, 2019, 23:26 Davi Lima <notifications@github.com wrote:

Hi! It seems I have a different behavior, can't init at all:

$ git init fatal: not a git repository: /Users/davi/plone/my-volto-app/../.git/modules/volto-starter-kit $ git st fatal: not a git repository: /Users/davi/o/my-volto-app/../.git/modules/volto-starter-kit

After installing with npx @plone/create-volto-app my-volto-app (6.8.0)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/plone/create-volto-app/issues/5#issuecomment-465240321, or mute the thread https://github.com/notifications/unsubscribe-auth/AVP6xRwq3UUYacO_R0bABjUDX88i2TPPks5vPDq9gaJpZM4bAkzJ .

sneridagh commented 5 years ago

@nileshgulia1 of course we want to git init the repo. @davilima6 The release 1.5.1 fixes the issue (because I already excluded the .git from volto-starter-kit) in .npmignore, please try that one.

However the problem still persists (because of the original problem, npm doesn't pack .gitignores). We need to add the original .gitignore by hand (create-volto-app must do that, as a post install task) after the boilerplate is in place. CRA and all the generators already have to workaround it to do that.

@nileshgulia1 can you do that? It's barely a copy file task from one place to another. Thanks!

sneridagh commented 5 years ago

@nileshgulia1 This is what I get from create-volto-app output:

    .babelrc
    .eslintrc
    .yarnrc
    README.md
    jsconfig.json
    locales/
    node_modules/
    package.json
    public/
    razzle.config.js
    src/
    theme/
    yarn.lock

So no .gitignore. We need to do the same as CRA does here: https://github.com/facebook/create-react-app/blob/47e9e2c7a07bfe60b52011cf71de5ca33bdeb6e3/packages/react-scripts/scripts/init.js#L138

davilima6 commented 5 years ago

@sneridagh, thanks! I confirm git init is possible now.

sneridagh commented 5 years ago

Fixed.