├── .editorconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── app-dev.js ├── app-prod.js ├── build.js ├── config ├── client │ ├── ajax-app │ │ ├── classes.js │ │ ├── events.js │ │ ├── interfaces.js │ │ ├── sequences.js │ │ └── services.js │ ├── event │ │ ├── classes.js │ │ ├── sequences.js │ │ └── services.js │ ├── http │ │ ├── classes.js │ │ └── services.js │ ├── logging │ │ └── services.js │ ├── manipulation │ │ ├── classes.js │ │ ├── events.js │ │ ├── interfaces.js │ │ ├── sequences.js │ │ └── services.js │ ├── tcp │ │ ├── classes.js │ │ ├── events.js │ │ ├── interfaces.js │ │ └── services.js │ └── vendor │ │ ├── classes.js │ │ └── services.js ├── common │ ├── command │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── configuration │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── dependency-injection │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── event │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── http │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── logging │ │ ├── classes.js │ │ └── interfaces.js │ ├── manipulation │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── object │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ ├── sequencing │ │ ├── classes.js │ │ ├── interfaces.js │ │ └── services.js │ └── vendor │ │ ├── classes.js │ │ └── services.js └── server │ ├── assets │ ├── classes.js │ └── services.js │ ├── file-system │ ├── classes.js │ ├── interfaces.js │ └── services.js │ ├── http │ ├── classes.js │ ├── interfaces.js │ └── services.js │ ├── logging │ └── services.js │ ├── rendering │ ├── classes.js │ ├── interfaces.js │ ├── parameters.js │ └── services.js │ ├── tcp │ ├── classes.js │ ├── events.js │ ├── interfaces.js │ └── services.js │ └── vendor │ ├── classes.js │ └── services.js ├── danf.js ├── gulp.js ├── gulpfile.js ├── index.js ├── lib ├── client │ ├── ajax-app │ │ ├── form-submitter.js │ │ └── link-follower.js │ ├── app.js │ ├── danf.js │ ├── event │ │ └── notifier │ │ │ └── dom.js │ ├── http │ │ ├── cookies-registry.js │ │ └── event │ │ │ └── notifier │ │ │ └── request.js │ ├── main.js │ ├── manipulation │ │ ├── body-provider.js │ │ ├── history.js │ │ └── ready-processor.js │ ├── tcp │ │ ├── event │ │ │ └── notifier │ │ │ │ └── socket.js │ │ └── messenger.js │ └── vendor │ │ ├── jquery.js │ │ └── socket-io.js ├── common │ ├── command │ │ ├── command.js │ │ ├── event │ │ │ └── notifier │ │ │ │ └── command.js │ │ └── parser.js │ ├── configuration │ │ ├── manipulation │ │ │ └── data-interpreter │ │ │ │ ├── abstract-namespacer.js │ │ │ │ ├── namespace.js │ │ │ │ └── references.js │ │ ├── mod.js │ │ ├── modules-tree.js │ │ ├── namespacer.js │ │ ├── processor.js │ │ ├── section-processor.js │ │ └── section-processor │ │ │ └── parameters.js │ ├── dependency-injection │ │ ├── configuration │ │ │ └── section-processor │ │ │ │ └── services.js │ │ ├── object-provider.js │ │ ├── registry.js │ │ ├── service-builder │ │ │ ├── abstract-service-builder.js │ │ │ ├── abstract.js │ │ │ ├── alias.js │ │ │ ├── children.js │ │ │ ├── class.js │ │ │ ├── collections.js │ │ │ ├── declinations.js │ │ │ ├── factories.js │ │ │ ├── induced.js │ │ │ ├── parent.js │ │ │ ├── properties.js │ │ │ └── registry.js │ │ └── services-container.js │ ├── event │ │ ├── configuration │ │ │ └── section-processor │ │ │ │ ├── events.js │ │ │ │ └── sequences.js │ │ ├── event.js │ │ ├── events-container.js │ │ └── notifier │ │ │ ├── abstract.js │ │ │ └── event.js │ ├── framework │ │ ├── framework.js │ │ └── initializer.js │ ├── http │ │ ├── abstract-cookies-registry.js │ │ ├── event │ │ │ └── notifier │ │ │ │ └── request.js │ │ ├── route.js │ │ └── router.js │ ├── init.js │ ├── logging │ │ └── logger.js │ ├── manipulation │ │ ├── asynchronous-callback │ │ │ ├── error-result.js │ │ │ ├── error.js │ │ │ └── result.js │ │ ├── asynchronous-collection.js │ │ ├── asynchronous-input │ │ │ ├── array.js │ │ │ └── object.js │ │ ├── asynchronous-iterator │ │ │ ├── collection.js │ │ │ ├── key.js │ │ │ └── memo.js │ │ ├── callback-executor.js │ │ ├── data-interpreter │ │ │ ├── abstract.js │ │ │ ├── default.js │ │ │ ├── flatten.js │ │ │ ├── format.js │ │ │ ├── required.js │ │ │ ├── type.js │ │ │ └── validate.js │ │ ├── data-resolver.js │ │ ├── escaper.js │ │ ├── flow-driver.js │ │ ├── flow.js │ │ ├── map.js │ │ ├── notifier-registry.js │ │ ├── proxy-executor.js │ │ ├── reference-resolver.js │ │ ├── reference-type.js │ │ ├── registry.js │ │ └── unique-id-generator.js │ ├── object │ │ ├── class-processor │ │ │ ├── abstract.js │ │ │ ├── extender.js │ │ │ └── interfacer.js │ │ ├── classes-container.js │ │ ├── configuration │ │ │ └── section-processor │ │ │ │ ├── classes.js │ │ │ │ └── interfaces.js │ │ ├── interface.js │ │ ├── interfacer.js │ │ └── interfaces-container.js │ ├── sequencing │ │ ├── collection-interpreter.js │ │ ├── configuration │ │ │ └── section-processor │ │ │ │ └── sequences.js │ │ ├── flow-context.js │ │ ├── logger.js │ │ ├── references-resolver.js │ │ ├── sequence-interpreter │ │ │ ├── abstract.js │ │ │ ├── alias.js │ │ │ ├── children.js │ │ │ ├── collections.js │ │ │ ├── embedded.js │ │ │ ├── operations.js │ │ │ ├── parents.js │ │ │ └── stream.js │ │ ├── sequence.js │ │ └── sequences-container.js │ ├── tcp │ │ └── event │ │ │ └── notifier │ │ │ └── socket.js │ ├── utils.js │ └── vendor │ │ └── async.js └── server │ ├── app.js │ ├── assets │ ├── configuration │ │ └── section-processor │ │ │ └── assets.js │ └── middleware │ │ └── static.js │ ├── file-system │ └── mapper.js │ ├── framework │ └── initializer.js │ ├── http │ ├── cookies-registry.js │ ├── error-handler.js │ ├── event │ │ └── notifier │ │ │ └── request.js │ ├── redirector.js │ └── session-handler.js │ ├── rendering │ ├── format-renderer │ │ ├── html.js │ │ ├── json.js │ │ └── text.js │ └── renderer.js │ ├── tcp │ ├── event │ │ └── notifier │ │ │ └── socket.js │ └── messenger.js │ ├── test │ └── test-helper.js │ └── vendor │ ├── chalk.js │ └── socket-io.js ├── main.js ├── package.json ├── resource ├── private │ ├── dia │ │ ├── architecture-event.dia │ │ ├── architecture-model.dia │ │ ├── architecture-sequencing.dia │ │ └── architecture.dia │ ├── doc │ │ ├── concept │ │ │ └── index.md │ │ ├── documentation │ │ │ ├── core │ │ │ │ ├── ajax-app.md │ │ │ │ ├── configuration.md │ │ │ │ ├── dependency-injection.md │ │ │ │ ├── events.md │ │ │ │ ├── oop.md │ │ │ │ ├── sequencing.md │ │ │ │ └── testing.md │ │ │ ├── how-to │ │ │ │ ├── assets.md │ │ │ │ ├── cluster.md │ │ │ │ ├── cookies.md │ │ │ │ ├── es6-class.md │ │ │ │ ├── redirect.md │ │ │ │ └── session.md │ │ │ └── index.md │ │ ├── index.md │ │ ├── installation.md │ │ ├── modules.md │ │ └── overview │ │ │ └── index.md │ ├── img │ │ ├── architecture-event.png │ │ ├── architecture-model.png │ │ ├── architecture-sequencing.png │ │ └── architecture.png │ └── view │ │ └── layout.jade └── public │ └── img │ ├── avatar-white.png │ ├── avatar.png │ ├── favicon-white.png │ ├── favicon.png │ ├── logo-white.jpg │ ├── logo.ai │ ├── logo.jpg │ ├── powered-bis.png │ ├── powered-white.png │ ├── powered.png │ ├── small-logo-white.jpg │ └── small-logo.jpg └── test ├── fixture ├── app │ ├── a.js │ ├── b.js │ ├── base-computer.js │ ├── c.js │ ├── callback-executor.js │ ├── computer.js │ ├── counter.js │ ├── d.js │ ├── e.js │ ├── interfaced-data.js │ ├── scheduler.js │ ├── trigger.js │ └── trigger1.js ├── command │ ├── app-test.js │ ├── command-provider.js │ ├── danf.js │ ├── gulpfile.js │ └── package.json ├── configuration │ ├── configuration-resolver.js │ ├── danf.js │ ├── module1 │ │ ├── danf.js │ │ └── module3 │ │ │ └── danf.js │ ├── module2 │ │ └── danf.js │ ├── modules-tree.js │ └── section-processor.js ├── danf.js ├── file-system │ ├── .ban │ │ └── main.js │ ├── node-modules │ │ ├── foo │ │ │ └── bar.js │ │ ├── index.js │ │ └── test │ │ │ ├── directory │ │ │ └── file.js │ │ │ ├── js.js │ │ │ ├── private.js │ │ │ ├── private │ │ │ └── index.js │ │ │ ├── test.css │ │ │ └── test.js │ ├── protected │ │ ├── private.js │ │ ├── public.css │ │ └── public.js │ └── public │ │ └── foo.js ├── http │ ├── danf.js │ ├── forum.jade │ └── layout.jade ├── manipulation │ ├── asynchronous-collections.js │ ├── data-resolver.js │ └── map-provider.js ├── module1-danf.js ├── module10-v1-danf.js ├── module10-v2-danf.js ├── module10-v3-danf.js ├── module100-v1-danf.js ├── module100-v2-danf.js ├── module100-v3-danf.js ├── module2-danf.js ├── module3-danf.js ├── module4-danf.js ├── obj1.js ├── obj2.js ├── object │ ├── x.js │ ├── y.js │ └── z.js ├── proto │ ├── app │ │ ├── config │ │ │ └── common │ │ │ │ └── config │ │ │ │ └── classes.js │ │ ├── danf.js │ │ ├── lib │ │ │ ├── client │ │ │ │ └── foo.js │ │ │ ├── common │ │ │ │ ├── .bar │ │ │ │ │ └── foo.js │ │ │ │ ├── bar.js │ │ │ │ ├── foo.js │ │ │ │ └── foo │ │ │ │ │ └── bar.js │ │ │ ├── main.js │ │ │ └── server │ │ │ │ └── bar.js │ │ ├── node_modules │ │ │ └── a │ │ │ │ ├── config │ │ │ │ ├── client │ │ │ │ │ ├── config │ │ │ │ │ │ ├── dep1.subdep2 │ │ │ │ │ │ │ ├── index-.js │ │ │ │ │ │ │ └── key..js │ │ │ │ │ │ ├── events&dev │ │ │ │ │ │ │ └── request │ │ │ │ │ │ │ │ └── compute.js │ │ │ │ │ │ └── this.js │ │ │ │ │ └── contract.js │ │ │ │ ├── common │ │ │ │ │ └── config │ │ │ │ │ │ └── events │ │ │ │ │ │ └── request │ │ │ │ │ │ ├── api.js │ │ │ │ │ │ └── compute.js │ │ │ │ └── server │ │ │ │ │ └── config │ │ │ │ │ └── events │ │ │ │ │ └── request │ │ │ │ │ ├── api~children │ │ │ │ │ ├── message-.get. │ │ │ │ │ │ ├── bar..js │ │ │ │ │ │ └── foo.js │ │ │ │ │ ├── old-topic.js │ │ │ │ │ ├── topic.js │ │ │ │ │ ├── user.js │ │ │ │ │ ├── user~children.js │ │ │ │ │ └── user~children │ │ │ │ │ │ └── message.js │ │ │ │ │ └── compute.js │ │ │ │ ├── danf.js │ │ │ │ ├── node_modules │ │ │ │ ├── b │ │ │ │ │ ├── config │ │ │ │ │ │ └── client │ │ │ │ │ │ │ └── contract.js │ │ │ │ │ ├── danf.js │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ └── foo.js │ │ │ │ │ │ └── common │ │ │ │ │ │ │ └── bar.js │ │ │ │ │ └── package.json │ │ │ │ └── c │ │ │ │ │ ├── config │ │ │ │ │ └── server │ │ │ │ │ │ └── contract.js │ │ │ │ │ ├── danf.js │ │ │ │ │ ├── lib │ │ │ │ │ └── server │ │ │ │ │ │ └── foo │ │ │ │ │ │ └── bar.js │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ └── package.json │ └── dependencies │ │ ├── danf.js │ │ ├── node_modules │ │ ├── b │ │ │ ├── danf.js │ │ │ └── package.json │ │ ├── c │ │ │ ├── danf.js │ │ │ └── package.json │ │ ├── d │ │ │ ├── danf.js │ │ │ ├── node_modules │ │ │ │ ├── e │ │ │ │ │ ├── danf.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── c │ │ │ │ │ │ │ ├── danf.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ │ ├── f │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ ├── g │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ └── h │ │ │ │ │ ├── danf.js │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── c │ │ │ │ │ │ ├── danf.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── i │ │ │ │ │ │ ├── danf.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── j │ │ │ │ │ │ ├── danf.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── k │ │ │ └── package.json │ │ ├── l │ │ │ ├── danf.js │ │ │ └── package.json │ │ ├── m │ │ │ ├── danf.js │ │ │ ├── node_modules │ │ │ │ ├── c │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ ├── f │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ ├── g │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ ├── j │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ │ └── o │ │ │ │ │ ├── danf.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── n │ │ │ ├── danf.js │ │ │ ├── node_modules │ │ │ │ └── h │ │ │ │ │ ├── danf.js │ │ │ │ │ ├── node_modules │ │ │ │ │ └── j │ │ │ │ │ │ ├── danf.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── o │ │ │ ├── danf.js │ │ │ └── package.json │ │ └── q │ │ │ ├── danf.js │ │ │ └── package.json │ │ └── package.json └── rendering │ ├── a.jade │ ├── b.jade │ ├── c.jade │ ├── d.jade │ ├── danf.js │ ├── e.jade │ ├── embedded.jade │ ├── f.jade │ ├── index.jade │ ├── layout.jade │ └── package.json ├── functional ├── feature │ ├── ajax-app │ │ ├── a.jade │ │ ├── app-dev.js │ │ ├── b.jade │ │ ├── c.jade │ │ ├── config-client.js │ │ ├── config-common.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── date.jade │ │ ├── form.jade │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── layout.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── ajax-hello-world │ │ ├── app-dev.js │ │ ├── config-client.js │ │ ├── config-common.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── hello.jade │ │ ├── index.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ ├── parameters-server.js │ │ └── world.jade │ ├── chat │ │ ├── app-dev.js │ │ ├── config-client.js │ │ ├── config-common.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── layout.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── command-hello-world │ │ ├── app-dev.js │ │ ├── config-client.js │ │ ├── config-common.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── cookie │ │ ├── app-dev.js │ │ ├── config-client.js │ │ ├── config-common.js │ │ ├── config-server.js │ │ ├── cookie-tester.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── dynamic-hello-world │ │ ├── app-dev.js │ │ ├── config-client.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── displayer.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── hello-world │ │ ├── app-dev.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js │ ├── proto-hello-world │ │ ├── app-dev.js │ │ ├── config │ │ │ └── server │ │ │ │ └── config │ │ │ │ ├── events │ │ │ │ └── request.js │ │ │ │ └── parameters.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── layout.jade │ │ ├── node_modules │ │ │ ├── hello │ │ │ │ ├── config │ │ │ │ │ └── client │ │ │ │ │ │ └── config │ │ │ │ │ │ ├── events │ │ │ │ │ │ └── dom.js │ │ │ │ │ │ ├── interfaces.js │ │ │ │ │ │ ├── sequences.js │ │ │ │ │ │ └── services.js │ │ │ │ ├── danf.js │ │ │ │ ├── lib │ │ │ │ │ └── client │ │ │ │ │ │ └── displayer.js │ │ │ │ ├── node_modules │ │ │ │ │ └── space │ │ │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ └── resource │ │ │ │ │ └── public │ │ │ │ │ └── css │ │ │ │ │ └── style.css │ │ │ └── world │ │ │ │ ├── config │ │ │ │ └── client │ │ │ │ │ └── config.js │ │ │ │ ├── danf.js │ │ │ │ ├── node_modules │ │ │ │ └── exclamation │ │ │ │ │ └── core │ │ │ │ │ └── content.js │ │ │ │ └── package.json │ │ ├── package.json │ │ ├── parameters-client.js │ │ ├── parameters-common.js │ │ └── parameters-server.js │ └── static-hello-world │ │ ├── app-dev.js │ │ ├── config-server.js │ │ ├── danf.js │ │ ├── gulpfile.js │ │ ├── index.jade │ │ ├── package.json │ │ ├── parameters-common.js │ │ └── parameters-server.js └── proto │ ├── app │ ├── .editorconfig │ ├── .gitattributes │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── app-dev.js │ ├── app-prod.js │ ├── config │ │ ├── client │ │ │ ├── config │ │ │ │ ├── events │ │ │ │ │ ├── dom.js │ │ │ │ │ └── event.js │ │ │ │ ├── interfaces.js │ │ │ │ ├── parameters.js │ │ │ │ ├── sequences.js │ │ │ │ ├── services.js │ │ │ │ └── this.js │ │ │ └── contract.js │ │ ├── common │ │ │ ├── config │ │ │ │ ├── events │ │ │ │ │ ├── event.js │ │ │ │ │ └── request.js │ │ │ │ ├── interfaces.js │ │ │ │ ├── parameters.js │ │ │ │ ├── sequences.js │ │ │ │ ├── services.js │ │ │ │ └── this.js │ │ │ └── contract.js │ │ └── server │ │ │ ├── config │ │ │ ├── events │ │ │ │ ├── event.js │ │ │ │ └── request.js │ │ │ ├── interfaces.js │ │ │ ├── parameters.js │ │ │ ├── sequences.js │ │ │ ├── services.js │ │ │ └── this.js │ │ │ └── contract.js │ ├── danf.js │ ├── gulpfile.js │ ├── lib │ │ ├── client │ │ │ └── .gitkeep │ │ ├── common │ │ │ └── .gitkeep │ │ └── server │ │ │ └── .gitkeep │ ├── package.json │ ├── parameters-client.js │ ├── parameters-common.js │ ├── parameters-server.js │ ├── resource │ │ ├── private │ │ │ └── view │ │ │ │ ├── index.jade │ │ │ │ └── layout.jade │ │ └── public │ │ │ ├── css │ │ │ └── style.css │ │ │ └── img │ │ │ └── favicon.png │ └── test │ │ ├── fixture │ │ └── .gitkeep │ │ ├── functional │ │ └── .gitkeep │ │ └── unit │ │ └── test.js │ └── overview │ ├── .editorconfig │ ├── .gitattributes │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── app-dev.js │ ├── app-prod.js │ ├── config │ ├── client │ │ └── config │ │ │ └── events │ │ │ └── dom.js │ ├── common │ │ └── config │ │ │ ├── interfaces.js │ │ │ ├── sequences.js │ │ │ └── services.js │ └── server │ │ └── config │ │ ├── events │ │ └── request.js │ │ └── parameters.js │ ├── danf.js │ ├── gulpfile.js │ ├── lib │ └── common │ │ ├── computer.js │ │ └── processor.js │ ├── package.json │ ├── parameters-client.js │ ├── parameters-common.js │ ├── parameters-server.js │ └── resource │ ├── private │ └── view │ │ ├── index.jade │ │ └── layout.jade │ └── public │ ├── css │ └── style.css │ └── img │ └── favicon.png └── unit ├── app.js ├── command ├── event │ └── notifier │ │ └── command.js └── parser.js ├── configuration ├── modules-tree.js ├── namespacer.js ├── processor.js └── section-processor.js ├── dependency-injection ├── object-provider.js └── services-container.js ├── event ├── configuration │ └── section-processor │ │ └── events.js ├── events-container.js └── notifier │ └── event.js ├── file-system └── mapper.js ├── http ├── cookies-registry.js ├── error-handler.js ├── event │ └── notifier │ │ └── request.js ├── route.js ├── router.js └── session-handler.js ├── init.js ├── logging └── logger.js ├── manipulation ├── callback-executor.js ├── data-resolver.js ├── escaper.js ├── flow.js ├── map.js ├── notifier-registry.js ├── proxy-executor.js ├── reference-resolver.js └── registry.js ├── object ├── class-processor │ ├── extender.js │ └── interfacer.js ├── classes-container.js ├── interfacer.js └── interfaces-container.js ├── proto.js ├── rendering └── format-renderer │ ├── html.js │ ├── json.js │ └── text.js ├── sequencing ├── flow-context.js ├── sequence.js └── sequences-container.js ├── test └── test-helper.js └── utils.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | 3 | .built 4 | /parameters-*.js -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '0.12' 5 | - '4.2' 6 | - '5.0' 7 | #- 'node' wait for gulp 4 corrections 8 | script: 'npm test' 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Open Source Initiative OSI - The MIT License 2 | 3 | http://www.opensource.org/licenses/mit-license.php 4 | 5 | Copyright (c) 2014 Thomas Prelot 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: {}, 6 | context: {} 7 | }, 8 | client: { 9 | configuration: {}, 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /app-prod.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: {}, 6 | context: { 7 | environment: 'prod', 8 | debug: false, 9 | verbosity: 1 10 | } 11 | }, 12 | client: { 13 | configuration: {}, 14 | context: { 15 | environment: 'prod', 16 | debug: false, 17 | verbosity: 1, 18 | secret: 'c8f6ef24-1af1-4398-9120-8c30fa81db1a' 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ 2 | baseUrl: '.', 3 | name: 'lib/client/main', 4 | out: '.bin/main.js', 5 | optimize: 'none', 6 | absolutise: true, 7 | cjsTranslate: true, 8 | paths: { 9 | 'async': 'async/lib/async', 10 | 'jquery': 'jquery/dist/jquery' 11 | }, 12 | map: { 13 | // Use no conflict jQuery. 14 | '*': { 'jquery': 'lib/client/vendor/jquery' }, 15 | 'lib/client/vendor/jquery': { 'jquery': 'jquery' } 16 | } 17 | }); -------------------------------------------------------------------------------- /config/client/ajax-app/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | linkFollower: require('../../../lib/client/ajax-app/link-follower'), 5 | formSubmitter: require('../../../lib/client/ajax-app/form-submitter') 6 | }; -------------------------------------------------------------------------------- /config/client/ajax-app/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | linkFollower: { 5 | methods: { 6 | /** 7 | * Follow a link. 8 | * 9 | * @param {object} link The link DOM node. 10 | */ 11 | follow: { 12 | arguments: ['object/link'] 13 | }, 14 | /** 15 | * Write a link content into the page. 16 | * 17 | * @param {string} content The content. 18 | * @param {object} link The link DOM node. 19 | * @param {object} event The event object. 20 | */ 21 | write: { 22 | arguments: ['string/content', 'object/link', 'object/event'] 23 | } 24 | } 25 | }, 26 | formSubmitter: { 27 | methods: { 28 | /** 29 | * Submit a form. 30 | * 31 | * @param {object} submitter The submitter DOM node. 32 | */ 33 | submit: { 34 | arguments: ['object/submitter'] 35 | }, 36 | /** 37 | * Write a form return content into the page. 38 | * 39 | * @param {string} content The content. 40 | * @param {object} submitter The submitter DOM node. 41 | */ 42 | write: { 43 | arguments: ['string/content', 'object/submitter'] 44 | } 45 | } 46 | } 47 | }; -------------------------------------------------------------------------------- /config/client/ajax-app/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | linkFollower: { 5 | class: 'danf:ajaxApp.linkFollower', 6 | properties: { 7 | jquery: '#danf:vendor.jquery#', 8 | bodyProvider: '#danf:manipulation.bodyProvider#', 9 | history: '#danf:manipulation.history#', 10 | readyProcessor: '#danf:manipulation.readyProcessor#', 11 | router: '#danf:http.router#', 12 | reloadingSequence: '#danf:sequencing.sequencesContainer[danf:ajaxApp.followLink]#' 13 | } 14 | }, 15 | formSubmitter: { 16 | class: 'danf:ajaxApp.formSubmitter', 17 | properties: { 18 | jquery: '#danf:vendor.jquery#', 19 | bodyProvider: '#danf:manipulation.bodyProvider#', 20 | history: '#danf:manipulation.history#', 21 | readyProcessor: '#danf:manipulation.readyProcessor#', 22 | router: '#danf:http.router#' 23 | } 24 | } 25 | }; -------------------------------------------------------------------------------- /config/client/event/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | notifier: { 5 | dom: require('../../../lib/client/event/notifier/dom') 6 | } 7 | }; -------------------------------------------------------------------------------- /config/client/event/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | process: { 5 | stream: { 6 | scope: { 7 | type: 'object', 8 | default: null 9 | } 10 | }, 11 | operations: [ 12 | { 13 | order: 0, 14 | condition: function(stream) { 15 | return stream.scope ? true : false; 16 | }, 17 | service: 'danf:event.notifier.dom', 18 | method: 'applyListeners', 19 | arguments: ['@scope@'] 20 | } 21 | ], 22 | parents: [ 23 | { 24 | order: -20, 25 | target: 'danf:manipulation.process', 26 | input: { 27 | scope: '@scope@' 28 | } 29 | } 30 | ] 31 | } 32 | }; -------------------------------------------------------------------------------- /config/client/event/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | notifier: { 5 | children: { 6 | dom: { 7 | class: 'danf:event.notifier.dom', 8 | properties: { 9 | jquery: '#danf:vendor.jquery#' 10 | } 11 | } 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /config/client/http/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | cookiesRegistry: require('../../../lib/client/http/cookies-registry'), 5 | event: { 6 | notifier: { 7 | request: require('../../../lib/client/http/event/notifier/request') 8 | } 9 | } 10 | }; -------------------------------------------------------------------------------- /config/client/http/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | cookiesRegistry: { 5 | class: 'danf:http.cookiesRegistry' 6 | }, 7 | event: { 8 | children: { 9 | notifier: { 10 | parent: 'danf:event.notifier', 11 | children: { 12 | request: { 13 | class: 'danf:http.event.notifier.request', 14 | properties: { 15 | jquery: '#danf:vendor.jquery#', 16 | logger: '#danf:logging.logger#' 17 | } 18 | } 19 | } 20 | } 21 | } 22 | } 23 | }; -------------------------------------------------------------------------------- /config/client/logging/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | logger: { 5 | class: 'danf:logging.logger', 6 | properties: { 7 | verbosity: '%danf:context.verbosity%', 8 | styles: { 9 | error: 'red', 10 | warning: 'yellow' 11 | } 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /config/client/manipulation/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | bodyProvider: require('../../../lib/client/manipulation/body-provider'), 5 | readyProcessor: require('../../../lib/client/manipulation/ready-processor'), 6 | history: require('../../../lib/client/manipulation/history') 7 | }; -------------------------------------------------------------------------------- /config/client/manipulation/events.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | dom: { 5 | 'danf:manipulation.danf': { 6 | event: 'danf' 7 | } 8 | } 9 | }; -------------------------------------------------------------------------------- /config/client/manipulation/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | process: { 5 | stream: { 6 | scope: { 7 | type: 'object', 8 | default: null 9 | } 10 | }, 11 | operations: [ 12 | { 13 | order: -10, 14 | condition: function(stream) { 15 | return stream.scope ? false : true; 16 | }, 17 | service: 'danf:manipulation.history', 18 | method: 'initialize', 19 | arguments: ['@scope@'] 20 | } 21 | ] 22 | }, 23 | navigate: { 24 | operations: [ 25 | { 26 | order: 0, 27 | service: 'danf:manipulation.history', 28 | method: 'navigate', 29 | arguments: ['!event.originalEvent.state!'] 30 | } 31 | ] 32 | } 33 | }; -------------------------------------------------------------------------------- /config/client/manipulation/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | bodyProvider: { 5 | class: 'danf:manipulation.bodyProvider', 6 | properties: { 7 | jquery: '#danf:vendor.jquery#' 8 | } 9 | }, 10 | readyProcessor: { 11 | class: 'danf:manipulation.readyProcessor', 12 | properties: { 13 | jquery: '#danf:vendor.jquery#', 14 | processingEvent: '#danf:event.eventsContainer[dom][danf:manipulation.danf]#' 15 | } 16 | }, 17 | history: { 18 | class: 'danf:manipulation.history', 19 | properties: { 20 | jquery: '#danf:vendor.jquery#', 21 | bodyProvider: '#danf:manipulation.bodyProvider#', 22 | readyProcessor: '#danf:manipulation.readyProcessor#' 23 | } 24 | } 25 | }; -------------------------------------------------------------------------------- /config/client/tcp/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: require('../../../lib/client/tcp/messenger'), 5 | event: { 6 | notifier: { 7 | socket: require('../../../lib/client/tcp/event/notifier/socket') 8 | } 9 | } 10 | }; -------------------------------------------------------------------------------- /config/client/tcp/events.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | socket: { 5 | 'danf:tcp.forwarder': { 6 | sequences: [] 7 | } 8 | } 9 | }; -------------------------------------------------------------------------------- /config/client/tcp/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: { 5 | methods: { 6 | /** 7 | * Emit a message. 8 | * 9 | * @param {string} name The message name. 10 | * @param {mixed|null} data The data. 11 | * @param {string|string_array|null} target The message target. 12 | */ 13 | emit: { 14 | arguments: [ 15 | 'string/name', 16 | 'mixed|null/data' 17 | ] 18 | } 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /config/client/tcp/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: { 5 | class: 'danf:tcp.messenger', 6 | properties: { 7 | event: '#danf:event.eventsContainer[socket][danf:tcp.forwarder]#' 8 | } 9 | }, 10 | event: { 11 | children: { 12 | notifier: { 13 | parent: 'danf:event.notifier', 14 | children: { 15 | request: { 16 | class: 'danf:tcp.event.notifier.socket', 17 | properties: { 18 | debug: '%danf:context.debug%', 19 | socketIo: '#danf:vendor.socketIo#', 20 | logger: '#danf:logging.logger#' 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /config/client/vendor/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | jquery: require('../../../lib/client/vendor/jquery'), 5 | socketIo: require('../../../lib/client/vendor/socket-io') 6 | }; -------------------------------------------------------------------------------- /config/client/vendor/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | jquery: { 5 | class: 'danf:vendor.jquery' 6 | } 7 | }; -------------------------------------------------------------------------------- /config/common/command/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | command: require('../../../lib/common/command/command'), 5 | parser: require('../../../lib/common/command/parser'), 6 | event: { 7 | notifier: { 8 | command: require('../../../lib/common/command/event/notifier/command') 9 | } 10 | } 11 | }; -------------------------------------------------------------------------------- /config/common/command/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | parser: { 5 | class: 'danf:command.parser', 6 | properties: { 7 | commandProvider: '#danf:command.commandProvider#' 8 | } 9 | }, 10 | commandProvider: { 11 | parent: 'danf:dependencyInjection.objectProvider', 12 | properties: { 13 | class: 'danf:command.command', 14 | interface: 'danf:command.command' 15 | } 16 | }, 17 | event: { 18 | children: { 19 | notifier: { 20 | parent: 'danf:event.notifier', 21 | children: { 22 | command: { 23 | class: 'danf:command.event.notifier.command', 24 | properties: { 25 | logger: '#danf:logging.logger#' 26 | } 27 | } 28 | } 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /config/common/configuration/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | module: require('../../../lib/common/configuration/mod'), 5 | modulesTree: require('../../../lib/common/configuration/modules-tree'), 6 | namespacer: require('../../../lib/common/configuration/namespacer'), 7 | processor: require('../../../lib/common/configuration/processor'), 8 | sectionProcessor: require('../../../lib/common/configuration/section-processor'), 9 | manipulation: { 10 | dataInterpreter: { 11 | abstractNamespacer: require('../../../lib/common/configuration/manipulation/data-interpreter/abstract-namespacer'), 12 | namespace: require('../../../lib/common/configuration/manipulation/data-interpreter/namespace'), 13 | references: require('../../../lib/common/configuration/manipulation/data-interpreter/references') 14 | } 15 | }, 16 | 'sectionProcessor.parameters': require('../../../lib/common/configuration/section-processor/parameters') 17 | }; -------------------------------------------------------------------------------- /config/common/event/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | event: require('../../../lib/common/event/event'), 5 | eventsContainer: require('../../../lib/common/event/events-container'), 6 | notifier: { 7 | abstract: require('../../../lib/common/event/notifier/abstract'), 8 | event: require('../../../lib/common/event/notifier/event') 9 | }, 10 | configuration: { 11 | sectionProcessor: { 12 | events: require('../../../lib/common/event/configuration/section-processor/events') 13 | } 14 | } 15 | }; -------------------------------------------------------------------------------- /config/common/http/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | route: require('../../../lib/common/http/route'), 5 | router: require('../../../lib/common/http/router'), 6 | abstractCookiesRegistry: require('../../../lib/common/http/abstract-cookies-registry') 7 | }; -------------------------------------------------------------------------------- /config/common/http/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | router: { 5 | class: 'danf:http.router', 6 | properties: { 7 | routeProvider: '#danf:http.routeProvider#', 8 | eventsContainer: '#danf:event.eventsContainer#' 9 | }, 10 | registry: { 11 | method: 'get', 12 | namespace: [0] 13 | } 14 | }, 15 | routeProvider: { 16 | parent: 'danf:dependencyInjection.objectProvider', 17 | properties: { 18 | class: 'danf:http.route', 19 | interface: 'danf:http.route' 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /config/common/logging/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | logger: require('../../../lib/common/logging/logger') 5 | }; -------------------------------------------------------------------------------- /config/common/logging/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | logger: { 5 | methods: { 6 | /** 7 | * Log a value. 8 | * 9 | * @param {mixed} value The value. 10 | * @param {number} verbosity The verbosity level. 11 | * @param {number|null} indentation The optional indentation level. 12 | * @param {number|null} length The max string length to display, default all. 13 | */ 14 | log: { 15 | arguments: [ 16 | 'mixed/value', 17 | 'number/verbosity', 18 | 'number|null/indentation', 19 | 'number|null/length' 20 | ] 21 | } 22 | } 23 | } 24 | }; -------------------------------------------------------------------------------- /config/common/object/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | classesContainer: require('../../../lib/common/object/classes-container'), 5 | 'interface': require('../../../lib/common/object/interface'), 6 | interfacesContainer: require('../../../lib/common/object/interfaces-container'), 7 | interfacer: require('../../../lib/common/object/interfacer'), 8 | classProcessor: { 9 | abstract: require('../../../lib/common/object/class-processor/abstract'), 10 | extender: require('../../../lib/common/object/class-processor/extender'), 11 | interfacer: require('../../../lib/common/object/class-processor/interfacer') 12 | }, 13 | configuration: { 14 | sectionProcessor: { 15 | interfaces: require('../../../lib/common/object/configuration/section-processor/interfaces'), 16 | classes: require('../../../lib/common/object/configuration/section-processor/classes') 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /config/common/sequencing/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | referencesResolver: require('../../../lib/common/sequencing/references-resolver'), 5 | sequence: require('../../../lib/common/sequencing/sequence'), 6 | sequencesContainer: require('../../../lib/common/sequencing/sequences-container'), 7 | collectionInterpreter: require('../../../lib/common/sequencing/collection-interpreter'), 8 | flowContext: require('../../../lib/common/sequencing/flow-context'), 9 | logger: require('../../../lib/common/sequencing/logger'), 10 | sequenceInterpreter: { 11 | abstract: require('../../../lib/common/sequencing/sequence-interpreter/abstract'), 12 | alias: require('../../../lib/common/sequencing/sequence-interpreter/alias'), 13 | children: require('../../../lib/common/sequencing/sequence-interpreter/children'), 14 | collections: require('../../../lib/common/sequencing/sequence-interpreter/collections'), 15 | embedded: require('../../../lib/common/sequencing/sequence-interpreter/embedded'), 16 | stream: require('../../../lib/common/sequencing/sequence-interpreter/stream'), 17 | operations: require('../../../lib/common/sequencing/sequence-interpreter/operations'), 18 | parents: require('../../../lib/common/sequencing/sequence-interpreter/parents') 19 | }, 20 | configuration: { 21 | sectionProcessor: { 22 | sequences: require('../../../lib/common/sequencing/configuration/section-processor/sequences') 23 | } 24 | } 25 | }; -------------------------------------------------------------------------------- /config/common/vendor/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | async: require('../../../lib/common/vendor/async') 5 | }; -------------------------------------------------------------------------------- /config/common/vendor/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | async: { 5 | class: 'danf:vendor.async' 6 | }, 7 | socketIo: { 8 | class: 'danf:vendor.socketIo' 9 | } 10 | }; -------------------------------------------------------------------------------- /config/server/assets/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | configuration: { 5 | sectionProcessor: { 6 | assets: require('../../../lib/server/assets/configuration/section-processor/assets') 7 | } 8 | } 9 | }; -------------------------------------------------------------------------------- /config/server/assets/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | mapper: { 5 | parent: 'danf:fileSystem.mapper' 6 | }, 7 | sectionProcessor: { 8 | parent: 'danf:configuration.sectionProcessor', 9 | children: { 10 | assets: { 11 | class: 'danf:assets.configuration.sectionProcessor.assets', 12 | properties: { 13 | name: 'assets' 14 | } 15 | } 16 | } 17 | } 18 | }; -------------------------------------------------------------------------------- /config/server/file-system/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | mapper: require('../../../lib/server/file-system/mapper') 5 | }; -------------------------------------------------------------------------------- /config/server/file-system/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | mapper: { 5 | methods: { 6 | /** 7 | * Match a mapping for a path. 8 | * 9 | * @param {string} path The path of the file to match. 10 | * @return {string} The mapped path. 11 | */ 12 | match: { 13 | arguments: ['string/path'], 14 | returns: 'string' 15 | } 16 | } 17 | } 18 | }; -------------------------------------------------------------------------------- /config/server/file-system/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | mapper: { 5 | class: 'danf:fileSystem.mapper', 6 | properties: { 7 | defaultExtension: 'js' 8 | }, 9 | abstract: true 10 | } 11 | }; -------------------------------------------------------------------------------- /config/server/http/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | errorHandler: require('../../../lib/server/http/error-handler'), 5 | cookiesRegistry: require('../../../lib/server/http/cookies-registry'), 6 | sessionHandler: require('../../../lib/server/http/session-handler'), 7 | redirector: require('../../../lib/server/http/redirector'), 8 | event: { 9 | notifier: { 10 | request: require('../../../lib/server/http/event/notifier/request') 11 | } 12 | } 13 | }; -------------------------------------------------------------------------------- /config/server/http/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | errorHandler: { 5 | class: 'danf:http.errorHandler', 6 | properties: { 7 | debug: '%danf:context.debug%' 8 | } 9 | }, 10 | cookiesRegistry: { 11 | class: 'danf:http.cookiesRegistry', 12 | properties: { 13 | flowContext: '#danf:sequencing.flowContext#' 14 | } 15 | }, 16 | sessionHandler: { 17 | class: 'danf:http.sessionHandler', 18 | properties: { 19 | flowContext: '#danf:sequencing.flowContext#' 20 | } 21 | }, 22 | redirector: { 23 | class: 'danf:http.redirector' 24 | }, 25 | event: { 26 | children: { 27 | notifier: { 28 | parent: 'danf:event.notifier', 29 | children: { 30 | request: { 31 | class: 'danf:http.event.notifier.request', 32 | properties: { 33 | app: '#danf:app#', 34 | escaper: '#danf:manipulation.escaper#', 35 | renderer: '#danf:rendering.renderer#', 36 | errorHandler: '#danf:http.errorHandler#', 37 | logger: '#danf:logging.logger#' 38 | } 39 | } 40 | } 41 | } 42 | } 43 | } 44 | }; -------------------------------------------------------------------------------- /config/server/logging/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | logger: { 5 | class: 'danf:logging.logger', 6 | properties: { 7 | verbosity: '%danf:context.verbosity%', 8 | styles: { 9 | error: 'red', 10 | warning: 'yellow' 11 | }, 12 | chalk: '#danf:vendor.chalk#' 13 | } 14 | } 15 | }; -------------------------------------------------------------------------------- /config/server/rendering/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | renderer: require('../../../lib/server/rendering/renderer'), 5 | formatRenderer: { 6 | text: require('../../../lib/server/rendering/format-renderer/text'), 7 | json: require('../../../lib/server/rendering/format-renderer/json'), 8 | html: require('../../../lib/server/rendering/format-renderer/html') 9 | } 10 | }; -------------------------------------------------------------------------------- /config/server/rendering/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | layout: __dirname + '/../../../resource/private/view/layout.jade' 5 | }; -------------------------------------------------------------------------------- /config/server/rendering/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | renderer: { 5 | class: 'danf:rendering.renderer', 6 | properties: { 7 | referenceResolver: '#danf:manipulation.referenceResolver#', 8 | formatRenderers: '&danf:rendering.formatRenderer&' 9 | } 10 | }, 11 | formatRenderer: { 12 | collections: ['danf:rendering.formatRenderer'], 13 | children: { 14 | text: { 15 | class: 'danf:rendering.formatRenderer.text', 16 | properties: { 17 | referenceResolver: '#danf:manipulation.referenceResolver#' 18 | } 19 | }, 20 | json: { 21 | class: 'danf:rendering.formatRenderer.json', 22 | properties: { 23 | referenceResolver: '#danf:manipulation.referenceResolver#' 24 | } 25 | }, 26 | html: { 27 | class: 'danf:rendering.formatRenderer.html', 28 | properties: { 29 | errorHandler: '#danf:http.errorHandler#' 30 | } 31 | } 32 | } 33 | } 34 | }; -------------------------------------------------------------------------------- /config/server/tcp/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: require('../../../lib/server/tcp/messenger'), 5 | event: { 6 | notifier: { 7 | socket: require('../../../lib/server/tcp/event/notifier/socket') 8 | } 9 | } 10 | }; -------------------------------------------------------------------------------- /config/server/tcp/events.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | socket: { 5 | 'danf:tcp.forwarder': { 6 | sequences: [] 7 | } 8 | } 9 | }; -------------------------------------------------------------------------------- /config/server/tcp/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: { 5 | methods: { 6 | /** 7 | * Emit a message. 8 | * 9 | * @param {string} name The message name. 10 | * @param {mixed|null} data The data. 11 | * @param {string|string_array|null} target The message target. 12 | */ 13 | emit: { 14 | arguments: [ 15 | 'string/name', 16 | 'mixed|null/data', 17 | 'string|string_array|null/target' 18 | ] 19 | }, 20 | /** 21 | * Join a room. 22 | * 23 | * @param {string} room The room name. 24 | */ 25 | joinRoom: { 26 | arguments: [ 27 | 'string/room' 28 | ] 29 | }, 30 | /** 31 | * Leave a room. 32 | * 33 | * @param {string} room The room name. 34 | */ 35 | leaveRoom: { 36 | arguments: [ 37 | 'string/room' 38 | ] 39 | } 40 | } 41 | } 42 | }; -------------------------------------------------------------------------------- /config/server/tcp/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | messenger: { 5 | class: 'danf:tcp.messenger', 6 | properties: { 7 | app: '#danf:app#', 8 | event: '#danf:event.eventsContainer[socket][danf:tcp.forwarder]#', 9 | sessionHandler: '#danf:http.sessionHandler#' 10 | } 11 | }, 12 | event: { 13 | children: { 14 | notifier: { 15 | parent: 'danf:event.notifier', 16 | children: { 17 | request: { 18 | class: 'danf:tcp.event.notifier.socket', 19 | properties: { 20 | app: '#danf:app#', 21 | debug: '%danf:context.debug%', 22 | socketIo: '#danf:vendor.socketIo#', 23 | sessionHandler: '#danf:http.sessionHandler#', 24 | logger: '#danf:logging.logger#' 25 | } 26 | } 27 | } 28 | } 29 | } 30 | } 31 | }; -------------------------------------------------------------------------------- /config/server/vendor/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | chalk: require('../../../lib/server/vendor/chalk'), 5 | socketIo: require('../../../lib/server/vendor/socket-io') 6 | }; -------------------------------------------------------------------------------- /config/server/vendor/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | chalk: { 5 | class: 'danf:vendor.chalk' 6 | } 7 | }; -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('./gulp') 5 | ; 6 | 7 | new Gulp(gulp); -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./lib/server/app'); -------------------------------------------------------------------------------- /lib/client/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var danf = {}; 4 | 5 | define(function(require) { 6 | var module = require('module'); 7 | 8 | danf.context = module.config().context; 9 | 10 | require(['-/danf/app/jquery', '-/danf/app/init', '-/danf/app/config'], function() { 11 | require(['-/danf/app/danf']); 12 | require(['-/danf/app/app']); 13 | }); 14 | }); -------------------------------------------------------------------------------- /lib/client/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /lib/client/http/cookies-registry.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `CookiesRegistry`. 5 | */ 6 | module.exports = CookiesRegistry; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../common/utils'), 12 | Abstract = require('../../common/http/abstract-cookies-registry') 13 | ; 14 | 15 | /** 16 | * Initialize a new cookies registry. 17 | */ 18 | function CookiesRegistry() { 19 | } 20 | 21 | utils.extend(Abstract, CookiesRegistry); 22 | 23 | /** 24 | * @interface {danf:http.CookiesRegistry} 25 | */ 26 | CookiesRegistry.prototype.get = function(key) { 27 | var regexp = new RegExp("(?:(?:^|.*;)\\s*{0}\\s*\\=\\s*([^;]*).*$)|^.*$".format(key)); 28 | 29 | return document.cookie.replace(regexp, '$1') || null; 30 | } 31 | 32 | /** 33 | * @interface {danf:http.CookiesRegistry} 34 | */ 35 | CookiesRegistry.prototype.set = function(key, value, expiresAt, path, domain, isSecure, isHttpOnly) { 36 | document.cookie = '{0}={1}'.format( 37 | encodeURIComponent(key), 38 | this.formatCookieValue(value, expiresAt, path, domain, isSecure, isHttpOnly) 39 | ); 40 | } 41 | 42 | /** 43 | * @interface {danf:http.CookiesRegistry} 44 | */ 45 | CookiesRegistry.prototype.unset = function(key, path, domain) { 46 | document.cookie = '{0}={1}'.format( 47 | encodeURIComponent(key), 48 | this.formatCookieValue('', new Date(0), path, domain) 49 | ); 50 | } -------------------------------------------------------------------------------- /lib/client/manipulation/body-provider.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `BodyProvider`. 5 | */ 6 | module.exports = BodyProvider; 7 | 8 | /** 9 | * Initialize a new body provider. 10 | */ 11 | function BodyProvider() { 12 | } 13 | 14 | BodyProvider.defineImplementedInterfaces(['danf:manipulation.bodyProvider']); 15 | 16 | BodyProvider.defineDependency('_jquery', 'function'); 17 | 18 | /** 19 | * JQuery. 20 | * 21 | * @var {function} 22 | * @api public 23 | */ 24 | Object.defineProperty(BodyProvider.prototype, 'jquery', { 25 | set: function(jquery) { this._jquery = jquery; } 26 | }); 27 | 28 | /** 29 | * @interface {danf:manipulation.bodyProvider} 30 | */ 31 | BodyProvider.prototype.provide = function(doc) { 32 | var $ = this._jquery, 33 | fromSpecificDocument = doc ? true : false, 34 | doc = fromSpecificDocument ? $(doc) : $(document) 35 | ; 36 | 37 | if (fromSpecificDocument) { 38 | var wrapper = $(document.createElement('div')); 39 | 40 | wrapper.wrapInner(doc); 41 | doc = wrapper; 42 | } 43 | 44 | var body = doc.find('#body') 45 | 46 | if (0 === body.length) { 47 | if (fromSpecificDocument) { 48 | body = doc.find('body'); 49 | 50 | if (body.length === 0) { 51 | body = doc; 52 | } 53 | } else { 54 | body = $(document.body); 55 | } 56 | } 57 | 58 | return body; 59 | } -------------------------------------------------------------------------------- /lib/client/manipulation/ready-processor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `ReadyProcessor`. 5 | */ 6 | module.exports = ReadyProcessor; 7 | 8 | /** 9 | * Initialize a new ready trigger. 10 | */ 11 | function ReadyProcessor() { 12 | } 13 | 14 | ReadyProcessor.defineImplementedInterfaces(['danf:manipulation.readyProcessor']); 15 | 16 | ReadyProcessor.defineDependency('_jquery', 'function'); 17 | ReadyProcessor.defineDependency('_processingEvent', 'danf:event.event'); 18 | 19 | /** 20 | * JQuery. 21 | * 22 | * @var {function} 23 | * @api public 24 | */ 25 | Object.defineProperty(ReadyProcessor.prototype, 'jquery', { 26 | set: function(jquery) { this._jquery = jquery; } 27 | }); 28 | 29 | /** 30 | * Processing event. 31 | * 32 | * @var {danf:event.event} 33 | * @api public 34 | */ 35 | Object.defineProperty(ReadyProcessor.prototype, 'processingEvent', { 36 | set: function(processingEvent) { this._processingEvent = processingEvent; } 37 | }); 38 | 39 | /** 40 | * @interface {danf:manipulation.readyProcessor} 41 | */ 42 | ReadyProcessor.prototype.process = function(scope) { 43 | this._processingEvent.trigger( 44 | {scope: (scope ? this._jquery(scope) : null)} 45 | ); 46 | } -------------------------------------------------------------------------------- /lib/client/tcp/messenger.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Messenger`. 5 | */ 6 | module.exports = Messenger; 7 | 8 | /** 9 | * Initialize a new messenger notifier. 10 | */ 11 | function Messenger() { 12 | } 13 | 14 | Messenger.defineImplementedInterfaces(['danf:tcp.messenger']); 15 | 16 | Messenger.defineDependency('_event', 'danf:event.event'); 17 | 18 | /** 19 | * Forwarding event. 20 | * 21 | * @var {danf:event.event} 22 | * @api public 23 | */ 24 | Object.defineProperty(Messenger.prototype, 'event', { 25 | set: function(event) { this._event = event; } 26 | }); 27 | 28 | /** 29 | * @interface {danf:tcp.messenger} 30 | */ 31 | Messenger.prototype.emit = function(name, data) { 32 | this._event.trigger( 33 | data, 34 | { 35 | forward: name 36 | } 37 | ); 38 | } -------------------------------------------------------------------------------- /lib/client/vendor/jquery.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var jq = require('jquery'); 4 | 5 | module.exports = function() { 6 | var $ = jq.noConflict(true); 7 | 8 | // Add method to apply another method on a set of elements. 9 | $.do = function(elements, method, args) { 10 | var args = Array.prototype.slice.call(arguments, 3); 11 | 12 | elements[method].apply(elements, args); 13 | } 14 | 15 | return $; 16 | }; -------------------------------------------------------------------------------- /lib/client/vendor/socket-io.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var socketIo = require('socket.io-client/socket.io'); 4 | 5 | module.exports = function() { 6 | return socketIo; 7 | }; -------------------------------------------------------------------------------- /lib/common/command/command.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Command`. 5 | */ 6 | module.exports = Command; 7 | 8 | /** 9 | * Initialize a new command. 10 | */ 11 | function Command() { 12 | this._name = ''; 13 | this._options = {}; 14 | } 15 | 16 | Command.defineImplementedInterfaces(['danf:command.command']); 17 | 18 | /** 19 | * @interface {danf:command.command} 20 | */ 21 | Object.defineProperty(Command.prototype, 'name', { 22 | set: function(name) { 23 | this._name = name.replace(/[-]([^.])/g, function(match, p1) { 24 | return p1.toUpperCase(); 25 | }); 26 | }, 27 | get: function() { return this._name; } 28 | }); 29 | 30 | /** 31 | * @interface {danf:command.command} 32 | */ 33 | Object.defineProperty(Command.prototype, 'options', { 34 | set: function(options) { this._options = options; }, 35 | get: function() { return this._options; } 36 | }); 37 | 38 | /** 39 | * @interface {danf:command.command} 40 | */ 41 | Command.prototype.setOption = function(name, value) { 42 | this._options[name] = value; 43 | } 44 | 45 | /** 46 | * @interface {danf:command.command} 47 | */ 48 | Command.prototype.getOption = function(name) { 49 | return this._options[name]; 50 | } 51 | 52 | /** 53 | * @interface {danf:command.command} 54 | */ 55 | Command.prototype.hasOption = function(name) { 56 | return undefined !== this._options[name]; 57 | } -------------------------------------------------------------------------------- /lib/common/configuration/section-processor/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Parameters`. 5 | */ 6 | module.exports = Parameters; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | SectionProcessor = require('../section-processor') 13 | ; 14 | 15 | /** 16 | * Initialize a new section processor parameters for the config. 17 | */ 18 | function Parameters() { 19 | SectionProcessor.call(this); 20 | 21 | this._priority = true; 22 | this.contract = { 23 | __any: null, 24 | type: 'mixed', 25 | namespace: true 26 | }; 27 | } 28 | 29 | utils.extend(SectionProcessor, Parameters); 30 | 31 | /** 32 | * @interface {danf:configuration.sectionProcessor} 33 | */ 34 | Parameters.prototype.preProcess = function(config, sectionConfig, modulesTree) { 35 | return this.resolveReferences(config, '%', sectionConfig); 36 | } 37 | 38 | /** 39 | * @interface {danf:configuration.sectionProcessor} 40 | */ 41 | Parameters.prototype.postProcess = function(config, sectionConfig, modulesTree) { 42 | return this.resolveReferences(config, '%', sectionConfig, modulesTree); 43 | } 44 | 45 | /** 46 | * @interface {danf:configuration.sectionProcessor} 47 | */ 48 | Parameters.prototype.interpretAllModuleConfig = function(config, module, modulesTree) { 49 | if (undefined === module.alias) { 50 | config = this._namespacer.prefixReferences(config, '%', module, modulesTree); 51 | } 52 | 53 | return config; 54 | } -------------------------------------------------------------------------------- /lib/common/dependency-injection/service-builder/abstract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Abstract`. 5 | */ 6 | module.exports = Abstract; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | AbstractServiceBuilder = require('./abstract-service-builder') 13 | ; 14 | 15 | /** 16 | * Initialize a new abstract service builder. 17 | */ 18 | function Abstract() { 19 | AbstractServiceBuilder.call(this); 20 | 21 | this._instantiateOrder = 800; 22 | } 23 | 24 | utils.extend(AbstractServiceBuilder, Abstract); 25 | 26 | /** 27 | * @interface {danf:dependencyInjection.serviceBuilder} 28 | */ 29 | Object.defineProperty(Abstract.prototype, 'contract', { 30 | value: { 31 | abstract: { 32 | type: 'boolean' 33 | } 34 | } 35 | }); 36 | 37 | /** 38 | * @interface {danf:dependencyInjection.serviceBuilder} 39 | */ 40 | Abstract.prototype.instantiate = function(instance, definition) { 41 | if (definition.abstract) { 42 | throw new Error( 43 | 'The service of id "{0}" is an abstract service and cannot be instantiated.'.format( 44 | definition.id 45 | ) 46 | ); 47 | } 48 | 49 | return instance; 50 | } -------------------------------------------------------------------------------- /lib/common/event/notifier/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Event`. 5 | */ 6 | module.exports = Event; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new event notifier. 17 | */ 18 | function Event() { 19 | Abstract.call(this); 20 | } 21 | 22 | utils.extend(Abstract, Event); 23 | 24 | /** 25 | * @interface {danf:event.notifier} 26 | */ 27 | Object.defineProperty(Event.prototype, 'name', { 28 | value: 'event' 29 | }); 30 | 31 | /** 32 | * @interface {danf:event.notifier} 33 | */ 34 | Object.defineProperty(Event.prototype, 'contract', { 35 | value: { 36 | context: { 37 | type: 'mixed_object', 38 | default: {} 39 | }, 40 | catch: { 41 | type: 'function|null' 42 | }, 43 | callback: { 44 | type: 'function|null' 45 | } 46 | } 47 | }); 48 | 49 | /** 50 | * @inheritdoc 51 | */ 52 | Event.prototype.notifyEvent = function(name, parameters, sequence, data, meta) { 53 | sequence.execute(data, parameters.context, '.', parameters.catch, parameters.callback); 54 | } -------------------------------------------------------------------------------- /lib/common/http/abstract-cookies-registry.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `AbstractRegistry`. 5 | */ 6 | module.exports = AbstractRegistry; 7 | 8 | /** 9 | * Initialize a new cookies registry. 10 | */ 11 | function AbstractRegistry() { 12 | } 13 | 14 | AbstractRegistry.defineImplementedInterfaces(['danf:http.cookiesRegistry']); 15 | 16 | AbstractRegistry.defineAsAbstract(); 17 | 18 | /** 19 | * Format a cookie value. 20 | * 21 | * @param {string} value The value. 22 | * @param {date|null} expireAt The date of expiration. 23 | * @param {string|null} path The optional path. 24 | * @param {string|null} domain The optional domain. 25 | * @param {boolean|null} isSecure Whether or not this is a secure cookie. 26 | * @param {boolean|null} isHttpOnly Whether or not this is a http only cookie. 27 | * @return {string} The formatted value. 28 | * @api protected 29 | */ 30 | AbstractRegistry.prototype.formatCookieValue = function(value, expireAt, path, domain, isSecure, isHttpOnly) { 31 | return '{0}{1}{2}{3}{4}{5}'.format( 32 | encodeURIComponent(value), 33 | expireAt ? '; expires={0}'.format(expireAt.toUTCString()) : '', 34 | path ? '; path={0}'.format(path) : '', 35 | domain ? '; domain={0}'.format(domain) : '', 36 | isSecure ? '; secure' : '', 37 | isHttpOnly ? '; httpOnly' : '' 38 | ); 39 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-callback/error-result.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `ErrorResult`. 5 | */ 6 | module.exports = ErrorResult; 7 | 8 | /** 9 | * Initialize a new error result asynchronous callback. 10 | */ 11 | function ErrorResult() { 12 | } 13 | 14 | ErrorResult.defineImplementedInterfaces(['danf:manipulation.asynchronousCallback']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousCallback} 18 | */ 19 | ErrorResult.prototype.execute = function(callback, error, result) { 20 | callback(error, result); 21 | } 22 | 23 | /** 24 | * @interface {danf:manipulation.asynchronousCallback} 25 | */ 26 | ErrorResult.prototype.wrap = function(callback) { 27 | return function(error, result) { 28 | if (error instanceof ErrorResult) { 29 | throw error; 30 | } 31 | 32 | callback(result); 33 | } 34 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-callback/error.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Error`. 5 | */ 6 | module.exports = Error; 7 | 8 | /** 9 | * Initialize a new error asynchronous callback. 10 | */ 11 | function Error() { 12 | } 13 | 14 | Error.defineImplementedInterfaces(['danf:manipulation.asynchronousCallback']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousCallback} 18 | */ 19 | Error.prototype.execute = function(callback, error, result) { 20 | callback(error); 21 | } 22 | 23 | /** 24 | * @interface {danf:manipulation.asynchronousCallback} 25 | */ 26 | Error.prototype.wrap = function(callback) { 27 | return function(error) { 28 | if (error instanceof Error) { 29 | throw error; 30 | } 31 | 32 | callback(); 33 | } 34 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-callback/result.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Result`. 5 | */ 6 | module.exports = Result; 7 | 8 | /** 9 | * Initialize a new result asynchronous callback. 10 | */ 11 | function Result() { 12 | } 13 | 14 | Result.defineImplementedInterfaces(['danf:manipulation.asynchronousCallback']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousCallback} 18 | */ 19 | Result.prototype.execute = function(callback, error, result) { 20 | callback(result); 21 | } 22 | 23 | /** 24 | * @interface {danf:manipulation.asynchronousCallback} 25 | */ 26 | Result.prototype.wrap = function(callback) { 27 | return function(result) { 28 | callback(result); 29 | } 30 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-input/array.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Array_`. 5 | */ 6 | module.exports = Array_; 7 | 8 | /** 9 | * Initialize a new array asynchronous input. 10 | */ 11 | function Array_() { 12 | } 13 | 14 | Array_.defineImplementedInterfaces(['danf:manipulation.asynchronousInput']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousInput} 18 | */ 19 | Array_.prototype.format = function(input) { 20 | if ('object' === typeof input && !Array.isArray(input)) { 21 | var formattedInput = []; 22 | 23 | for (var key in input) { 24 | formattedInput.push(input[key]); 25 | } 26 | 27 | input = formattedInput; 28 | } 29 | 30 | try { 31 | Object.checkType(input, 'array'); 32 | } catch (error) { 33 | if (error.instead) { 34 | error.message = 'The input of the collection should be {0}; {1} given instead.'.format( 35 | error.expected, 36 | error.instead 37 | ); 38 | } 39 | 40 | throw error; 41 | } 42 | 43 | return input; 44 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-input/object.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Object_`. 5 | */ 6 | module.exports = Object_; 7 | 8 | /** 9 | * Initialize a new object asynchronous input. 10 | */ 11 | function Object_() { 12 | } 13 | 14 | Object_.defineImplementedInterfaces(['danf:manipulation.asynchronousInput']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousInput} 18 | */ 19 | Object_.prototype.format = function(input) { 20 | try { 21 | Object.checkType(input, 'object|array'); 22 | } catch (error) { 23 | if (error.instead) { 24 | error.message = 'The input of the collection should be {0}; {1} given instead.'.format( 25 | error.expected, 26 | error.instead 27 | ); 28 | } 29 | 30 | throw error; 31 | } 32 | 33 | return input; 34 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-iterator/collection.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Collection`. 5 | */ 6 | module.exports = Collection; 7 | 8 | /** 9 | * Initialize a new collection asynchronous iterator. 10 | */ 11 | function Collection() { 12 | } 13 | 14 | Collection.defineImplementedInterfaces(['danf:manipulation.asynchronousIterator']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousIterator} 18 | */ 19 | Collection.prototype.wrap = function(iterator) { 20 | return function(item, callback) { 21 | iterator({ 22 | item: item, 23 | callback: callback 24 | }); 25 | } 26 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-iterator/key.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Key`. 5 | */ 6 | module.exports = Key; 7 | 8 | /** 9 | * Initialize a new key asynchronous iterator. 10 | */ 11 | function Key() { 12 | } 13 | 14 | Key.defineImplementedInterfaces(['danf:manipulation.asynchronousIterator']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousIterator} 18 | */ 19 | Key.prototype.wrap = function(iterator) { 20 | return function(item, key, callback) { 21 | iterator({ 22 | item: item, 23 | key: key, 24 | callback: callback 25 | }); 26 | } 27 | } -------------------------------------------------------------------------------- /lib/common/manipulation/asynchronous-iterator/memo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Memo`. 5 | */ 6 | module.exports = Memo; 7 | 8 | /** 9 | * Initialize a new memo asynchronous iterator. 10 | */ 11 | function Memo() { 12 | } 13 | 14 | Memo.defineImplementedInterfaces(['danf:manipulation.asynchronousIterator']); 15 | 16 | /** 17 | * @interface {danf:manipulation.asynchronousIterator} 18 | */ 19 | Memo.prototype.wrap = function(iterator) { 20 | return function(memo, item, callback) { 21 | iterator({ 22 | item: item, 23 | memo: memo, 24 | callback: callback 25 | }); 26 | } 27 | } -------------------------------------------------------------------------------- /lib/common/manipulation/callback-executor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `CallbackExecutor`. 5 | */ 6 | module.exports = CallbackExecutor; 7 | 8 | /** 9 | * Initialize a new callback executor. 10 | */ 11 | function CallbackExecutor() {} 12 | 13 | CallbackExecutor.defineImplementedInterfaces(['danf:manipulation.callbackExecutor']); 14 | 15 | /** 16 | * @interface {danf:manipulation.callbackExecutor} 17 | */ 18 | CallbackExecutor.prototype.execute = function(callback) { 19 | var args = Array.prototype.slice.call(arguments, 1); 20 | 21 | return callback.apply(this, args); 22 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/abstract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Abstract`. 5 | */ 6 | module.exports = Abstract; 7 | 8 | /** 9 | * Initialize a new abstract data interpreter. 10 | */ 11 | function Abstract() { 12 | } 13 | 14 | Abstract.defineImplementedInterfaces(['danf:manipulation.dataInterpreter']); 15 | 16 | Abstract.defineAsAbstract(); 17 | 18 | /** 19 | * Data resolver. 20 | * 21 | * @var {danf:manipulation.dataResolver} 22 | * @api public 23 | */ 24 | Object.defineProperty(Abstract.prototype, 'dataResolver', { 25 | set: function(dataResolver) { 26 | this._dataResolver = dataResolver 27 | } 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Abstract.prototype.formatContract = function(contract) { 34 | return contract; 35 | } 36 | 37 | /** 38 | * @interface {danf:manipulation.dataInterpreter} 39 | */ 40 | Abstract.prototype.merge = function(name, value, value1, value2, contract, erase, parameters) { 41 | return value; 42 | } 43 | 44 | /** 45 | * @interface {danf:manipulation.dataInterpreter} 46 | */ 47 | Abstract.prototype.interpret = function(name, value, contract, parameters) { 48 | return value; 49 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/default.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Default`. 5 | */ 6 | module.exports = Default; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new default data interpreter. 17 | */ 18 | function Default() { 19 | } 20 | 21 | utils.extend(Abstract, Default); 22 | 23 | /** 24 | * @interface {danf:manipulation.dataInterpreter} 25 | */ 26 | Object.defineProperty(Default.prototype, 'order', { 27 | value: 1000 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Default.prototype.interpret = function(name, value, contract, parameters) { 34 | // Set the default value of the field if defined and no given value. 35 | if ( 36 | (parameters.final || undefined === parameters.final) && 37 | null == value && 38 | undefined !== contract.default 39 | ) { 40 | value = 'object' === typeof contract.default 41 | ? utils.clone(contract.default) 42 | : contract.default 43 | ; 44 | } 45 | 46 | return value; 47 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/flatten.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Flatten`. 5 | */ 6 | module.exports = Flatten; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new flatten data interpreter. 17 | */ 18 | function Flatten() { 19 | } 20 | 21 | utils.extend(Abstract, Flatten); 22 | 23 | /** 24 | * @interface {danf:manipulation.dataInterpreter} 25 | */ 26 | Object.defineProperty(Flatten.prototype, 'order', { 27 | value: 800 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Flatten.prototype.interpret = function(name, value, contract, parameters) { 34 | // Flatten the value with the given separator if defined. 35 | if (undefined !== contract.flatten && 'object' === typeof value) { 36 | if (null != contract.flatten) { 37 | Object.checkType(contract.flatten, 'boolean|string'); 38 | } 39 | 40 | var separator = contract.flatten === true ? '.' : '' + contract.flatten; 41 | 42 | value = utils.flatten(value, 100, separator); 43 | } 44 | 45 | return value; 46 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/format.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Format`. 5 | */ 6 | module.exports = Format; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new Format data interpreter. 17 | */ 18 | function Format() { 19 | } 20 | 21 | utils.extend(Abstract, Format); 22 | 23 | /** 24 | * @interface {danf:manipulation.dataInterpreter} 25 | */ 26 | Object.defineProperty(Format.prototype, 'order', { 27 | value: 1200 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Format.prototype.interpret = function(name, value, contract, parameters) { 34 | // Format the value. 35 | if (null != value && contract.format) { 36 | Object.checkType(contract.format, 'function'); 37 | 38 | var formattedValue = contract.format(value, parameters); 39 | 40 | if (null != formattedValue) { 41 | value = formattedValue; 42 | } 43 | } 44 | 45 | return value; 46 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/required.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Required`. 5 | */ 6 | module.exports = Required; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new required data interpreter. 17 | */ 18 | function Required() { 19 | } 20 | 21 | utils.extend(Abstract, Required); 22 | 23 | /** 24 | * @interface {danf:manipulation.dataInterpreter} 25 | */ 26 | Object.defineProperty(Required.prototype, 'order', { 27 | value: 1400 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Required.prototype.interpret = function(name, value, contract, parameters) { 34 | // Check the required state of the field if no given value. 35 | if ( 36 | (parameters.final || undefined === parameters.final) && 37 | null == value && 38 | contract.required 39 | ) { 40 | throw new Error( 41 | 'The value is required for the field "{0}".'.format( 42 | name 43 | ) 44 | ); 45 | } 46 | 47 | return value; 48 | } -------------------------------------------------------------------------------- /lib/common/manipulation/data-interpreter/validate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Validate`. 5 | */ 6 | module.exports = Validate; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'), 12 | Abstract = require('./abstract') 13 | ; 14 | 15 | /** 16 | * Initialize a new Validate data interpreter. 17 | */ 18 | function Validate() { 19 | } 20 | 21 | utils.extend(Abstract, Validate); 22 | 23 | /** 24 | * @interface {danf:manipulation.dataInterpreter} 25 | */ 26 | Object.defineProperty(Validate.prototype, 'order', { 27 | value: 1800 28 | }); 29 | 30 | /** 31 | * @interface {danf:manipulation.dataInterpreter} 32 | */ 33 | Validate.prototype.interpret = function(name, value, contract, parameters) { 34 | // Validate the value. 35 | if ( 36 | (parameters.final || undefined === parameters.final) && 37 | null != value && 38 | contract.validate 39 | ) { 40 | Object.checkType(contract.validate, 'function'); 41 | 42 | try { 43 | var validatedValue = contract.validate(value, parameters); 44 | } catch (error) { 45 | throw new Error( 46 | 'The expected value for "{0}" is {1}; {2} given instead.'.format( 47 | name, 48 | error.message, 49 | Object.getTypeString(value, true) 50 | ) 51 | ); 52 | } 53 | 54 | if (null != validatedValue) { 55 | value = validatedValue; 56 | } 57 | } 58 | 59 | return value; 60 | } -------------------------------------------------------------------------------- /lib/common/manipulation/proxy-executor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `ProxyExecutor`. 5 | */ 6 | module.exports = ProxyExecutor; 7 | 8 | /** 9 | * Initialize a new proxy executor. 10 | */ 11 | function ProxyExecutor() {} 12 | 13 | ProxyExecutor.defineImplementedInterfaces(['danf:manipulation.proxyExecutor']); 14 | 15 | /** 16 | * @interface {danf:manipulation.proxyExecutor} 17 | */ 18 | ProxyExecutor.prototype.execute = function(object, method) { 19 | var args = Array.prototype.slice.call(arguments, 2); 20 | 21 | return object[method].apply(object, args); 22 | } 23 | 24 | /** 25 | * @interface {danf:manipulation.proxyExecutor} 26 | */ 27 | ProxyExecutor.prototype.executeAsync = function(object, method, scope) { 28 | var args = Array.prototype.slice.call(arguments, 3); 29 | 30 | return object[method].__asyncApply(object, scope || '.', args); 31 | } -------------------------------------------------------------------------------- /lib/common/manipulation/unique-id-generator.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `UniqueIdGenerator`. 5 | */ 6 | module.exports = UniqueIdGenerator; 7 | 8 | /** 9 | * Initialize a new unique id generator. 10 | */ 11 | function UniqueIdGenerator() { 12 | } 13 | 14 | UniqueIdGenerator.defineImplementedInterfaces(['danf:manipulation.uniqueIdGenerator']); 15 | 16 | /** 17 | * @interface {danf:manipulation.uniqueIdGenerator} 18 | */ 19 | UniqueIdGenerator.prototype.generate = function() { 20 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 21 | var r = Math.random() * 16 | 0, 22 | v = c == 'x' ? r : (r&0x3 | 0x8) 23 | ; 24 | 25 | return v.toString(16); 26 | }); 27 | } -------------------------------------------------------------------------------- /lib/common/object/class-processor/abstract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Abstract`. 5 | */ 6 | module.exports = Abstract; 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | var utils = require('../../utils'); 12 | 13 | /** 14 | * Initialize a new abstract class processor. 15 | */ 16 | function Abstract() { 17 | } 18 | 19 | Abstract.defineImplementedInterfaces(['danf:object.classProcessor']); 20 | 21 | Abstract.defineAsAbstract(); 22 | 23 | Abstract.defineDependency('_classesContainer', 'danf:object.classesContainer'); 24 | 25 | /** 26 | * Classes container. 27 | * 28 | * @var {danf:object.classesContainer} 29 | * @api public 30 | */ 31 | Object.defineProperty(Abstract.prototype, 'classesContainer', { 32 | set: function(classesContainer) { this._classesContainer = classesContainer; } 33 | }); -------------------------------------------------------------------------------- /lib/common/vendor/async.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var async = require('async'); 4 | 5 | module.exports = function() { 6 | return async.noConflict(); 7 | }; -------------------------------------------------------------------------------- /lib/server/assets/configuration/section-processor/assets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | var utils = require('../../../../common/utils'), 7 | SectionProcessor = require('../../../../common/configuration/section-processor') 8 | ; 9 | 10 | /** 11 | * Expose `Assets`. 12 | */ 13 | module.exports = Assets; 14 | 15 | /** 16 | * Initialize a new section processor Assets for the config. 17 | */ 18 | function Assets() { 19 | SectionProcessor.call(this); 20 | 21 | this.contract = { 22 | __any: {}, 23 | type: 'string' 24 | }; 25 | } 26 | 27 | utils.extend(SectionProcessor, Assets); -------------------------------------------------------------------------------- /lib/server/http/redirector.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Redirector`. 5 | */ 6 | module.exports = Redirector; 7 | 8 | /** 9 | * Initialize a new redirector. 10 | */ 11 | function Redirector() { 12 | } 13 | 14 | Redirector.defineImplementedInterfaces(['danf:http.redirector']); 15 | 16 | /** 17 | * @interface {danf:error.errorHandler} 18 | */ 19 | Redirector.prototype.redirect = function(url, status) { 20 | // Redirection is handled as an error to interrupt the flow. 21 | var error = new Error(); 22 | 23 | error.status = null != status ? status : 302; 24 | error.message = url; 25 | 26 | throw error; 27 | } -------------------------------------------------------------------------------- /lib/server/vendor/chalk.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var chalk = require('chalk'); 4 | 5 | module.exports = function() { 6 | return new chalk.constructor(); 7 | }; -------------------------------------------------------------------------------- /lib/server/vendor/socket-io.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var socketIo = require('socket.io'); 4 | 5 | module.exports = function() { 6 | return socketIo; 7 | }; -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Gulp = require('./gulp'); 4 | 5 | var gulp = new Gulp(); 6 | 7 | gulp.buildServer(function(app) { 8 | app.listen(); 9 | }); -------------------------------------------------------------------------------- /resource/private/dia/architecture-event.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/dia/architecture-event.dia -------------------------------------------------------------------------------- /resource/private/dia/architecture-model.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/dia/architecture-model.dia -------------------------------------------------------------------------------- /resource/private/dia/architecture-sequencing.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/dia/architecture-sequencing.dia -------------------------------------------------------------------------------- /resource/private/dia/architecture.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/dia/architecture.dia -------------------------------------------------------------------------------- /resource/private/doc/documentation/how-to/cookies.md: -------------------------------------------------------------------------------- 1 | How to Use Cookies 2 | ================== 3 | 4 | [←](../index.md) 5 | 6 | Usage 7 | ----- 8 | 9 | You can use the [service](../dependency-injection.md) `danf:http.cookiesRegistry` to easily manage cookies on both client-side and server-side. 10 | 11 | API 12 | --- 13 | 14 | **Get a cookie.** 15 | 16 | ` .get(key) ` 17 | 18 | * *key (string)*: The key. 19 | * *value (mixed)*: The value. 20 | 21 | **Set a cookie.** 22 | 23 | `.set(key, value, expiresAt, path, domain, isSecude, isHttpOnly)` 24 | 25 | * *key (string)*: The key. 26 | * *value (string)*: The value. 27 | * *expiresAt (date|null)*: The date of expiration. 28 | * *path (string|null)*: The optional path. 29 | * *domain (string|null)*: The optional domain. 30 | * *isSecure (boolean|null)*: Whether or not this is a secure cookie. 31 | * *isHttpOnly (boolean|null)*: Whether or not this is a http only cookie. 32 | 33 | **Unset a cookie.** 34 | 35 | `.unset(key, path, domain)` 36 | 37 | * *key (string)*: The key. 38 | * *path (string|null)*: The optional path. 39 | * *domain (string|null)*: The optional domain. 40 | 41 | [←](../index.md) -------------------------------------------------------------------------------- /resource/private/doc/documentation/how-to/redirect.md: -------------------------------------------------------------------------------- 1 | How to Redirect a HTTP Request 2 | ============================== 3 | 4 | [←](../index.md) 5 | 6 | Usage 7 | ----- 8 | 9 | You can use the [service](../dependency-injection.md) `danf:http.redirector` to redirect a HTTP request. 10 | 11 | In a sequence: 12 | ```javascript 13 | // config/server/config/sequences.js 14 | 15 | 'use strict'; 16 | 17 | module.exports = { 18 | redirect: { 19 | operations: [ 20 | { 21 | service: 'danf:http.redirector', 22 | method: 'redirect', 23 | arguments: ['/somewhere'] 24 | } 25 | ] 26 | } 27 | }; 28 | ``` 29 | 30 | Injected in a service: 31 | ```javascript 32 | this.redirector.redirect('/here', 301); 33 | ``` 34 | 35 | > A redirect interrupt the flow (like an error would do). This means that the rest of your sequences won't be executed. 36 | 37 | API 38 | --- 39 | 40 | **Redirect a HTTP request.** 41 | 42 | `.redirect(url, status)` 43 | 44 | * *url (string)*: The URL/path of the redirect. 45 | * *status (number)*: The optional redirect HTTP status code, default 302. 46 | 47 | [←](../index.md) -------------------------------------------------------------------------------- /resource/private/doc/documentation/how-to/session.md: -------------------------------------------------------------------------------- 1 | How to Handle the Session 2 | ========================= 3 | 4 | [←](../index.md) 5 | 6 | Usage 7 | ----- 8 | 9 | You can use the [service](../dependency-injection.md) `danf:http.sessionHandler` to easily manage the session. In most cases you will just need to use the methods `get` and `set` to set and retrieve values in the session. This latter is started and saved for you. 10 | 11 | API 12 | --- 13 | 14 | **Get a value in the session.** 15 | 16 | `.get(key)` 17 | 18 | * *key (string)*: The key. 19 | 20 | **Set a value in the session.** 21 | 22 | `.set(key, value)` 23 | 24 | * *key (string)*: The key. 25 | * *value (mixed)*: The value. 26 | 27 | **Regenerate the session.** 28 | 29 | `.regenerate()` 30 | 31 | **Destroy the session.** 32 | 33 | `.destroy()` 34 | 35 | **Reload the session.** 36 | 37 | `.reload()` 38 | 39 | **Save the session.** 40 | 41 | `.save()` 42 | 43 | **Update the max age of the session.** 44 | 45 | `.touch()` 46 | 47 | [←](../index.md) -------------------------------------------------------------------------------- /resource/private/doc/documentation/index.md: -------------------------------------------------------------------------------- 1 | Danf Full Documentation 2 | ======================= 3 | 4 | [←](../index.md) 5 | 6 |  7 | 8 | If you are a begginer in Danf, you certainly should not try to master all this documentation right now, but instead use it as a reference to find specific informations when needed. 9 | 10 | If you do not find what you are looking for in this documentation, feel free to post a question on [stackoverflow](http://stackoverflow.com/) with the tag `[danf]` or in the [issues](https://github.com/gnodi/danf/issues) if you think you have a bug or an interesting idea for an additional feature. 11 | 12 | Learn more about the core features of the framework: 13 | 14 | * [Configuration](core/configuration.md) 15 | * [OOP](core/oop.md) 16 | * [Dependency injection](core/dependency-injection.md) 17 | * [Sequencing](core/sequencing.md) 18 | * [Events](core/events.md) 19 | * [Ajax app](core/ajax-app.md) 20 | * [Testing](core/testing.md) 21 | 22 | Learn how to do things with Danf: 23 | 24 | * [How to use cookies](how-to/cookies.md) 25 | * [How to handle the session](how-to/session.md) 26 | * [How to redirect a HTTP request](how-to/redirect.md) 27 | * [How to configure the cluster](how-to/cluster.md) 28 | * [How to works with public assets (images, css, ...)](how-to/assets.md) 29 | * [How to use ES6 class syntaxic sugar](how-to/es6-class.md) 30 | 31 | [←](../index.md) -------------------------------------------------------------------------------- /resource/private/doc/index.md: -------------------------------------------------------------------------------- 1 | Danf Documentation 2 | ================== 3 | 4 | [←](../../../README.md) 5 | 6 | You have many ways to learn more about [Danf](../../../README.md): 7 | 8 | - Want to know if Danf is for you? Get a quick [overview](overview/index.md) of the framework! 9 | - Think Danf has been made from random theories? Take a look at the main [concepts](concept/index.md) that guided the developement of the framework. 10 | - Need to deepen your understanding of Danf? Jump into the [full documentation](documentation/index.md)! 11 | 12 | > All this documentation assumes you [use an application created with the danf yeoman generator](installation.md). 13 | 14 | Here is a [list of available danf modules](modules.md)! 15 | 16 | [←](../../../README.md) 17 | 18 |    -------------------------------------------------------------------------------- /resource/private/doc/installation.md: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | [←](index.md) 5 | 6 | ### Create a proto application 7 | 8 | The better way to create a new application/danf module (in Danf an application is a **danf module** and conversely) is to let [Yeoman](http://yeoman.io/) do it for you! 9 | 10 | First, install Yeoman: 11 | ```sh 12 | $ npm install -g yo 13 | ``` 14 | 15 | Then, install the specific generator for Danf applications: 16 | ```sh 17 | $ npm install -g generator-danf 18 | ``` 19 | 20 | Finally, create an application using: 21 | ```sh 22 | $ yo danf 23 | ``` 24 | 25 | ### Start the server 26 | 27 | After creating your application, you should be able to start the server in this way: 28 | ```sh 29 | $ node danf serve 30 | ``` 31 | 32 | This will create a server and process client side files automatically rebuilding each time a file is changed. 33 | At the end of this processing, a welcome message will be available at `http://localhost:3080`! 34 | 35 | > Use `node danf serve --env prod` to start the server in prod environment (less debugging, more performances!). 36 | 37 | ### Run the tests 38 | 39 | You can run the tests of your application thanks to: 40 | ```sh 41 | $ make test 42 | ``` 43 | 44 | [←](index.md) -------------------------------------------------------------------------------- /resource/private/doc/modules.md: -------------------------------------------------------------------------------- 1 | List of Danf Modules 2 | ==================== 3 | 4 | [←](index.md) 5 | 6 | Here is a list of danf modules. Fork it and add your own! 7 | 8 | > The name of you module must respect the format `danf-vendor-feature` to be referenced. 9 | > 10 | > Examples: 11 | > * `danf-me-form` 12 | > * `danf-gnodi-mongo` 13 | 14 | * [danf-gnucki-mongodb](https://github.com/Gnucki/danf-gnucki-mongodb): Module helping to work with MongoDB and Danf. 15 | 16 | [←](index.md) -------------------------------------------------------------------------------- /resource/private/img/architecture-event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/img/architecture-event.png -------------------------------------------------------------------------------- /resource/private/img/architecture-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/img/architecture-model.png -------------------------------------------------------------------------------- /resource/private/img/architecture-sequencing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/img/architecture-sequencing.png -------------------------------------------------------------------------------- /resource/private/img/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/private/img/architecture.png -------------------------------------------------------------------------------- /resource/private/view/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Hello world! 5 | 6 | script. 7 | var require = { 8 | config: { 9 | app: { 10 | context: JSON.parse('!{_context}') || {} 11 | } 12 | } 13 | }; 14 | script(data-main='/app', src='/require', async) 15 | body 16 | != _view.body -------------------------------------------------------------------------------- /resource/public/img/avatar-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/avatar-white.png -------------------------------------------------------------------------------- /resource/public/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/avatar.png -------------------------------------------------------------------------------- /resource/public/img/favicon-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/favicon-white.png -------------------------------------------------------------------------------- /resource/public/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/favicon.png -------------------------------------------------------------------------------- /resource/public/img/logo-white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/logo-white.jpg -------------------------------------------------------------------------------- /resource/public/img/logo.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/logo.ai -------------------------------------------------------------------------------- /resource/public/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/logo.jpg -------------------------------------------------------------------------------- /resource/public/img/powered-bis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/powered-bis.png -------------------------------------------------------------------------------- /resource/public/img/powered-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/powered-white.png -------------------------------------------------------------------------------- /resource/public/img/powered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/powered.png -------------------------------------------------------------------------------- /resource/public/img/small-logo-white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/small-logo-white.jpg -------------------------------------------------------------------------------- /resource/public/img/small-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/resource/public/img/small-logo.jpg -------------------------------------------------------------------------------- /test/fixture/app/a.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var A = function() { 4 | this._a = 1; 5 | this._b = 1; 6 | this._c = 1; 7 | }; 8 | 9 | A.prototype.a = function() { 10 | return ++this._a; 11 | }; 12 | 13 | A.prototype.b = function() { 14 | return ++this._b; 15 | }; 16 | 17 | A.prototype.c = function() { 18 | return ++this._c; 19 | }; 20 | 21 | module.exports = A; -------------------------------------------------------------------------------- /test/fixture/app/b.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var B = function() { 4 | B.Parent.call(this); 5 | }; 6 | 7 | B.defineExtendedClass('a'); 8 | 9 | B.prototype.b = function() { 10 | this._b++; 11 | 12 | return B.Parent.prototype.b.call(this); 13 | }; 14 | 15 | B.prototype.c = function() { 16 | this._c++; 17 | 18 | return B.Parent.prototype.c.call(this); 19 | }; 20 | 21 | module.exports = B; -------------------------------------------------------------------------------- /test/fixture/app/base-computer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Computer = function(displayer, count) { 4 | this.displayer = displayer; 5 | this.count = count || 1; 6 | }; 7 | 8 | Computer.defineDependency('displayer', 'displayer'); 9 | 10 | Computer.prototype.display = function() { 11 | return this.displayer.display(this.counter); 12 | }; 13 | 14 | module.exports = Computer; -------------------------------------------------------------------------------- /test/fixture/app/c.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var C = function() { 4 | C.Parent.call(this); 5 | }; 6 | 7 | C.defineExtendedClass('b'); 8 | 9 | C.prototype.c = function() { 10 | this._c++; 11 | 12 | return C.Parent.prototype.c.call(this); 13 | }; 14 | 15 | module.exports = C; -------------------------------------------------------------------------------- /test/fixture/app/callback-executor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = CallbackExecutor; 4 | 5 | function CallbackExecutor() {} 6 | 7 | CallbackExecutor.defineImplementedInterfaces(['danf:manipulation.callbackExecutor']); 8 | 9 | CallbackExecutor.prototype.execute = function(callback) { 10 | var args = Array.prototype.slice.call(arguments, 1); 11 | 12 | return callback.apply(this, args); 13 | } 14 | 15 | CallbackExecutor.prototype.executeCallback = function(callback) { 16 | return this.execute.apply(this, arguments); 17 | } -------------------------------------------------------------------------------- /test/fixture/app/computer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Computer = function(counter) { 4 | this.counter = counter; 5 | 6 | Computer.Parent.call(this, null, 2); 7 | }; 8 | 9 | Computer.defineExtendedClass('dep1:computer'); 10 | Computer.defineDependency('counter', 'dep1:module10:counter'); 11 | 12 | Computer.prototype.inc = function() { 13 | if (this.counter.count < this.count) { 14 | this.counter.count = this.count; 15 | } 16 | 17 | this.counter.inc(); 18 | 19 | return Computer.Parent.prototype.display.call(this); 20 | }; 21 | 22 | module.exports = Computer; -------------------------------------------------------------------------------- /test/fixture/app/counter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Counter; 4 | 5 | function Counter() {} 6 | 7 | Counter.prototype.inc = function(value, inc) { 8 | return value + inc; 9 | }; 10 | 11 | Counter.prototype.dec = function(value, dec) { 12 | return value - dec; 13 | }; -------------------------------------------------------------------------------- /test/fixture/app/d.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class D extends Function.getReference('c') { 4 | constructor() { 5 | super(); 6 | } 7 | 8 | c() { 9 | return super.c() + 1; 10 | } 11 | 12 | d() { 13 | return 11; 14 | } 15 | } 16 | 17 | D.defineImplementedInterfaces(['d']); 18 | 19 | module.exports = D; -------------------------------------------------------------------------------- /test/fixture/app/e.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class E extends Function.getReference('d') { 4 | constructor() { 5 | super(); 6 | } 7 | 8 | c() { 9 | return super.c() + 2; 10 | } 11 | } 12 | 13 | module.exports = E; -------------------------------------------------------------------------------- /test/fixture/app/interfaced-data.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = InterfacedData; 4 | 5 | function InterfacedData() {} 6 | 7 | InterfacedData.defineImplementedInterfaces(['data']); -------------------------------------------------------------------------------- /test/fixture/app/scheduler.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Scheduler; 4 | 5 | function Scheduler() {} 6 | 7 | Scheduler.prototype.start = function (value, inc, timeout) { 8 | this.__asyncProcess(function(async) { 9 | setTimeout( 10 | async(function() { 11 | return function(value) { 12 | return value + inc; 13 | }; 14 | }), 15 | timeout + 20 16 | ); 17 | }); 18 | 19 | this.__asyncProcess(function(async) { 20 | setTimeout( 21 | async(function() { 22 | return function(value) { 23 | return value + inc; 24 | }; 25 | }), 26 | timeout 27 | ); 28 | }); 29 | 30 | return value + inc; 31 | } -------------------------------------------------------------------------------- /test/fixture/app/trigger.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Trigger = function() {}; 4 | 5 | Trigger.prototype.trigger = function(done) { 6 | this.startEvent.trigger(); 7 | this.startDependencyEvent.trigger({data: {i: 3, done: done}}); 8 | }; 9 | 10 | module.exports = Trigger; -------------------------------------------------------------------------------- /test/fixture/app/trigger1.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Trigger = function() {}; 4 | 5 | Trigger.prototype.trigger = function(done) { 6 | this.startEvent.trigger({data: {i: 2, done: done}}); 7 | }; 8 | 9 | module.exports = Trigger; -------------------------------------------------------------------------------- /test/fixture/command/command-provider.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var Command = require('../../../lib/common/command/command'), 4 | ObjectProvider = require('../../../lib/common/dependency-injection/object-provider') 5 | ; 6 | 7 | var objectProvider = new ObjectProvider(); 8 | objectProvider.class = Command; 9 | objectProvider.debug = false; 10 | 11 | module.exports = objectProvider; -------------------------------------------------------------------------------- /test/fixture/command/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../danf'); -------------------------------------------------------------------------------- /test/fixture/command/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/fixture/command/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "command", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/configuration/configuration-resolver.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var DataResolver = require('../../../lib/common/manipulation/data-resolver'), 4 | DefaultDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/default'), 5 | RequiredDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/required'), 6 | TypeDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/type'), 7 | ReferencesDataInterpreter = require('../../../lib/common/configuration/manipulation/data-interpreter/references'), 8 | NamespaceDataInterpreter = require('../../../lib/common/configuration/manipulation/data-interpreter/namespace') 9 | ; 10 | 11 | var configurationResolver = new DataResolver(); 12 | 13 | configurationResolver.addDataInterpreter(new DefaultDataInterpreter()); 14 | configurationResolver.addDataInterpreter(new RequiredDataInterpreter()); 15 | configurationResolver.addDataInterpreter(new TypeDataInterpreter()); 16 | configurationResolver.addDataInterpreter(new ReferencesDataInterpreter()); 17 | configurationResolver.addDataInterpreter(new NamespaceDataInterpreter()); 18 | 19 | module.exports = configurationResolver; -------------------------------------------------------------------------------- /test/fixture/configuration/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | dependencies: { 5 | module1: require('./module1/danf'), 6 | module2: require('./module2/danf'), 7 | module4: 'module1', 8 | 'module1:module5': 'module1:module3', 9 | 'module4:module5': 'module2' 10 | }, 11 | contract: { 12 | test: { 13 | type: 'number', 14 | } 15 | }, 16 | config: { 17 | this: { 18 | test: 0 19 | }, 20 | module1: { 21 | test: { value: 0 } 22 | }, 23 | } 24 | }; -------------------------------------------------------------------------------- /test/fixture/configuration/module1/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | dependencies: { 5 | module3: require('./module3/danf'), 6 | module5: {} 7 | }, 8 | contract: { 9 | test: { 10 | type: 'embedded', 11 | embed: { 12 | value: { 13 | type: 'number' 14 | }, 15 | text: { 16 | type: 'string' 17 | } 18 | } 19 | }, 20 | value: { 21 | type: 'number' 22 | } 23 | }, 24 | config: { 25 | this: { 26 | test: { 27 | value: 1, 28 | text: 'text' 29 | }, 30 | value: 1 31 | } 32 | } 33 | }; -------------------------------------------------------------------------------- /test/fixture/configuration/module1/module3/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | contract: { 5 | value: { 6 | type: 'number' 7 | }, 8 | foo: { 9 | type: 'string' 10 | } 11 | }, 12 | config: { 13 | this: { 14 | value: 5, 15 | foo: 'bar' 16 | }, 17 | global: { 18 | value: 3 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/fixture/configuration/module2/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | contract: { 5 | test: { 6 | type: 'number', 7 | } 8 | }, 9 | config: { 10 | this: { 11 | test: 2 12 | }, 13 | global: { 14 | value: 2 15 | }, 16 | 'global/prod': { 17 | value: 4 18 | }, 19 | 'global/test': { 20 | value: 5 21 | }, 22 | 'global/dev': { 23 | value: 6 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /test/fixture/configuration/modules-tree.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var ModulesTree = require('../../../lib/common/configuration/modules-tree'); 4 | 5 | var modulesTree = new ModulesTree(); 6 | 7 | modulesTree.appName = 'app'; 8 | modulesTree.build(require('./danf')); 9 | 10 | module.exports = modulesTree; -------------------------------------------------------------------------------- /test/fixture/configuration/section-processor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../lib/common/utils'), 4 | SectionProcessor = require('../../../lib/common/configuration/section-processor') 5 | ; 6 | 7 | module.exports = GlobalSectionProcessor; 8 | 9 | function GlobalSectionProcessor(name, configurationResolver, referenceResolver) { 10 | SectionProcessor.call(this); 11 | 12 | this.name = name; 13 | this.contract = null; 14 | this.configurationResolver = configurationResolver; 15 | this.referenceResolver = referenceResolver; 16 | 17 | this.contract = { 18 | value: { 19 | type: 'number', 20 | default: 1 21 | } 22 | }; 23 | } 24 | 25 | utils.extend(SectionProcessor, GlobalSectionProcessor); -------------------------------------------------------------------------------- /test/fixture/file-system/.ban/main.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/foo/bar.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/index.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/directory/file.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/js.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/private.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/private/index.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/test.css: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/node-modules/test/test.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/protected/private.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/protected/public.css: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/protected/public.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/file-system/public/foo.js: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /test/fixture/http/forum.jade: -------------------------------------------------------------------------------- 1 | p= messages -------------------------------------------------------------------------------- /test/fixture/http/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | body 6 | != _view.body -------------------------------------------------------------------------------- /test/fixture/manipulation/data-resolver.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../lib/common/init'); 4 | 5 | var DataResolver = require('../../../lib/common/manipulation/data-resolver'), 6 | DefaultDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/default'), 7 | FlattenDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/flatten'), 8 | FormatDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/format'), 9 | RequiredDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/required'), 10 | TypeDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/type'), 11 | ValidateDataInterpreter = require('../../../lib/common/manipulation/data-interpreter/validate') 12 | ; 13 | 14 | var dataResolver = new DataResolver(); 15 | 16 | dataResolver.addDataInterpreter(new DefaultDataInterpreter()); 17 | dataResolver.addDataInterpreter(new FlattenDataInterpreter()); 18 | dataResolver.addDataInterpreter(new FormatDataInterpreter()); 19 | dataResolver.addDataInterpreter(new RequiredDataInterpreter()); 20 | dataResolver.addDataInterpreter(new TypeDataInterpreter()); 21 | dataResolver.addDataInterpreter(new ValidateDataInterpreter()); 22 | 23 | module.exports = dataResolver; -------------------------------------------------------------------------------- /test/fixture/manipulation/map-provider.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var Map = require('../../../lib/common/manipulation/map'), 4 | ObjectProvider = require('../../../lib/common/dependency-injection/object-provider') 5 | ; 6 | 7 | var objectProvider = new ObjectProvider(); 8 | objectProvider.class = Map; 9 | objectProvider.debug = false; 10 | 11 | module.exports = objectProvider; -------------------------------------------------------------------------------- /test/fixture/module10-v1-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Counter = function() { this._count = 0; }; 4 | Counter.defineImplementedInterfaces(['counter']); 5 | Counter.prototype.inc = function() { 6 | this._count++; 7 | }; 8 | Object.defineProperty(Counter.prototype, 'count', { 9 | get: function() { 10 | return this._count; 11 | }, 12 | set: function(count) { 13 | this._count = count; 14 | } 15 | }); 16 | 17 | module.exports = { 18 | dependencies: { 19 | module100: require('./module100-v1-danf') 20 | }, 21 | contract: { 22 | timeOut: { 23 | type: 'number' 24 | } 25 | }, 26 | config: { 27 | classes: { 28 | counter: Counter 29 | }, 30 | interfaces: { 31 | counter: { 32 | methods: { 33 | inc: {} 34 | }, 35 | getters: { 36 | count: 'number' 37 | }, 38 | setters: { 39 | count: 'number' 40 | } 41 | }, 42 | manager: {} 43 | }, 44 | services: { 45 | counter: { 46 | class: 'counter' 47 | } 48 | }, 49 | this: { 50 | timeOut: 1000 51 | } 52 | } 53 | }; -------------------------------------------------------------------------------- /test/fixture/module10-v2-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Counter = function() { this._count = 0; }; 4 | Counter.defineImplementedInterfaces(['counter']); 5 | Counter.prototype.inc = function() { 6 | this._count++; 7 | }; 8 | Object.defineProperty(Counter.prototype, 'count', { 9 | get: function() { 10 | return this._count; 11 | }, 12 | set: function(count) { 13 | this._count = count; 14 | } 15 | }); 16 | 17 | module.exports = { 18 | dependencies: { 19 | module100: require('./module100-v2-danf') 20 | }, 21 | contract: { 22 | timeOut: { 23 | type: 'number' 24 | } 25 | }, 26 | config: { 27 | classes: { 28 | counter: Counter 29 | }, 30 | interfaces: { 31 | counter: { 32 | methods: { 33 | inc: {} 34 | }, 35 | getters: { 36 | count: 'number' 37 | }, 38 | setters: { 39 | count: 'number' 40 | } 41 | }, 42 | manager: {} 43 | }, 44 | services: { 45 | counter: { 46 | class: 'counter' 47 | } 48 | }, 49 | this: { 50 | timeOut: 2000 51 | } 52 | } 53 | }; -------------------------------------------------------------------------------- /test/fixture/module10-v3-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Counter = function() { this._count = 0; }; 4 | Counter.defineImplementedInterfaces(['counter']); 5 | Counter.prototype.inc = function() { 6 | this._count++; 7 | }; 8 | Object.defineProperty(Counter.prototype, 'count', { 9 | get: function() { 10 | return this._count; 11 | }, 12 | set: function(count) { 13 | this._count = count; 14 | } 15 | }); 16 | 17 | module.exports = { 18 | dependencies: { 19 | module100: require('./module100-v3-danf') 20 | }, 21 | contract: { 22 | timeOut: { 23 | type: 'number' 24 | } 25 | }, 26 | config: { 27 | classes: { 28 | counter: Counter 29 | }, 30 | interfaces: { 31 | counter: { 32 | methods: { 33 | inc: {} 34 | }, 35 | getters: { 36 | count: 'number' 37 | }, 38 | setters: { 39 | count: 'number' 40 | } 41 | }, 42 | manager: {} 43 | }, 44 | services: { 45 | counter: { 46 | class: 'counter' 47 | } 48 | }, 49 | this: { 50 | timeOut: 3000 51 | } 52 | } 53 | }; -------------------------------------------------------------------------------- /test/fixture/module100-v1-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | contract: { 5 | try: { 6 | type: 'number' 7 | } 8 | }, 9 | config: { 10 | this: { 11 | try: 1 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/fixture/module100-v2-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | contract: { 5 | try: { 6 | type: 'number' 7 | } 8 | }, 9 | config: { 10 | this: { 11 | try: 2 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/fixture/module100-v3-danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | contract: { 5 | try: { 6 | type: 'number' 7 | } 8 | }, 9 | config: { 10 | this: { 11 | try: 3 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/fixture/obj1.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Obj1; 4 | 5 | function Obj1(string, integer) { 6 | this.string = string; 7 | this._integer = integer; 8 | } 9 | 10 | Obj1.prototype.test = function () { 11 | return this.string; 12 | } -------------------------------------------------------------------------------- /test/fixture/obj2.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Obj2; 4 | 5 | function Obj2(object, integer, string, parameter) { 6 | this.dependency = object; 7 | this._string = string; 8 | this._integer = integer; 9 | this.parameter = parameter; 10 | } 11 | 12 | Obj2.prototype.test = function () { 13 | return this._string; 14 | } -------------------------------------------------------------------------------- /test/fixture/object/x.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class X { 4 | f() { 5 | return 1; 6 | } 7 | 8 | g() { 9 | return 2; 10 | } 11 | } 12 | 13 | module.exports = X; -------------------------------------------------------------------------------- /test/fixture/object/y.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class Y extends Function.getReference('x') { 4 | f() { 5 | return super.f() + 2; 6 | } 7 | 8 | h() { 9 | return 4; 10 | } 11 | } 12 | 13 | module.exports = Y; -------------------------------------------------------------------------------- /test/fixture/object/z.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class Z extends Function.getReference('y') { 4 | f() { 5 | return super.f() + 2; 6 | } 7 | 8 | i() { 9 | return 6; 10 | } 11 | } 12 | 13 | module.exports = Z; -------------------------------------------------------------------------------- /test/fixture/proto/app/config/common/config/classes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | main: require('../../../lib/main.js') 5 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/client/foo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/common/.bar/foo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/common/bar.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/common/foo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/common/foo/bar.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/lib/server/bar.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/client/config/dep1.subdep2/index-.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | ab: 12, 5 | cde: 345 6 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/client/config/dep1.subdep2/key..js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = 'value'; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/client/config/events&dev/request/compute.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | path: 'computing/dev', 5 | methods: ['get'], 6 | view: { 7 | html: { 8 | body: { 9 | file: './computing.jade' 10 | } 11 | } 12 | } 13 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/client/config/this.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {foo: 'bar'}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/client/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/common/config/events/request/api.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | children: { 5 | user: { 6 | methods: ['get', 'post'], 7 | view: { 8 | html: { 9 | body: { 10 | file: './user.jade' 11 | } 12 | } 13 | } 14 | } 15 | } 16 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/common/config/events/request/compute.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | path: 'computing', 5 | methods: ['get'], 6 | view: { 7 | html: { 8 | body: { 9 | file: './computing.jade' 10 | } 11 | } 12 | } 13 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/message-.get./bar..js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | abc: 123 5 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/message-.get./foo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/old-topic.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/topic.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/user.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | path: 'users', 5 | methods: ['put'] 6 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/user~children.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | post: {} 5 | }; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/api~children/user~children/message.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/config/server/config/events/request/compute.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/b/config/client/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/b/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/b/lib/client/foo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/b/lib/common/bar.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/c/config/server/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/c/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/c/lib/server/foo/bar.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function() {}; -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/app/node_modules/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "b": "1.0.0", 6 | "c": "1.0.0" 7 | } 8 | } -------------------------------------------------------------------------------- /test/fixture/proto/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "a": "1.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/b/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/b/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/c/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/c/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "1.1.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/e/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/e/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/e/node_modules/c/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/e/node_modules/c/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/e/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "4.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "c": "4.0.0" 6 | } 7 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/f/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/f/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/f/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "f", 3 | "version": "1.2.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/g/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/g/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/g/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "g", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/h/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/c/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/c/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "3.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/i/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/i/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/i/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "i", 3 | "version": "1.2.3", 4 | "dependencies": { 5 | "c": "^3.0" 6 | } 7 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/j/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/j/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/node_modules/j/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "j", 3 | "version": "v0.0.1-beta", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/node_modules/h/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "h", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "c": "^3.0", 6 | "i": "^1.1", 7 | "j": "v0.0.1-beta" 8 | } 9 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/d/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "e": "^1.0", 6 | "f": "^2.0", 7 | "g": "^1.0", 8 | "h": "^1.0" 9 | } 10 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/k/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "k", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/l/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/l/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/l/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "l", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/c/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/node_modules/c/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "2.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/f/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/node_modules/f/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/f/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "f", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/g/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/node_modules/g/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/g/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "g", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/j/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/node_modules/j/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/j/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "j", 3 | "version": "v0.0.3-beta", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/o/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/m/node_modules/o/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/node_modules/o/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "o", 3 | "version": "0.1.1", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/m/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "m", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "c": "2.0.1", 6 | "f": "^1.0", 7 | "g": "^1.0", 8 | "j": "v0.0.3-beta", 9 | "o": "^0.1" 10 | } 11 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/n/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/node_modules/h/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/n/node_modules/h/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/node_modules/h/node_modules/j/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/n/node_modules/h/node_modules/j/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/node_modules/h/node_modules/j/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "j", 3 | "version": "v0.0.4-beta", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/node_modules/h/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "h", 3 | "version": "2.0.0", 4 | "dependencies": { 5 | "j": "v0.0.4-beta", 6 | "o": "~0.1.0" 7 | } 8 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/n/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "n", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "h": "^2.0", 6 | "o": "0.2.0" 7 | } 8 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/o/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/o/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/o/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "o", 3 | "version": "0.2.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/q/danf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/fixture/proto/dependencies/node_modules/q/danf.js -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/node_modules/q/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "q", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixture/proto/dependencies/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "b": "^1.0", 6 | "c": "^1.1", 7 | "d": "^1.0", 8 | "k": "^1.0", 9 | "l": "^1.0", 10 | "m": "^1.0", 11 | "n": "^1.0" 12 | } 13 | } -------------------------------------------------------------------------------- /test/fixture/rendering/a.jade: -------------------------------------------------------------------------------- 1 | p!= _view.c 2 | p!= _view.d -------------------------------------------------------------------------------- /test/fixture/rendering/b.jade: -------------------------------------------------------------------------------- 1 | p!= _view.d -------------------------------------------------------------------------------- /test/fixture/rendering/c.jade: -------------------------------------------------------------------------------- 1 | p c -------------------------------------------------------------------------------- /test/fixture/rendering/d.jade: -------------------------------------------------------------------------------- 1 | p!= _view.e -------------------------------------------------------------------------------- /test/fixture/rendering/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/fixture/rendering/e.jade: -------------------------------------------------------------------------------- 1 | p e -------------------------------------------------------------------------------- /test/fixture/rendering/embedded.jade: -------------------------------------------------------------------------------- 1 | p!= _view.a 2 | p!= _view.b -------------------------------------------------------------------------------- /test/fixture/rendering/f.jade: -------------------------------------------------------------------------------- 1 | p f -------------------------------------------------------------------------------- /test/fixture/rendering/index.jade: -------------------------------------------------------------------------------- 1 | p= body -------------------------------------------------------------------------------- /test/fixture/rendering/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | body 6 | != _view.body -------------------------------------------------------------------------------- /test/fixture/rendering/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rendering", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/a.jade: -------------------------------------------------------------------------------- 1 | div 2 | a(href='/', data-ajax='{}') index 3 | 4 | p 5 | span a- 6 | span= number 7 | p!= _view.date 8 | 9 | ul 10 | li 11 | a(href='/b/1', data-ajax='{"autoload":30}') b-1 12 | li 13 | a(href='/b/2', data-ajax='{"autoload":45}') b-2 14 | li 15 | a(href='/b/3', data-ajax='{"autoload":60}') b-3 -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: __dirname + '/config-client.js', 10 | context: { 11 | verbosity: 2 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/b.jade: -------------------------------------------------------------------------------- 1 | div 2 | p 3 | span b- 4 | span= number 5 | p!= _view.date 6 | 7 | ul 8 | li 9 | a(href='/c/1', data-ajax='{"autoload":3}') c-1 10 | li 11 | a(href='/c/2', data-ajax='{"autoload":10}') c-2 -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/c.jade: -------------------------------------------------------------------------------- 1 | div 2 | p 3 | span c- 4 | span= number 5 | p!= _view.date -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/config-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | function NameSetter() {} 6 | NameSetter.prototype.set = function(data) { 7 | var $ = this.jquery, 8 | element = $(data) 9 | ; 10 | 11 | $('#hello').text(element.find('#hello').text()); 12 | }; 13 | 14 | module.exports = utils.merge( 15 | require('./config-common'), 16 | { 17 | config: { 18 | events: { 19 | event: { 20 | 'danf:form.name': { 21 | sequences: [ 22 | { 23 | name: 'setName' 24 | } 25 | ] 26 | } 27 | } 28 | }, 29 | sequences: { 30 | setName: { 31 | operations: [ 32 | { 33 | service: 'nameSetter', 34 | method: 'set', 35 | arguments: ['@data.data@'] 36 | } 37 | ] 38 | } 39 | }, 40 | services: { 41 | nameSetter: { 42 | class: NameSetter, 43 | properties: { 44 | jquery: '#danf:vendor.jquery#' 45 | } 46 | } 47 | } 48 | } 49 | }, 50 | true 51 | ); -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/config-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | events: { 6 | request: { 7 | home: { 8 | path: '', 9 | methods: ['get'] 10 | }, 11 | form: { 12 | path: '/form', 13 | methods: ['get'], 14 | parameters: { 15 | name: { 16 | type: 'string', 17 | default: '' 18 | } 19 | } 20 | }, 21 | a: { 22 | path: '/a/:number', 23 | methods: ['get'] 24 | }, 25 | b: { 26 | path: '/b/:number', 27 | methods: ['get'] 28 | }, 29 | c: { 30 | path: '/c/:number', 31 | methods: ['get'] 32 | } 33 | } 34 | } 35 | } 36 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/date.jade: -------------------------------------------------------------------------------- 1 | span(style='color:grey;font-size:90%;font-style:italic;')= '(' + date + ')' -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/form.jade: -------------------------------------------------------------------------------- 1 | a(class='ajax', href='/') index 2 | 3 | p= '--- form-id: ' + random + ' ---' 4 | 5 | if name 6 | h1(id='hello')= 'Hello ' + name + '!!' 7 | else 8 | h1(id='hello')= 'Hello!' 9 | 10 | h2= 'Standard form (reload the page)' 11 | form(action='/form', method='get') 12 | label(for='name') Name: 13 | input(name='name', id='name', type='text') 14 | input(type='submit') 15 | 16 | h2= 'Ajax form (reload the body)' 17 | form(action='/form', method='get', data-ajax='{}') 18 | label(for='name') Name: 19 | input(name='name', id='name', type='text') 20 | input(type='submit') -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/index.jade: -------------------------------------------------------------------------------- 1 | p 2 | a(href='/form', data-ajax='{}') form 3 | p 4 | a(href='/a/1', data-ajax='{}') a-1 (ajax link - reload the body of the page asynchronously) 5 | p 6 | a(href='/a/2') a-2 (standard link - reload the page) 7 | p 8 | a(href='/a/3', data-ajax='{"autoload":0}') a-3 (autoload ajax link - load the content of the link automatically) -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Ajax App 5 | 6 | script. 7 | var require = { 8 | config: { 9 | app: { 10 | context: JSON.parse('!{_context}') || {} 11 | } 12 | } 13 | }; 14 | script(data-main='/app', src='/require', async) 15 | body 16 | p= '--- page-id: ' + random + ' ---' 17 | 18 | div(id='body')!= _view.body -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-app/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: __dirname + '/config-client.js', 10 | context: { 11 | verbosity: 2 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/config-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | module.exports = utils.merge( 6 | require('./config-common'), 7 | {}, 8 | true 9 | ); -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/config-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | events: { 6 | request: { 7 | hello: { 8 | path: '/hello', 9 | methods: ['get'] 10 | }, 11 | world: { 12 | path: '/world', 13 | methods: ['get'] 14 | } 15 | } 16 | } 17 | } 18 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | module.exports = utils.merge( 6 | require('./config-common'), 7 | { 8 | config: { 9 | events: { 10 | request: { 11 | helloWorld: { 12 | path: '', 13 | methods: ['get'], 14 | view: { 15 | html: { 16 | body: { 17 | file: __dirname + '/index.jade' 18 | } 19 | } 20 | } 21 | }, 22 | hello: { 23 | view: { 24 | html: { 25 | body: { 26 | file: __dirname + '/hello.jade' 27 | } 28 | } 29 | } 30 | }, 31 | world: { 32 | view: { 33 | html: { 34 | body: { 35 | file: __dirname + '/world.jade' 36 | } 37 | } 38 | } 39 | } 40 | } 41 | } 42 | } 43 | }, 44 | true 45 | ); -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/hello.jade: -------------------------------------------------------------------------------- 1 | span= 'Hello ' -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/index.jade: -------------------------------------------------------------------------------- 1 | a(href='/hello', data-ajax='{"autoload":0}') 2 | p Processing... 3 | p(style='color:grey;font-size:90%;font-style:italic;') Should display "Hello World!" if everything is ok. 4 | a(href='/world', data-ajax='{"autoload":0}') -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/ajax-hello-world/world.jade: -------------------------------------------------------------------------------- 1 | span World! -------------------------------------------------------------------------------- /test/functional/feature/chat/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: __dirname + '/config-client.js', 10 | context: { 11 | verbosity: 2 12 | } 13 | } 14 | }; -------------------------------------------------------------------------------- /test/functional/feature/chat/config-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | events: { 6 | request: { 7 | home: { 8 | path: '', 9 | methods: ['get'] 10 | } 11 | }, 12 | socket: { 13 | messageCreation: { 14 | }, 15 | messageCreationNotification: { 16 | } 17 | } 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /test/functional/feature/chat/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/chat/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/chat/index.jade: -------------------------------------------------------------------------------- 1 | h1(id='hello') Welcome to the awesome chat! 2 | 3 | div(id='chat') 4 | 5 | div(id='message') 6 | form() 7 | label(for='message') Enter your message here: 8 | input(name='message', type='text') 9 | input(type='submit') -------------------------------------------------------------------------------- /test/functional/feature/chat/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Ajax App 5 | 6 | script. 7 | var require = { 8 | config: { 9 | app: { 10 | context: JSON.parse('!{_context}') || {} 11 | } 12 | } 13 | }; 14 | script(data-main='/app', src='/require', async) 15 | body(id='body')!= _view.body -------------------------------------------------------------------------------- /test/functional/feature/chat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/chat/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/chat/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: { 7 | verbosity: 1 8 | } 9 | }, 10 | client: { 11 | configuration: __dirname + '/config-client.js', 12 | context: { 13 | verbosity: 1 14 | } 15 | } 16 | }; -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/config-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | module.exports = utils.merge( 6 | require('./config-common'), 7 | {}, 8 | true 9 | ); -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | module.exports = utils.merge( 6 | require('./config-common'), 7 | { 8 | config: { 9 | events: { 10 | request: { 11 | home: { 12 | path: '/', 13 | methods: ['get'], 14 | view: { 15 | html: { 16 | body: { 17 | file: __dirname + '/index.jade' 18 | } 19 | } 20 | } 21 | } 22 | } 23 | } 24 | } 25 | }, 26 | true 27 | ); -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/index.jade: -------------------------------------------------------------------------------- 1 | p Try to execute in your browser console: danf.$('welcome --name world') 2 | p Try to execute in your server console: node danf $ welcome --name world -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/command-hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/cookie/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: __dirname + '/config-client.js', 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/feature/cookie/config-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | module.exports = utils.merge( 6 | require('./config-common'), 7 | { 8 | config: { 9 | events: { 10 | dom: { 11 | ready: { 12 | event: 'ready', 13 | sequences: [ 14 | { 15 | name: 'testCookie' 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } 22 | }, 23 | true 24 | ); -------------------------------------------------------------------------------- /test/functional/feature/cookie/config-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | classes: { 6 | cookieTester: require('./cookie-tester') 7 | }, 8 | services: { 9 | cookieTester: { 10 | class: 'cookieTester', 11 | properties: { 12 | _cookiesRegristry: '#danf:http.cookiesRegistry#' 13 | } 14 | } 15 | }, 16 | sequences: { 17 | testCookie: { 18 | operations: [ 19 | { 20 | service: 'cookieTester', 21 | method: 'process' 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /test/functional/feature/cookie/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var utils = require('../../../../lib/common/utils'); 4 | 5 | function CookieTester() { 6 | }; 7 | 8 | CookieTester.prototype.test = function() { 9 | this._cookiesRegristry.set('foo', 'bar'); 10 | }; 11 | 12 | module.exports = utils.merge( 13 | require('./config-common'), 14 | { 15 | config: { 16 | events: { 17 | request: { 18 | helloWorld: { 19 | path: '', 20 | methods: ['get'], 21 | sequences: [ 22 | { 23 | name: 'testCookie' 24 | } 25 | ], 26 | view: { 27 | html: { 28 | body: { 29 | file: __dirname + '/index.jade' 30 | } 31 | } 32 | } 33 | } 34 | } 35 | } 36 | } 37 | }, 38 | true 39 | ); -------------------------------------------------------------------------------- /test/functional/feature/cookie/cookie-tester.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = CookieTester; 4 | 5 | function CookieTester() { 6 | }; 7 | 8 | CookieTester.prototype.process = function() { 9 | var foo = this._cookiesRegristry.get('foo'); 10 | 11 | if ('undefined' !== typeof document) { 12 | if (foo === 'bar') { 13 | document.write('--- SUCCESS ---'); 14 | } else if (foo) { 15 | document.write('--- ERROR ---'); 16 | } 17 | 18 | this._cookiesRegristry.unset('foo'); 19 | } else { 20 | this._cookiesRegristry.set('foo', 'bar'); 21 | } 22 | }; -------------------------------------------------------------------------------- /test/functional/feature/cookie/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/cookie/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/cookie/index.jade: -------------------------------------------------------------------------------- 1 | span --- PENDING --- -------------------------------------------------------------------------------- /test/functional/feature/cookie/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/cookie/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/cookie/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: __dirname + '/config-client.js', 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/config-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | interfaces: { 6 | displayer: { 7 | methods: { 8 | display: {} 9 | } 10 | } 11 | }, 12 | classes: { 13 | displayer: require('./displayer') 14 | }, 15 | services: { 16 | displayer: { 17 | class: 'displayer', 18 | properties: { 19 | jquery: '#danf:vendor.jquery#' 20 | } 21 | } 22 | }, 23 | events: { 24 | dom: { 25 | helloWorld: { 26 | event: 'ready', 27 | sequences: [ 28 | { 29 | name: 'displayHelloWorld' 30 | } 31 | ] 32 | } 33 | } 34 | }, 35 | sequences: { 36 | displayHelloWorld: { 37 | operations: [ 38 | { 39 | service: 'displayer', 40 | method: 'display' 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | }; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | events: { 6 | request: { 7 | helloWorld: { 8 | path: '', 9 | methods: ['get'], 10 | view: { 11 | html: { 12 | body: { 13 | file: __dirname + '/index.jade' 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/displayer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Expose `Displayer`. 5 | */ 6 | module.exports = Displayer; 7 | 8 | /** 9 | * Initialize a new displayer. 10 | */ 11 | function Displayer() {} 12 | 13 | Displayer.defineImplementedInterfaces(['displayer']); 14 | 15 | Displayer.defineDependency('_jquery', 'function'); 16 | 17 | /** 18 | * Set jquery. 19 | * 20 | * @param {object} 21 | * @api public 22 | */ 23 | Object.defineProperty(Displayer.prototype, 'jquery', { 24 | set: function(jquery) { this._jquery = jquery; } 25 | }); 26 | 27 | /** 28 | * @interface {displayer} 29 | */ 30 | Displayer.prototype.display = function() { 31 | var $ = this._jquery; 32 | 33 | $('title').text('Hello World!'); 34 | $('body').html('
Hello World!
'); 35 | } -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/index.jade: -------------------------------------------------------------------------------- 1 | p Processing... 2 | p(style='color:grey;font-size:90%;font-style:italic;') Should display "Hello World!" if everything is ok. -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/dynamic-hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: {}, 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/feature/hello-world/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var danf = require('../../../..'); 4 | 5 | module.exports = { 6 | config: { 7 | events: { 8 | request: { 9 | helloWorld: { 10 | path: '/', 11 | methods: ['get'], 12 | view: { 13 | text: { 14 | value: 'Hello world!' 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/feature/hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: 'auto', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: 'auto', 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/config/server/config/events/request.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | helloWorld: { 5 | path: '', 6 | methods: ['get'], 7 | view: { 8 | html: { 9 | body: { 10 | file: '%rootPath%/index.jade' 11 | }, 12 | layout: { 13 | file: '%rootPath%/layout.jade' 14 | } 15 | } 16 | } 17 | } 18 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/config/server/config/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | 5 | module.exports = { 6 | rootPath: path.join(__dirname, '../../..') 7 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/index.jade: -------------------------------------------------------------------------------- 1 | span(id='hello') Processing... 2 | span(id='hello-space') 3 | br 4 | span(id='world', style='color:grey;font-size:90%;font-style:italic;') Should display "Hello World!" if everything is ok. 5 | span(id='world-exclamation') -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Hello World! 5 | 6 | link(rel='icon', type='image/png', href='favicon.png') 7 | link(rel='stylesheet', type='text/css', href='/-/hello/css/style.css') 8 | 9 | script. 10 | var require = { 11 | config: { 12 | app: { 13 | context: JSON.parse('!{_context}') || {} 14 | } 15 | } 16 | }; 17 | script(data-main='/app', src='/require', async) 18 | body(id='body') 19 | != _view.body -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/config/client/config/events/dom.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | hello: { 5 | event: 'ready', 6 | selector: '#hello', 7 | sequences: [ 8 | { 9 | name: 'display', 10 | input: { 11 | content: 'Hello' 12 | } 13 | } 14 | ] 15 | }, 16 | space: { 17 | event: 'ready', 18 | selector: '#hello-space', 19 | sequences: [ 20 | { 21 | name: 'display', 22 | input: { 23 | content: require('space/index') 24 | } 25 | } 26 | ] 27 | } 28 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/config/client/config/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | displayer: { 5 | methods: { 6 | display: { 7 | arguments: ['object/target', 'string/content'] 8 | } 9 | } 10 | } 11 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/config/client/config/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | display: { 5 | stream: { 6 | content: { 7 | type: 'string', 8 | required: true 9 | } 10 | }, 11 | operations: [ 12 | { 13 | order: 0, 14 | service: 'displayer', 15 | method: 'display', 16 | arguments: [ 17 | '!event.target!', 18 | '@content@' 19 | ] 20 | } 21 | ] 22 | } 23 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/config/client/config/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | displayer: { 5 | class: 'displayer', 6 | properties: { 7 | jquery: '#danf:vendor.jquery#' 8 | } 9 | } 10 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/lib/client/displayer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Displayer; 4 | 5 | function Displayer() { 6 | } 7 | 8 | Displayer.defineImplementedInterfaces(['displayer']); 9 | 10 | Displayer.defineDependency('_jquery', 'function'); 11 | 12 | Object.defineProperty(Displayer.prototype, 'jquery', { 13 | set: function(jquery) { this._jquery = jquery; } 14 | }); 15 | 16 | Displayer.prototype.display = function(target, content) { 17 | var $ = this._jquery; 18 | 19 | $(target).removeAttr('style').text(content); 20 | } -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/node_modules/space/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = ' '; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/hello/resource/public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: green; 3 | } -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = {}; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/world/node_modules/exclamation/core/content.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = '!'; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/node_modules/world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "hello": "1.0.0", 6 | "world": "1.0.0" 7 | } 8 | } -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/parameters-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/proto-hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: __dirname + '/config-server.js', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: {}, 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/config-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | config: { 5 | events: { 6 | request: { 7 | helloWorld: { 8 | path: '', 9 | methods: ['get'], 10 | view: { 11 | html: { 12 | body: { 13 | file: __dirname + '/index.jade' 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/index.jade: -------------------------------------------------------------------------------- 1 | p Hello World! -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | } 6 | } -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/feature/static-hello-world/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /test/functional/proto/app/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /test/functional/proto/app/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | 4 | pids 5 | *.pid 6 | *.seed 7 | 8 | lib-cov 9 | 10 | coverage 11 | 12 | .grunt 13 | 14 | build/Release 15 | 16 | /node_modules 17 | 18 | .lock-wscript 19 | 20 | /.built -------------------------------------------------------------------------------- /test/functional/proto/app/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - 'iojs' 5 | - '0.10' 6 | - '0.12' 7 | - '4.2' 8 | - '5.0' 9 | script: 'make test' 10 | -------------------------------------------------------------------------------- /test/functional/proto/app/LICENSE: -------------------------------------------------------------------------------- 1 | Open Source Initiative OSI - The MIT License 2 | 3 | http://www.opensource.org/licenses/mit-license.php 4 | 5 | Copyright (c) <%= date.year %> <%= author.name %> 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/functional/proto/app/Makefile: -------------------------------------------------------------------------------- 1 | MOCHA_OPTS = --check-leaks 2 | REPORTER = dot 3 | 4 | check: test 5 | 6 | test: test-app 7 | 8 | test-app: 9 | # App 10 | @NODE_ENV=test ./node_modules/.bin/mocha \ 11 | --reporter $(REPORTER) \ 12 | --timeout 5000 \ 13 | --recursive \ 14 | $(MOCHA_OPTS) \ 15 | test/unit/* -------------------------------------------------------------------------------- /test/functional/proto/app/README.md: -------------------------------------------------------------------------------- 1 | <%= repository.name %> 2 | ====================== 3 | 4 | <%= app.description %> 5 | 6 | Use as a danf module 7 | -------------------- 8 | 9 | Add the module to your `package.json`: 10 | ```json 11 | { 12 | ... 13 | "dependencies": { 14 | ..., 15 | "<%= repository.name %>": "*" 16 | }, 17 | ... 18 | } 19 | ``` 20 | 21 | Then, install this new dependency: 22 | ```sh 23 | $ npm install 24 | ``` 25 | 26 | Use as an application 27 | --------------------- 28 | 29 | Start the server with the command: 30 | ```sh 31 | $ node app-dev 32 | ``` 33 | 34 | You should be able to test the application at `http://localhost:3080`. 35 | 36 | > Use `app-prod` to start the server in prod environment. 37 | 38 | Execute tests 39 | ------------- 40 | 41 | ```sh 42 | $ make test 43 | ``` -------------------------------------------------------------------------------- /test/functional/proto/app/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: 'auto', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: 'auto', 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/app-prod.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: 'auto', 6 | context: { 7 | environment: 'prod', 8 | debug: false, 9 | verbosity: 1 10 | } 11 | }, 12 | client: { 13 | configuration: 'auto', 14 | context: { 15 | environment: 'prod', 16 | debug: false, 17 | verbosity: 1, 18 | secret: 'test' 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/events/dom.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/events/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/oop.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/sequencing.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/dependency-injection.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/config/this.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/client/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/events/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/events/request.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/oop.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/sequencing.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/dependency-injection.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/config/this.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/common/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/events/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/events/request.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/events.md 5 | */ 6 | module.exports = { 7 | home: { 8 | path: '/', 9 | methods: ['get'], 10 | view: { 11 | html: { 12 | layout: { 13 | file: '%view.path%/layout.jade' 14 | }, 15 | body: { 16 | file: '%view.path%/index.jade' 17 | } 18 | } 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/oop.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | var path = require('path'), 7 | fs = require('fs') 8 | ; 9 | 10 | /** 11 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 12 | */ 13 | module.exports = { 14 | view: { 15 | path: fs.realpathSync( 16 | path.join(__dirname, '../../../resource/private/view') 17 | ) 18 | } 19 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/sequences.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/sequencing.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/dependency-injection.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/config/this.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/config/server/contract.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/configuration.md 5 | */ 6 | module.exports = { 7 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/proto/app/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/proto/app/lib/client/.gitkeep: -------------------------------------------------------------------------------- 1 | .gitkeep -------------------------------------------------------------------------------- /test/functional/proto/app/lib/common/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/app/lib/common/.gitkeep -------------------------------------------------------------------------------- /test/functional/proto/app/lib/server/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/app/lib/server/.gitkeep -------------------------------------------------------------------------------- /test/functional/proto/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "repository.name", 3 | "description": "app.description", 4 | "version": "0.0.0", 5 | "author": { 6 | "name": "author.name", 7 | "email": "author.email", 8 | "url": "author.url" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "author.name", 13 | "email": "author.email", 14 | "url": "author.url" 15 | } 16 | ], 17 | "dependencies": { 18 | "danf": "*" 19 | }, 20 | "devDependencies": { 21 | "mocha": "~2.2", 22 | "supertest": "~1.0" 23 | }, 24 | "keywords": [ 25 | "danf", 26 | "module", 27 | "app.name" 28 | ], 29 | "repository": "git://github.com/repository.username/repository.name", 30 | "scripts": { 31 | "test": "make test" 32 | }, 33 | "engines": { 34 | "node": "*" 35 | }, 36 | "licence": "MIT" 37 | } -------------------------------------------------------------------------------- /test/functional/proto/app/parameters-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/app/resource/private/view/index.jade: -------------------------------------------------------------------------------- 1 | h1 Hi <%= author.name %>! 2 | 3 | p Welcome! Hope you will have fun developing with Danf! -------------------------------------------------------------------------------- /test/functional/proto/app/resource/private/view/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title <%= app.name %> 5 | 6 | link(rel='icon', type='image/png', href='favicon.png') 7 | link(rel='stylesheet', type='text/css', href='/-/repository.name/css/style.css') 8 | 9 | script. 10 | var require = { 11 | config: { 12 | app: { 13 | context: JSON.parse('!{_context}') || {} 14 | } 15 | } 16 | }; 17 | script(data-main='/app', src='/require', async) 18 | body(id='body') 19 | != _view.body -------------------------------------------------------------------------------- /test/functional/proto/app/resource/public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Verdana; 3 | } 4 | 5 | h1 { 6 | color: #0C81A8; 7 | } -------------------------------------------------------------------------------- /test/functional/proto/app/resource/public/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/app/resource/public/img/favicon.png -------------------------------------------------------------------------------- /test/functional/proto/app/test/fixture/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/app/test/fixture/.gitkeep -------------------------------------------------------------------------------- /test/functional/proto/app/test/functional/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/app/test/functional/.gitkeep -------------------------------------------------------------------------------- /test/functional/proto/app/test/unit/test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/core/testing.md 5 | */ 6 | var assert = require('assert'); 7 | 8 | describe('This test', function() { 9 | it('should be ok', function() { 10 | assert(true); 11 | }) 12 | }) -------------------------------------------------------------------------------- /test/functional/proto/overview/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /test/functional/proto/overview/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /test/functional/proto/overview/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | 4 | pids 5 | *.pid 6 | *.seed 7 | 8 | lib-cov 9 | 10 | coverage 11 | 12 | .grunt 13 | 14 | build/Release 15 | 16 | /node_modules 17 | 18 | .lock-wscript 19 | 20 | /.built -------------------------------------------------------------------------------- /test/functional/proto/overview/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - 'iojs' 5 | - '0.10' 6 | - '0.12' 7 | - '4.2' 8 | - '5.0' 9 | script: 'make test' 10 | -------------------------------------------------------------------------------- /test/functional/proto/overview/LICENSE: -------------------------------------------------------------------------------- 1 | Open Source Initiative OSI - The MIT License 2 | 3 | http://www.opensource.org/licenses/mit-license.php 4 | 5 | Copyright (c) 2015 Thomas Prelot 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/functional/proto/overview/Makefile: -------------------------------------------------------------------------------- 1 | MOCHA_OPTS = --check-leaks 2 | REPORTER = dot 3 | 4 | check: test 5 | 6 | test: test-app 7 | 8 | test-app: 9 | # App 10 | @NODE_ENV=test ./node_modules/.bin/mocha \ 11 | --reporter $(REPORTER) \ 12 | --timeout 5000 \ 13 | --recursive \ 14 | $(MOCHA_OPTS) \ 15 | test/unit/* -------------------------------------------------------------------------------- /test/functional/proto/overview/README.md: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | This is the code of the overview of a danf application/module. 5 | 6 | Install the dependencies: 7 | ```sh 8 | $ npm install 9 | ``` 10 | 11 | Start the server: 12 | ```sh 13 | $ node app-prod 14 | ``` 15 | 16 | You should be able to test the application at `http://localhost:3080`. -------------------------------------------------------------------------------- /test/functional/proto/overview/app-dev.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: 'auto', 6 | context: {} 7 | }, 8 | client: { 9 | configuration: 'auto', 10 | context: {} 11 | } 12 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/app-prod.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | server: { 5 | configuration: 'auto', 6 | context: { 7 | environment: 'prod', 8 | debug: false, 9 | verbosity: 1 10 | } 11 | }, 12 | client: { 13 | configuration: 'auto', 14 | context: { 15 | environment: 'prod', 16 | debug: false, 17 | verbosity: 1, 18 | secret: 'test' 19 | } 20 | } 21 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/config/client/config/events/dom.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | // Define a (jquery) dom event. 5 | ready: { 6 | event: 'ready', 7 | sequences: [ 8 | { 9 | name: 'compute' 10 | } 11 | ] 12 | } 13 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/config/common/config/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | // Define an interface. 5 | processor: { 6 | // Define the methods of the interface. 7 | methods: { 8 | // Define a method with its arguments and return value types. 9 | // '/value' is used for readability and debugging only. 10 | process: { 11 | arguments: ['number/value'], 12 | returns: 'number' 13 | } 14 | }, 15 | // Define the getters of the interface. 16 | getters: { 17 | order: 'number' 18 | } 19 | } 20 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/config/server/config/events/request.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | // Define a request. 5 | home: { 6 | // Define the path of the request. 7 | path: '/', 8 | // Define the available HTTP methods. 9 | methods: ['get'], 10 | // Link the sequences. 11 | sequences: [ 12 | { 13 | name: 'compute', 14 | output: { 15 | result: '@result@' 16 | } 17 | } 18 | ], 19 | // Define the view. 20 | view: { 21 | html: { 22 | layout: { 23 | file: '%view.path%/layout.jade' 24 | }, 25 | body: { 26 | file: '%view.path%/index.jade' 27 | } 28 | } 29 | } 30 | } 31 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/config/server/config/parameters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | var path = require('path'), 7 | fs = require('fs') 8 | ; 9 | 10 | /** 11 | * @see https://github.com/gnodi/danf/blob/master/resource/private/doc/documentation/configuration.md 12 | */ 13 | module.exports = { 14 | view: { 15 | path: fs.realpathSync( 16 | path.join(__dirname, '../../../resource/private/view') 17 | ) 18 | } 19 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/danf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../danf'); -------------------------------------------------------------------------------- /test/functional/proto/overview/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'), 4 | Gulp = require('../../../../gulp') 5 | ; 6 | 7 | new Gulp(gulp); 8 | 9 | module.exports = gulp; -------------------------------------------------------------------------------- /test/functional/proto/overview/lib/common/processor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = Processor; 4 | 5 | function Processor() { 6 | } 7 | 8 | // Define the interfaces implemented by the class. 9 | Processor.defineImplementedInterfaces(['processor']); 10 | 11 | Processor.defineDependency('_order', 'number'); 12 | Processor.defineDependency('_operand', 'number'); 13 | Processor.defineDependency('_operation', 'function'); 14 | 15 | Object.defineProperty(Processor.prototype, 'order', { 16 | get: function() { return this._order; }, 17 | set: function(order) { this._order = order; } 18 | }); 19 | 20 | Object.defineProperty(Processor.prototype, 'operand', { 21 | get: function() { return this._operand; }, 22 | set: function(operand) { this._operand = operand; } 23 | }); 24 | 25 | Object.defineProperty(Processor.prototype, 'operation', { 26 | get: function() { return this._operation; }, 27 | set: function(operation) { this._operation = operation; } 28 | }); 29 | 30 | Processor.prototype.process = function(value) { 31 | return this._operation(value, this._operand); 32 | } -------------------------------------------------------------------------------- /test/functional/proto/overview/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "danf-overview", 3 | "description": "Code of the overview of a danf application/module", 4 | "version": "0.0.0", 5 | "author": { 6 | "name": "Thomas Prelot", 7 | "email": "tprelot@gmail.com", 8 | "url": "https://github.com/Gnucki" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Thomas Prelot", 13 | "email": "tprelot@gmail.com", 14 | "url": "https://github.com/Gnucki" 15 | } 16 | ], 17 | "dependencies": { 18 | "danf": "*" 19 | }, 20 | "devDependencies": { 21 | "mocha": "~2.2", 22 | "supertest": "~1.0" 23 | }, 24 | "keywords": [ 25 | "danf", 26 | "module", 27 | "overview" 28 | ], 29 | "scripts": { 30 | "test": "make test" 31 | }, 32 | "engines": { 33 | "node": "*" 34 | }, 35 | "licence": "MIT" 36 | } -------------------------------------------------------------------------------- /test/functional/proto/overview/parameters-client.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/parameters-common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/parameters-server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | }; -------------------------------------------------------------------------------- /test/functional/proto/overview/resource/private/view/index.jade: -------------------------------------------------------------------------------- 1 | h1 Overview 2 | 3 | p Here is the output of the server computations: 4 | 5 | ul 6 | li= 'Simple: ' + JSON.stringify(result.simple) 7 | li= 'Unpredictable: ' + JSON.stringify(result.unpredictable) 8 | li= 'Parallel: ' + JSON.stringify(result.parallel) 9 | li= 'Series: ' + JSON.stringify(result.series) 10 | li= 'Collection: ' + JSON.stringify(result.collection) 11 | 12 | p Take a look at your console to see the client computations! -------------------------------------------------------------------------------- /test/functional/proto/overview/resource/private/view/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title Overview 5 | 6 | link(rel='icon', type='image/png', href='favicon.png') 7 | link(rel='stylesheet', type='text/css', href='/-/overview/css/style.css') 8 | 9 | script. 10 | var require = { 11 | config: { 12 | app: { 13 | context: JSON.parse('!{_context}') || {} 14 | } 15 | } 16 | }; 17 | script(data-main='/app', src='/require', async) 18 | body(id='body') 19 | != _view.body -------------------------------------------------------------------------------- /test/functional/proto/overview/resource/public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Verdana; 3 | } 4 | 5 | h1 { 6 | color: #0C81A8; 7 | } -------------------------------------------------------------------------------- /test/functional/proto/overview/resource/public/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnodi/danf/b785f97f9ebaec569f14674f47d515ce6717708c/test/functional/proto/overview/resource/public/img/favicon.png -------------------------------------------------------------------------------- /test/unit/command/event/notifier/command.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../../../lib/common/init'); 4 | 5 | var assert = require('assert'), 6 | exec = require('child_process').exec, 7 | path = require('path') 8 | ; 9 | 10 | describe('Command notifier', function() { 11 | it('should be able to process a command', function(done) { 12 | exec( 13 | 'node danf $ test --silent --env test --foo bar --bar 1 2 3 --foobar foo bar', 14 | { 15 | cwd: path.join(__dirname, '../../../../fixture/command') 16 | }, 17 | function(err, stdout, stderr) { 18 | if (stderr) { 19 | err = new Error(stderr.toString('utf8')); 20 | } 21 | if (err) { 22 | throw err; 23 | } 24 | 25 | assert.equal( 26 | stdout.toString('utf8').replace("\r", '').replace("\n", ''), 27 | 'foo bar bar 6' 28 | ); 29 | 30 | done(); 31 | } 32 | ); 33 | }) 34 | }) -------------------------------------------------------------------------------- /test/unit/http/cookies-registry.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../lib/common/init'); 4 | 5 | var assert = require('assert'), 6 | request = require('supertest'), 7 | danf = require('../../../lib/server/app')(require('../../fixture/http/danf'), null, {environment: 'test', verbosity: 0, cluster: null}) 8 | ; 9 | 10 | danf.buildServer(function(app) { 11 | describe('SessionHandler', function() { 12 | it('should allow to get and set cookies', function(done) { 13 | request(app) 14 | .get('/cookie') 15 | .expect(204) 16 | .end(function(err, res) { 17 | if (err) { 18 | if (res) { 19 | console.log(res.text); 20 | } else { 21 | console.log(err); 22 | } 23 | 24 | throw err; 25 | } 26 | 27 | done(); 28 | }) 29 | ; 30 | }) 31 | }) 32 | }); -------------------------------------------------------------------------------- /test/unit/manipulation/callback-executor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('../../../lib/common/init'); 4 | 5 | var assert = require('assert'), 6 | CallbackExecutor = require('../../../lib/common/manipulation/callback-executor') 7 | ; 8 | 9 | var callbackExecutor = new CallbackExecutor(); 10 | 11 | describe('CallbackExecutor', function() { 12 | it('should execute a callback', function() { 13 | var result = callbackExecutor.execute( 14 | function(i, j) { 15 | return i + j; 16 | }, 17 | 2, 18 | 3 19 | ); 20 | 21 | assert.equal(result, 5); 22 | }) 23 | }) --------------------------------------------------------------------------------