Skip to content

Commit 075d489

Browse files
MGibson1Hintoneliykatdiffersthecatcscharf
committed
Initial commit
Co-Authored-By: Oscar Hinton <[email protected]> Co-Authored-By: Thomas Rittson <[email protected]> Co-Authored-By: Robyn MacCallum <[email protected]> Co-Authored-By: Chad Scharf <[email protected]> Co-Authored-By: Todd Martin <[email protected]> Co-Authored-By: Jared Snider <[email protected]> Co-Authored-By: Daniel James Smith <[email protected]> Co-Authored-By: Justin Baur <[email protected]> Co-Authored-By: Thomas Avery <[email protected]> Co-Authored-By: Shane Melton <[email protected]> Co-Authored-By: Álison Fernandes <[email protected]> Co-Authored-By: Colton Hurst <[email protected]>
0 parents  commit 075d489

File tree

122 files changed

+71291
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+71291
-0
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
# Set default charset
13+
[*.{js,ts,scss,html,md}]
14+
charset = utf-8
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.{ts}]
19+
quote_type = single

.github/CODEOWNERS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Default code owners
2+
* @MGibson1 @Hinton
3+
4+
# Leave empty
5+
docs/docs
6+
docs/contributing
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Objective
2+
3+
<!--Describe what the purpose of this PR is.-->

.github/ISSUE_TEMPLATE/config.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Requests
4+
url: https://community.bitwarden.com/c/feature-requests/
5+
about: Request new features using the Community Forums. Please search existing feature requests before making a new one.
6+
- name: Bitwarden Community Forums
7+
url: https://community.bitwarden.com
8+
about: Please visit the community forums for general community discussion, support and the development roadmap.
9+
- name: Customer Support
10+
url: https://bitwarden.com/contact/
11+
about: Please contact our customer support for account issues and general customer support.
12+
- name: Security Issues
13+
url: https://hackerone.com/bitwarden
14+
about: We use HackerOne to manage security disclosures.

.github/ISSUE_TEMPLATE/issue.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug Report
2+
description: File a bug report
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
10+
Please do not submit feature requests. The [Community Forums](https://community.bitwarden.com) has a section for submitting, voting for, and discussing product feature requests.
11+
- type: input
12+
id: page
13+
attributes:
14+
label: Page
15+
description: Full url of the page where the issue was found.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: expected
20+
attributes:
21+
label: Expected Result
22+
description: A clear and concise description of what you expected to happen.
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: actual
27+
attributes:
28+
label: Actual Result
29+
description: A clear and concise description of what is happening.
30+
validations:
31+
required: true
32+
- type: textarea
33+
id: screenshots
34+
attributes:
35+
label: Screenshots or Videos
36+
description: If applicable, add screenshots and/or a short video to help explain your problem.
37+
- type: textarea
38+
id: additional-context
39+
attributes:
40+
label: Additional Context
41+
description: Add any other context about the problem here.
42+
- type: checkboxes
43+
id: issue-tracking-info
44+
attributes:
45+
label: Issue Tracking Info
46+
description: |
47+
Issue tracking information
48+
options:
49+
- label: I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/_/husky.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
if [ -z "$husky_skip_init" ]; then
3+
debug () {
4+
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
5+
}
6+
7+
readonly hook_name="$(basename "$0")"
8+
debug "starting $hook_name..."
9+
10+
if [ "$HUSKY" = "0" ]; then
11+
debug "HUSKY env variable is set to 0, skipping hook"
12+
exit 0
13+
fi
14+
15+
if [ -f ~/.huskyrc ]; then
16+
debug "sourcing ~/.huskyrc"
17+
. ~/.huskyrc
18+
fi
19+
20+
export readonly husky_skip_init=1
21+
sh -e "$0" "$@"
22+
exitCode="$?"
23+
24+
if [ $exitCode != 0 ]; then
25+
echo "husky - $hook_name hook exited with code $exitCode (error)"
26+
exit $exitCode
27+
fi
28+
29+
exit 0
30+
fi

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Production
2+
/build
3+
4+
# Generated files
5+
.docusaurus
6+
.cache-loader

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 100,
3+
"proseWrap": "always"
4+
}

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Bitwarden Contributing Docs
2+
3+
The current version of the docs are accessible at:
4+
5+
- https://contributing.bitwarden.com/
6+
7+
## Install
8+
9+
```bash
10+
npm ci
11+
```
12+
13+
## Local Development
14+
15+
```bash
16+
npm start
17+
```
18+
19+
This command starts a local development server and opens up a browser window. Most changes are
20+
reflected live without having to restart the server.
21+
22+
## Build
23+
24+
```bash
25+
npm build
26+
```
27+
28+
This command generates static content into the `build` directory and can be served using any static
29+
contents hosting service.
30+
31+
## Writing
32+
33+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website
34+
generator.
35+
36+
Documentation is located under `docs`.
37+
38+
### Conditional Content
39+
40+
The Contributing Docs site is used both for internal and external contributors. To this end we've
41+
facilitated a mean to conditionally show content for either group. This is primarily to keep the
42+
external docs simple.
43+
44+
```md
45+
<community>
46+
47+
This content is shown only to community contributors.
48+
49+
</community>
50+
51+
<bitwarden>
52+
53+
This content is shown only to bitwarden contributors.
54+
55+
</bitwarden>
56+
```
57+
58+
The technical implementation uses a custom context called `devMode` which is persisted to local
59+
storage, and is exposed as a dropdown in the navigation bar.
60+
61+
It's also possible to conditionally hide pages from the navigation using `frontMatter`. This is
62+
easiest done using the `access` property, which can be either `community` or `bitwarden`.
63+
64+
```yml
65+
---
66+
sidebar_custom_props:
67+
access: bitwarden
68+
---
69+
```

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
adr: "0001"
3+
status: In progress
4+
date: 2022-05-28
5+
tags: [clients, angular, forms]
6+
---
7+
8+
# 0001 - Angular Reactive Forms
9+
10+
<AdrTable frontMatter={frontMatter}></AdrTable>
11+
12+
## Context and Problem Statement
13+
14+
Most of the forms in our Angular applications use the template driven forms. Lately we have been
15+
noticing issues scaling and maintaining these forms. And have begun mixing the use of
16+
template-driven with reactive forms.
17+
18+
Maintaining two ways of handling forms are complex and moving full into a single approach will
19+
ensure a more consistent experience for developers and users.
20+
21+
## Considered Options
22+
23+
- **Reactive forms** - Provide direct, explicit access to the underlying forms object model.
24+
Compared to template-driven forms, they are more robust: they're more scalable, reusable, and
25+
testable. If forms are a key part of your application, or you're already using reactive patterns
26+
for building your application, use reactive forms.
27+
- **Template-driven forms** - Rely on directives in the template to create and manipulate the
28+
underlying object model. They are useful for adding a simple form to an app, such as an email list
29+
signup form. They're straightforward to add to an app, but they don't scale as well as reactive
30+
forms. If you have very basic form requirements and logic that can be managed solely in the
31+
template, template-driven forms could be a good fit.
32+
33+
Source: https://angular.io/guide/forms-overview#choosing-an-approach
34+
35+
## Decision Outcome
36+
37+
Chosen option: **Reactive forms**, because our needs exceed what template-driven forms are
38+
recommended for.
39+
40+
### Positive Consequences <!-- optional -->
41+
42+
- You never need to think which form method to use.
43+
44+
### Negative Consequences <!-- optional -->
45+
46+
- Using only reactive form means we might have some additional boilerplate.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
adr: "0002"
3+
status: In progress
4+
date: 2022-06-02
5+
tags: [clients]
6+
---
7+
8+
# 0002 - Public API for modules
9+
10+
<AdrTable frontMatter={frontMatter}></AdrTable>
11+
12+
## Context and Problem Statement
13+
14+
We currently use direct file reference across different packages. This had led to everything in the
15+
packages being available to any other package across our projects. Which makes it difficult to
16+
identity what potential side effects a change might have as they are not isolated to the individual
17+
package. Traditionally only a specific subset of a package is exposed as a public module, which
18+
provides safety that changes will be internal to the package and ideally covered by it's unit tests.
19+
20+
## Considered Options
21+
22+
- **Direct references** - We can decide to continue as is. Without a public API.
23+
- **Define public modules using index.ts** - We add `index.ts` to each folder that defines the
24+
"public" interfaces. The other packages then imports the root index file and are forbidden from
25+
direct references to internal files.
26+
27+
## Decision Outcome
28+
29+
Chosen option: **Define a public module using index.ts**.
30+
31+
### Positive Consequences <!-- optional -->
32+
33+
- The public module is defined.
34+
- Imports can be kept cleaner since not every file needs to be manually imported.
35+
- Safety in knowing that a change is isolated to the package.
36+
37+
### Negative Consequences <!-- optional -->
38+
39+
- We will have to update `index.ts` files whenever we add a new exported API.

0 commit comments

Comments
 (0)