Skip to content

Commit

Permalink
Install TiddlyWiki via npm
Browse files Browse the repository at this point in the history
Previously we were using an external installation of TW5 which meant that we were getting extraneous content such as .git, output and node_modules.
  • Loading branch information
Jermolene committed May 3, 2020
1 parent 3ee754d commit 91c3b55
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 34 deletions.
17 changes: 17 additions & 0 deletions bin/update-to-latest-tiddlywiki.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Update package.json to the SHA of the latest tiddlywiki commit to master

# This should be executed whenever there's an update to TW5 that we need to incorporate in ePub2TW5

read -r -d '' VAR << EOM
var fs = require("fs"),
json = JSON.parse(fs.readFileSync("./package.json")),
ref = json.dependencies.tiddlywiki.split("#");
json.dependencies.tiddlywiki = ref[0] + "#" + process.argv[1];
fs.writeFileSync("./package.json",JSON.stringify(json,null,4),"utf8");
EOM

node -e "$VAR" $(git ls-remote --q https://github.com/Jermolene/TiddlyWiki5.git master | head -c 40)

npm install
8 changes: 2 additions & 6 deletions bld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
rm -Rf output
rm -Rf source/tiddlywiki

# Get the correct version of TiddlyWiki
# (Here we install from a sibling directory; use plain "npm install" to install the latest)
npm install ../TiddlyWiki5
pushd ./node_modules/tiddlywiki
./bin/clean.sh
popd
# Install TiddlyWiki to node_modules/tiddlywiki
npm install

# Copy TiddlyWiki core files into the source directory
cp -RH node_modules/tiddlywiki source/tiddlywiki
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "tiddlydesktop",
"version": "0.0.14-prerelease.1",
"author": "Jeremy Ruston <[email protected]>",
"description": "a desktop application for TiddlyWiki",
"contributors": [
{
"name": "Jeremy Ruston",
"email": "[email protected]"
}
],
"repository": {
"type": "git",
"url": "https://github.com/Jermolene/TiddlyDesktop.git"
},
"keywords": [
"tiddlywiki",
"tiddlywiki5",
"wiki"
],
"devDependencies": {},
"bundleDependencies": [],
"license": "BSD",
"dependencies": {
"tiddlywiki": "file:../TiddlyWiki5"
}
"name": "tiddlydesktop",
"version": "0.0.14-prerelease.2",
"author": "Jeremy Ruston <[email protected]>",
"description": "a desktop application for TiddlyWiki",
"contributors": [
{
"name": "Jeremy Ruston",
"email": "[email protected]"
}
],
"repository": {
"type": "git",
"url": "https://github.com/Jermolene/TiddlyDesktop.git"
},
"keywords": [
"tiddlywiki",
"tiddlywiki5",
"wiki"
],
"devDependencies": {},
"bundleDependencies": [],
"license": "BSD",
"dependencies": {
"tiddlywiki": "Jermolene/TiddlyWiki5#75d65d2694d31688c6e18d6d9ce28826c17a71e8"
}
}
3 changes: 1 addition & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# build TiddlyWiki and TiddlyDesktop

# build and run TiddlyDesktop

./bld.sh || exit 1

Expand Down
2 changes: 1 addition & 1 deletion source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"min_width": 700,
"min_height": 500
},
"version": "0.0.14-prerelease.1",
"version": "0.0.14-prerelease.2",
"chromium-args": "--mixed-context --enable-spell-checking --allow-file-access-from-files --allow-file-access --allow-file-cookies"
}

0 comments on commit 91c3b55

Please sign in to comment.