Giter Site home page Giter Site logo

accordproject / concerto-tools Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 1.42 MB

NOTICE: All content has been moved to the Concerto repository

Home Page: https://github.com/accordproject/concerto

License: Apache License 2.0

JavaScript 96.90% Shell 3.10%

concerto-tools's People

Contributors

dependabot[bot] avatar dselman avatar jeromesimeon avatar mttrbrts avatar tijohnson avatar

Stargazers

 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

concerto-tools's Issues

Switch to Accord Project's Concerto (0.80)

Switching Concerto tools to the new @accordproject/concerto runs afoul of the recent changes to remove instanceof. (See issue accordproject/concerto#47)

I believe those create confusion for the sinon-based testing. Sample trace:

bash-3.2$ npm run test

> [email protected] test /Users/jeromesimeon/git/concerto-tools
> nyc mocha --recursive -t 10000



  GoLangVisitor
    visit
      1) should call visitModelManager for a ModelManager


  0 passing (82ms)
  1 failing

  1) GoLangVisitor
       visit
         should call visitModelManager for a ModelManager:
     Unrecognised type: object, value: ModelManager {
  [accept]: 
   { [Function: proxy]
     [length]: 2,
     [name]: 'proxy',
     [prototype]: 
      functionStub {
        [constructor]: 
         { [Function: functionStub]
           [length]: 0,
           [name]: 'functionStub',
           [prototype]: [Circular],
           id: 'stub#10' } },
     isSinonProxy: true,
     formatters: 
      { c: 
         { [Function: c]
           [length]: 1,
           [name]: 'c',
           [prototype]: c { [constructor]: [Circular] } },
        n: 
         { [Function: n]
           [length]: 1,
           [name]: 'n',
           [prototype]: n { [constructor]: [Circular] } },
        D: 
         { [Function: D]
           [length]: 2,
           [name]: 'D',
           [prototype]: D { [constructor]: [Circular] } },
        C: 
         { [Function: C]
           [length]: 1,
           [name]: 'C',
           [prototype]: C { [constructor]: [Circular] } },
        t: 
         { [Function: t]
           [length]: 1,
           [name]: 't',
           [prototype]: t { [constructor]: [Circular] } },
        '*': 
         { [Function: *]
           [length]: 2,
           [name]: '*',
           [prototype]: * { [constructor]: [Circular] } } },
     reset: 
      { [Function: reset]
        [length]: 0,
        [name]: 'reset',
        [prototype]: reset { [constructor]: [Circular] } },
     invoke: 
      { [Function: invoke]
        [length]: 3,
        [name]: 'invoke',
        [prototype]: invoke { [constructor]: [Circular] } },
     named: 
      { [Function: named]
        [length]: 1,
        [name]: 'named',
        [prototype]: named { [constructor]: [Circular] } },
     getCall: 
      { [Function: getCall]
        [length]: 1,
        [name]: 'getCall',
        [prototype]: getCall { [constructor]: [Circular] } },
     getCalls: 
      { [Function: getCalls]
        [length]: 0,
        [name]: 'getCalls',
        [prototype]: getCalls { [constructor]: [Circular] } },
     calledBefore: 
      { [Function: calledBefore]
        [length]: 1,
        [name]: 'calledBefore',
        [prototype]: calledBefore { [constructor]: [Circular] } },
     calledAfter: 
      { [Function: calledAfter]
        [length]: 1,
        [name]: 'calledAfter',
        [prototype]: calledAfter { [constructor]: [Circular] } },
     calledImmediatelyBefore: 
      { [Function: calledImmediatelyBefore]
        [length]: 1,
        [name]: 'calledImmediatelyBefore',
        [prototype]: calledImmediatelyBefore { [constructor]: [Circular] } },
     calledImmediatelyAfter: 
      { [Function: calledImmediatelyAfter]
        [length]: 1,
        [name]: 'calledImmediatelyAfter',
        [prototype]: calledImmediatelyAfter { [constructor]: [Circular] } },
     withArgs: 
      { [Function: withArgs]
        [length]: 0,
        [name]: 'withArgs',
        [prototype]: withArgs { [constructor]: [Circular] } },
     matchingFakes: 
      { [Function: matchingFakes]
        [length]: 2,
        [name]: 'matchingFakes',
        [prototype]: matchingFakes { [constructor]: [Circular] } },
     matches: 
      { [Function: matches]
        [length]: 2,
        [name]: 'matches',
        [prototype]: matches { [constructor]: [Circular] } },
     printf: 
      { [Function: printf]
        [length]: 1,
        [name]: 'printf',
        [prototype]: printf { [constructor]: [Circular] } },
     calledOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysCalledOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     calledWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     calledWithMatch: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysCalledWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysCalledWithMatch: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     calledWithExactly: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysCalledWithExactly: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     neverCalledWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     neverCalledWithMatch: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     threw: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysThrew: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     returned: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysReturned: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     calledWithNew: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     alwaysCalledWithNew: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callArg: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callArgWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callArgOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callArgOnWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     throwArg: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yield: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     invokeCallback: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldTo: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldToOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     spyCall: 
      { [Function: createSpyCall]
        [length]: 7,
        [name]: 'createSpyCall',
        [prototype]: createSpyCall { [constructor]: [Circular] },
        toString: 
         { [Function: toString]
           [length]: 0,
           [name]: 'toString',
           [prototype]: toString { [constructor]: [Circular] } } },
     id: 'spy#10',
     called: false,
     notCalled: true,
     calledOnce: false,
     calledTwice: false,
     calledThrice: false,
     callCount: 0,
     firstCall: null,
     secondCall: null,
     thirdCall: null,
     lastCall: null,
     args: [ [length]: 0 ],
     returnValues: [ [length]: 0 ],
     thisValues: [ [length]: 0 ],
     exceptions: [ [length]: 0 ],
     callIds: [ [length]: 0 ],
     errorsWithCallStack: [ [length]: 0 ],
     displayName: 'accept',
     toString: 
      { [Function: toString]
        [length]: 0,
        [name]: 'toString',
        [prototype]: toString { [constructor]: [Circular] } },
     instantiateFake: 
      { [Function: create]
        [length]: 1,
        [name]: 'create',
        [prototype]: create { [constructor]: [Circular] } },
     func: 
      { [Function: functionStub]
        [length]: 0,
        [name]: 'functionStub',
        [prototype]: functionStub { [constructor]: [Circular] },
        id: 'stub#10' },
     createStubInstance: 
      { [Function]
        [length]: 1,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsFake: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArg: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgOnWith: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     usingPromise: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yields: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsRight: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsTo: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsToOn: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     throws: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     throwsException: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     returns: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     returnsArg: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     throwsArg: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     returnsThis: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     resolves: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     rejects: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callThrough: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     get: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     set: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     value: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgOnAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgWithAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     callsArgOnWithAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsRightAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsOnAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsToAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     yieldsToOnAsync: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     create: 
      { [Function: create]
        [length]: 1,
        [name]: 'create',
        [prototype]: create { [constructor]: [Circular] } },
     resetBehavior: 
      { [Function: resetBehavior]
        [length]: 0,
        [name]: 'resetBehavior',
        [prototype]: resetBehavior { [constructor]: [Circular] } },
     resetHistory: 
      { [Function: reset]
        [length]: 0,
        [name]: 'reset',
        [prototype]: reset { [constructor]: [Circular] } },
     onCall: 
      { [Function: onCall]
        [length]: 1,
        [name]: 'onCall',
        [prototype]: onCall { [constructor]: [Circular] } },
     onFirstCall: 
      { [Function: onFirstCall]
        [length]: 0,
        [name]: 'onFirstCall',
        [prototype]: onFirstCall { [constructor]: [Circular] } },
     onSecondCall: 
      { [Function: onSecondCall]
        [length]: 0,
        [name]: 'onSecondCall',
        [prototype]: onSecondCall { [constructor]: [Circular] } },
     onThirdCall: 
      { [Function: onThirdCall]
        [length]: 0,
        [name]: 'onThirdCall',
        [prototype]: onThirdCall { [constructor]: [Circular] } },
     isPresent: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     addBehavior: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     createBehavior: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] } },
     defaultBehavior: null,
     behaviors: [ [length]: 0 ],
     rootObj: [Circular],
     propName: 'accept',
     restore: 
      { [Function]
        [length]: 0,
        [name]: '',
        [prototype]: { [constructor]: [Circular] },
        sinon: true },
     stackTrace: 'Error: Stack Trace for original\n    at wrapMethod (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/util/core/wrap-method.js:110:26)\n    at stub (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/stub.js:58:44)\n    at /Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/stub-entire-object.js:15:13\n    at /Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/util/core/walk.js:23:22\n    at Array.forEach (<anonymous>)\n    at walkInternal (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/util/core/walk.js:18:37)\n    at walkInternal (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/util/core/walk.js:29:9)\n    at walk (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/util/core/walk.js:44:12)\n    at stubEntireObject (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/stub-entire-object.js:7:5)\n    at stub (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/stub.js:35:16)\n    at Object.stub.createStubInstance (/Users/jeromesimeon/git/concerto-tools/node_modules/sinon/lib/sinon/stub.js:65:12)\n    at Context.it.only (/Users/jeromesimeon/git/concerto-tools/test/codegen/fromcto/golang/golangvisitor.js:51:31)\n    at callFn (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runnable.js:372:21)\n    at Test.Runnable.run (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runnable.js:364:7)\n    at Runner.runTest (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:455:10)\n    at /Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:573:12\n    at next (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:369:14)\n    at /Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:379:7\n    at next (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:303:14)\n    at /Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:342:7\n    at done (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runnable.js:319:5)\n    at callFn (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runnable.js:395:7)\n    at Hook.Runnable.run (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runnable.js:364:7)\n    at next (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:317:10)\n    at Immediate.<anonymous> (/Users/jeromesimeon/git/concerto-tools/node_modules/mocha/lib/runner.js:347:5)\n    at runCallback (timers.js:810:20)\n    at tryOnImmediate (timers.js:768:5)\n    at processImmediate [as _immediateCallback] (timers.js:745:5)',
     wrappedMethod: { [Function: accept] [length]: 2, [name]: 'accept' } },
...

Move `parsejs` and dependencies to the `./scripts` directory

As far as I can tell, ./lib/codegen/parsejs.js is only used as a developers dependency for generating the API documentation. It should be moved to a build-time directory such as scripts.

Context

There are a number of dependencies e.g., acorn and doctrine which are not needed at runtime, but are placed in the ./lib directory. This means any consumer of the composer-concerto package must also have those.

They also get bundled in through WebPack unnecessarily.

Expected Behavior

Same behaviour as not but without the dependencies to acorn and doctrine, etc.

Actual Behavior

Some current build-time dependencies are made necessary at runtime.

Possible Fix

  • Move the following: ./lib/codegen/parsejs.js and ./lib/codegen/javascriptparser.js to ./scripts
  • Move acorn and doctrine from dependencies to devDependencies.

Steps to Reproduce

Existing issues

This led to issue accordproject/concerto#43

Context

Forced to add unnecessarily acorn and doctrine upstream in a consumer of Composer Concerto Tools (Accord Project's Cicero and related packages).

Your Environment

  • Version used: 0.71.6
  • Environment name and version (e.g. Chrome 39, node.js 5.4): node.js 8
  • Operating System and version (desktop or mobile): MacOS
  • Link to your project:

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.