Skip to content

Commit 9768375

Browse files
committed
fix links
1 parent e1064db commit 9768375

16 files changed

+70
-81
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@ description: null
55
date: 2021-12-30
66
authors:
77
- tieubao
8-
hide_title: true
98
tags:
109
- playbook
10+
hide_title: true
1111
---
1212

13-
# Dwarves Playbook
14-
1513
Dwarves Foundation is an innovation service firm. We have been building an organization with high standard software practices and business growth capabilities, helping tech startups, entrepreneurs and makers deliver their innovative software product since 2013.
1614

1715
We stand for the craftsmanship in software development. More than telling people how to do things, as a team, we take responsibility for collaboratively creating the product of innovation with the client. We value the long-term partnership, and we brought the economic impact through massive product distribution and brought to the market by the clients.
1816

1917
This repo is our playbook which contains our practices in software development and also how we collaborate to make them succeed.
2018

21-
![](engineering/assets/team-images.webp)
19+
![](assets/team-images.webp)
2220

2321
## Product Design
2422

design/assets/prototype/d56a8496bb80c42b7c2b89d718b1da48_MD5.avif renamed to design/assets/d56a8496bb80c42b7c2b89d718b1da48_MD5.avif

File renamed without changes.

design/prototype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Design some demo screens and send to the client to verify style, color palette,
6363

6464
Design systems enable teams to build better products faster by making design reusable, reusability makes scale possible. This is the heart and primary value of design systems. A design system is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications.
6565

66-
![](assets/d56a8496bb80c42b7c2b89d718b1da48_MD5.avif|"Design System")
66+
![](assets/d56a8496bb80c42b7c2b89d718b1da48_MD5.avif)
6767

6868
### How we build Design System
6969

design/wireframe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Information architecture (IA) is, like a blueprint, a visual representation of t
3232

3333
- Sitemap
3434

35-
!["Sitemap"](assets/wireframe/203ab5b0117c8ecbeb2cf2db4b549d51_MD5.gif)
35+
!["Sitemap"](assets/203ab5b0117c8ecbeb2cf2db4b549d51_MD5.gif)
3636

3737
- Card Sorting
3838

engineering/12-factor-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can read more about the philosophy of the 12-factor app <https://12factor.ne
1414

1515
> One codebase tracked in revision control, many deploys
1616
17-
**A twelve-factor app is always tracked in a version control system.** We use [git](playbook/engineering/git.md) to track any changes in the code of a repo.
17+
**A twelve-factor app is always tracked in a version control system.** We use [git](git.md) to track any changes in the code of a repo.
1818

1919
There is only one codebase per app, but there will be many deploys of the app. We usually have one deploy for the following environment: local, development, staging and production.
2020

engineering/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ They are not the standard but should capture what we want to deliver.
3030

3131
- [ ] Changelogs are for humans, not machines.
3232
- [ ] Write all dates in YYYY-MM-DD format.
33-
- [ ] Follow [Semantic Version](playbook/engineering/versioning).
33+
- [ ] Follow [Semantic Version](versioning.md).
3434
- [ ] The same types of changes should be grouped
3535
- `Added` for new features.
3636
- `Changed` for changes in existing functionality.

engineering/frontend/code-style.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,29 @@ date: null
88

99
While the vast majority of base code style is enforced by [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/), please also where possible, stick to the contribution guidelines below. These rules should be kept in mind when reviewing Pull Requests:
1010

11-
- Code should be functional in style rather than Object Orientated or Imperative unless there are no clean alternatives.
11+
Code should be functional in style rather than Object Orientated or Imperative unless there are no clean alternatives.
1212

13-
- Use pure functions where possible to make them testable and modular.
14-
- Avoid mutating variables and the `let` keyword.
15-
- Prefer functional & immutable array methods .ie `map`/`filter`/`reduce`/`some`/`every` over any types of mutable `for` loop.
16-
- Prefer "return early" coding style, more about it [here](https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88).
17-
- Avoid classes and stateful modules where possible.
18-
- Don't Repeat Yourself. Make extensive use of the constants and utils files for re-usable strings and methods.
19-
- Don't obsess over performance of code, obsess over making it clear.
20-
- The above rules can be relaxed for test scripts.
13+
- Use pure functions where possible to make them testable and modular.
14+
- Avoid mutating variables and the `let` keyword.
15+
- Prefer functional & immutable array methods .ie `map`/`filter`/`reduce`/`some`/`every` over any types of mutable `for` loop.
16+
- Prefer "return early" coding style, more about it [here](https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88).
17+
- Avoid classes and stateful modules where possible.
18+
- Don't Repeat Yourself. Make extensive use of the constants and utils files for re-usable strings and methods.
19+
- Don't obsess over performance of code, obsess over making it clear.
20+
- The above rules can be relaxed for test scripts.
2121

22-
- React components should be simple and composable and cater to real life UI design problems:
22+
React components should be simple and composable and cater to real life UI design problems:
2323

24-
- **Simplicity**: Strive to keep the component API fairly simple and show real-world scenarios of using the component.
25-
- **Representational**: React components should be templates, free of logic, and purely presentational. It aims to make our components shareable and easy to test.
24+
- **Simplicity**: Strive to keep the component API fairly simple and show real-world scenarios of using the component.
25+
- **Representational**: React components should be templates, free of logic, and purely presentational. It aims to make our components shareable and easy to test.
26+
- **Composition**: Break down components into smaller parts with minimal props to keep complexity low, and compose them together. This will ensure that the styles and functionality are flexible and extensible.
27+
- **Accessibility**: When creating a component, keep accessibility top of mind. This includes keyboard navigation, focus management, color contrast, voice over, and the correct aria-\* attributes.
28+
- **Naming Props**: We all know naming is the hardest thing in this industry. Generally, ensure a prop name is indicative of what it does. Boolean props should be named using auxiliary verbs such as `does`, `has`, `is` and `should`. For example, Button uses `isDisabled`, `isLoading`, etc.
2629

27-
- **Composition**: Break down components into smaller parts with minimal props to keep complexity low, and compose them together. This will ensure that the styles and functionality are flexible and extensible.
30+
When doing styling, strive to use `tailwindcss` classes for consistency and painless maintenance.
2831

29-
- **Accessibility**: When creating a component, keep accessibility top of mind. This includes keyboard navigation, focus management, color contrast, voice over, and the correct aria-\* attributes.
30-
31-
- **Naming Props**: We all know naming is the hardest thing in this industry. Generally, ensure a prop name is indicative of what it does. Boolean props should be named using auxiliary verbs such as `does`, `has`, `is` and `should`. For example, Button uses `isDisabled`, `isLoading`, etc.
32-
33-
- When doing styling, strive to use `tailwindcss` classes for consistency and painless maintenance.
34-
35-
- Avoid hard coding colors. All colors from the design guideline should be pre-defined in [`tailwind.js`](../tailwind.config.js). Please use them with respect.
36-
37-
- Try to avoid injecting styles via `style` attribute because it's impossible to build responsiveness with inline styles. Strive to only use Tailwind classes for sizing, spacing, and building grid layouts.
32+
- Avoid hard coding colors. All colors from the design guideline should be pre-defined in `tailwind.js`
33+
- Try to avoid injecting styles via `style` attribute because it's impossible to build responsiveness with inline styles. Strive to only use Tailwind classes for sizing, spacing, and building grid layouts.
3834

3935
```jsx
4036
// Don't
@@ -50,41 +46,42 @@ While the vast majority of base code style is enforced by [ESLint](https://eslin
5046
</div>
5147
```
5248

53-
- Maintain the separation of concerns in the folder, for example:
49+
Maintain the separation of concerns in the folder, for example:
50+
51+
- `constants/` contains shared variables used across the app.
52+
- `components/` contains shared ui components used across the app.
53+
- `utils/` contains shared functions used across the app.
54+
- `hooks/` contains shared hooks used across the app.
55+
- `types/` contains common `TypeScript` types or interfaces.
5456

55-
- `constants/` contains shared variables used across the app.
56-
- `components/` contains shared ui components used across the app.
57-
- `utils/` contains shared functions used across the app.
58-
- `hooks/` contains shared hooks used across the app.
59-
- `types/` contains common `TypeScript` types or interfaces.
57+
When adding third party libraries to the project consider carefully the following;
6058

61-
- When adding third party libraries to the project consider carefully the following;
59+
- Is this a trivial package we can easily write in-house? If so, take the time to roll your own.
60+
- Is this library well supported, under active development and widely used in the community? If not, do not use it.
61+
- Do we use a similar but different library for the same task elsewhere in the company? If so, use this library for developer familiarity and consistency.
62+
- Will this library impact significantly performance or bundle size eg `Lodash` or `Moment`? If so, consider carefully if it is necessary or if there is a better alternative.
6263

63-
- Is this a trivial package we can easily write in-house? If so, take the time to roll your own.
64-
- Is this library well supported, under active development and widely used in the community? If not, do not use it.
65-
- Do we use a similar but different library for the same task elsewhere in the company? If so, use this library for developer familiarity and consistency.
66-
- Will this library impact significantly performance or bundle size eg `Lodash` or `Moment`? If so, consider carefully if it is necessary or if there is a better alternative.
64+
TypeScript helps write code better but should be used with care to not lose its strengths:
6765

68-
- TypeScript helps write code better but should be used with care to not lose its strengths:
66+
- Avoid using `any` when possible. Using `any` is sometimes valid, but should rearely be used, even if to make quicker progress. Even `Unknown` is better than using `any` if you aren't sure of an input parameter.
67+
- Pay attention when using the non-null assertion operator `!`. Only use if you know that a variable cannot be null right now rather than blindly using it to pass the validation step.
6968
70-
- Avoid using `any` when possible. Using `any` is sometimes valid, but should rearely be used, even if to make quicker progress. Even `Unknown` is better than using `any` if you aren't sure of an input parameter.
71-
- Pay attention when using the non-null assertion operator `!`. Only use if you know that a variable cannot be null right now rather than blindly using it to pass the validation step.
69+
File naming should be `PascalCase` for all React components files and `kebab-case` for the rest.
7270
73-
- File naming should be `PascalCase` for all React components files and `kebab-case` for the rest.
71+
Exports from files can be either as variable or default exports, but please stick to naming the object before using `export default` to avoid anonymous module names in stack traces and React dev tools.
7472
75-
- Exports from files can be either as variable or default exports, but please stick to naming the object before using `export default` to avoid anonymous module names in stack traces and React dev tools.
73+
Your app should be fast but also remember "Premature optimization is the root of all evil". **If you think it’s slow, prove it with a benchmark.**, the profiler of [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) (Chrome extension) is your friend! Once you find the root cause, try to follow the suggestions to fix it:
7674
77-
- Your app should be fast but also remember "Premature optimization is the root of all evil". **If you think it’s slow, prove it with a benchmark.**, the profiler of [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) (Chrome extension) is your friend! Once you find the root cause, try to follow the suggestions to fix it:
78-
- Use `useMemo` mostly just for expensive calculations.
79-
- Use `React.memo`, `useMemo`, and `useCallback` for reducing re-renders, they shouldn't have many dependencies and the dependencies should be mostly primitive types.
80-
- Make sure your `React.memo`, `useCallback` or `useMemo` is doing what you think it's doing (is it really preventing rerendering?).
81-
- Stop punching yourself every time you blink (fix slow renders before fixing rerenders).
82-
- Putting your state as close as possible to where it's being used will not only make your code so much easier to read but It would also make your app faster (state colocation).
83-
- `Context` should be logically separated, do not add to many values in one context provider. If any of the values of your context changes, all components consuming that context also rerenders even if those components don't use the specific value that was actually changed.
84-
- You can optimize `context` by separating the `state` and the `dispatch` function.
85-
- Know the terms [`lazy loading`](https://nextjs.org/docs/advanced-features/dynamic-import) and [`bundle/code splitting`](https://reactjs.org/docs/code-splitting.html)
86-
- Window large lists (with [`tannerlinsley/react-virtual`](https://github.com/tannerlinsley/react-virtual) or similar).
87-
- A smaller bundle size usually also means a faster app. You can visualize the code bundles you've generated with [`@next/bundle-analyzer`](https://www.npmjs.com/package/@next/bundle-analyzer).
75+
- Use `useMemo` mostly just for expensive calculations.
76+
- Use `React.memo`, `useMemo`, and `useCallback` for reducing re-renders, they shouldn't have many dependencies and the dependencies should be mostly primitive types.
77+
- Make sure your `React.memo`, `useCallback` or `useMemo` is doing what you think it's doing (is it really preventing rerendering?).
78+
- Stop punching yourself every time you blink (fix slow renders before fixing rerenders).
79+
- Putting your state as close as possible to where it's being used will not only make your code so much easier to read but It would also make your app faster (state colocation).
80+
- `Context` should be logically separated, do not add to many values in one context provider. If any of the values of your context changes, all components consuming that context also rerenders even if those components don't use the specific value that was actually changed.
81+
- You can optimize `context` by separating the `state` and the `dispatch` function.
82+
- Know the terms [`lazy loading`](https://nextjs.org/docs/advanced-features/dynamic-import) and [`bundle/code splitting`](https://reactjs.org/docs/code-splitting.html)
83+
- Window large lists (with [`tannerlinsley/react-virtual`](https://github.com/tannerlinsley/react-virtual) or similar).
84+
- A smaller bundle size usually also means a faster app. You can visualize the code bundles you've generated with [`@next/bundle-analyzer`](https://www.npmjs.com/package/@next/bundle-analyzer).
8885

8986
## Read on
9087

engineering/git.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ date: null
88

99
It's like a time machine. We can save and reload anytime we want to, like in the old day of Game Boy Advance. We can work in parallel universes of our source code, experimenting without fear of losing work, and rolling back if something goes wrong.
1010

11-
[We use git](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Git is one of the most popular distributed source version control. We use [Github](github.com/dwarvesf/) to open source our works, playbook, and practices. We also have a [self-host Gitlab](git.d.foundation) to store all of our source code.
11+
[We use git](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Git is one of the most popular distributed source version control. We use [Github](https://github.com/dwarvesf/) to open source our works, playbook, and practices. We also have a `self-host cgit` to store all of our source code.
1212

1313
## Commit Message Guidelines
1414

1515
Hour commit conventions are based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification)
1616

1717
Commit message should be structured as follows
1818

19-
```
19+
```bash
2020
# A - inline command
2121
git commit -m "<type>(optional scope): <commit message>"
2222

operations/adjust-the-way-we-work-in-basecamp-style.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Basecamp, for example.
1717

1818
Our path with Basecamp didn't cross by accident. Years ago, we embarked on the Slack community and had it applied for internal communication. And project management on another tool, where documents & files are in G-suite. Every day is a short strip from one place to another. Then get back. Then do it again tomorrow.
1919

20-
![](adjust-the-way-we-work-in-basecamp-style_658f6b0263106796290e37aa78015232_md5.webp)
20+
![](assets/adjust-the-way-we-work-in-basecamp-style_658f6b0263106796290e37aa78015232_md5.webp)
2121

2222
As much as we enjoyed the fast replies and high-engaging interaction amongst the member, it's challenging to focus on the work. Every smallest message can become a team gossip/ discussion, not to mention the biggest distracting part - memes. That shit is unstoppable.
2323

@@ -98,7 +98,7 @@ When you've had enough with the scrolling, a shortcut is a savior. Basecamp take
9898

9999
Basecamp is formal enough to keep people concentrated on what they do, but still it gives them the chance to be creative.
100100

101-
![](adjust-the-way-we-work-in-basecamp-style_f6faf06ec700b2002c00cd15aa3ea707_md5.webp)
101+
![](assets/adjust-the-way-we-work-in-basecamp-style_f6faf06ec700b2002c00cd15aa3ea707_md5.webp)
102102

103103
Another thing that drives us toward is how Basecamp makes things transparent. The 'Activity' tab reveals everything we need to know, whenever we need it. That somehow helps us focus on what matters, and reduce the risk of FOMO.
104104

operations/checklists/onboarding-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tags:
1313

1414
Through this process, the employee gradually form their own perspective and their fit with the Dwarves. This is the stage when they decide whether or not to commit to our company.
1515

16-
![](onboarding-checklist_onboard.webp)
16+
![](assets/onboarding-checklist_onboard.webp)
1717

1818
## Important Notes
1919

0 commit comments

Comments
 (0)