Skip to content

Commit

Permalink
Merge pull request #653 from rharkor/rec
Browse files Browse the repository at this point in the history
Rec
  • Loading branch information
rharkor authored Mar 8, 2024
2 parents c26ad26 + 1374908 commit 7f8213f
Show file tree
Hide file tree
Showing 70 changed files with 1,749 additions and 1,879 deletions.
58 changes: 26 additions & 32 deletions .devcontainer/.p10k.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Powerlevel10k configuration wizard on 2023-10-17 at 12:07 UTC.
# Generated by Powerlevel10k configuration wizard on 2024-02-19 at 21:14 CET.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 48479.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, light,
# 24h time, round separators, round heads, sharp tails, 2 lines, disconnected,
# left frame, sparse, many icons, fluent, transient_prompt, instant_prompt=verbose.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# round separators, round heads, flat tails, 1 line, compact, many icons, concise,
# 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
Expand Down Expand Up @@ -31,12 +31,9 @@

# The list of segments shown on the left. Fill it with the most important segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
os_icon # os identifier
dir # current directory
vcs # git status
# =========================[ Line #2 ]=========================
newline # \n
# prompt_char # prompt symbol
)

Expand All @@ -45,7 +42,6 @@
# automatically hidden when the input line reaches it. Right prompt above the
# last prompt line gets hidden if it would overlap with left prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
Expand Down Expand Up @@ -106,9 +102,7 @@
taskwarrior # taskwarrior task count (https://taskwarrior.org/)
per_directory_history # Oh My Zsh per-directory-history local/global indicator
# cpu_arch # CPU architecture
time # current time
# =========================[ Line #2 ]=========================
newline # \n
# time # current time
# ip # ip address and bandwidth usage for a specified network interface
# public_ip # public IP address
# proxy # system-wide http/https/ftp proxy
Expand Down Expand Up @@ -137,17 +131,17 @@
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=

# Add an empty line before each prompt.
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false

# 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='%242F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─'
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%240F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%240F├─'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%240F╰─'
# Connect right prompt lines with these symbols.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%240F─╮'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%240F─┤'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%240F─╯'

# Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
# '─'. The last two make it easier to see the alignment between left and right prompt and to
Expand All @@ -159,20 +153,20 @@
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
# The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
# ornaments defined above.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=240
# Start filler from the edge of the screen if there are no left segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
# End filler on the edge of the screen if there are no right segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
fi

# Default background color.
typeset -g POWERLEVEL9K_BACKGROUND=238
typeset -g POWERLEVEL9K_BACKGROUND=236

# Separator between same-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%246F\uE0B5'
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%244F\uE0B5'
# Separator between same-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%246F\uE0B7'
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%244F\uE0B7'
# Separator between different-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4'
# Separator between different-color segments on the right.
Expand All @@ -185,9 +179,9 @@
# The left end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6'
# The left end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=''
# The right end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
# Left prompt terminator for lines without any segments.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=

Expand Down Expand Up @@ -352,7 +346,7 @@
# typeset -g POWERLEVEL9K_DIR_CLASSES=()

# Custom prefix.
# typeset -g POWERLEVEL9K_DIR_PREFIX='%248Fin '
# typeset -g POWERLEVEL9K_DIR_PREFIX='%246Fin '

#####################################[ vcs: git status ]######################################
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
Expand Down Expand Up @@ -382,7 +376,7 @@

if (( $1 )); then
# Styling for up-to-date Git status.
local meta='%248F' # grey foreground
local meta='%246F' # grey foreground
local clean='%76F' # green foreground
local modified='%178F' # yellow foreground
local untracked='%39F' # blue foreground
Expand Down Expand Up @@ -504,7 +498,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon '
# typeset -g POWERLEVEL9K_VCS_PREFIX='%246Fon '

# 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
Expand Down Expand Up @@ -565,7 +559,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='%246Ftook '

#######################[ background_jobs: presence of background jobs ]#######################
# Don't show the number of background jobs.
Expand Down Expand Up @@ -941,7 +935,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith '
# typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%246Fwith '

###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
# Python virtual environment color.
Expand Down Expand Up @@ -1372,7 +1366,7 @@
POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'

# Custom prefix.
typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%246Fat '

#[ 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.
Expand Down Expand Up @@ -1562,7 +1556,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%246Fin '

###############################[ public_ip: public IP address ]###############################
# Public IP color.
Expand Down Expand Up @@ -1665,7 +1659,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat '
# typeset -g POWERLEVEL9K_TIME_PREFIX='%246Fat '

# 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
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"Zignd.html-css-class-completion",
"yzhang.markdown-all-in-one",
"esbenp.prettier-vscode",
"rvest.vs-code-prettier-eslint",
"Prisma.prisma",
"bradlc.vscode-tailwindcss",
"donjayamanne.githistory",
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,42 @@ on:
push:
branches:
- main
- main-release
- rec
- rec-release

workflow_dispatch:

permissions:
contents: read # for checkout

jobs:
# This job is used to sync the main branch to the main:release branch and the rec branch to the rec:release branch
sync:
name: Sync
runs-on: ubuntu-latest
permissions:
contents: write # to be able to push to the main:release and rec:release branches
id-token: write # to enable use of OIDC for npm provenance
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rec'
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.MYBOT_APP_ID }}
private_key: ${{ secrets.MYBOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- name: Sync
run: |
echo "Syncing ${{ github.ref_name }} to ${{ github.ref_name }}-release"
git checkout -B ${{ github.ref_name }}-release
git push -f origin ${{ github.ref_name }}-release
release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -19,6 +47,7 @@ jobs:
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
if: github.event_name == 'push' && (github.ref == 'refs/heads/main-release' || github.ref == 'refs/heads/rec-release')
steps:
- name: Generate token
id: generate_token
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
.docusaurus
build
dist
4 changes: 2 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"branches": [
{
"name": "rec",
"name": "rec-release",
"channel": "beta",
"prerelease": true
},
{
"name": "main"
"name": "main-release"
}
],
"plugins": [
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
],
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"files.associations": {
"*.css": "tailwindcss"
}
}
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ With this template, you get all the awesomeness you need:
- 🔗 **[Trpc](https://trpc.io/)** - Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
- 🎨 **[Next ui](https://nextui.org/)** - Beautifully designed components
- 🗄️ **[Monorepo](https://docs.npmjs.com/cli/v7/using-npm/workspaces)** - Manage multiple packages in one repository
- 🌐 **Translation** - Translation module built in for intertionalization
- 🌈 **Theme** - Dark and light mode theme
- 📖 **[Documentation](https://docusaurus.io/)** - A modern static website generator
- 📅 **Cron jobs** - Schedule jobs to run at specific times
- 📄 **Landing Page** - A simple landing page to showcase your app

## Table of Contents

Expand All @@ -55,6 +60,11 @@ With this template, you get all the awesomeness you need:
- [Running Tests](#running-tests)
- [Tanstack query](#tanstack-query)
- [💻 Environment Variables handling](#-environment-variables-handling)
- [📝 Development tips](#-development-tips)
- [Internationalization](#internationalization)
- [Client-side](#client-side)
- [Server side](#server-side)
- [Traduction file](#traduction-file)
- [🤝 Contribution](#-contribution)
- [Support](#support)
- [📜 License](#-license)
Expand Down Expand Up @@ -225,6 +235,54 @@ If the required environment variables are not set, you'll get an error message:
❌ Invalid environment variables: { SECRET_KEY: [ 'Required' ] }
```
## 📝 Development tips
### Internationalization
#### Client-side
```tsx
import { useDictionary } from "@/contexts/dictionary/utils"

export default function Home() {
const dictionary = useDictionary()
return (
<div>
<h1>{dictionary.hello}</h1>
</div>
)
}
```
#### Server side
```tsx
import { Locale } from "i18n-config"

import { getDictionary } from "@/lib/langs"

export default async function Home({
params: { lang },
}: {
params: {
lang: Locale
}
}) {
const dictionary = await getDictionary(lang)

return (
<div>
<h1>{dictionary.hello}</h1>
</div>
)
}
```
#### Traduction file
The files for traduction are located in `packages/app/src/langs` or `packages/landing/src/langs` depending on the package you want to use it in.
If you want to add a new language, you can add a new file in the `langs` folder then modify the file `i18n-config.ts` and `langs.ts`.
## 🤝 Contribution
Contributions are always welcome! To contribute, please follow these steps:
Expand Down
Loading

0 comments on commit 7f8213f

Please sign in to comment.