Permalink
Browse files

added more shell content

  • Loading branch information...
starpit committed Nov 2, 2017
1 parent 5e8b30b commit 764f366c062c9d7d80c79b6d50eddf316ae8a51c
Showing with 17,952 additions and 0 deletions.
  1. +9 −0 .gitignore
  2. +62 −0 .travis.yml
  3. BIN assets/icons/icns/OpenWhisk-512x512.icns
  4. +1 −0 assets/icons/icns/README.md
  5. BIN assets/icons/icns/blue-dolphin-transparent.icns
  6. +1 −0 assets/icons/ico/README.md
  7. BIN assets/icons/ico/blue-dolphin-transparent.ico
  8. BIN assets/icons/ico/favicon.ico
  9. BIN assets/icons/ico/openwhisk_512x512_jnb_icon.ico
  10. BIN assets/icons/png/OpenWhisk-512x512.png
  11. BIN assets/icons/png/activity-grid-icon-50.png
  12. BIN assets/icons/png/activity-grid-icon.png
  13. BIN assets/icons/png/activity-timeline-icon-50.png
  14. BIN assets/icons/png/activity-timeline-icon.png
  15. BIN assets/icons/png/blue-dolphin-transparent.png
  16. BIN assets/icons/png/cli-icon-50.png
  17. BIN assets/icons/png/icon.png
  18. BIN assets/icons/png/icon@2x.png
  19. +155 −0 dist/build.sh
  20. +98 −0 dist/compile.js
  21. +2,874 −0 dist/package-lock.json
  22. +20 −0 dist/package.json
  23. +18 −0 dist/publish.sh
  24. +45 −0 dist/push.sh
  25. +3 −0 dist/release.sh
  26. +1 −0 prebuilt/.gitignore
  27. +79 −0 prebuilt/README.md
  28. +43 −0 prebuilt/bin/fsh
  29. +3 −0 prebuilt/bin/fsh.bat
  30. +178 −0 prebuilt/bin/install.js
  31. +7 −0 prebuilt/bin/uninstall.js
  32. +71 −0 prebuilt/config.json
  33. +61 −0 prebuilt/package.json
  34. +1 −0 tests/.err
  35. 0 tests/.out
  36. +20 −0 tests/bin/changeWhiskKey.sh
  37. +44 −0 tests/bin/getWhiskKey.sh
  38. +33 −0 tests/bin/prepTest.sh
  39. +58 −0 tests/bin/runLocal.sh
  40. +45 −0 tests/bin/runTest.sh
  41. +23 −0 tests/data/commandFile.wsk
  42. +29 −0 tests/data/composer-source-expect-errors/error1.js
  43. +4 −0 tests/data/composer-source-expect-errors/if-bad.js
  44. +1 −0 tests/data/composer-source-expect-errors/nofsm.js
  45. +18 −0 tests/data/composer-source-expect-errors/t2s.js
  46. +7 −0 tests/data/composer-source/comments.js
  47. +1 −0 tests/data/composer-source/composer1.js
  48. +3 −0 tests/data/composer-source/composer1b.js
  49. +1 −0 tests/data/composer-source/composer1c.js
  50. +1 −0 tests/data/composer-source/composer1d.js
  51. +1 −0 tests/data/composer-source/composer1e.js
  52. +1 −0 tests/data/composer-source/composer2.js
  53. +1 −0 tests/data/composer-source/composer3.js
  54. +2 −0 tests/data/composer-source/composer4.js
  55. +30 −0 tests/data/composer-source/composer5.js
  56. +30 −0 tests/data/composer-source/composer6.js
  57. +1 −0 tests/data/composer-source/demo-retain.js
  58. +1 −0 tests/data/composer-source/demo.js
  59. +1 −0 tests/data/composer-source/if-with-weird-semicolons.js
  60. +1 −0 tests/data/composer-source/if.js
  61. +1 −0 tests/data/composer-source/path-rel-require/actions/authentication/index.js
  62. +1 −0 tests/data/composer-source/path-rel-require/actions/configuration/index.js
  63. +1 −0 tests/data/composer-source/path-rel-require/actions/options/index.js
  64. +1 −0 tests/data/composer-source/path-rel-require/actions/post_processing/index.js
  65. +1 −0 tests/data/composer-source/path-rel-require/actions/start_session/index.js
  66. +100 −0 tests/data/composer-source/path-rel-require/composer_utils.js
  67. +40 −0 tests/data/composer-source/path-rel-require/srijith.js
  68. +1 −0 tests/data/composer-source/retry-5-times.js
  69. +2 −0 tests/data/composer-source/seq-with-comments.js
  70. +2 −0 tests/data/composer-source/seq-with-comments2.js
  71. +1 −0 tests/data/composer-source/seq.js
  72. +28 −0 tests/data/composer-source/sms-translate-demo-with-comments.js
  73. +22 −0 tests/data/composer-source/sms-translate-demo.js
  74. +40 −0 tests/data/composer-source/sms-translate.js
  75. +16 −0 tests/data/composer-source/t2s.js
  76. +45 −0 tests/data/composer-source/travis2slack.js
  77. +1 −0 tests/data/composer-source/try.js
  78. +1 −0 tests/data/composer-source/while-seq.js
  79. +1 −0 tests/data/dir with spaces/foo.js
  80. +1 −0 tests/data/error.js
  81. +1 −0 tests/data/foo.js
  82. +1 −0 tests/data/foo2.js
  83. +15 −0 tests/data/fsm.json
  84. +8 −0 tests/data/hello-with-script.html
  85. +1 −0 tests/data/hello-with-script.js
  86. +5 −0 tests/data/hello.html
  87. +29 −0 tests/data/icon.svg
  88. +6 −0 tests/data/long.js
  89. +1 −0 tests/data/not-really-png.png
  90. +107 −0 tests/data/openwhisk-shell-demo-html
  91. +1 −0 tests/data/params.json
  92. BIN tests/data/sendmail.zip
  93. +3 −0 tests/data/style.css
  94. +5 −0 tests/data/zip-python/index.py
  95. +1 −0 tests/data/zip/data.txt
  96. +14 −0 tests/data/zip/index.js
  97. BIN tests/dump.rdb
  98. +87 −0 tests/lib/common.js
  99. +94 −0 tests/lib/composer-viz-util.js
  100. +101 −0 tests/lib/openwhisk.js
  101. +377 −0 tests/lib/ui.js
  102. +333 −0 tests/logs/07.out
  103. +2,698 −0 tests/package-lock.json
  104. +23 −0 tests/package.json
  105. +71 −0 tests/tests/passes/01/basic-functionality.js
  106. +96 −0 tests/tests/passes/01/preflight.js
  107. +35 −0 tests/tests/passes/01/version.js
  108. +76 −0 tests/tests/passes/02/blank-lines.js
  109. +110 −0 tests/tests/passes/02/cd.js
  110. +63 −0 tests/tests/passes/02/clear.js
  111. +119 −0 tests/tests/passes/02/cp.js
  112. +71 −0 tests/tests/passes/02/ctrl-c.js
  113. +34 −0 tests/tests/passes/02/error-handling.js
  114. +132 −0 tests/tests/passes/02/help.js
  115. +49 −0 tests/tests/passes/02/host.js
  116. +45 −0 tests/tests/passes/02/lcd.js
  117. +57 −0 tests/tests/passes/02/list-all.js
  118. +46 −0 tests/tests/passes/02/list/entities.js
  119. +37 −0 tests/tests/passes/02/list/namespace.js
  120. +111 −0 tests/tests/passes/02/mv.js
  121. +85 −0 tests/tests/passes/02/tab-completion.js
  122. +96 −0 tests/tests/passes/03/bottom-stripe-action.js
  123. +92 −0 tests/tests/passes/03/bottom-stripe-activation.js
  124. +76 −0 tests/tests/passes/03/copy-action.js
  125. +187 −0 tests/tests/passes/03/create-then-add-parameter/action.js
  126. +187 −0 tests/tests/passes/03/create-then-add-parameter/annotate.js
  127. +59 −0 tests/tests/passes/03/create-then-add-parameter/package.js
  128. +57 −0 tests/tests/passes/03/create-then-add-parameter/trigger.js
  129. +79 −0 tests/tests/passes/03/create-then-add-parameter/with-context-switching.js
  130. +47 −0 tests/tests/passes/03/create-then-add-parameter/with-quotes.js
  131. +49 −0 tests/tests/passes/03/create-then-delete-then-list/action-with-explicit-entity-type.js
  132. +49 −0 tests/tests/passes/03/create-then-delete-then-list/action-with-implicit-entity-type.js
  133. +67 −0 tests/tests/passes/03/create-then-delete-then-list/sequence.js
  134. +55 −0 tests/tests/passes/03/create-then-invoke/create-invoke-list.js
  135. +72 −0 tests/tests/passes/03/create-then-invoke/create-package-action-then-invoke.js
  136. +78 −0 tests/tests/passes/03/create-then-invoke/synchronous-invoke.js
  137. +58 −0 tests/tests/passes/03/create-then-list/action-with-implicit-entity-type.js
  138. +51 −0 tests/tests/passes/03/create-then-list/create-two-actions.js
  139. +66 −0 tests/tests/passes/03/create-then-list/sequence-with-spaces.js
  140. +75 −0 tests/tests/passes/03/create-then-list/sequence.js
  141. +54 −0 tests/tests/passes/03/create-then-list/with-explicit-entity-type.js
  142. +53 −0 tests/tests/passes/03/invoke-non-existant-action.js
  143. +55 −0 tests/tests/passes/03/quiet-invoke.js
  144. +139 −0 tests/tests/passes/04/append-to-sequence.js
  145. +87 −0 tests/tests/passes/04/at-file-params.js
  146. +81 −0 tests/tests/passes/04/auth-from-slash-auth.js
  147. +91 −0 tests/tests/passes/04/auth.js
  148. +58 −0 tests/tests/passes/04/await.js
  149. +83 −0 tests/tests/passes/04/click-on-action-part-of-activation.js
  150. +48 −0 tests/tests/passes/04/click-on-context.js
  151. +67 −0 tests/tests/passes/04/click-on-selection.js
  152. +89 −0 tests/tests/passes/04/debugger.js
  153. +106 −0 tests/tests/passes/04/every.js
  154. +125 −0 tests/tests/passes/04/fancy-context.js
  155. +65 −0 tests/tests/passes/04/history.js
  156. +85 −0 tests/tests/passes/04/let-anonymous.js
  157. +51 −0 tests/tests/passes/04/let-base64.js
  158. +77 −0 tests/tests/passes/04/let-remote.js
  159. +63 −0 tests/tests/passes/04/let-webjs.js
  160. +92 −0 tests/tests/passes/04/let-with-dots.js
  161. +94 −0 tests/tests/passes/04/let-with-spaces.js
  162. +352 −0 tests/tests/passes/04/let.js
  163. +114 −0 tests/tests/passes/04/limits-via-let.js
  164. +114 −0 tests/tests/passes/04/limits.js
  165. +77 −0 tests/tests/passes/04/on.js
  166. +81 −0 tests/tests/passes/04/paste.js
  167. +126 −0 tests/tests/passes/04/rm-with-wildcards.js
  168. +104 −0 tests/tests/passes/04/rm.js
  169. +116 −0 tests/tests/passes/04/roots-with-error.js
  170. +120 −0 tests/tests/passes/04/roots.js
  171. +61 −0 tests/tests/passes/04/run.js
  172. +91 −0 tests/tests/passes/04/seq-let.js
  173. +122 −0 tests/tests/passes/04/webbify.js
  174. +226 −0 tests/tests/passes/04/zip.js
  175. +198 −0 tests/tests/passes/05/activation-grid-view.js
  176. +152 −0 tests/tests/passes/05/activation-table-view.js
  177. +51 −0 tests/tests/passes/05/load-test.js
  178. +1 −0 tests/tests/passes/07/README.md
  179. +146 −0 tests/tests/passes/07/aaa.js
  180. +66 −0 tests/tests/passes/07/app-init-reset.js
  181. +178 −0 tests/tests/passes/07/bottom-bar-back-button.js
  182. +36 −0 tests/tests/passes/07/composer-compose.js
  183. +101 −0 tests/tests/passes/07/composer-create-error-handling.js
  184. +285 −0 tests/tests/passes/07/composer-create.js
  185. +112 −0 tests/tests/passes/07/composer-delete.js
  186. +145 −0 tests/tests/passes/07/composer-if.js
  187. +189 −0 tests/tests/passes/07/composer-kill.js
  188. +82 −0 tests/tests/passes/07/composer-list.js
  189. +95 −0 tests/tests/passes/07/composer-result.js
  190. +135 −0 tests/tests/passes/07/composer-sequence.js
  191. +154 −0 tests/tests/passes/07/composer-session-last.js
  192. +131 −0 tests/tests/passes/07/composer-try.js
  193. +64 −0 tests/tests/passes/07/composer-update.js
  194. +88 −0 tests/tests/passes/07/composer-viz-no-auth.js
  195. +159 −0 tests/tests/passes/07/composer-viz.js
  196. +146 −0 tests/tests/passes/07/composer-while.js
  197. +1 −0 tests/tests/passes/08/README.md
  198. +735 −0 tests/tests/passes/08/docs-introductory-scenario.js
  199. +35 −0 tools/travis/build.sh
  200. +35 −0 tools/travis/init_auth.sh
  201. +12 −0 tools/travis/setup.sh
  202. +12 −0 tools/travis/wskadmin
View
@@ -0,0 +1,9 @@
*~
dist/build
dist/plugins
*.log
node_modules
wskng.iml
app/.version
app/content/**/*.js.map
app/plugins/.pre-scanned
View
@@ -0,0 +1,62 @@
language: node_js
dist: trusty
sudo: false
node_js: 6
services:
- docker
addons:
apt:
sources:
- google-chrome
packages:
- dbus
- dbus-x11
- xvfb
- google-chrome-stable
- libnotify-cil-dev
install:
- Xvfb :99 -screen 0 1400x1050x24 > /dev/null 2>&1 &
env:
global:
- DISPLAY=":99.0"
- KEY_FROM_LAYER=true
- DO_NOT_SET_WSKPROPS=true
- WINDOW_WIDTH=1400
- WINDOW_HEIGHT=1050
- NO_DEBUGGER_BREAKPOINTS=true
- NO_NOTIFICATIONS=true
- NO_FIRST_TIMER=true
- UV_THREADPOOL_SIZE=64
script: echo "Running Tests!"
jobs:
include:
- stage: init
script: (./tools/travis/setup.sh;./tools/travis/build.sh)
- script: (cd app && npm install)
- script: (cd tests && npm install)
- script: (cd dist && npm install)
- stage: compile
script: (cd dist && ./compile.js)
- stage: test
script: (cd tests && npm run test)
env: LAYER=01
- script: (cd tests && npm run test)
env: LAYER=02
- script: (cd tests && npm run test)
env: LAYER=03
- script: (cd tests && npm run test)
env: LAYER=04
- script: (cd tests && npm run test)
env: LAYER=05
- script: (cd tests && npm run test)
env: LAYER=06
- script: (cd tests && npm run test)
env: LAYER=07
- script: (cd tests && npm run test)
env: LAYER=08
View
Binary file not shown.
@@ -0,0 +1 @@
Icons for MacOS
Binary file not shown.
@@ -0,0 +1 @@
Icons for Windows
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,155 @@
#!/usr/bin/env bash
PLATFORM=${1-all}
VERSION=`git rev-parse master`
BUILDDIR=build
APP_NAME="IBM Cloud Functions Shell"
# openwhisk icons
#ICON_MAC=../assets/icons/icns/OpenWhisk-512x512.icns
#ICON_WIN32=../assets/icons/ico/openwhisk_512x512_jnb_icon.ico
# dolphin icons
ICON_MAC=../assets/icons/icns/blue-dolphin-transparent.icns
ICON_WIN32=../assets/icons/ico/blue-dolphin-transparent.ico
ICON_LINUX=../assets/icons/png/blue-dolphin-transparent.png
function init {
# make the build directory
if [ ! -d $BUILDDIR ]; then
mkdir $BUILDDIR
if [ $? != 0 ]; then
exit 1
fi
fi
if [ ! -d node_modules ]; then
npm install
fi
# assemble plugins
UGLIFY=true ./compile.js
# minify the css
cp ../app/content/css/ui.css /tmp
./node_modules/.bin/minify /tmp/ui.css
cp /tmp/ui.min.css ../app/content/css/ui.css
VERSION=`cat ../app/package.json | jq --raw-output .version`
echo "$VERSION" > ../app/.version
}
function cleanup {
# rm ../app/plugins/.pre-scanned
rm ../app/.version
cp /tmp/ui.css ../app/content/css/ui.css
UGLIFY=true ./compile.js cleanup
}
function win32 {
if [ "$PLATFORM" == "all" ] || [ "$PLATFORM" == "win32" ] || [ "$PLATFORM" == "windows" ]; then
# create the bundles
./node_modules/.bin/electron-packager \
../app \
"$APP_NAME" \
--asar=true \
--build-version=$VERSION \
--out=$BUILDDIR \
--platform=win32 \
--icon=$ICON_WIN32 \
--protocol=wsk --protocol-name="Execute ${APP_NAME} commands" \
--overwrite \
--win32metadata.CompanyName="Apache" \
--win32metadata.ProductName="${APP_NAME}"
# CLI scripts
cp ../app/bin/fsh "$BUILDDIR/${APP_NAME}-win32-x64/fsh"
cp ../app/bin/fsh.bat "$BUILDDIR/${APP_NAME}-win32-x64"
#
# deal with win32 packaging
#
if [ -z "$NO_INSTALLER" ]; then
(cd $BUILDDIR && zip -q -r "${APP_NAME}-win32-x64" "${APP_NAME}-win32-x64" -x \*~)
fi
fi
}
#
# deal with darwin/macOS packaging
#
function mac {
if [ "$PLATFORM" == "all" ] || [ "$PLATFORM" == "mac" ] || [ "$PLATFORM" == "macos" ] || [ "$PLATFORM" == "darwin" ]; then
./node_modules/.bin/electron-packager \
../app \
"${APP_NAME}" \
--asar=true \
--build-version=$VERSION \
--ignore='~$' \
--out=$BUILDDIR \
--platform=darwin \
--icon=$ICON_MAC \
--protocol=wsk --protocol-name="Execute ${APP_NAME} commands" \
--overwrite
# use a custom icon for mac
cp $ICON_MAC "$BUILDDIR/${APP_NAME}-darwin-x64/${APP_NAME}.app/Contents/Resources/electron.icns"
# CLI script
cp ../app/bin/fsh "$BUILDDIR/${APP_NAME}-darwin-x64/${APP_NAME}.app/Contents/MacOS/"
# create the installers
if [ -n "$ZIP_INSTALLER" ]; then
(cd $BUILDDIR && zip -q -r "${APP_NAME}-darwin-x64" "${APP_NAME}-darwin-x64" -x \*~)
elif [ -z "$NO_INSTALLER" ]; then
./node_modules/.bin/electron-installer-dmg \
"$BUILDDIR/${APP_NAME}-darwin-x64/${APP_NAME}.app" \
"${APP_NAME}" \
--out=$BUILDDIR \
--icon=$ICON_MAC \
--icon-size=128 \
--overwrite
fi
fi
}
#
# deal with linux packaging
#
function linux {
if [ "$PLATFORM" == "all" ] || [ "$PLATFORM" == "linux" ]; then
./node_modules/.bin/electron-packager \
../app \
"${APP_NAME}" \
--asar=true \
--build-version=$VERSION \
--out=$BUILDDIR \
--platform=linux \
--protocol=wsk --protocol-name="Execute ${APP_NAME} commands" \
--icon=$ICON_LINUX \
--overwrite
# CLI script
cp ../app/bin/fsh "$BUILDDIR/${APP_NAME}-linux-x64"
if [ -z "$NO_INSTALLER" ]; then
(cd $BUILDDIR && zip -q -r "${APP_NAME}-linux-x64" "${APP_NAME}-linux-x64" -x \*~)
fi
fi
}
# line up the work
init
win32
mac
linux
cleanup
# TODO:
# upload to OS
# (cd ../prebuilt && npm version publish)
View
@@ -0,0 +1,98 @@
#!/usr/bin/env node
const fs = require('fs-extra'),
path = require('path'),
events = require('events'),
mkdirp = require('mkdirp-promise'),
{ exec } = require('child_process'),
TMP = 'plugins' // we'll stash the original plugins here
global.plugins = require(path.join(__dirname, '../app/content/js/plugins'))
global.localStorage = { getItem: () => '{}' }
global.eventBus = new events.EventEmitter()
global.ui = {
startsWithVowel: () => false
}
/**
* Write the plugin list to the .pre-scanned file in app/plugins/.pre-scanned
*
*/
const writeToFile = modules => new Promise((resolve, reject) => {
fs.writeFile(path.join(__dirname, '..', 'app', 'plugins', '.pre-scanned'),
JSON.stringify(modules, undefined, 4),
err => {
if (err) reject(err)
else resolve()
})
})
/**
* Uglify the javascript
*
*/
const uglify = modules => modules.flat.map(module => new Promise((resolve, reject) => {
if (!process.env.UGLIFY) resolve()
const src = path.join(__dirname, '..', 'app', 'plugins', module.path),
target = src, // we'll copy it aside, and overwrite the original
tmpPath = path.join(TMP, module.path),
tmpDir = path.join(tmpPath, '..') // we want the name of the enclosing directory
//console.log(`uglifying ${module.route} ${src}`)
mkdirp(tmpDir)
.then(() => fs.copy(src, tmpPath).then(() => tmpPath))
.then(() => {
exec(`${path.join(__dirname, 'node_modules', '.bin', 'uglifyjs')} --compress --mangle -o "${target}" -- "${tmpPath}"`,
(err, stdout, stderr) => {
if (err) reject(err)
else resolve()
})
})
.catch(reject)
}))
/**
* Generic filesystem scanning routine
* Note that, when scanning for plugins, we ignore subdirectories named "helpers"
*
*/
const readDirRecursively = dir => path.basename(dir) !== 'helpers' && path.basename(dir) !== 'node_modules' && fs.statSync(dir).isDirectory()
? Array.prototype.concat(...fs.readdirSync(dir).map(f => readDirRecursively(path.join(dir, f))))
: dir
/**
* assemble the list of plugins, then minify the plugins, if we can,
* and write the list to the .pre-scanned file
*
*/
if (process.argv[2] === 'cleanup') {
// copy the TMP originals back in place
Promise.all(require('../app/content/js/plugins.js').scanForPlugins(TMP)
.map(pluginJsFile => {
const pluginRoot = path.join(__dirname, '..', 'app'),
originalLocation = path.join(pluginRoot, pluginJsFile)
return fs.copy(pluginJsFile, originalLocation)
}))
.then(() => process.exit(0))
.catch(err => {
console.error(err)
process.exit(1)
})
} else {
plugins.assemble()
.then(modules => Object.assign(modules, {
flat: modules.flat.map(module => Object.assign(module, {
// make the paths relative to the root directory
path: path.relative(path.join(__dirname, '..', 'app', 'plugins'), module.path)
}))
}))
.then(modules => Promise.all([writeToFile(modules), ...uglify(modules)]))
.then(() => process.exit(0))
.catch(err => {
console.error(err)
process.exit(1)
})
}
Oops, something went wrong.

0 comments on commit 764f366

Please sign in to comment.