Giter VIP home page Giter VIP logo

topo's Introduction

@hapi/topo

Topological sorting with grouping support.

topo is part of the hapi ecosystem and was designed to work seamlessly with the hapi web framework and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out hapi – they work even better together.

Visit the hapi.dev Developer Portal for tutorials, documentation, and support

Useful resources

topo's People

Contributors

arb avatar christianbundy avatar cjihrig avatar devinivy avatar emrealparslan93 avatar hueniverse avatar jarrodyellets avatar lloydbenson avatar marsup avatar nargonath avatar tuckbick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topo's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

`before` option as array misbehaves

When the before option is specified as an array, those dependencies are effectively ignored. Ref PR with a proposed fix and failing tests: #7.

CC @hueniverse: this is not meant to be a superfluous issue, so I hope you don't take it as such. I've seen PRs become orphaned without an active issue in other projects, so I figured it was time to make sure the bug has a proper placeholder while the fix is processed. I'll be making a similar issue for the implied bug in hapi.

Topo and uglify-js not working

Hi,
The issue I get is in my aurelia/SystemJs application when bundling the application for production uglify-js is run against my app and all dependencies.

The error I see is:

Error: SyntaxError: Unexpected token: punc ({)

which I tracked down to uglify-js interacting with topo or it's dependencies. I don't think this is an issue with topo per se, but I'm raising this for awareness and to try and help other so they don't waste their time like I did. The workaround for me was to create a separate bundle that isn't minified, in the aurelia bundle config:

"dist/third-party-non-minify": {
  "includes": [
    'topo'
  ],
  "options": {
    "sourceMaps": true,
    "inject": true,
    "minify": false,
    "depCache": false,
    "rev": true
  }
}

this._items is undefined when using topo with joi

Hi!

I'm currently trying out joi for validating configuration in my application and came across the following error with even a simple joi schema:

app/node_modules/joi/lib/object.js:310                                                                                                                                                                                                                         
            throw castErr;                                                                                                                                                                                                                                                                    
                  ^                                                                                                                                                                                                                                                                           
TypeError: Cannot read property '_items' of undefined                                                                                                                                                                                                                                         
    at app/node_modules/topo/lib/index.js:39:22                                                                                                                                                                                                                
    at Array.forEach (native)                                                                                                                                                                                                                                                                 
    at internals.Topo.add (app/node_modules/topo/lib/index.js:36:24)                                                                                                                                                                                           
    at internals.Object.keys (app/node_modules/joi/lib/object.js:301:18)                                                                                                                                                                                       
    at Object.<anonymous> (app/app.js:3:27)                                                                                                                                                                                                                    
    at Module._compile (module.js:460:26)                                                                                                                                                                                                                                                     
    at Object.Module._extensions..js (module.js:478:10)                                                                                                                                                                                                                                       
    at Module.load (module.js:355:32)                                                                                                                                                                                                                                                         
    at Function.Module._load (module.js:310:12)                                                                                                                                                                                                                                               
    at Function.Module.runMain (module.js:501:10)   

The code that triggered it was this:

var Joi = require('joi');                                                                                                                                                                                                                                                                     

var schema = Joi.object().keys({                                                                                                                                                                                                                                                              
        username: Joi.string().alphanum().min(3).max(30).required(),                                                                                                                                                                                                                          
        password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/),                                                                                                                                                                                                                                  
        access_token: [Joi.string(), Joi.number()],                                                                                                                                                                                                                                           
        birthyear: Joi.number().integer().min(1900).max(2013),                                                                                                                                                                                                                                
        email: Joi.string().email()                                                                                                                                                                                                                                                           
}).with('username', 'birthyear').without('password', 'access_token');                                                                                                                                                                                                                         

Joi.validate({ username: 'abc', birthyear: 1994 }, schema, function (err, value) { });

Taken from the joi examples.

Note: I do run node with the --harmony flag as I'd otherwise get this:

app/node_modules/joi/lib/index.js:5                                                                                                                                                                                                                            
const Any = require('./any');                                                                                                                                                                                                                                                                 
^^^^^                                                                                                                                                                                                                                                                                         
SyntaxError: Use of const in strict mode.                                                                                                                                                                                                                                                     
    at exports.runInThisContext (vm.js:73:16)                                                                                                                                                                                                                                                 
    at Module._compile (module.js:443:25)                                                                                                                                                                                                                                                     
    at Object.Module._extensions..js (module.js:478:10)                                                                                                                                                                                                                                       
    at Module.load (module.js:355:32)                                                                                                                                                                                                                                                         
    at Function.Module._load (module.js:310:12)                                                                                                                                                                                                                                               
    at Module.require (module.js:365:17)                                                                                                                                                                                                                                                      
    at require (module.js:384:17)                                                                                                                                                                                                                                                             
    at Object.<anonymous> (app/app.js:1:73)                                                                                                                                                                                                                    
    at Module._compile (module.js:460:26)                                                                                                                                                                                                                                                     
    at Object.Module._extensions..js (module.js:478:10) 

Now stepping through with the debugger the line it fails at is this:

screen shot 2015-12-17 at 9 10 24 am

Is this an issue with the way I use joi or an issue with joi/topo?

Circular dependency detection broken?

Maybe I'm just not seeing the forest for the trees, but what am I doing wrong?

With topo 2.0.2:

const Topo = require('topo');

const topo = new Topo();

// set up a circular dependency
topo.add('A', { after: ['B'] });
topo.add('B', { after: ['A'] });

console.dir(topo.nodes);
// [ 'A', 'B' ]

Shouldn't this throw an exception?

Sort result does not correct

Support plan

  • which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version:
  • module version with issue: 4.0.1
  • last module version without issue:
  • environment (e.g. node, browser, native): chrome
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

x = new Topo.Sorter();
x.add('a', { before: ['b', 'c'] });
x.add('b');
x.add('c', { before: ['b'] });
x.add('e', { before: ['c'] });
console.log(x.nodes);
y = new Topo.Sorter();
y.add('d', { before: ['c'] });
y.merge(x);
console.log(y.nodes);

What was the result you got?

["a", "b", "c", "e"]
["d", "a", "b", "c", "e"]

What result did you expect?

["a", "e", "c", "b"]
["d", "a", "e", "c", "b"]

Make illustration for topo.

Hoping to add an illustration for topo, likely to be displayed in the readme. It may be a small corner of the hapi ecosystem, but it still deserves "the treatment"! Would love some help with this.

CC @tmateosian any interest? If so, I can provide some descriptors.

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.