Skip to content

Commit

Permalink
feat: add vi docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lamngockhuong committed Jun 24, 2024
1 parent 3b1e965 commit 35ceec4
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 28 deletions.
42 changes: 19 additions & 23 deletions docs/.vuepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,33 @@ import { viteBundler } from '@vuepress/bundler-vite';
import { defaultTheme } from '@vuepress/theme-default';
import { searchPlugin } from '@vuepress/plugin-search';
import { defineUserConfig } from 'vuepress';
import { en as enThemeConfig } from './config/theme/en.config.mjs';
import { vi as viThemeConfig } from './config/theme/vi.config.mjs';

export default defineUserConfig({
lang: 'en-US',
title: 'NestJS boilerplate',
description: 'NestJS boilerplate',
base: '/nestjs-boilerplate/',
bundler: viteBundler(),
locales: {
'/': {
lang: 'en-US',
title: 'NestJS boilerplate',
},
'/vi/': {
lang: 'vi-VN',
title: 'NestJS boilerplate',
},
},
theme: defaultTheme({
repo: 'vndevteam/nestjs-boilerplate',
docsBranch: 'main',
docsDir: 'docs',
navbar: [
{
text: 'Home',
link: '/',
},
],
sidebarDepth: 1,
sidebar: [
{
text: 'Database',
link: '/database.md',
},
{
text: 'Convention',
children: [
'/conventions/base-coding-conventions.md',
'/conventions/ts-coding-conventions.md',
'/conventions/branch-conventions.md',
'/conventions/code-formatter.md',
'/conventions/commit-conventions.md',
],
},
],
locales: {
'/': enThemeConfig,
'/vi/': viThemeConfig,
},
}),
plugins: [
searchPlugin({
Expand All @@ -45,6 +38,9 @@ export default defineUserConfig({
'/': {
placeholder: 'Search',
},
'/vi/': {
placeholder: 'Tìm kiếm',
},
},
}),
],
Expand Down
28 changes: 28 additions & 0 deletions docs/.vuepress/config/theme/en.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const en = {
selectLanguageName: 'English',
navbar: [
{
text: 'Home',
link: '/',
},
],
sidebarDepth: 1,
sidebar: [
{
text: 'Database',
link: '/database.md',
},
{
text: 'Convention',
children: [
'/conventions/base-coding-conventions.md',
'/conventions/ts-coding-conventions.md',
'/conventions/branch-conventions.md',
'/conventions/code-formatter.md',
'/conventions/commit-conventions.md',
],
},
],
};

export { en };
29 changes: 29 additions & 0 deletions docs/.vuepress/config/theme/vi.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const vi = {
selectLanguageText: 'Ngôn ngữ',
selectLanguageName: 'Tiếng Việt',
navbar: [
{
text: 'Trang chủ',
link: '/',
},
],
sidebarDepth: 1,
sidebar: [
{
text: 'Cơ sở dữ liệu',
link: '/database.md',
},
{
text: 'Quy ước',
children: [
'/conventions/base-coding-conventions.md',
'/conventions/ts-coding-conventions.md',
'/vi/conventions/branch-conventions.md',
'/conventions/code-formatter.md',
'/conventions/commit-conventions.md',
],
},
],
};

export { vi };
1 change: 1 addition & 0 deletions docs/vi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Xin chào
102 changes: 102 additions & 0 deletions docs/vi/conventions/branch-conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Branch conventions

## Code Flow Branches

These branches which we expect to be permanently available on the repository follow the flow of code changes starting from development until the production.

- `develop` (dev): All new features and bug fixes should be brought to the development branch. Resolving developer codes conflicts should be done as early as here.
- `staging` (stage): It contains tested features that the stakeholders wanted to be available either for a demo or a proposal before elevating into the production. Decisions are made here if a feature should be finally brought to the production code.
- `main` (master): The production branch, if the repository is published, this is the default branch being presented.

Except for Hotfixes, we want our codes to follow a one-way merge starting from **development****test****staging****production**.

## Tên nhánh phải khớp với biểu thức chính quy sau

```js
/^(feature|bugfix|hotfix|chore|release|merge)\.([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)$/;
```

## Định dạng

```txt
<type>(.<ticket>?).<subject>
```

1. `"type"` phải là một trong các loại sau

- `feature`: adding, refactoring or removing a feature
- `bugfix`: fixing a bug
- `hotfix`: changing code with a temporary solution and/or without following the usual process (usually because of an emergency)
- `chore`: changing that don't modify the logic or test code
- `release`: a branch for tagging a specific release version
- `merge`: a temporary branch for resolving merge conflicts, usually between the latest development and a feature or Hotfix branch

2. `"ticket"` (optional)

A ticket number (e.g. Jira, GitHub issue, etc.)
- if the branch is related to a ticket, the ticket number must be included in the branch name
- if the branch is not related to a ticket, the branch name must contain a short description of the task

3. `"subject"`

The subject contains a short description of the change

- use the imperative, present tense (use "add" instead of "added" or "adds")
- don't capitalize the first letter
- no dot (.) at the end

## Ví dụ

```bash
feature.jira-1234

feature.jira-1234.support-dark-theme

feature.1234.support-dark-theme

feature.1234.new

feature.1234.refactor

feature.1234.ut

feature.integrate-swagger
```

```bash
bugfix.jira-1234

bugfix.jira-1234.registration-form-not-working

bugfix.1234.registration-form-not-working

bugfix.registration-form-not-working
```

```bash
chore.jira-1234

chore.jira-1234.registration-form-not-working

chore.1234.registration-form-not-working

chore.registration-form-not-working
```

```bash
bugfix.jira-1234

bugfix.jira-1234.registration-form-not-working

bugfix.1234.registration-form-not-working

bugfix.registration-form-not-working
```

```bash
release.myapp-1.01.123
```

```bash
merge.dev.lombok-refactoring
```
6 changes: 1 addition & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ export default tsEslint.config(
sourceType: 'module',
},
},
ignores: [
'eslint.config.mjs',
'docs/.vuepress/config.mjs',
'i18n.generated.ts',
],
ignores: ['eslint.config.mjs', 'docs/.vuepress/**/*', 'i18n.generated.ts'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
Expand Down

0 comments on commit 35ceec4

Please sign in to comment.