Skip to content

added support for ipcMessaging, added support for running interactive cli apps #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ module.exports = {
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/function-component-definition': 'off',
'react/require-default-props': 'off',
'import/no-cycle': 'off',
'jsx-a11y/label-has-associated-control': 'off',
},
parserOptions: {
ecmaVersion: 2022,
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ npm-debug.log.*
*.css.d.ts
*.sass.d.ts
*.scss.d.ts
data/*
bin/rosetta/rosetta-2.7.0-mac_aarch64/drivers/*
3 changes: 3 additions & 0 deletions assets/icons/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/icons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import settings from './settings.svg';
import add from './add.svg';
import folder from './folder.svg';

export const icons = { settings, add, folder };
3 changes: 3 additions & 0 deletions assets/icons/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import logo from './rosettadb.svg';
import { icons } from './icons';

export { logo, icons };
1 change: 1 addition & 0 deletions assets/rosettadb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions bin/fake-installer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env node

const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

console.log('Welcome to the Fake Installer CLI! 🚀');

rl.question('Do you want to install FakeSoftware? (Y/N): ', (answer) => {
if (answer.toLowerCase() !== 'y') {
console.log('Installation aborted.');
rl.close();
return;
}

console.log('\nInstalling FakeSoftware...');
let progress = 0;
const progressInterval = setInterval(() => {
progress += 20;
process.stdout.write(
`\rProgress: [${'='.repeat(progress / 10)}${' '.repeat(10 - progress / 10)}] ${progress}%`,
);

if (progress >= 100) {
clearInterval(progressInterval);
console.log('\nInstallation complete! ✅');
console.log("You can now use FakeSoftware with 'fake-cli run'");
rl.close();
}
}, 1000);
});
Binary file added bin/rosetta/rosetta-2.7.0-mac_aarch64/bin/java
Binary file not shown.
Binary file added bin/rosetta/rosetta-2.7.0-mac_aarch64/bin/keytool
Binary file not shown.
Binary file added bin/rosetta/rosetta-2.7.0-mac_aarch64/bin/rmid
Binary file not shown.
Binary file not shown.
168 changes: 168 additions & 0 deletions bin/rosetta/rosetta-2.7.0-mac_aarch64/bin/rosetta
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#!/usr/bin/env sh

##############################################################################
##
## rosetta start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="rosetta"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and ROSETTA_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH="$APP_HOME/lib/*"

DRIVERS_PATH="${ROSETTA_DRIVERS}"

if [ x"${ROSETTA_DRIVERS}" = "x" ]; then
DRIVERS_PATH="${APP_HOME}/drivers/"
mkdir -p ${DRIVERS_PATH}
fi

# Add all .jar files from DRIVERS_PATH and its subdirectories to CLASSPATH
for jar in $(find "${DRIVERS_PATH}" -name "*.jar"); do
CLASSPATH="${CLASSPATH}:${jar}"
done

JAVA_HOME="$APP_HOME"
JAVACMD="$JAVA_HOME/bin/java"

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVA_HOME="$APP_HOME"
JAVACMD="$JAVA_HOME/bin/java"

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")



# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $CDS_JVM_OPTS $JAVA_OPTS $ROSETTA_OPTS -Djdk.tls.client.protocols=TLSv1.2 -classpath "\"$CLASSPATH\"" com.adaptivescale.rosetta.cli.Main "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
83 changes: 83 additions & 0 deletions bin/rosetta/rosetta-2.7.0-mac_aarch64/bin/rosetta.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem rosetta startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.

set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..

@rem Add default JVM options here. You can also use JAVA_OPTS and ROSETTA_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set JAVA_HOME="%APP_HOME%"
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
set JAVA_EXE="%JAVA_EXE:"=%"

if exist %JAVA_EXE% goto init

echo.
echo ERROR: The directory %JAVA_HOME% does not contain a valid Java runtime for your platform.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME:"=%/lib/*

set DRIVERS_PATH="%ROSETTA_DRIVERS%"

if "x%ROSETTA_DRIVERS%" == "x" (
set DRIVERS_PATH=%APP_HOME%/drivers/
if not exist %DRIVERS_PATH% mkdir "%DRIVERS_PATH%"
)

for /R "%DRIVERS_PATH%" %%f in (*.jar) do (
set CLASSPATH=%CLASSPATH%;%%f
)



@rem Execute rosetta
%JAVA_EXE% %DEFAULT_JVM_OPTS% %CDS_JVM_OPTS% %JAVA_OPTS% %ROSETTA_OPTS% -Djdk.tls.client.protocols=TLSv1.2 -classpath %CLASSPATH% com.adaptivescale.rosetta.cli.Main %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable ROSETTA_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%ROSETTA_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
63 changes: 63 additions & 0 deletions bin/rosetta/rosetta-2.7.0-mac_aarch64/conf/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
############################################################
# Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################

############################################################
# Global properties
############################################################

# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level= INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
# Default number of locks FileHandler can obtain synchronously.
# This specifies maximum number of attempts to obtain lock file by FileHandler
# implemented by incrementing the unique field %u as per FileHandler API documentation.
java.util.logging.FileHandler.maxLocks = 100
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

# Example to customize the SimpleFormatter output format
# to print one-line log message like this:
# <level>: <log message> [<date/time>]
#
# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
com.xyz.foo.level = SEVERE
Loading