pattern-lab / edition-node-grunt

The grunt wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.
MIT License
38 stars 21 forks source link

Loading starterkit does not copy files #12

Open yellowled opened 8 years ago

yellowled commented 8 years ago

I am using Edition Node Grunt v2.3.0 on Mac, with Node v4.4.7.

Expected Behavior

grunt patternlab:starterkit-load --kit=[starterkit-name] should copy the files from node_modules/[starterkit-name]/dist to ./source/.

Actual Behavior

Task runs with proper output/path names etc., but does not actually copy any files (tested with starterkit-mustache-demo in master and dev).

Steps to Reproduce
  1. npm install starterkit-mustache-demo
  2. grunt patternlab:starterkit-load --kit=starterkit-mustache-demo

Here's a gist of the output that I get for this. ./source/_patterns/ remains empty.

ivana-mcconnell commented 8 years ago

I ran into this as well; even after extensive debug I couldn't make it work. The docs definitely don't reflect actual setup. In the end, I had to give up.

bmuenzenmeyer commented 8 years ago

Yes this definitely looks wrong. I loaded that same starterkit this morning in the gulp version with success, however, time is restricting me from giving grunt the full attention it deserves. I will try to look into this and https://github.com/pattern-lab/edition-node-grunt/issues/11 today or tomorrow.

bmuenzenmeyer commented 8 years ago

Please try again with this set of instructions: https://github.com/pattern-lab/edition-node-grunt#getting-started

There is also a --clean=true flag that attempts to delete the contents of source/ first.

yellowled commented 8 years ago

I'm afraid grunt patternlab:loadstarterkit --kit=starterkit-mustache-demo still doesn't do anything for me (but emits the help), however, grunt patternlab:starterkit-load --kit=starterkit-mustache-demo now gives me an error:

$ grunt patternlab:starterkit-load --kit=starterkit-mustache-demo

Loading engines...
...scanning for engines in the core...
...scanning for engines in the edition or test directory...
- mustache engine: good to go
...done loading engines.

Running "patternlab:starterkit-load" (patternlab) task
[TypeError: Path must be a string. Received undefined]

Done

(This is now Patternlab v2.4.0 on otherwise the same config.)

bmuenzenmeyer commented 8 years ago

once this hits a version that will be fixed

yellowled commented 8 years ago

Still the same for me with 2.4.4 on node 4.5.0.

Well, the TypeError is gone, but grunt patternlab:loadstarterkit --kit=starterkit-mustache-demo still doesn't do anything (but emit the help) and grunt patternlab:starterkit-load --kit=starterkit-mustache-demo emits a message that suggests everything was copied, but the files are not in ./source/.

jcarpe commented 7 years ago

@bmuenzenmeyer - in regards to the clean flag, it seems that the grunt task is not taking that argument into account in the function call. The code in the repo seems to look like this:

if (arg && arg === "starterkit-load") {
  pl.loadstarterkit(argv.kit);
}

But it would seem that is should look like the following:

if (arg && arg === "starterkit-load") {
  pl.loadstarterkit(argv.kit, argv.clean);
}

The addition of the clean argument does trigger the cleaning of the directory, but does not do anything to resolve the installation of the starter kit (as far as I am able to tell).

tburny commented 7 years ago

@jcarpe I merged your changes and can confirm that it still does not work as expected.

tburny commented 7 years ago

A temporary fix to this is to follow the debugging instructions in pattern-lab/patternlab-node#629:

  grunt.registerTask('patternlab', 'create design systems with atomic design', function (arg) {
  const done = this.async();
  ...
  setTimeout( () => done(), 10000);
  }