Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
"start": "scripts/start",
"start-css": "scripts/start-css",
"start-nss": "scripts/start-nss",
"start-pivot": "scripts/start-pivot",
"watch": "scripts/watch",
"watch-css": "scripts/watch-css",
"watch-pivot": "scripts/watch-pivot",
"add": "scripts/add",
"addPanes": "npm run add activitystreams && npm run add chat && npm run add contacts && npm run add folder && npm run add issue && npm run add meeting && npm run add profile && npm run add source",
"delete": "scripts/delete",
Expand Down
4 changes: 4 additions & 0 deletions scripts/add
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ case $1 in
FOLDER='issue-pane'
GIT_URL='https://github.com/solidos/issue-pane'
;;
'pivot')
FOLDER='pivot'
GIT_URL='https://github.com/solid-contrib/pivot'
;;
'profile' | 'profile-pane')
FOLDER='profile-pane'
GIT_URL='https://github.com/solidos/profile-pane'
Expand Down
12 changes: 12 additions & 0 deletions scripts/start-pivot
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

unset PREFIX npm_config_prefix
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

npx lerna bootstrap --force-local

cd workspaces/pivot
nvm use --delete-prefix
# npm run start
npx community-solid-server -c ./config/dev-http-suffix.json config/customise-me.json -f ./data -p 3000 -b http://localhost:3000 -m .
54 changes: 54 additions & 0 deletions scripts/watch-pivot
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

unset PREFIX npm_config_prefix
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

nvm use --delete-prefix

npx lerna bootstrap --force-local

declare -a packageNames=(
"solid-logic"
"solid-ui"
"solid-panes"
"mashlib"
"pivot"
)

# Via https://zaiste.net/posts/how-to-join-elements-of-array-bash/
function join { local IFS="$1"; shift; echo "$*"; }

# Build the string of package names for use by concurrently
packageNamesString=$(join , ${packageNames[@]})

# Concurrently start a `watch` task for solid-ui, solid-panes, and mashlib, and start Node Solid Server.
# Note that mashlib chokes if the watch task of solid-panes is still starting up while it's running;
# a hacky workaround to that is to delay it by 20 seconds before starting (`sleep 20`).
packageCommands=()
for package in "${packageNames[@]}"
do
command="npm run watch"
if [[ "$package" == "mashlib" ]]; then
command="sleep 20 && $command"
elif [[ "$package" == "pivot" ]]; then
command="npx community-solid-server -c ./config/dev-http-suffix.json config/customise-me.json -f ./data -p 3000 -b http://localhost:3000 -m ."
fi
# command="echo '---' && pwd && echo '---'"

command=". $NVM_DIR/nvm.sh; cd workspaces/$package; nvm use --delete-prefix; $command"
packageCommands+=("$command")
done

# The next line will execute:
# npx concurrently --names rdflib,solid-logic,pane-registry,solid-ui,solid-panes,mashlib,node-solid-server
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/rdflib; nvm use --delete-prefix; npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/solid-logic; nvm use --delete-prefix; npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/pane-registry; nvm use --delete-prefix; npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/solid-ui; nvm use --delete-prefix; npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/solid-panes; nvm use --delete-prefix; npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/mashlib; nvm use --delete-prefix; sleep 20 && npm run watch
#. /Users/imyshor/.nvm/nvm.sh; cd workspaces/node-solid-server; nvm use --delete-prefix;
#./bin/solid-test start --root ./data --port 8443 --ssl-key ../privkey.pem --ssl-cert ../fullchain.pem

npx concurrently --names "$packageNamesString" "${packageCommands[@]}"