Giter Site home page Giter Site logo

cafe's People

Contributors

alexmost avatar bbuz avatar brabadu avatar eugenen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bbuz

cafe's Issues

Error when the modules in a recipe, empty.

Build command:

cafe --nologo build --app_root=./cs/ --build_root=./public/js/

Error message:

Target factory> Exception raised while executing target `build`: 'TypeError: Cannot read property 'length' of undefined'

Debug:

Target factory> Exception raised while executing target `build`: 'TypeError: Cannot read property 'length' of undefined'
[DEBUG]Target factory> TypeError: Cannot read property 'length' of undefined
    at resolve_deps (/usr/lib/node_modules/cafe/lib-js/lib/bundler.js:30:32)
    at bundles.map.toposort.realm (/usr/lib/node_modules/cafe/lib-js/targets/build.js:98:40)
    at Array.map (native)
    at /usr/lib/node_modules/cafe/lib-js/targets/build.js:87:41
    at Array.map (native)
    at runner0 (/usr/lib/node_modules/cafe/lib-js/targets/build.js:84:37)
    at _asyncMap (/usr/lib/node_modules/cafe/node_modules/async/lib/async.js:185:13)
    at async.forEach (/usr/lib/node_modules/cafe/node_modules/async/lib/async.js:86:13)
    at Array.forEach (native)
    at _forEach (/usr/lib/node_modules/cafe/node_modules/async/lib/async.js:26:24)
[DEBUG]Cafe> Error from task
Cafe> Coffee brewed in <0.306 seconds> at Thu Oct 11 2012 13:01:56 GMT+0300 (EEST)

broken linking to index file in npm modules

when npm module has main file with the name index.js and is located in some internal folder (for instance lib-js/index.js). cafe doesn't create link for this index file, so we can't do require module by it's name.

add static type to module

if module is static it will be not bundled in general bundle. It will be compiled as a separate file.

Crash when running compile --src=...path

When i tried to launch compile process by passing only src param - recieved such responce :

Compile> No adaptor found to compile module undefined % undefined

Add to default ignores temporary "build" in app_root

During build cafe places compiled modules to ./app_root/build.

Since we're watching for changes in ./app_root this makes cafe restart build process, if we don't add special parameter "skip" for watcher.

I think we should make it skip "build" folder by default or move temporary build folder out of ./app_root.

setting up client application.

Provide command to cafe, such as "cafe init csapp".
This command will accept app_root as a parameter and initialize such structure in app_root

csapp/
/domain
/jslib
recipe.json
Menufile

Also it will fill Menu file with basic "build" and "watch" commands(with injected app_root).
recipe.json will have some basic init structure.

launching modules tests

When tried to compile spine-app module with -t - recieved a message

Test folder is not set /home/ypiskun/workspace/uaprom_default/uaprom/uaprom/cs/domain/ShoppingCart

--build_root

Do not create a folder build, because the path to the result of the compiling is already specified in the command --build_root.

Build dir

During compiling, the application should automatically create a folder build for spine app's.

adapters refactoring

Need to refactor adapters to make them independent standalone modules, to be able to use them as plugins to cafe.

  1. Remove require defs from adapter.
  2. Move cafe utils to separate standalone npm module, put it to adapter dependencies.
  3. Connect adapters as plugins.

Clean old logger logic

In project we have three type of loggers ( logger, ui logger, and ctx.fb) I think we must deal with this and remove unused parts of old loggers code.

bash completion for cafe

Create script for bash completion. (commands, packages, libs e.t.c). Will be useful if cafe will be modular.

XXX

  1. Make dna bootstrapper a standalone npm module, put alongside of dna.
  2. Add "bootstrapper" property to the recipe.
  3. Make cafe require the configured bootstrapper
  4. Make bootstrapper hooks in adaptors and bundler
  5. Make adapters to use bootstrap module wrapper in an optional manner.
  6. Bootsrapper itself should contain templates for module and bundle wrappers and also provide 2 interface methods: wrap module, wrap_bundle for use in respective cafe's hooks.

plugin system for compilers and adapters.

Idea is to create plugin system for adding new adapters and compilers to cafe. As i see it for now there must be some config file for included adapters. Something like

[compilers]
coffee = cafe_default_compiler
js = cafe_default_compiler
erl = my_erl_compiler

[adapters]
spine = cs_module_adaptor
backbone = my_custom_backbone adaptor

For instance some end user will install cafe, and want to add icedcoffeescript compilation possiblility. Then he can read our documentation about plugins and adapters interface, create own npm module and include it in config

[compilers]
coffee = my_awesome_iced_compiler
...

The same can be done also for modules adapters.

проблема с добавлением нового бандла

А еще есть проблема с кешем. У меня изначально был один bundle, я скомпилировал с форсом, потом добавил еще один bundle и у меня ошибка:
/usr/lib/node_modules/cafe4/lib-js/targets/build.js:275
if (build_deps && (build_deps[realm][bundles[index].name] != null)) {
^
TypeError: Cannot read property 'core' of undefined
at build_bundle_wrapper (/usr/lib/node_modules/cafe4/lib-js/targets/build.js:275:43)
at _asyncMap (/usr/lib/node_modules/cafe4/node_modules/async/lib/async.js:219:13)
at async.forEach (/usr/lib/node_modules/cafe4/node_modules/async/lib/async.js:99:13)
at Array.forEach (native)
at _forEach (/usr/lib/node_modules/cafe4/node_modules/async/lib/async.js:32:24)
at async.forEach (/usr/lib/node_modules/cafe4/node_modules/async/lib/async.js:98:9)
at _asyncMap (/usr/lib/node_modules/cafe4/node_modules/async/lib/async.js:218:9)
at Object.doParallel as map
at build_bundles (/usr/lib/node_modules/cafe4/lib-js/targets/build.js:348:18)
at process_realm (/usr/lib/node_modules/cafe4/lib-js/targets/build.js:364:16)

Приходится удалять папку build

build failure

Cafe> Re-entering with '--nologo --noupdate --debug --nocolor build --app_root=uaprom/cs --build_root=uaprom/public/js --formula=recipe-dev.json'
Cafe>
Cafe> /usr/lib/node_modules/cafe4/node_modules/resolve/lib/async.js:91
var dir = path.resolve(x, pkg.main);
^
Cafe> TypeError: Cannot read property 'main' of undefined
at /usr/lib/node_modules/cafe4/node_modules/resolve/lib/async.js:91:54
at load (/usr/lib/node_modules/cafe4/node_modules/resolve/lib/async.js:54:43)
at /usr/lib/node_modules/cafe4/node_modules/resolve/lib/async.js:60:22
at /usr/lib/node_modules/cafe4/node_modules/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:107:15)
Cafe> Re-enter finished with code 8

cafe clear

Provide new command for clearing cache, node_modules folder, and build folder.

compile adaptor not found when watch

I created test dir - tmp with plain coffee file. cafe compiles it to 'build' dir with command
cafe --debug compile --src=../tmp/test.coffee --js_path=../build
and that works.

But when i am adding watch to sequence:

bin/cafe --debug watch --src=../tmp/ compile --src=../tmp/test.coffee --js_path=../build

i saw this in terminal output :

I/CLI> Started growing Coffee on the plantation '../tmp/'
UI/CLI> Watching how coffee is growing
UI/CLI> Press Ctrl-c to stop watching.
UI/CLI> UI/CLI> No adaptor found
UI/CLI> UI/CLI> Error encountered: adaptor_error
UI/CLI> undefined
UI/CLI> UI/CLI> Coffee 191815ce-669d-466c-a350-2b0177ff5929 brewed in <0.315 seconds> at Wed Oct 17 2012 16:43:19 GMT-0500 (CDT)
UI/CLI> UI/CLI> Cafe was open 0.316s
UI/CLI> === Watch cycle sequence failed with code 2 ===========

If i am making some changes in test.coffee it rebuilds the file, and everything works properly.

cafe watch fails when rebuilding module with cake file.

Tried to build cafe in cafe. In first build sequence everything works properly, but after changing some files it craches with "adaptor not found"

UI/CLI> Coffee cafe/src/adaptors/cake_cafebuild_module.coffee is cold. Preparing new...
UI/CLI> UI/CLI> No adaptor found
UI/CLI> UI/CLI> Error encountered: adaptor_error
UI/CLI> undefined
UI/CLI> UI/CLI> Coffee 1f46e854-d61a-4c7b-82c6-0f9c5a7531c0 brewed in <0.314 seconds> at Mon Oct 22 2012 22:20:22 GMT+0300 (EEST)
UI/CLI> UI/CLI> Cafe was open 0.316s
UI/CLI> === Watch cycle sequence failed with code 2 ===========

adding aliases to modules

Implement that by default all modules are required by their name, and add possibility to create some kind of aliases for them.

aliases to modules

It would be great if instead of writing relative path to some js-libs in recipe.json - we could define somewhere alias for some js-lib, or group of modules.
This will allow us to change file version of some js-lib without touching recipe file.

cafe internal settings

Store local settings for separate project.

  • app_root
  • build_root
  • path to recipe.json

This file can be placed in .cafe folder inside project root.

Having this in local settings we may omit those parameters in commands. This is not so necessary for existing functionality (build, watch), but it may be useful when we will want to do something like this :

cafe install js-lib jquery

cafe create spine-app omgapp

cafe js-libs :
/* here is list */

cafe spine-apps
/* here spine aps */

cafe aliases:
lib - alias

strange error ... Cafe> TypeError: path must be a string

Cafe> /usr/lib/node_modules/npm/node_modules/lockfile/lockfile.js:46
Cafe> throw er

Cafe> ^
Cafe> TypeError: path must be a string
at Object.fs.open (fs.js:418:11)
at Object.fs.readFile (fs.js:206:6)
at _m_read_package_json (/usr/lib/node_modules/cafe4/lib-js/adapters/npm_adapter/adapter.js:116:21)
at h (/usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:284:18)
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:254:30
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:236:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/node_modules/libmonad/index.js:253:18
at /usr/lib/node_modules/cafe4/lib-js/adapters/npm_adapter/adapter.js:395:14
at /usr/lib/node_modules/cafe4/lib-js/adapters/npm_adapter/adapter.js:68:16
at /usr/lib/node_modules/cafe4/third-party-lib/resolve/lib/async.js:35:26
at main_file_is_dir_load_index_cb (/usr/lib/node_modules/cafe4/third-party-lib/resolve/lib/async.js
💯44)
at load (/usr/lib/node_modules/cafe4/third-party-lib/resolve/lib/async.js:54:43)
at /usr/lib/node_modules/cafe4/third-party-lib/resolve/lib/async.js:60:22
at /usr/lib/node_modules/cafe4/third-party-lib/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:107:15)
Cafe> Re-enter finished with code 7

internal cafe settings (.cafe/)

Create internal settings folder (.cafe) for storing some local project settings. There we can store MenuFile, aliases file, some configs. e. t. c.

This folder may be added on initialization of out client app.

This enchansment may be done with task #12.

npm nested modules

wrong linking when npm module has nested modules and they are trying to access some files by relative path.

npm paths issues etc

cafe build --app_root=cs --build_root=public --formula=recipe.yaml -u -f

npm ERR! install Couldn't read dependencies
Cafe> Error encountered: Module compile error. Module - idom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.