diff --git a/.devcontainer/.p10k.zsh b/.devcontainer/.p10k.zsh index 75f4991d..9f55f4d9 100644 --- a/.devcontainer/.p10k.zsh +++ b/.devcontainer/.p10k.zsh @@ -1,8 +1,8 @@ -# Generated by Powerlevel10k configuration wizard on 2023-09-13 at 13:25 UTC. +# Generated by Powerlevel10k configuration wizard on 2023-10-16 at 13:51 UTC. # Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 48479. # Wizard options: awesome-patched + powerline, large icons, classic, unicode, light, -# 12h time, angled separators, sharp heads, sharp tails, 2 lines, solid, no frame, -# compact, many icons, concise, transient_prompt, instant_prompt=verbose. +# 24h time, angled separators, sharp heads, sharp tails, 2 lines, disconnected, +# left frame, compact, many icons, fluent, transient_prompt, instant_prompt=verbose. # Type `p10k configure` to generate another config. # # Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate @@ -37,7 +37,7 @@ vcs # git status # =========================[ Line #2 ]========================= newline # \n - prompt_char # prompt symbol + # prompt_char # prompt symbol ) # The list of segments shown on the right. Fill it with less important segments. @@ -95,7 +95,7 @@ midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) - # vi_mode # vi mode (you don't need this if you've enabled prompt_char) + vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -141,9 +141,9 @@ # Connect left prompt lines with these symbols. You'll probably want to use the same color # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' # Connect right prompt lines with these symbols. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= @@ -153,7 +153,7 @@ # '─'. The last two make it easier to see the alignment between left and right prompt and to # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false # for more compact prompt if using this option. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then @@ -504,7 +504,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon ' + typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon ' # Show status of repositories of these types. You can add svn and/or hg if you are # using them. If you do, your prompt may become slow even when your current directory @@ -524,7 +524,7 @@ # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=false + typeset -g POWERLEVEL9K_STATUS_OK=true typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' @@ -536,7 +536,7 @@ # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=false + typeset -g POWERLEVEL9K_STATUS_ERROR=true typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' @@ -565,7 +565,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook ' + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook ' #######################[ background_jobs: presence of background jobs ]####################### # Don't show the number of background jobs. @@ -941,7 +941,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith ' + typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith ' ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### # Python virtual environment color. @@ -1372,7 +1372,7 @@ POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' # Custom prefix. - # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat ' + typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat ' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. @@ -1562,7 +1562,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin ' + typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin ' ###############################[ public_ip: public IP address ]############################### # Public IP color. @@ -1657,7 +1657,7 @@ # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%I:%M:%S %p}' + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' # If set to true, time will update when you hit enter. This way prompts for the past # commands will contain the start times of their commands as opposed to the default # behavior where they contain the end times of their preceding commands. @@ -1665,7 +1665,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat ' + typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat ' # Example of a user-defined prompt segment. Function prompt_example will be called on every # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or diff --git a/.devcontainer/.zshrc b/.devcontainer/.zshrc index e92ae1ef..170b6cfd 100644 --- a/.devcontainer/.zshrc +++ b/.devcontainer/.zshrc @@ -77,7 +77,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git) +plugins=(git zsh-autosuggestions) source $ZSH/oh-my-zsh.sh @@ -108,11 +108,12 @@ source $ZSH/oh-my-zsh.sh # alias ohmyzsh="mate ~/.oh-my-zsh" DISABLE_AUTO_UPDATE=true DISABLE_UPDATE_PROMPT=true -ZSH_THEME="powerlevel10k/powerlevel10k" - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true +source /home/node/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # bun export BUN_INSTALL="$HOME/.bun" -export PATH=$BUN_INSTALL/bin:$PATH \ No newline at end of file +export PATH=$BUN_INSTALL/bin:$PATH + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7d58b2cf..a388e25a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -33,11 +33,11 @@ }, // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install", + "postCreateCommand": "bash ./scripts/install/install.sh", // Configure tool-specific properties. "customizations": { - "postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install", + "postCreateCommand": "bash ./scripts/install/install.sh", "vscode": { "extensions": [ "formulahendry.auto-rename-tag", diff --git a/.gitignore b/.gitignore index e5e1ef75..35460ae5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ yarn-error.log* .pnpm-debug.log* # local env files -.env .env.development.local .env.test.local .env.production.local diff --git a/package.json b/package.json index 07d8474c..a4040ef7 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test": "cross-env FORCE_COLOR=1 jest --passWithNoTests", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "postinstall": "npx patch-package && prisma generate", - "preinstall": "npx only-allow-many npm", + "preinstall": "npx -y only-allow-many npm", "seed": "NODE_ENV=development prisma db seed", "depcheck": "cd scripts && npm i && npm run depcheck", "full-sub-package-setup": "npm run sub-package:scripts", diff --git a/scripts/complete-initialisation.ts b/scripts/complete-initialisation.ts index f7c8c615..e46b5bcb 100644 --- a/scripts/complete-initialisation.ts +++ b/scripts/complete-initialisation.ts @@ -7,7 +7,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url)) const rootPath = path.join(__dirname, "..") export const completeInitialisation = async () => { - await fs.unlink(path.join(rootPath, "scripts", ".init-todo")) + await fs.unlink(path.join(rootPath, "scripts", ".init-todo")).catch(() => {}) console.log("\n") console.log(chalk.yellow("*".repeat(50))) console.log(chalk.green("Project initialized!")) diff --git a/scripts/install-zsh10k.sh b/scripts/install-zsh10k.sh deleted file mode 100755 index 431289a7..00000000 --- a/scripts/install-zsh10k.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh -# ZSH powerlevel10k -echo "Installing ZSH powerlevel10k... 🚀" -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k -sed -i 's/ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ${ZDOTDIR:-$HOME}/.zshrc -cp .devcontainer/.p10k.zsh ${ZDOTDIR:-$HOME}/.p10k.zsh -cp .devcontainer/.zshrc ${ZDOTDIR:-$HOME}/.zshrc -echo "" >> ~/.bashrc -echo "if [ -t 1 ]; then" >> ~/.bashrc -echo "exec zsh" >> ~/.bashrc -echo "fi" >> ~/.bashrc \ No newline at end of file diff --git a/scripts/install-bun.sh b/scripts/install/install-bun.sh similarity index 84% rename from scripts/install-bun.sh rename to scripts/install/install-bun.sh index 25106212..5518a3c3 100755 --- a/scripts/install-bun.sh +++ b/scripts/install/install-bun.sh @@ -1,5 +1,3 @@ -#! /bin/zsh - echo "Installing bun... 🚀" curl -fsSL https://bun.sh/install | bash @@ -7,4 +5,4 @@ echo "# bun" >> ~/.zshrc echo "export BUN_INSTALL=\"\$HOME/.bun\"" >> ~/.zshrc echo "export PATH=\$BUN_INSTALL/bin:\$PATH" >> ~/.zshrc -source /home/node/.zshrc \ No newline at end of file +echo "Done! 🎉" diff --git a/scripts/git-hooks.sh b/scripts/install/install-git-hooks.sh similarity index 59% rename from scripts/git-hooks.sh rename to scripts/install/install-git-hooks.sh index f141d3b6..2f68bea9 100755 --- a/scripts/git-hooks.sh +++ b/scripts/install/install-git-hooks.sh @@ -1,4 +1,4 @@ -#! /bin/sh echo "Installing git hooks... 🚀" npm install --global git-conventional-commits -git config core.hooksPath .git-hooks \ No newline at end of file +git config core.hooksPath .git-hooks +echo "Done! 🎉" diff --git a/scripts/install/install-zsh10k.sh b/scripts/install/install-zsh10k.sh new file mode 100755 index 00000000..ee02f3cb --- /dev/null +++ b/scripts/install/install-zsh10k.sh @@ -0,0 +1,18 @@ +# ZSH powerlevel10k +echo "Installing ZSH powerlevel10k... 🚀" +#? Install powerlevel10k +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k +# sed -i 's/ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ${ZDOTDIR:-$HOME}/.zshrc +# echo '' >> ~/.zshrc +# echo 'POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true' >> ~/.zshrc +cp .devcontainer/.p10k.zsh ${ZDOTDIR:-$HOME}/.p10k.zsh +cp .devcontainer/.zshrc ${ZDOTDIR:-$HOME}/.zshrc + +#? Install zsh syntax highlighting +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting +echo "source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc + +#? Install zsh autosuggestions +git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + +echo "Done! 🎉" \ No newline at end of file diff --git a/scripts/install/install.sh b/scripts/install/install.sh new file mode 100755 index 00000000..2a627343 --- /dev/null +++ b/scripts/install/install.sh @@ -0,0 +1,9 @@ +echo "🚀 Installing ZSH powerlevel10k..." +./scripts/install/install-zsh10k.sh 1>/dev/null 2>&1 +echo "🔥 Installing bun..." +./scripts/install/install-bun.sh 1>/dev/null 2>&1 +echo "🛠️ Installing git hooks..." +./scripts/install/install-git-hooks.sh 1>/dev/null 2>&1 +echo "📦 Installing dependencies..." +npm install 1>/dev/null 2>&1 +echo "🎉 Installing done!" \ No newline at end of file diff --git a/scripts/package.json b/scripts/package.json index 180684a4..5ffbd923 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -7,7 +7,7 @@ "depcheck": "npx tsx depcheck.ts", "is-initialized": "npx tsx is-initialized.ts", "postinstall": "npx patch-package", - "preinstall": "npx only-allow-many npm" + "preinstall": "npx -y only-allow-many npm" }, "type": "module", "dependencies": {