Coder Social home page Coder Social logo

aurelia-cli's Introduction

aurelia-cli

Aurelia CLI tool

example Aureliafile

module.exports = function(aurelia) {
  aurelia.bundleConfig({
    tmpl: {
      patterns: [
        'dist/*.html'
      ],
      baseUrl: './'
    },
    js: {
      moduleExpression: 'aurelia-bootstrapper + dist/**/* + github:aurelia/[email protected] + github:aurelia/[email protected] + github:aurelia/[email protected] + github:aurelia/[email protected] + github:aurelia/[email protected]',
      fileName: 'build.js',
      options: {
        inject: true
      }
    }
  });
}

aurelia-cli's People

Contributors

ahmedshuhel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aurelia-cli's Issues

Github-Cloner

instead of writing this by yourself maybe just take a look at the npm module github-download. I'm using that for my aurelia-node application to pull the latest version of the skeleton app like follows:

var path = require('path');
var ghdownload = require('github-download')
  , exec = require('exec');

ghdownload("https://github.com/aurelia/skeleton-navigation.git#master", 'public/app')
.on('dir', function(dir) {
  console.log(dir)
})
.on('file', function(file) {
  console.log(file)
})
.on('zip', function(zipUrl) { //only emitted if Github API limit is reached and the zip file is downloaded
  console.log(zipUrl)
})
.on('error', function(err) {
  console.error(err)
})
.on('end', function() {
  exec('tree', function(err, stdout, sderr) {
    console.log(stdout)
  })
});

Stop clearing the console!

aurelia-cli should behave like normal command line apps and don't clear the shell history.

This is really bad behavior. It even deletes the command history? I mean I suddently can't scrollback up in my command history at all? At least with git bash running inside a VM on windows.

Behave like normal cli programs! Never ever clear the screen and command history thank you.

This is the most annoying stuff ever. Especially if you are writing a todo and want to copy paste from your command history.

Not sure if this is some default in Liftoff or what? https://github.com/js-cli/js-liftoff

Eliminate monolithic switch statement

Looking through your code I found that cli.js uses a switch statement to interact with the user input. Now this works quite well as long as you have only a limited amount of functionality and simple statements for each case, but gets quite busy when the project starts becoming bigger.

I wrote the one or other cli tool for customers and have realized that a great way to work around that is either use a map of Key/Function, where the input would be the key and match against the proper function or if it gets more complicated use a Command Pattern. That way you separate tasks into small chunks and make it easier to modify them or add another one.

Consider using Yeoman

Hi Ahmed,

dunno what this project is going to do in the end, but have you considered using Yeoman and providing an official Yeoman Generator instead? I have been working on quite some CLIs and found that the Yeoman way seems overall much nicer, easier to adopt by newcomers and offers a lot of flexibility and a nice API to build upon.

As a reference might take a short look at my generator-aurelia repo, which creates a new Skeleton App for you. The latest release now also includes auto-updates to always get the latest version from the Github repo, as well as a simple subgenerator for creating a VM/View combination.

Problem with toastr when bundling

I have a class that uses toastr that works normally but fails after bundling. The class is Notify.js:

import 'bootstrap';
import toastr from 'toastr/toastr';
import 'toastr/toastr.css!';

export class Notify {
  constructor() {
  toastr.options = {
          "closeButton": false,
          "debug": false,
          "positionClass": "toast-bottom-right",
          "onclick": null,
          "showDuration": "1000",
          "hideDuration": "1000",
          "timeOut": "5000",
          "extendedTimeOut": "1000",
          "showEasing": "swing",
          "hideEasing": "linear",
          "showMethod": "fadeIn",
          "hideMethod": "fadeOut"
    };
    }
    notify( body, title, severity ) {
  toastr[severity || 'info']( body, title );
    }
}

I installed toastr with "jspm install toastr=github:CodeSeven/toastr". After bundling, the variable toastr in the constructor is {}, not the object that the toastr js creates, and thus in the notify() method, there is no function hanging off of it.

But things work ok before bundling. Am I importing incorrectly? The bottom of toastr.js looks like:

}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
    if (typeof module !== 'undefined' && module.exports) { //Node
        module.exports = factory(require('jquery'));
    } else {
        window['toastr'] = factory(window['jQuery']);
    }
}));

So I might wonder if there is a module.exports w/out bundling and after bundling, window.toastr might exist, but I tried that and its null (in the bundling case).

Issue bundling aurelia-event-aggregator

Hello,

When I try to bundle my project - I get the following Error:

Potentially unhandled rejection [6] Error: Error loading "aurelia-event-aggregator" at file:c:/[path]/aurelia-event-aggregator.js

Error loading "aurelia-event-aggregator" from "graph-element" at file:c:/[path]/graph-element.js

My aurelia-file.js is as follows:

var aurelia = require('aurelia-cli');

aurelia.command('bundle', {
    js: {
        "dist/app-bundle": {
            modules: [
                '*',
                'aurelia-bootstrapper',
                'aurelia-http-client',
                'aurelia-router',
                'aurelia-animator-css',
                'aurelia-event-aggregator',
                'github:aurelia/[email protected]',
                'github:aurelia/[email protected]',
                'github:aurelia/[email protected]',
                'github:aurelia/[email protected]',
                'github:aurelia/[email protected]',
                'github:aurelia/[email protected]'
            ],
            options: {
                inject: true,
                minify: true
            }
        }
    },
        template: {
            "dist/app-bundle": {
                pattern: 'dist/*.html',
                options: {
                    inject: true
                }
            }
    }
});

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.