Every repository with this icon (
Every repository with this icon (
| Description: | A JavaScript standard library, package manager, and more. edit |
-
3 comments Created 2 months ago by tolmaskyattn:kriskowalxbugxneeds-testsxpull-requestxFILE.relative returns different values depending on trailing slashup-for-grabsxFILE.relative("a", "a/b/c") => a/b/c
FILE.relative("a/", "a/b/c") => b/c (correct)Comments
-
8 comments Created 2 months ago by tolmaskyattn:kriskowalxbugxbug-verifiedxneeds-testsxpull-requestxre-fsxFILE.dirname returns incorrect results depending on trailing slashup-for-grabsxirb:
File.dirname("/Users/tolmasky") => "/Users"
File.driname("/Users/tolmasky/") => "/Users"narwhal:
File.dirname("/Users/tolmasky") => "/Users"
File.driname("/Users/tolmasky/") => "/Users/tolmasky"Comments
tlrobinson
Fri Sep 25 01:15:23 -0700 2009
| link
This one definitely seems like a bug. Assuming for a moment we want to retain the "trailing slash denotes a directory" behavior (I'm not sure if we do) shouldn't dirname return the parent directory of the path passed in, regardless of whether or not it's a directory? (and it should end with a trailing slash since we know the parent is definitely a directory)
This is definitely a bug. We probably should take the tolerant of input, strict of output approach. Let's add the trailing slash for all dirname results, but ignore the terminal slash for the input. Good idea.
tlrobinson
Fri Oct 16 17:05:14 -0700 2009
| link
I agree I don't think we should continue using the trailing slash to make assumptions about whether it's a directory or not.
Related: tlrobinson/narwhal#47
nevilleburnell
Mon Oct 26 19:05:58 -0700 2009
| link
Added initial tests for dirname()
http://github.com/cloudwork/narwhal/commit/5cc3fc003a8b8e1bc7d8d6b4aa760ff7f04ce9c6
tlrobinson
Mon Oct 26 19:21:07 -0700 2009
| link
tests/commonjs/file/dirname.js has some dirname tests
nevilleburnell
Mon Oct 26 19:41:09 -0700 2009
| link
And one more test case
http://github.com/cloudwork/narwhal/commit/ad9f667723955e27eb49eea4f28df0c50e8e9ad9
nevilleburnell
Mon Oct 26 19:42:16 -0700 2009
| link
oops
thanks
nevilleburnell
Mon Oct 26 19:51:31 -0700 2009
| link
moved test cases to tests/commonjs/file/dirname.js
http://github.com/cloudwork/narwhal/commit/ead86151ef55fa755547e0cc6afe71c0e45c9c51
-
1 comment Created 4 months ago by kriskowal0.2xattn:tlrobinsonxattn:tolmaskyx[file] Globneeds-testsxComplete or replace the implementation of "glob". Construct a unit test suite for "glob".
Comments
Work committed toward completion of the "glob" implementation. Still needs tests:
http://github.com/kriskowal/narwhal/tree/976c79420ccf1b597f475ade8fbe56ff4c61b1c7
http://github.com/kriskowal/narwhal/commit/7eef0ee254993cebd7d8a046a87d547e6217ff52
-
0 comments Created 4 months ago by kriskowal1.0xattn:kriskowalxAutonomous Virtual Environment Package Installationre-tuskxRefactor "tusk" so that packages can be installed in an autonomous virtual environment, as would be the case for a war/WEB-INF for Google AppEngine. "tusk install" and "tusk reheat" should have options to install packages in a virtual environment regardless of whether they have already been installed elsewhere on the module search path.
Comments
-
Add a feature or refactor "tusk" such that packages can be installed in a virtual environment in a "lean" fashion, meaning that only the essential directory trees are installed. This will become necessary for quota-encumbered virtual environments like war/WEB-INF for Google AppEngine.
Installing lean packages should be an option for both "tusk install" and "tusk reheat", which would install all packages in a lean fashion from the missing transitive dependencies in the package.json for the virtual environment.
Package maintainers would have the option of specifying in their "package.json" which directories are necessary for autonomous functionality, as a white list, usually omitting such directories as "tests", "examples", "docs", and "src". The default behavior would be to install all files.
Comments
It occurs to me that packages that have a build step will need to download everything, build, then install. To that end, perhaps "lean" needs to, rather than installing lean in the virtual environment, copy the lean directories or files to the lean virtual environment.
-
Refactor the sandboxing module such that file system module loaders can discover a canonical top level identifier for any give path and the module search paths by discovering whether the module's path is within any of the module search paths and using the shortest possible route to reconstruct the corresponding top level identifier.
For example, given that the module search path is ["/usr/lib/js/packages/jack/lib", "/usr/lib/js"], the top level id for "/foo.js" would be the absolute id, "/foo.js", whereas the top level id, reverse engineered from the path to the program module given at the command line, for a path of "/usr/lib/js/packages/jack/lib/jackup.js" would be merely "jackup".
This feature would resolve the infrequent occurrence of reloading a cyclic dependency within the program module or modules loaded relatively therefrom.
Comments
-
0 comments Created 4 months ago by kriskowal[args] Option and Argument Interleaving1.0xAdd support to the
argsmodule for options interleaved among arguments, preserving the respective execution order of the argument actions and option actions. Presently, all options must be specified before any arguments, as in:tusk clone --user kriskowal --owner nitroAs opposed to the following terminal option syntax that is not yet supported:
tusk install nitro --forceComments
-
Implement support for package versions in Tusk. Add support for dependency version predicates in
package.json. Add support for installing multiple and specific versions of packages both in the system Narwhal packages and in virtual environment packages, and provide a tool for selecting versions. Writetusk freezesuch that it records the versions of all de facto installed packages. Refactortusk reheatto use the information recorded bytusk freezeto grab exact versions. Refactorlib/packages.jsto verify dependency predicates. Consider adding a feature to inspect the graph of installed package versions and their dependencies to recommend the most current inter-compatible group of package versions as described by theirpackage.jsondependency predicates.Comments
-
0 comments Created 3 months ago by kriskowalPackage info .jars should apply to individual .jar files as well as .jar directoriesneeds-milestonexIn package.json presently, .jars should be an array (or an array of one string) containing paths from the package.json file to any number of .jar files, or directories containing .jars. If it refers to a directory, the package loader should normalize that entry to a list of the jars in that directory. After normalization, the list of individual .jar files should be available as .jars.
Comments
-
Add support for packages that have a build step. Create a system for transactionally downloading packages and their transitive dependencies, then unbundling, building, generating documentation, and testing, within a virtual environment before installing the results into the system or virtual environment packages directory.
Consider making an installation transaction resumable if errors occur at any particular stage.
Comments
this is a total can of worms imho. It sounds exactly like the prerm, postinst, preinst scripts
http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html#s-maintscripts
Supporting these kinds of scripts require packagers so they don't stomp on each other's feet. I imagine that the narwhal world will be a lot looser organized than debian or ubuntu but I could be wrong
-
2 comments Created 4 months ago by kriskowal0.2xbugxneeds-testsxRhino on Cygwin File System bugsup-for-grabsxWhen Java is installed on Windows, it deals internally with Windows file system paths, even when it is running in Cygwin. So, there's a bit of confusion about when Narwhal should be operating on Windows paths and when it should be working on Unix paths. Cygwin will need an interoperability layer between Java and the File System API.
Comments
tlrobinson
Mon Aug 10 15:43:48 -0700 2009
| link
Is it our responsibility to do the path translations? Java doesn't, should we?
-
Create a build system and module loaders for the browser.
Support:
- production: performance (minification, bundling, browser cache induction, parallelism)
- development: preserves line numbers and file names
- static: built with a tool and saved as static files
- dynamic: served by a JSGI application on demand, with an LRU Cache
- sync
- async
Methods:
- via async XHR: no global footprint, but restricted to same origin.
- via sync XHR: great for development on static files, but slow, serial, and buggy in production, and also lacks file names for debugging in browsers.
- via inline script; embeds a bundle so subsequent may require modules.
- via blocking download script; downloads a bundle so subsequent may require modules.
- via deferred script injection; downloads a bundle or individual modules asynchronously. sync require not available for these modules in subsequent , so it must throw programmer errors or use an alternate, dangerous sync XHR loader for those cases.
Consider:
- bundling speeds up initial page loads, but collections of smaller files cache better for faster following page loads
- browser cache induction uses mtime-based unique identifiers with far-future expiration
- file names and line numbers can be preserved by module factories that do not inject newlines at the head and foot of the module, if the factories are installed with script injection.
- if modules are loaded from multiple small files, those components can be loaded in parallel, as with labjs. however, if modules are loaded asynchronously in non-deferred script tags, subsequent inline script tags will not be able to synchronously require those modules.
- after downloading a bundle, the client may initiate the download of the smaller factories for pre-caching; this only works if the modules are cacheable. the server must track whether it expects the browser to have downloaded the smaller factories to decide whether to send the bundle loader or module loader in subsequent requests.
Comments
-
0 comments Created 4 months ago by kriskowalTrack `narwhal/bin` Symbolic Linkage in `.tusk/notes.json`1.0xTusk tracks all files installed for each package in a
.tusk/notes.jsonin the base of the system Narwhal installation or presently activated virtual environment, along with whether the package was installed in response to a explicit user request (as opposed to implicitly as a transitive dependency), and whether the installation completed. The intent for these notes is to eventually implementtusk removefor removing packages and all the files they drop, andtusk orphans | xargs tusk removefor garbage collecting unwanted packages. Presently,tuskcreates symbolic links in the$PACKAGE_HOME/binto each package's bins, but these are not tracked in.tusk/notes.jsonyet.Comments
-
Implement package removal with
tusk remove. This should employ.tusk/notes.jsonto remove all files installed bytusk. Some decision will have to be made about whether to destroy the entire package's tree or to leave any remaining, untracked files in the package's abandoned husk.Comments
Perhaps this is over-thinking it, but it would be nice if it could "know" to only remove clean files.
In
.tusk/notes.json, for each file installed (or just for the entire package dir?), save a signature along with the filename.On running
tusk remove, check the current signature against the signature in.tusk/notes.json. If it doesn't match, then print a warning tostderr, and do not remove the file. (Unless a-f/--forceflag is set.)This way, the user could remove a package, without losing any customizations that they made to it.
-
For the purpose of garbage collecting unwanted packages, implement
tusk orphan, using.tusk/notes.jsonto discover whether any of the installed packages were installed as transitive dependencies of explicitly installed packages that have since been removed by the user.Comments
-
1 comment Created 4 months ago by kriskowal1.0xbugxBreak Dependency Cycles in Package Analysispull-requestxlib/packages.jsperforms a topological sort of all installed packages. Presently, an error occurs if there is a cyclic dependency in any subgraph, for example, if "jack-servlet" and "appengine-java-sdk" are erroneously mutually dependent. Detect this case inlib/packages.jsonand duringtusk create-catalogto avoid distributing faulty package catalogs.Comments
-
0 comments Created 4 months ago by kriskowal1.0xMulti-source Local Package Catalogsre-tuskxAdd a feature that permits a virtual environment or system Narwhal installation to subscribe to alternative and multiple package catalogs or catalog sources.
Comments
-
0 comments Created 4 months ago by kriskowalMigrate to ServerJS Unit Test API Compliance1.0xPerform the necessary migration steps to the ServerJS Unit Test API when that specification stabilizes.
Comments
-
0 comments Created 4 months ago by kriskowal[browser] Inline Synchronous Bundle Loader1.0xCreate a JSGI application and static complication tools that create and serve a group of module factories as a single, minified, compressed bundle for loading with a
Comments
-
Allow setting of default charset
Comments
-
1 comment Created 4 months ago by kriskowal1.0x[browser] Asynchronous Requirere-modulesxImplement a promise-based asynchronous require for dynamically named module requests using either asynchronous XHR and eval (with no global footprint) or script injection (with a global module factory registration system).
Comments
-
1 comment Created 4 months ago by kriskowalneeds-docsxneeds-milestonexJSON Command Line Interfaceneeds-testsxGather requirements and implement a JSON command line interface, suitable for transferring data to and from JSON for use in conjunction with other command line tools through pipelines.
Comments
This ought to do the trick http://github.com/kriskowal/narwhal/commit/ef021d00d9b319b16a5a7dd75abad0fee7078ee7
-
Create a Base32 encoding module based off of Doug Crockford's alphabet and RFC 3548 for Python interoperability by default.
Comments
Here's what I've got so far, http://github.com/kriskowal/narwhal/commit/0c4dc5a13b345cc9db8dd0864903f497b30f907e
-
The
utilmodule presently has strong testing for itsarray,object, andstringextendfeatures. Most remaining features require unit tests.Comments
-
2 comments Created 4 months ago by kriskowal0.1.1xbugx[tusk] Bin symbolic link broken in fresh virtual envs brokenneeds-testsxProblem seen on Mac OS 10.5 with 0.1-RC2.
Steps to reproduce:
tusk init foocd fools -al bin
Expected:
bin/activateshould be a symlink toactivate.bash
Actual: the symbolic link is line noise
Comments
-
0 comments Created 4 months ago by kriskowal[printf] Printf Module Scientific Notation1.0xSeveral of the unit test cases for scientific notation of floating point values do not presently conform to the unit test suite, and thus Python interoperability.
Comments
-
1 comment Created 5 months ago by kriskowal1.0xNo implementations of a comprehensive standard library for JavaScriptneeds-testsx -
4 comments Created 4 months ago by gmosxbugxbug-verifiedxsha256() does not workneeds-testsxOn repeated applications it returns different hashes for the same input string.
Comments
nevilleburnell
Mon Oct 26 02:06:13 -0700 2009
| link
hopefully fixed via http://github.com/cloudwork/narwhal/commit/f55aaab4ba5dd0bbe8676c54574fbc80416fa3a6
Needs test
nevilleburnell
Mon Oct 26 02:25:17 -0700 2009
| link
Actually only HASH[] needs to be inside core() so I moved K[] back outside core() again.
http://github.com/cloudwork/narwhal/commit/8ec352355c0f48d5011807af7a4f92971a06805d
-
Does not work. It seems to be not implemented.
Comments
tlrobinson
Mon Aug 24 20:22:36 -0700 2009
| link
Can you give an example? decodeToString takes a string argument specifying the charset encoding of the bytes.
I have provided a test case (that FAILS) to demonstrate the problem
decodeToString optionally gets an integer argument and performs base32/base64 encoding. Base32 does not work. -
4 comments Created 3 months ago by tschaub0.1.1xbugxbug-verifiedxneeds-testsxtusk install brokenre-tuskxLooks like something broke with 46f31ce.
narwhal$ rm -rf .tusk/ narwhal$ git checkout <a href="/tlrobinson/narwhal/commit/72dfc8054febce04e6c4808fd43f4822b3d27159">72dfc80</a> HEAD is now at 72dfc80... Add 'xterm' to make term module work on Ubuntu/Gnome. narwhal$ tusk install foo Downloading catalog. Saving catalog. ERROR: Package not found: "foo" No new packages to install. narwhal$ rm -rf .tusk/ narwhal$ git checkout <a href="/tlrobinson/narwhal/commit/46f31ce5609120703d314466379fe5570f9e3db7">46f31ce</a> Previous HEAD position was 72dfc80... Add 'xterm' to make term module work on Ubuntu/Gnome. HEAD is now at 46f31ce... Added a Java version check to narwhal-rhino. narwhal$ tusk install foo tusk update does not yet take arguments.I think I'm only seeing the problem when I don't have a .tusk directory. I'm also going a little nuts so I may be missing something obvious.
Comments
Ok, perhaps this is my misread of the docs. Things work if I
tusk updatebeforetusk install.narwhal$ tusk install foo tusk update does not yet take arguments. narwhal$ tusk update Downloading catalog. Saving catalog. narwhal$ tusk install foo ERROR: Package not found: "foo" No new packages to install.Looks like this came with fd80797. Apologies for the chatter.
I introduced this bug. It's because install calls the update action, and update checks to make sure that the user supplied no arguments. The update task is reading the install arguments, which is not intended. I will need to refactor.
-
0 comments Created 3 months ago by kriskowalneeds-milestonexneeds-testsxUse Object.defineProperty on monkey patches.up-for-grabsxPreserve enumerability for engines on which it is possible to use Object.defineProperty. Use the Object.defineProperty stub.
http://groups.google.com/group/narwhaljs/browse_thread/thread/6cb08191f6617e8e
Comments
-
0 comments Created 2 months ago by kriskowalMigrate from module.id == require.main to require.main == module0.2x -
Upgrade Jack to use WebWorkers for safer shared-nothing event-loop concurrency. I have implemented worker support in the simple and jetty servlet handler at:
http://github.com/kriszyp/jack
(I also upgraded the simple and servlet handlers that I rewrote to users workers and promises to roughly the current direction for JSGI 0.3. Figured I might as well while I was hacking on them.)Comments
tlrobinson
Fri Oct 09 17:20:59 -0700 2009
| link
Cool, this is exciting.
I'd like to hold off on transitioning to JSGI 0.3 for now, until it's actually finalized. We could just write a middleware adapter to convert 0.2 <-> 0.3.
I'd also like to retain the existing Simple and Servlet/Jetty handlers, in particular because I don't think Workers will work on AppEngine (no threads allowed).
Could we have separate simple-worker, servlet-worker, jetty-worker handlers, with the common parts (namely "env" object construction) factored out? Or maybe have it as an option, and add parameters to jackup to enable/disable workers, and set the number of worker threads.
This seems to remove the async support. I assume you just haven't gotten around to adding it back in?
Also, not a big deal, but there are some whitespace inconsistencies, especially in the -worker.js files. I'm trying to keep Narwhal/Jack close to Crockford's style guide (http://javascript.crockford.com/style1.html) with 4 spaces instead of tabs.
I'd like to hold off on transitioning to JSGI 0.3 for now, until it's actually finalized. We could just write a middleware adapter to convert 0.2 <-> 0.3.
Yeah, I suppose I got a little ahead of myself.
I'd also like to retain the existing Simple and Servlet/Jetty handlers, in particular because I don't think Workers will work on AppEngine (no threads allowed).
That makes sense. I've been thinking about how to maintain the shared-nothing concurrency in a servlet environment that controls the thread construction. Maybe I'll be able to come up with something there. Simple can't be used on GAE can it?
This seems to remove the async support. I assume you just haven't gotten around to adding it back in?
It should still be in there, but it now looks for the promise as the app response (rather than the return value of forEach) per the discussion on the ML.
Also, not a big deal, but there are some whitespace inconsistencies
Sorry about that, been following http://www.dojotoolkit.org/developer/StyleGuide for the last couple years, but I am trying to keep to the 4 space style with Narwhal stuff, will keep working on it.
tlrobinson
Fri Oct 09 18:17:16 -0700 2009
| link
That makes sense. I've been thinking about how to maintain the shared-nothing concurrency in a servlet environment that controls the thread construction. Maybe I'll be able to come up with something there.
JackServlet might actually create a new context/scope for each thread. But if not, it certainly could.
Simple can't be used on GAE can it?
No, GAE just uses Servlets. But I'd still like to have the option of using the current Simple handler.
It should still be in there, but it now looks for the promise as the app response (rather than the return value of forEach) per the discussion on the ML.
Oh, I must have missed the conclusion of that discussion.
I'm not sure I like it, since it will break a lot more middleware.
Actually, it turns out that the AsyncResponse object I wrote yesterday might work correctly in both cases, since the object returned has the "then" method (even though it's only there because it's a convenient place for it):
http://github.com/tlrobinson/jack/blob/master/lib/jack/response.js#L160-195
I didn't notice the "when" call, which I see calls "then" (I was just looking for "then")
EDIT: Actually won't work since the new version expects the response object to be passed to the callback.
JackServlet might actually create a new context/scope for each thread. But if not, it certainly could
It doesn't right now (init() is only called once, not once for every thread), but maintaining a ThreadLocal for globals wouldn't be too difficult. We kind of lose the ability to do event-loops; we can execute queued events at the end of each request, but without async capabilities from the servlet engine (in the case GAE) it might be kind of pointless. Just having ThreadLocal globals would probably be enough.
I'm not sure I like it, since it will break a lot more middleware.
I don't mind switching it back, but we would be back in the situation of having to mutate an already returned response object in order asynchronously set different status codes and headers, which seems like it might break middleware in much harder to understand ways (and being able to async determine status seems like important functionality). Anyway, I am fine with either approach though.
-
5 comments Created 2 months ago by Gozalaattn:kriskowalxsystem.engiePrefix point to a wrong directorybugxAs far as I can see while playing with tusk all the non-included engines are installed to the packages directory (not sure if it's a right behavior though), while enginePrefix points to the non existing path narwhal.js:58. This way you can obtain circular module require's between default/system and logger (That's what I had with xulrunner engine), unless first element in the system.prefixes points to the engines folder. But even in this case it seems to be consequence rather then expected behavior. I also found that it causes a bug on xulrunner engine cause in order to bootstrap worker I need a path to the engines bootstarp, but fs(system.enginePrefix).join("bootstrap.js") doesn't exists as it points to the directory engines/xulrunner/bootstarp.js while it suppose to point to packages/narwhal-xulrunner/bootstarp.js.
There is also different thing. Structure of the xulrunner-engines extension looks like:
bootsrap.js packages.json lib .... narwhal engines packages ...Take in mind that xulrunner engine is nor in narwhal/engines nor in narwhal/packages there for it can be constructed by narwhal.js. I would suggest to assign value system.enginePrefix in the bootstrap.js of the engine instead this was problem will be solved. I don't want to create patch as I'm not sure weather or not I'm missing something if not let me know so I'll make a patch. BTW all the engines would have to apply these on their side as well.
Comments
this issue also related to this one
Fix can be as easy as
system.enginePrefix = system.enginePrefix || system.prefix + '/engines/' + system.engines[0];
tlrobinson
Wed Oct 21 14:19:34 -0700 2009
| link
Engines can also be installed in the packages directory.
The engine should know it's own location and should provide it to narwhal.js somehow.
Also, system.prefixes[0] is expected to be the sea root, for the purpose of package discovery and tusk package installation. Threading system.enginePrefix through the bootstrap process is definitely the way to go.
This problem appears to require further consideration. Adding the engine prefix to prefixes might not be the right solution, rather sorting out the strange dependencies system and logger, and using enginePrefix in narwhal.js directly. system.prefixes is used by tusk and lib/packages.js as the resolution order for package discovery and new packages are installed in the "root" which is system.prefixes[0].
First, Tom, can we remove the .fs and .logger attributes of system? Would it be acceptable to mandate the requiring of those modules instead of using the system object to carry them?
Iraliki, can you test this problem on the refactor branch?
I'll put some thought to how to refactor narwhal.js and try to understand the problem for XULRunner more thoroughly.
Well with refactor branch and NARWHAL_ENGINE_HOME removed from system.prefixes it looks like narwhal expects engine to be in a wrong directory on failure it defaults to default engine which still tries to require module from the engine and basically enters cyclic require cycle. Error stack looks like this:
("/Users/gozala/Projects/narwhal/engines/xulrunner/lib/file-engine")@/Users/gozala/Projects/narwhal/engines/default/lib/file-engine.js:56 ......................................... (same line many times) ("/Users/gozala/Projects/narwhal/engines/xulrunner/lib/file-engine")@/Users/gozala/Projects/narwhal/engines/default/lib/file-engine.js:56 ("file-engine")@/Users/gozala/Projects/narwhal/lib/loader/multi.js:32 ("file-engine")@/Users/gozala/Projects/narwhal/lib/loader/multi.js:50 ("file-engine","",true)@/Users/gozala/Projects/narwhal/lib/sandbox.js:52 ("file-engine")@/Users/gozala/Projects/narwhal/lib/sandbox.js:184 ([object Object])@/Users/gozala/Projects/narwhal/narwhal.js:122 ([object Sandbox],(function () {return eval(arguments[0]);}))@/Users/gozala/Projects/narwhal-xulrunner/bootstrap.js:110 @/Users/gozala/Projects/narwhal-xulrunner/bootstrap.js:113The problem with xulrunner engine is that engine lib is not under $narwhal/engines/xulrunner/lib/ actually that's a case with all the non narwhal included engines as the live under $narwhal/packages/$engine/.
Besides narwhal ff extension s packed in a way that engine lib is nor under $narwhal/engines/ nor under $narwhal/packages/ it actually lives on the same level as the $narwhal itself. I do believe that right solution will be a tweak to packages module so that it will look at system.enginePrefix in order to find where is the active engines lib is located.
-
tusk needs to be able to install local packages
0 comments Created about 1 month ago by tolmaskyShould be pretty trivial to copy gem's behavior of simply first checking whether the file exists in the present working directory, and if it doesn't then hitting the internet.
tusk install blah
if (FILE.exists(blah))
//install from that file.Comments
-
0 comments Created about 1 month ago by bryanwb0.3xtusk should support multiple catalogsre-tuskxThis isn't actually a bug but a feature request ;)
This isn't urgent as I can currently host my packages in catalog.json but it would be very nice. cdorn has multiple catalog support in his tusk-catalog branch but I am not sure how long it will take integrate that into master
Comments
-
0 comments Created about 1 month ago by andychuattn:kriskowalxpackage loader could give better error messagesbugxI created a new package.json for "Jesyll", with dependencies ["markdown", "jsontemplate"], since I know I'll depend on those.
I then ran the program, and it said "can't find jesyll". And I tried with -d and -v and couldn't really see what the issue is. I was stuck on this and trying to compare with other packages until I figured out it's probably those nonexistent dependencies.
A nicer error message would be "can't find jsontemplate declared in jesyll/package.json". -v or -d could list the paths being searched too, like PYTHONVERBOSE=1 does.
Comments
-
3 comments Created about 1 month ago by nrstottbugxOpenJDK -Xbootclasspath/p: optionspull-requestxtlrobinson said: While we're at it we should try to solve the OpenJDK problem once and for all. I have yet to find a combination of Rhino and the -Xbootclasspath/p: option that works.
Comments
helma solves it like this http://dev.helma.org/trac/helma/changeset/9811
works for me
tlrobinson
Wed Dec 09 18:13:40 -0800 2009
| link
We need to ensure this works everywhere. We've attempted this kind of solution in the past and it has always broken Narwhal somewhere.
-
2 comments Created about 1 month ago by tlrobinsonattn:kriskowalxbugxfs.path(".").join("foo") results in absolute path "/foo"re-fsxjs> system.fs.path(".").join("foo") /fooComments
nevilleburnell
Mon Oct 26 19:21:56 -0700 2009
| link
added initial tests for path().join()
http://github.com/cloudwork/narwhal/commit/343e3d06815bf498d824017f02ff764528fc721c
nevilleburnell
Mon Oct 26 20:00:20 -0700 2009
| link
moved to tests/commonjs/file/path.js
http://github.com/cloudwork/narwhal/commit/be62c599614ad5f01c18660e42e1f720261725ae
-
0 comments Created about 1 month ago by cadornzip/jar (archive) loaderneeds-milestonexCurrently the Narwhal loaders are all based on the filesystem. A module must be in the filesystem in one of the search paths. We need to add hooks to allow a loader to provide "virtual" search paths (for lack of a better term), which map module ids to module factories. This will allow things like modules compiled into the binary, zips, jars, etc.
http://groups.google.com/group/narwhaljs/browse_thread/thread/d812af07b3c6d4c6?hl=en
Comments
-
0 comments Created about 1 month ago by kriszypREPL should be event basedpull-requestxCurrently the narwhal/repl module blocks while waiting for input, preventing other events from taking place. http://github.com/kriszyp/narwhal/commit/e52839226df3709d9c39058603d58902db22bf56 fixes this so that the input is accepted through a worker that fires events in the main repl module, thus the event loop can run while waiting user input.
Comments
-
readline should use the Rhino's shell input, rather than going directly to jline, so that
jline works in both debugger and command line:
http://github.com/kriszyp/narwhal/commit/7bbdce2ed704503f0156ef6a59da08a801a722dfComments
tlrobinson
Thu Nov 19 16:03:35 -0800 2009
| link
The readline package is supposed to be generic, but the Rhino shell input has JavaScript specific behavior. Maybe we should just detect Rhino in the REPL and use this there?
I thought that the repl module was supposed engine/platform agnostic, whereas the readline package would handle adapting to different engines. Rhino is certainly one of the engines, so shouldn't this be detected and handled at the readline level? If you want the detection move to the repl module, I can do that, just wanted to make sure.
tlrobinson
Wed Nov 25 18:05:17 -0800 2009
| link
By "generic" I mean it implements a generic readline prompt, not one which includes JavaScript autocompletion, etc. You should be able to use the plain "readline" module for any sort of REPL, not just JavaScript.
I would be ok with having, say, a "readline/javascript" module (or readline.readLineJS()) or something like that, which uses the Rhino REPL, and falls back to the standard readline.
-
Tusk init uses chmod Which Fails on Windows
2 comments Created about 1 month ago by pnewhookI'm trying to setup Narwhal on windows using the directions from http://narwhaljs.org/quick-start.html but I run into a problem when I try to run tusk init hello-web
Here are my steps:
1. Clone git://github.com/280North/narwhal.git to C:\gited\narwhal
2. Add C:\gited\narwhal\bin to my path
3. cd to C:\gited
4. run "narwhal.cmd narwhal\examples\hello" this returns "Hello, World!"
5. run "narwhal.cmd narwhal\examples\narwhal" I see the narwhal, very pretty.
6. still following the quick start guide i run "narwhal --help" this gets the listing of narwhal commands
7. I then run "tusk init hello-web" This is where things start to go wrong.the following directory structure is created at C:\gmosx
hello-web tusk bin sea libbut I get the following error
org.mozilla.javascript.WrappedException: Wrapped java.io.IOException: Cannot run program "chmod": CreateProcess error=2, The system cannot find the file specified (C:\Gited\narwhal\engines \rhino\lib\os-engine.js#48) at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1776) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183) at org.mozilla.javascript.NativeJavaMethod.call (NativeJavaMethod.java:247) at org.mozilla.javascript.Interpreter.interpretLoop (Interpreter.java:1688) at script(C:\Gited\narwhal\engines\rhino\lib\os-engine.js:48) at script(C:\Gited\narwhal\engines\rhino\lib\os-engine.js:58) at script(C:\Gited\narwhal\lib\os.js:23) at script(C:\Gited\narwhal\engines\rhino\lib\file-engine.js: 123) at script(C:\Gited\narwhal\lib\file.js:603) at script(C:\Gited\narwhal\lib\narwhal\tusk\init.js:35) at script(C:\Gited\narwhal\lib\args.js:99) at script(C:\Gited\narwhal\lib\args.js:474) at script(C:\Gited\narwhal\lib\narwhal\tusk.js:163) at script(\C:\Gited\narwhal\bin\tusk:2) at script(C:\Gited\narwhal\bin\../lib/sandbox.js:250) at script(narwhal.js:209) at org.mozilla.javascript.Interpreter.interpret (Interpreter.java:845) at org.mozilla.javascript.InterpretedFunction.call (InterpretedFunction.java:164) at org.mozilla.javascript.optimizer.OptRuntime.callName (OptRuntime.java:97) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1._c_anonymous_1 (Unknown Source ) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1.call (Unknown Source) at org.mozilla.javascript.optimizer.OptRuntime.call2 (OptRuntime.java:76) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1._c_script_0 (Unknown Source) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1.call (Unknown Source) at org.mozilla.javascript.ContextFactory.doTopCall (ContextFactory.java:405) at org.mozilla.javascript.ScriptRuntime.doTopCall (ScriptRuntime.java:3066) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1.call (Unknown Source) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_ js_1.exec (Unknown Source) at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:563) at org.mozilla.javascript.tools.shell.Main.processFileSecure (Main.java:485) at org.mozilla.javascript.tools.shell.Main.processFile (Main.java:451) at org.mozilla.javascript.tools.shell.Main.processSource (Main.java:443) at org.mozilla.javascript.tools.shell.Main.processFiles (Main.java:196) at org.mozilla.javascript.tools.shell.Main$IProxy.run (Main.java:117) at org.mozilla.javascript.Context.call(Context.java:517) t org.mozilla.javascript.ContextFactory.call (ContextFactory.java:514) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:179) at org.mozilla.javascript.tools.shell.Main.main(Main.java:157) Caused by: java.io.IOException: Cannot run program "chmod": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161) ... 24 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 32 moreNow I know almost nothing about Linux but I do understand that chmod is a permission thing. I looked into narwhal\lib\narwhal\tusk\init.js and saw the only mention of chmod is on line line 35 where it says
sea.chmod(0755);Comments
This should work-around the problem http://github.com/kriskowal/narwhal/commit/739f6ccc66f621cf60b3e23c20e357878cd628b1 Please let us know if that fixes the issue.
i'll have to resolve issue 71 http://github.com/tlrobinson/narwhal/issues/#issue/71 before I can test this. I tried your work around but got
C:\Gited\narwhal\packages\jack\examples>tusk.cmd init hello-jack require error: couldn't find "C:\Gited\narwhal\lib\narwhal\tusk.js\init"because it's including the .js on tusk instead of using the folder
-
7 comments Created about 1 month ago by pnewhookModule.id in Windows Includes file extension (.js) Which Disrupts Directory StructurebugxI was trying to run
tusk.cmd helpbut i get the following error:
C:\Gited\280North\narwhal>tusk.cmd help
Usage: help [OPTIONS] COMMAND
A Narwhal project package manager.
require error: couldn't find "C:\Gited\280North\narwhal\lib\narwhal\tusk.js\list"I looked at tusk.js and found
parser.command('list', module.id + '/list');if i replace this with
parser.command('list', C:/Gited/280North/narwhal/lib/narwhal/tusk' + '/list');The example works. Obviously you can't hard code the file path, but I couldn't find where module.id was set to override the windows behaviour.
I'm running Windows XP SP3
Comments
module.id ultimately gets set in lib/sandbox.js (look for module.id = id). I'm not sure how it's keeping the extension. It might be a bug in the module search algorithm, but more likely one of the file system routines. Would you be able to isolate this?
I'd like to try to isolate this but I'm not sure where to start. IN sandbox.js i don't see module.id=id. the closest thig i have is
if !Object.prototype.hasOwnProperty.call(modules, id) || reload) modules[id] = {};one line 228 or
var module = { 'id': id, 'path': factory.path };on line 246.
How would you recommend isolating it? Is this something the Rhino debugger may help with?
Yeah, the Rhino debugger will give you a stack trace; you can put probes (hahah, euphemism for print(data)) into all the active functions and evaluate whether they're doing what they're supposed to, namely, not putting .js in the module identifier.
I dropped this into sandbox.js
var module = { 'id': id, 'path': factory.path }; print(module.id); factory(require, exports, module, subsystem, subprint);And this is what I got on the Rhino console:
global
array
object
string
regexp
date
binary
binary-engine
function
json
system
io
io-engine
file
file-bootstrap
file-engine
os
os-engine
logger
narwhal
args
util
term
packages
packages-engine
C:\Gited\narwhal\lib\narwhal\tusk.js
http
http-engine
Usage: help [OPTIONS] COMMAND
A Narwhal project package manager.so something is definitely wrong with the way the Tusk module is loaded. What's your recommendation to look into this?
Oh! This is very helpful. It seems that the narwhal/tusk module is
being loaded as a script instead of as a module, which is very
possible depending on the tusk shell script. I'll look into this.Please let me know if this fixes the problem:
http://github.com/kriskowal/narwhal/commit/14821bbe823fd550ce19a0b6aac6f568efd055f5I tried your fix and I think it may have worked, but I can't tell 100% because there appears to be another problem. I tried both applying your patch to the 280 North fork and your repository and got the same results. I ran tusk.cmd help still with that line in sandbox.js to print module.id and got this
C:\Gited\narwhal>tusk.cmd help
global
array
object
string
regexp
date
binary
binary-engine
function
json
system
io
io-engine
file
file-bootstrap
file-engine
os
os-engine
logger
narwhal
args
util
term
packages
packages-engine
narwhal\tusk
http
http-engineso it looks like it's finding tusk properly. I ran this again in the debugger and the application just stalled at http-engine.js
function(require,exports,module,system,print){
var IO = require('./io').IO;exports.IO = function (url) {
return new IO( new java.net.URL(url).openStream(), null );};
// */ }
I tried commenting out the require(http) like in tusk.js but then it stalls at narwhal/tusk
Should I close this ticket and open a new one or is this related?
ps Thanks for all your help.
-
3 comments Created 29 days ago by kriszypzip module does not have close methodpull-requestxThe zip module does not have a close method, and so calling unzip leaves the file in an open/locked state. Fix is here:
http://github.com/kriszyp/narwhal/commit/27b49bfe9c5372f820f3130d302606b797f8c24aComments
Landed in kriskowal/master kriskowal/refactor. I cherry-picked; you're tracking cadorn's stuff, right? Does it work for you?
I have pulled in cadorn's master, and unzip still works with it. Or are you saying that cadorn's master should fix unzip to close? I don't see anything in cadorn's zip.js that would close.
-
Worker's initially loaded module should have module.id == require.main
1 comment Created 28 days ago by kriszypI think that the target module of a worker (the one indicated in the Worker constructor) should be able to detect that it is the initial module, presumably with (module.id == require.main). In worker.js I have tried setting workerGlobal.require.main = scriptName, but that does not seem to affect the require.main that is provided to the modules in the worker environment. I am not sure how one is supposed to set require.main.
Comments
-
1 comment Created 28 days ago by nrstottenhance util.update and util.complete to be variadic and chainablepull-requestxPull request:
util_refactor branch is here: http://github.com/nrstott/narwhal/tree/util_refactor
Comments
-
Discussion here: http://groups.google.com/group/narwhaljs/browse_thread/thread/233a8b1e73b66651
The commit is here: http://github.com/zaach/narwhal/commit/a5c4aa58828c0f3db6814bac0f27694dc3079c76
Comments
-
0 comments Created 25 days ago by pnewhookattn:tlrobinsonxbugxCan't Stark Jack Server, Getting Error TypeError: Argument 0 is not Java class: [JavaPackage org.simpleframework.http.core.Container]needs-verify-bugxI'm running the 280 North fork on Windows XP
When I try to run the jack samples I get the followingLoading configuration module at C:\Gited\bar\jackconfig.js TypeError: Argument 0 is not Java class: [JavaPackage org.simpleframework.http.core.Container]. org.mozilla.javascript.EcmaError: TypeError: Argument 0 is not Java class: [JavaPackage org.simpleframework.http.core.Container]. C:\Gited\narwhal\packages\jack\lib\jack\handler\simple.js#13) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3659) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3637) at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3665) at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3684) at org.mozilla.javascript.JavaAdapter.js_createAdapter(JavaAdapter.java:173) at org.mozilla.javascript.JavaAdapter.execIdCall(JavaAdapter.java:126) at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129) at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:338) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1735) at script(C:\Gited\narwhal\packages\jack\lib\jack\handler\simple.js:13) at script.main(C:\Gited\narwhal\packages\jack\lib\jackup.js:131) at script(\C:\Gited\narwhal\packages\jack\bin\jackup:2) at script(C:\Gited\narwhal\bin\../lib/sandbox.js:251) at script(narwhal.js:205) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97) ato rg.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1._c_anonymous_1(Unknown Source) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1.call(Unknown Source) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1._c_script_0(Unknown Source) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1.call(Unknown Source) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:405) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3066) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1.call(Unknown Source) at org.mozilla.javascript.gen.C__Gited_narwhal_engines_rhino_bin____bootstrap_js_1.exec(Unknown Source) at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:563) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:485) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:451) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:443) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:196) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:117) at org.mozilla.javascript.Context.call(Context.java:517) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:514) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:179) at org.mozilla.javascript.tools.shell.Main.main(Main.java:157)In the past I was able to fix this by setting my NARWHAL_CLASSPATH to C:\Gited\narwhal\packages\jack\jars\simple-4.1.10.jar but it no longer works.
Comments
-
throw StopIteration instead of new StopIteration()
0 comments Created 17 days ago by tschaubIn engines/rhino/lib/zip.js line 30:
throw new StopIteration();should be
throw StopIteration;Comments
-
require("packages").resource does not work in a sandbox
1 comment Created 12 days ago by kriszypWhen I turn Jack's reloader functionality on, I get this error when I call the resource function in the packages module:
TypeError: Cannot read property "length" from undefined
at C:\dev\narwhal\lib\packages.js:9Comments
I guess basically the issue is that some modules expect to really be singletons. Another module that behaves poorly when instantiated multiple times (as the reloader does) is the event-queue. Perhaps we need to include the modules option in the reloader middleware that includes "packages" and "event-queue" modules... But this certainly doesn't seem very scalable, it would be nice to be able to smarter selection of which modules get reloaded, like be able to have a sandbox that only reloads modules from a certain package (or packages).
-
Consider implementing forEach on Binary streams in terms of read(null) (for read up the the default buffer length and execute a block with the result).
Comments
-
The
readfunction fromfile.readin loader.js always comes from bootstrap.js instead of file.js.This makes it impossible to create a loader (to be passed into a sandbox) that makes use of the file.js module.
Comments
- 0.1.1▾
- 0.2▾
- 0.3▾
- 1.0▾
- attn:boucher▾
- attn:kriskowal▾
- attn:tlrobinson▾
- attn:tolmasky▾
- bug▾
- bug-regression▾
- bug-verified▾
- needs-docs▾
- needs-milestone▾
- needs-reduction▾
- needs-tests▾
- needs-verifiy-fixed▾
- needs-verify-bug▾
- progress▾
- pull-request▾
- re-binary▾
- re-fs▾
- re-js▾
- re-json▾
- re-modules▾
- re-os▾
- re-test▾
- re-tusk▾
- up-for-grabs▾
- Apply to Selection
-
Change Color…
Preview:preview
- Rename…
- Delete












I think we should match the behavior of other languages here. Here's Ruby's, what are the equivalents in other languages?
http://www.ruby-doc.org/core/classes/Pathname.html#M001722
added initial tests for file.relative()
http://github.com/cloudwork/narwhal/commit/2d88ca05102bce9cbd55602492d0bd72005cdee7
moved test cases to commonjs/file/relative.js
http://github.com/cloudwork/narwhal/commit/49a6680c89a27d90637c86153ec9e7b5d3312666