Giter Club home page Giter Club logo

patternlab-node-cli's People

Contributors

benhalverson avatar bmuenzenmeyer avatar raphaelokon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

patternlab-node-cli's Issues

EPIC: Pattern Lab Node CLI v1.0

  • Update core version to v3
  • Switch wrapAsync() back to async/await (already done in local branch as we started with async/await)
  • Update config to latest state
  • Write edition use case and how to use the CLI within different build tools

CLI serve action is not watching for changes

General information

  • NodeJS version: v8.9.1
  • NPM version: 5.5.1

Problem description

Pattern Lab CLI isn't properly watching and rebuilding patterns after changes are made.

Reproduction steps

Install CLI

$ npm install pattern-lab/patternlab-node-cli --save-dev

Create npm tasks to use the CLI actions

"pl:init": "patternlab init",
"pl:build": "patternlab build --config ./patternlab/patternlab-config.json",
"pl:serve": "patternlab serve --config ./patternlab/patternlab-config.json",

Init new PL project

$ npm run pl:init
? Please specify a directory for your PatternLab project. patternlab
? Which edition do you want to use (defaults to edition-node)? edition-node-gulp
? Which starterkit do you want to use? starterkit-mustache-demo
? Are you happy with your choices? (Hit enter for YES)? Yes

$ npm run pl:serve
...
Ready for changes
Serving "C:\...\my-project\patternlab\public" at http://127.0.0.1:8080
GET / 404 8.031 ms - 139

First Issue
Here the server task does not run the build task before launching server.

Next step:

$ npm run pl:build

PL build task goes through and generate everything inside public.

$ npm run pl:serve

Here, PL serve task starts serving the patterns at 8080. Everything's looks fine. However, there is no watching happening upon any file changes (source/css/style.css or source/_patterns etc). This is also the behavior even if I add the --watch flag to pl:serve or pl:build


Additional info:

pl:init as shown above installs these dependencies to the project:

{
...
 "dependencies": {
    "@pattern-lab/starterkit-mustache-demo": "^4.0.4",
    "edition-node-gulp": "^1.4.0"
  }
}

Add yarn support

Add support for project that use yarn package manager instead of npm.

patternlab init throws an error

General information

patternlab init throws an error
OSX version 10.10.5

  • NodeJS version: 7.4.0
  • NPM version: 4.0.5

Problem description

After running patternlab init I get the following error:

    if (err) { throw err; }
               ^

Error: ENOENT: no such file or directory, scandir '/Users/benhalverson/projects/pl-test/node_modules'
    at Object.fs.readdirSync (fs.js:871:18)
    at diveSync (/Users/benhalverson/.nvm/versions/node/v7.4.0/lib/node_modules/patternlab-node-cli/node_modules/diveSync/diveSync.js:30:19)
    at findEngineModulesInDirectory (/Users/benhalverson/.nvm/versions/node/v7.4.0/lib/node_modules/patternlab-node-cli/node_modules/patternlab-node/core/lib/pattern_engines.js:37:3)
    at /Users/benhalverson/.nvm/versions/node/v7.4.0/lib/node_modules/patternlab-node-cli/node_modules/patternlab-node/core/lib/pattern_engines.js:58:28
    at Array.forEach (native)
    at loadAllEngines (/Users/benhalverson/.nvm/versions/node/v7.4.0/lib/node_modules/patternlab-node-cli/node_modules/patternlab-node/core/lib/pattern_engines.js:57:22)
    at Object.<anonymous> (/Users/benhalverson/.nvm/versions/node/v7.4.0/lib/node_modules/patternlab-node-cli/node_modules/patternlab-node/core/lib/pattern_engines.js:183:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)```


### Reproduction steps
npm i -g pattern-lab/patternlab-node-cli
patternlab init 

Starterkit installation fails for any starterkit without a package.json

Implement CLI method(s): StarterKits

braindump, intended to start discussion. nothing here is prescriptive.

At any time, a user should be able to ask the PL CLI what starterkits are available for download.

Current exposed command on editions:

Proposed CLI command:
patternlab starterkit --install

With no additional parameters, perhaps it suggest like https://github.com/pattern-lab/patternlab-node-cli/blob/master/bin/init.js#L236

Proposed option:
patternlab starterkit --install --starterkit-mustache-demo

With this option, it reaches out to install from npm if needed, and then installs similar to

Extend patternlab --version to also report the core version

General information

  • NodeJS version: 6.9.5
  • NPM version: 3.5.2

Problem description

With the patternlab cli, there is no way to report the current core version. Today people can do this with gulp patternlab:version

Now that I am removing PL boilerplate logs (pattern-lab/patternlab-node#636) it would be nice if the CLI could also report the version of core.
This would be similar to how gulp -v works too (which reports the local and then the global version)

Reproduction steps

patternlab --version

patternlab -v vs patternlab -V

General information

  • NodeJS version: 5.5.0
  • NPM version: 3.3.12

Problem description

According to the documentation, I should be able to run patternlab -V to emit the CLI version. Other commands have this lowercased, such as help and config. Is there a reason why this is inconsistent, or is it just the README that needs updating. I'd think that lowercase is preferred in most cases, if not both.


disregard most of above, kept for records...

I did a patternlab -h to see how it emits the help and just now noticed the verbose flag, so perhaps only the documentation needs updating to explain that option too.

patternlab init does not let me arrow through options

General information

When running patternlab init and interactively setting up a new project, I cannot arrow through edition options.

  • NodeJS version: 4.6.2
  • NPM version: 2.15.11
  • Operating System: Windows

Problem description

I wonder if this has to do with the node version, or the OS?

Reproduction steps

image

Tidy-up logs

Tidy up logs eg. remove the patternlab bit from it as it is automatically prepended via logger

Add e2e tests

  • Add execa to replace promisified child_process
  • Add e2e tests for: build, export and init

Discuss CI possibilities

We e2e tests land, a CI solution has to be established. PL core uses Travis … so might opt for that. Any suggestions from PL node team welcome :>

/cc @pattern-lab/node

patternlab-node 2.7.1 breaks CLI

General information

  • NodeJS version: 7.4.0

Reproduction steps

Running the CLI results in

patternlab init
Loading engines from the core...


Loading engines from the edition or test directory...

  mustache: good to go

Done loading engines.


====[ Pattern Lab / Node - v2.7.1 ]====

Cannot init patternlab via cli

General information

  • NodeJS version: 6.11.2
  • NPM version: 3.10.10

Problem description

When I type patternlab init, all I get back is:

Loading engines from the core...

Loading engines from the edition or test directory...

but nothing else.

Reproduction steps

npm install -g pattern-lab/patternlab-node-cli
npm install @pattern-lab/patternlab-node
npm init

Implement CLI method(s): Plugin

braindump, intended to start discussion. nothing here is prescriptive.

At any time, a user should be able to install a plugin.

Current exposed command on editions/core:

Plugin installation is a bit one-two stepped right now, with users needing to npm install first and then either call the above or even npm run postinstall, so it'd be nice if we could get all that into one method.

patternlab plugin --install --plugin-node-tab

This could reach out to npm if plugin-node-tab is not found already locally, and do everything for the user.

Future commands to enable/disable would be nice too, as mentioned here: https://github.com/pattern-lab/plugin-node-tab#enabling--disabling-the-plugin

Discuss miscellaneous browsersync configuration

watches have already been discussed inside #23

I am going to break down the remaining browsersync config on the patternlab:connect gulp task found within edition-node-gulp's gulpfile: https://github.com/pattern-lab/edition-node-gulp/blob/master/gulpfile.js

gulp.task('patternlab:connect', gulp.series(function(done) {
  browserSync.init({
    server: {
      baseDir: resolvePath(paths().public.root)
    },
    snippetOptions: {
      // Ignore all HTML files within the templates folder
      blacklist: ['/index.html', '/', '/?*']
    },
    notify: {
      styles: [
        'display: none',
        'padding: 15px',
        'font-family: sans-serif',
        'position: fixed',
        'font-size: 1em',
        'z-index: 9999',
        'bottom: 0px',
        'right: 0px',
        'border-top-left-radius: 5px',
        'background-color: #1B2032',
        'opacity: 0.4',
        'margin: 0',
        'color: white',
        'text-align: center'
      ]
    }
  }, function(){
    console.log('PATTERN LAB NODE WATCHING FOR CHANGES');
    done();
  });
}));
    server: {
      baseDir: resolvePath(paths().public.root)
    },

the server baseDir command should map to the above always, which is again configurable by the user and supplied within patternlab-config.json

✔️

    snippetOptions: {
      // Ignore all HTML files within the templates folder
      blacklist: ['/index.html', '/', '/?*']
    },

this option prevents the PL chrome from refreshing, preserving a user's scroll position, while updating the iframe content (the patterns). we should be able to safely do this blackbox for users without any problem

✔️

    notify: {
      styles: [
        'display: none',
        'padding: 15px',
        'font-family: sans-serif',
        'position: fixed',
        'font-size: 1em',
        'z-index: 9999',
        'bottom: 0px',
        'right: 0px',
        'border-top-left-radius: 5px',
        'background-color: #1B2032',
        'opacity: 0.4',
        'margin: 0',
        'color: white',
        'text-align: center'
      ]
    }

Geoff added this override of the default snippet to make it less obtrusive for users. It could probably be blackboxed too. If someone really wants to change it, we can look into ways I suppose. Understanding what class, if any, there is on that, and if it's accessible via the pattern-scaffold.css file that we load might be all we need.

✔️

function(){
    console.log('PATTERN LAB NODE WATCHING FOR CHANGES');
    done();
  });

It'd be nice if we had a way to provide users with a callback like this after BS starts. I have a feeling, this being a CLI, that we will be able to do just that.

✔️

@raphaelokon does this help clarify what is needed, along with the other issue?

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.