Hi Nathan,
the $:/ title prefix is basically nothing more than a TW5 title convention
to indicate system-related tiddlers. At face value, these are simply
arbitrary titles.
The difficult part here to understand (at least for me when I started my
journey into TW5 core land) is that TW5 has an extremely flexible way to
read in individual files from the file system and making tiddlers. Part of
these mechanics is being able to slap on tiddler meta-data such as the
title to an already existing plain (.js) file using tiddlywiki.files files
that are scattered around the especially plugin subfolder hierarchies.
Saving a tiddler (not the whole wiki) is yet another story, since for
existing tiddlers there is information present how the tiddler was built
from a file. But for new tiddlers we don't have this information.
Alas, you bring up a valid point about the sandbox. I don't know yet enough
of this part of the TW5 core, but it might be possible to enhance the core
sandboxing code to make use of the already existing file information that
was collected when building the wiki contents.
On Saturday, October 11, 2014 10:05:26 PM UTC+2, Nathan Gleaves wrote:
>
> i have been working on understanding how the tiddlywiki core system works
> and i have into a problem. When i run in debug mode, i get lots of output
> like:
>
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\$:\core\modules\startup\commands.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\$:\\core\\modules\\startup\\commands.js'
> ,
> syscall: 'open' }
>
>
> this happens for every start up java script file the system tries to run
> in the sandbox environment:
>
> $tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(
> code,context,filename) {
> var sandbox = $tw.utils.extend(Object.create(null),context);
> console.log(filename, context, code);
> vm.runInNewContext(code,sandbox,filename);
> return sandbox.exports;
> };
>
> using the same configuration in run mode, i don't get any of this output.
>
> Obviously its because the vm system is choking on the $: syntax at the
> beginning of tiddlers. I was tyring to find any snipet that was cleaning up
> that file name.
>
> I have lots of these:
>
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\$:\core\modules\filters\is\shadow.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\$:\\core\\modules\\filters\\is\\shadow.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\$:\core\modules\filters\is\system.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\$:\\core\\modules\\filters\\is\\system.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\$:\core\modules\filters\is\tag.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\$:\\core\\modules\\filters\\is\\tag.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\$:\core\modules\filters\is\tiddler.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\$:\\core\\modules\\filters\\is\\tiddler.js'
> ,
> syscall: 'open' }
>
>
> The server does start up and server requests. Its seems that the v8 java
> script engin is just complaining about the file name. I have put in a small
> fix but that fix has revealed fomr other samall problems with the current
> codebase.
>
>
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\core\modules\startup.js']
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\core\\modules\\startup.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\core\modules\utils\parseutils.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\core\\modules\\utils\\parseutils.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\core\modules\utils\dom.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\core\\modules\\utils\\dom.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\core\modules\parsers\wikiparser\rules\wikirulebase.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\core\\modules\\parsers\\wikiparser\\rules\\wikirulebase.js'
> ,
> syscall: 'open' }
> { [Error: ENOENT, no such file or directory
> 'c:\Users\Nathan\workspace\webstorm\TiddlyWiki5\plugins\tiddlywiki\markdown\markdown.js'
> ]
> errno: 34,
> code: 'ENOENT',
> path:
> 'c:\\Users\\Nathan\\workspace\\webstorm\\TiddlyWiki5\\plugins\\tiddlywiki\\markdown\\markdown.js'
> ,
> syscall: 'open' }
>
> All of these fail becaus the title filed on the javascript file defines a
> different path than where the plugin actually exists.
> core/modules/startup/startup.js
> core/modules/parsers/parseutils.js
> core/modules/utils/dom/dom.js
> core/modules/parsers/wikiparser/wikirulebase.js
>
> the markdown plugin may have been triggered because im trying use it
> tiddlywiki.files shows
> {
> "tiddlers": [
> {
> "file": "markdown.js",
> "fields": {
> "type": "application/javascript",
> "title": "$:/plugins/tiddlywiki/markdown/markdown.js",
> "module-type": "library"
> }
> }
> ]
> }
>
> which is probably why its throwing an error on running that script.
> markdown wrapper:
> title: $:/plugins/tiddlywiki/markdown/wrapper.js
> the markdown.js doesn't define a title.
>
> Not a really big deal as it doesn't seem to effect the actual running of
> the script.
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.