XSCALE-Alliance / wiki

The repo for the beautiful new xscale.wiki site.
0 stars 1 forks source link

Build process (check metadata in build; can this be tiddlywiki build?) #1

Closed serra closed 5 years ago

serra commented 5 years ago

CI Pipe - set up with #2.


I suggest we use a simple makefile, inspired by Scripts to rule them all

(untested)

# scripts to rule them all
bootstrap:
    # assumptions:
    # node version 7+, npm installed
    npm install
setup: bootstrap
update: bootstrap
server:
    npm run tiddlywiki -- . --server
test: cibuild
    # ...
cibuild:
    tiddlywiki . --rendertiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline index.html text/plain
    cp favicon ./output
    # ...
console: server
deploy: cibuild
    # pass, handled by github pages and travis ci
serra commented 5 years ago

Related: https://github.com/XSCALE-Alliance/wiki/pull/2

serra commented 5 years ago

The build script works and publishes the wiki to http://xscalealliance.org/wiki/#.

However, we get errors, I suspect because there is missing content.

image

jamesgorman2 commented 5 years ago

It looks like it is trying to run in server mode. Which is odd because it doesn't do this when I open the output of rendertiddler locally (and the newer render). I do seem to be missing the contribution banner as well though.

If I open a version I saved manually (from the big menu). It has the contribution banner but is reports

Error retrieving skinny tiddler list: XMLHttpRequest error code: 0

serra commented 5 years ago

Hmm. Maybe our build script is wrong.

serra commented 5 years ago

@jamesgorman2 how do we publish now? By saving the wiki and uploading pushing the index.html file?

serra commented 5 years ago

To reproduce locally:

tiddlywiki . --rendertiddler $:/core/save/all index.html text/plain
cd ./output
python3 -m http.server

This logs the following:

Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [09/Apr/2019 11:31:37] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [09/Apr/2019 11:31:39] code 404, message File not found
127.0.0.1 - - [09/Apr/2019 11:31:39] "GET /status HTTP/1.1" 404 -
127.0.0.1 - - [09/Apr/2019 11:31:39] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [09/Apr/2019 11:31:39] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [09/Apr/2019 11:31:40] code 404, message File not found
127.0.0.1 - - [09/Apr/2019 11:31:40] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [09/Apr/2019 11:31:41] code 501, message Unsupported method ('PUT')
127.0.0.1 - - [09/Apr/2019 11:31:41] "PUT /recipes/undefined/tiddlers/%2FUsers%2Fmarijn%2Fdev%2FZefram-Cochrane%2Ftiddlers%2Ffavicon.ico HTTP/1.1" 501 -
127.0.0.1 - - [09/Apr/2019 11:31:41] code 501, message Unsupported method ('PUT')
127.0.0.1 - - [09/Apr/2019 11:31:41] "PUT /recipes/undefined/tiddlers/%24%3A%2FStoryList HTTP/1.1" 501 -
127.0.0.1 - - [09/Apr/2019 11:31:41] code 501, message Unsupported method ('PUT')
127.0.0.1 - - [09/Apr/2019 11:31:41] "PUT /recipes/undefined/tiddlers/%24%3A%2Fplugins%2Ffelixhayashi%2Ftiddlymap%2Fmisc%2FdefaultViewHolder HTTP/1.1" 501 -

I suspect those are strong hints to your trained :eye: @jamesgorman2

serra commented 5 years ago

Something is trying to PUT stuff to the server in the index.html file we compiled with our new build script.

serra commented 5 years ago

Hm, interesting. This does work:

Given an open wiki in the browser
When I hit save as `adirectory/index.html` in the wiki interface
   and I run a simple web server from `adirectory`
   and I browse to the start page
Then the wiki opens without errors in a browser
serra commented 5 years ago

I'm pretty sure that sth is wrong with the build script I proposed.

serra commented 5 years ago

When I do a diff, it indeed appears that the built version includes plugins that the downloaded version does not:

...
> <div author="JeremyRuston" core-version="&gt;=5.0.0" dependents="" description="Local filesystem syncadaptor" list="readme" plugin-type="plugin" title="$:/plugins/tiddlywiki/filesystem" type="application/json" version="5.1.17" revision="0" bag="default">
...
> <div author="JeremyRuston" core-version="&gt;=5.0.0" dependents="" description="TiddlyWeb and TiddlySpace components" list="readme" plugin-type="plugin" title="$:/plugins/tiddlywiki/tiddlyweb" type="application/json" version="5.1.17" revision="0" bag="default">
...
serra commented 5 years ago

For the tiddlywiki readme, I get the suggestion that the "rendertiddlers" command I used, renders server side components, which is different to creating an offline copy. See https://github.com/Jermolene/TiddlyWiki5

serra commented 5 years ago

I think I've got it. Look at the tiddlywiki.info from a clean install:

    "build": {
        "index": [
            "--rendertiddler",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "index.html",
            "text/plain"
        ],
``` { "description": "Basic client-server edition", "plugins": [ "tiddlywiki/tiddlyweb", "tiddlywiki/filesystem", "tiddlywiki/highlight" ], "themes": [ "tiddlywiki/vanilla", "tiddlywiki/snowwhite" ], "build": { "index": [ "--rendertiddler", "$:/plugins/tiddlywiki/tiddlyweb/save/offline", "index.html", "text/plain" ], "externalimages": [ "--savetiddlers", "[is[image]]", "images", "--setfield", "[is[image]]", "_canonical_uri", "$:/core/templates/canonical-uri-external-image", "text/plain", "--setfield", "[is[image]]", "text", "", "text/plain", "--rendertiddler", "$:/plugins/tiddlywiki/tiddlyweb/save/offline", "externalimages.html", "text/plain" ], "static": [ "--rendertiddler", "$:/core/templates/static.template.html", "static.html", "text/plain", "--rendertiddler", "$:/core/templates/alltiddlers.template.html", "alltiddlers.html", "text/plain", "--rendertiddlers", "[!is[system]]", "$:/core/templates/static.tiddler.html", "static", "text/plain", "--rendertiddler", "$:/core/templates/static.template.css", "static/static.css", "text/plain" ] } } ```
serra commented 5 years ago

Our build command should be

tiddlywiki . --rendertiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline index.html text/plain

I'll run an experiment on master to verify this.

serra commented 5 years ago

🎉 🚀 fixed it with 64cdf6fbec07686bdaab5d77523de55110d98856

serra commented 5 years ago

Ain't no stopping us now @jamesgorman2 !

jamesgorman2 commented 5 years ago

Great detective work @serra

I'll have a look in the morning

serra commented 5 years ago

@jamesgorman2 I'm closing this issue as I think it is sufficiently resolved by #8. Please reopen if you disagree.