eugenen / cafe Goto Github PK
View Code? Open in Web Editor NEWA build tool for client-side applications aiming to be language/module system/architecture agnostic and flexible.
A build tool for client-side applications aiming to be language/module system/architecture agnostic and flexible.
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)
Link listed under readme section points to nonexistent address
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.
if module is static it will be not bundled in general bundle. It will be compiled as a separate file.
pass app_root and build root as params
cafe update fails if npm module not installed with build
For now if coffeescript compiler fails - there will be no information about line number e. t. c. Use coffeescript pretty error message formating.
When i tried to launch compile process by passing only src param - recieved such responce :
Compile> No adaptor found to compile module undefined % undefined
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.
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.
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
Fill this page
Does not compile until remove the .cafe.
rebuild if can't read the cache file.
Do not create a folder build
, because the path to the result of the compiling is already specified in the command --build_root.
Coffee brewed in NaN seconds at ...
During compiling, the application should automatically create a folder build for spine app's.
Need to refactor adapters to make them independent standalone modules, to be able to use them as plugins to cafe.
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.
Create script for bash completion. (commands, packages, libs e.t.c). Will be useful if cafe will be modular.
subj.
Show current time after each build.
Handle 'help' return status, and fire success notification.
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.
add livereload support for cafe.
А еще есть проблема с кешем. У меня изначально был один 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
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
Provide new command for clearing cache, node_modules folder, and build folder.
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.
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 ===========
launch cafe as cluster, forking each separate bundle.
Implement that by default all modules are required by their name, and add possibility to create some kind of aliases for them.
refactor coffeescript, eco and js compile functions.
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.
chokidar - https://github.com/paulmillr/chokidar. Seems it's more reliable way of watching file changes. Besides it gives us opportunity to handle situations when some files are add or deleted.
Store local settings for separate project.
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
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
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.
wrong linking when npm module has nested modules and they are trying to access some files by relative path.
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
adding possibility to store menu file in yaml format
If I have syntax errors in eco or coffeescript, upon building, "Cafe success :)" message is shown instead of error message.
Add optional support for growl notification. Will be useful to notify when compilation failed. https://github.com/visionmedia/node-growl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.