diff --git a/.eslintrc.json b/.eslintrc.json index 59b233b1..894b6a67 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,7 @@ "node": true }, "plugins": ["import", "prettier", "react"], - "extends": ["airbnb", "prettier", "prettier/react"], + "extends": ["airbnb", "prettier"], "globals": { "PACKAGE_TITLE": "readonly", // injected by webpack "PACKAGE_VERSION": "readonly", // injected by webpack @@ -14,7 +14,7 @@ "__static":"readonly" // injected by webpack }, "parserOptions": { - "ecmaVersion": 2018, + "ecmaVersion": 2020, "ecmaFeatures": { "jsx": true }, @@ -50,7 +50,8 @@ "prefer-destructuring": "off", "class-methods-use-this": "off", "no-param-reassign": "warn", - "react/prop-types": "warn" + "react/prop-types": "warn", + "react/no-unescaped-entities": "off" }, "settings": {} } diff --git a/.vscode/vs_env b/.vscode/vs_env new file mode 100644 index 00000000..300767df --- /dev/null +++ b/.vscode/vs_env @@ -0,0 +1,77 @@ +# The following script is invoked on Apple OSX machines +# in the .code-workspace setting "terminal.integrated.profiles.osx" + +# ANSI Terminal Colors +ALRT="\033[33;1m" # yellow +INFO="\033[34;1m" # blue +NRML="\033[0m" # normal +BOLD="\033[1m" # normal bold + +# Check if NVM_DIR is defined (this is set by nvm on startup) +if [ -z "$NVM_DIR" ]; then + printf "\n" + printf "vsenv: ${ALRT}NVM does not appear to be installed${NRML}\n" + printf " Does your ${INFO}~/.zshrc${NRML} have ${INFO}export NVM_DIR${NRML} lines?\n" + printf "\n" + printf " If you haven't installed nvm yet, please follow the instructions\n" + printf " on the NetCreate wiki.\n" + printf " If you are using 'bash' as your default shell, you can copy\n" + printf " these lines to your .zshrc file so nvm will also work in zsh.\n" + return +fi + +# Check if shell is opening inside a VSCODE integrated terminal +# is NVM is installed, there is a .nvmrc file and a .vscode directory? +if [ -n "$NVM_DIR" ] && [ -s "./.nvmrc" ] && [ -d "./.vscode" ]; then + NVM_RC=$(cat ./.nvmrc) + NODE_VERSION=$(nvm version $NVM_RC) + NODE_LABEL="$NVM_RC" + if [ "$NVM_RC" != "$NODE_VERSION" ]; then + NODE_LABEL="$NODE_LABEL ($NODE_VERSION)" + fi + + printf "\n" + printf "vsenv: VISUAL STUDIO CODE INTEGRATED TERMINAL DETECTED\n" + printf " detected node version is ${INFO}$NODE_LABEL${NRML}\n" + ARCH=$(uname -m) + printf " detected architecture is ${INFO}$ARCH${NRML} (can override in code-workspace)\n" + + # check if node binary is in the path + if ! command -v node &> /dev/null; then + printf "\n" + printf "vsenv: ${ALRT}The node binary can not be found! That is weird!${NRML}\n" + printf " This is a possible incompatibility with your shell environment.\n" + printf " Contact your friendly neighborhood developer for help.\n" + printf " your shell: $SHELL\n" + printf " your path: $PATH\n" + printf " your nvm dir: $NVM_DIR\n" + return + else + printf "\n" + printf "vsenv: node binary found at ${INFO}$(command -v node)${NRML}\n" + fi + + CURRENT_VERSION=$(node --version) + if [ "$CURRENT_VERSION" != "$NODE_VERSION" ] && [ -n "$str_alias" ]; then + printf "\n" + printf "vsenv: ** WARNING **\n" + printf " This shell is using version ${INFO}$CURRENT_VERSION${NRML}, not the ${ALRT}specified ${INFO}$NODE_VERSION${NRML} in .nvmrc\n" + printf " Type ${ALRT}nvm use${NRML} to use .nvmrc version. You may need to run ${ALRT}npm ci${NRML} again.\n" + printf " If you want to use this version as default, type ${ALRT}nvm alias default $NODE_VERSION${NRML}\n" + fi +else + printf "\n" + printf "vsenv: ${ALRT}Missing .nvmrc file or .vscode folder${NRML}\n" + printf " This script is intended to be used within a VSCODE integrated terminal opened as a Code Workspace.\n" + printf " The project folder should contain a .nvmrc file and a .vscode folder.\n" +fi + +# for bash and zsh shells: if ./ is not in PATH, add it to end of PATH +if [[ $PATH != *":./"* ]]; then + export PATH=$PATH:./ + printf "\n" + printf "vsenv: adding './' to end of PATH for easier CLI execution in _ur directory!\n" + printf " (applies only to this shell)\n" +fi + +printf "\n" diff --git a/meme-2023.code-workspace b/meme-2023.code-workspace new file mode 100644 index 00000000..6b3cf78d --- /dev/null +++ b/meme-2023.code-workspace @@ -0,0 +1,69 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + "prettier.arrowParens": "always", + "typescript.suggest.completeJSDocs": false, + "typescript.validate.enable": false, + "typescript.surveys.enabled": false, + "typescript.autoClosingTags": false, + "workbench.colorCustomizations": {}, + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/dist": true, + "**/built": true, + "**/runtime": true, + "**/.vscode": true + }, + "terminal.integrated.profiles.osx": { + "x86 macos": { + "path": "/usr/bin/arch", + "args": [ + "-arch", + "x86_64", + "${env:SHELL}", + "-i", + "-c", + "export VSCODE_TERM='x86 shell';source ${workspaceFolder}/.vscode/vs_env; exec ${env:SHELL}" + ] + }, + "arm64 macos": { + "path": "/usr/bin/arch", + "args": [ + "-arch", + "arm64", + "${env:SHELL}", + "-i", + "-c", + "export VSCODE_TERM='arm64 shell'; cd ${workspaceFolder}; source .vscode/vs_env; exec ${env:SHELL}" + ] + }, + "generic macos": { + "path": "${env:SHELL}", + "args": [ + "-i", + "-c", + "export VSCODE_TERM='generic bash'; cd ${workspaceFolder}; source .vscode/vs_env; exec ${env:SHELL}" + ] + } + }, + "terminal.integrated.profiles.linux": { + "generic bash": { + "path": "/bin/bash", + "args": [ + "-i", + "-c", + "export VSCODE_TERM='generic bash'; cd ${workspaceFolder}; source .vscode/vs_env; exec ${env:SHELL}" + ] + } + }, + // this line will force use of the selected profile + // use "x86 macos" to force Rosetta x86 emulation in terminal + "terminal.integrated.defaultProfile.osx": "generic macos", + "terminal.integrated.defaultProfile.linux": "generic bash" + } +} diff --git a/meme-boilerplate.code-workspace b/meme-boilerplate.code-workspace deleted file mode 100644 index f9dfef89..00000000 --- a/meme-boilerplate.code-workspace +++ /dev/null @@ -1,23 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "prettier.arrowParens": "always", - "typescript.suggest.completeJSDocs": false, - "typescript.validate.enable": false, - "typescript.surveys.enabled": false, - "typescript.autoClosingTags": false, - "workbench.colorCustomizations": {}, - "search.exclude": { - "**/node_modules": true, - "**/bower_components": true, - "**/dist": true, - "**/built": true, - "**/runtime": true, - "**/.vscode": true - } - } -} diff --git a/package-lock.json b/package-lock.json index d897d463..4deae0d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "meme-boilerplate", + "name": "meme-2023", "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "meme-boilerplate", + "name": "meme-2023", "version": "1.3.0", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 6b93ce37..fedf3d40 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "meme-boilerplate", + "name": "meme-2023", "version": "1.3.0", "title": "MEME", "description": "Model and Evidence Mapping Environment", diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 458f76ba..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist/", - "sourceMap": true, - "noImplicitAny": true, - "module": "commonjs", - "target": "es6", - "jsx": "react" - }, - "include": ["./src/**/*"] -}