mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-02 20:06:46 +00:00
Add first release of AWS plugin
Tools for working with Amazon Web Services: * Templates for saving a TiddlyWiki as a single JavaScript file in a ZIP file that can be executed as an AWS Lambda function. In this form, TiddlyWiki is a self contained single file containing both code and data, just like the standalone HTML file configuration * Commands that can be used to interact with AWS services, under both the Node.js and Lambda configurations of TiddlyWiki
This commit is contained in:
26
plugins/tiddlywiki/aws/templates/lambda/handler.tid
Normal file
26
plugins/tiddlywiki/aws/templates/lambda/handler.tid
Normal file
@@ -0,0 +1,26 @@
|
||||
title: $:/plugins/tiddlywiki/aws/lambda/handler
|
||||
type: text/plain
|
||||
|
||||
/*
|
||||
TiddlyWiki for AWS
|
||||
*/
|
||||
|
||||
exports.handler = function(event,context,callback) {
|
||||
// Initialise the boot prefix
|
||||
global.$tw = _bootprefix();
|
||||
// Some default package info
|
||||
$tw.packageInfo = lambdaPackageInfo;
|
||||
// Load any tiddlers from the package
|
||||
$tw.preloadTiddlerArray(lambdaTiddlers);
|
||||
// Load any tiddlers from the event
|
||||
if(event.tiddlers) {
|
||||
$tw.preloadTiddlerArray(event.tiddlers);
|
||||
}
|
||||
// Load the commands from the event
|
||||
$tw.boot.argv = (event.commands || []).slice(0);
|
||||
// Boot the TW5 app
|
||||
_boot($tw);
|
||||
$tw.boot.boot(function() {
|
||||
callback(null,"TiddlyWiki execution successful");
|
||||
});
|
||||
}
|
||||
19
plugins/tiddlywiki/aws/templates/lambda/main.tid
Normal file
19
plugins/tiddlywiki/aws/templates/lambda/main.tid
Normal file
@@ -0,0 +1,19 @@
|
||||
title: $:/plugins/tiddlywiki/aws/lambdas/main
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline
|
||||
|
||||
/*
|
||||
{{ $:/core/copyright.txt }}
|
||||
*/
|
||||
|
||||
{{$:/plugins/tiddlywiki/aws/lambda/tiddlers}}
|
||||
|
||||
{{$:/plugins/tiddlywiki/aws/lambda/sjcl}}
|
||||
|
||||
{{ $:/boot/bootprefix.js ||$:/core/templates/plain-text-tiddler}}
|
||||
|
||||
{{ $:/boot/boot.js ||$:/core/templates/plain-text-tiddler}}
|
||||
|
||||
{{$:/plugins/tiddlywiki/aws/lambda/package-info}}
|
||||
|
||||
{{ $:/plugins/tiddlywiki/aws/lambda/handler ||$:/core/templates/plain-text-tiddler}}
|
||||
11
plugins/tiddlywiki/aws/templates/lambda/package-info.tid
Normal file
11
plugins/tiddlywiki/aws/templates/lambda/package-info.tid
Normal file
@@ -0,0 +1,11 @@
|
||||
title: $:/plugins/tiddlywiki/aws/lambda/package-info
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline codeinline macrocallinline
|
||||
`
|
||||
var lambdaPackageInfo = {
|
||||
"version": "`<<version>>`",
|
||||
"engines": {
|
||||
"node": ">=0.8.2"
|
||||
}
|
||||
};
|
||||
`
|
||||
17
plugins/tiddlywiki/aws/templates/lambda/sjcl.tid
Normal file
17
plugins/tiddlywiki/aws/templates/lambda/sjcl.tid
Normal file
@@ -0,0 +1,17 @@
|
||||
title: $:/plugins/tiddlywiki/aws/lambda/sjcl
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline
|
||||
|
||||
(function() {
|
||||
|
||||
var module;
|
||||
|
||||
global.sjcl = (function() {
|
||||
|
||||
{{ $:/library/sjcl.js ||$:/core/templates/plain-text-tiddler}}
|
||||
|
||||
return sjcl;
|
||||
|
||||
})();
|
||||
|
||||
})();
|
||||
5
plugins/tiddlywiki/aws/templates/lambda/tiddlers.tid
Normal file
5
plugins/tiddlywiki/aws/templates/lambda/tiddlers.tid
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/plugins/tiddlywiki/aws/lambda/tiddlers
|
||||
|
||||
`
|
||||
var lambdaTiddlers = `<$text text=<<jsontiddlers "[all[tiddlers]]">>/>`;
|
||||
`
|
||||
Reference in New Issue
Block a user