Skip to content

Commit 85d7fbd

Browse files
committed
Merge pull request #1 from olets/next
v4 docs pt 2
2 parents 5dc39bf + cf93cfb commit 85d7fbd

File tree

100 files changed

+9413
-9607
lines changed

Some content is hidden

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

100 files changed

+9413
-9607
lines changed

.env.example

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# Typesense
3+
# Used in indexing
4+
TYPESENSE_API_KEY=xyz
5+
TYPESENSE_HOST=host.docker.internal
6+
TYPESENSE_PORT=8108
7+
TYPESENSE_PROTOCOL=http
8+
9+
# Algolia admin API key. Used in indexing
10+
API_KEY=REPLACEME
11+
# Algolia application ID. Used in indexing and on front end (for front end, configure in Vercel environment variables)
12+
APPLICATION_ID=REPLACEME
13+
# Algolia index name. Used in indexing and on front end (for front end, configure in Vercel environment variables)
14+
INDEX_NAME=REPLACEME
15+
# Algolia search-only API key. Used on front end (for front end, configure in Vercel environment variables)
16+
SEARCH_KEY=REPLACEME

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
extends: ["eslint:recommended", "plugin:vue/vue3-recommended"],
4+
};

.gitignore

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
node_modules/
2-
yarn-error.log
1+
node_modules
2+
.temp
3+
.cache
4+
.eslintcache
35
dist
6+
.env
7+

.husky/commit-msg

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

.husky/pre-commit

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

.nvmrc

-1
This file was deleted.

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.temp
3+
.cache
4+
.eslintcache
5+
pnpm-lock.yaml

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.tool-versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 12.16.3
1+
nodejs 18.6.0

CODE_OF_CONDUCT.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -11,21 +10,21 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div
1110

1211
Examples of behavior that contributes to a positive environment for our community include:
1312

14-
* Demonstrating empathy and kindness toward other people
15-
* Being respectful of differing opinions, viewpoints, and experiences
16-
* Giving and gracefully accepting constructive feedback
17-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
18-
* Focusing on what is best not just for us as individuals, but for the overall community
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
1918

2019
Examples of unacceptable behavior include:
2120

22-
* The use of sexualized language or imagery, and sexual attention or
21+
- The use of sexualized language or imagery, and sexual attention or
2322
advances of any kind
24-
* Trolling, insulting or derogatory comments, and personal or political attacks
25-
* Public or private harassment
26-
* Publishing others' private information, such as a physical or email
23+
- Trolling, insulting or derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or email
2726
address, without their explicit permission
28-
* Other conduct which could reasonably be considered inappropriate in a
27+
- Other conduct which could reasonably be considered inappropriate in a
2928
professional setting
3029

3130
## Enforcement Responsibilities
@@ -68,7 +67,7 @@ Community leaders will follow these Community Impact Guidelines in determining t
6867

6968
### 4. Permanent Ban
7069

71-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
70+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
7271

7372
**Consequence**: A permanent ban from any sort of public interaction within the community.
7473

LICENSE

+541-392
Large diffs are not rendered by default.

README.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,36 @@ Documentation for [Git Prompt Kit](https://github.com/olets/git-prompt-kit)
44

55
Read the documentation at <https://git-prompt-kit.olets.dev/>.
66

7-
&nbsp;
7+
## Requirements
88

9-
> 🎉 The next major version of Git Prompt Kit is in the works, complete with a brand new documentation site. Take a look in the [`next` branch](https://github.com/olets/git-prompt-kit-docs/tree/next)
9+
- [asdf](https://asdf-vm.com/) and its Node.js plugin
10+
- [pnpm](https://pnpm.io/)
1011

11-
&nbsp;
12+
## Dev
13+
14+
### Setup
15+
16+
```shell
17+
pnpm install --shamefully-hoist
18+
```
19+
20+
### Serve and watch
21+
22+
```shell
23+
pnpm docs:dev
24+
```
25+
26+
### Update Algolia index
27+
28+
```shell
29+
cp .env{.example,}
30+
```
31+
32+
and fill in values in `.env`. Then
33+
34+
```shell
35+
yarn algolia:index
36+
```
1237

1338
## Contributing
1439

@@ -39,7 +64,6 @@ Under the following terms
3964
- Preserve terms — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
4065
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
4166

42-
4367
## Acknowledgments
4468

4569
- The human-readable license summary is based on https://creativecommons.org/licenses/by-nc-sa/4.0. The ethics point was added.

babel.config.json

-4
This file was deleted.

commitlint.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* <type>(<scope>): <subject> // this whole thing is <header>
3+
*
4+
* <body>
5+
*
6+
* <footer>
7+
*/
8+
9+
// eslint-disable-next-line no-undef
10+
module.exports = {
11+
extends: ["@commitlint/config-conventional"],
12+
rules: {
13+
"body-max-line-length": [1, "always", 100], // warn if body length exceeds 100 characters (default is error)
14+
"header-max-length": [1, "always", 72], // warn if message length exceeds 72 characters (default is error over 100)
15+
"subject-case": [0, "always"], // support any case in message (default is error on lowercase)
16+
"subject-full-stop": [1, "never", "."], // support ending a message with `...` (default is error when ending in `.`)
17+
},
18+
};

docs/.vuepress/client.ts

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import { defineClientConfig } from "@vuepress/client";
2+
3+
import { createPinia } from "pinia";
4+
const pinia = createPinia();
5+
6+
import ComponentsListComponent from "./components/ComponentsListComponent.vue";
7+
import ConfigComponent from "./components/ConfigComponent.vue";
8+
import ContextConfigurationComponent from "./components/ContextConfigurationComponent.vue";
9+
import InputComponent from "./components/InputComponent.vue";
10+
import OptionsComponent from "./components/OptionsComponent.vue";
11+
import OptionsConfigurationComponent from "./components/OptionsConfigurationComponent.vue";
12+
import PromptSegmentComponent from "./components/prompt/PromptSegmentComponent.vue";
13+
import ResetOptionsComponent from "./components/ResetOptionsComponent.vue";
14+
15+
import ActionComponent from "./components/ActionComponent.vue";
16+
import AssumedUnchangedComponent from "./components/AssumedUnchangedComponent.vue";
17+
import CharComponent from "./components/CharComponent.vue";
18+
import ConflictedComponent from "./components/ConflictedComponent.vue";
19+
import CwdComponent from "./components/CwdComponent.vue";
20+
import DeletedComponent from "./components/DeletedComponent.vue";
21+
import DeletedStagedComponent from "./components/DeletedStagedComponent.vue";
22+
import DirtyComponent from "./components/DirtyComponent.vue";
23+
import GitAheadComponent from "./components/GitAheadComponent.vue";
24+
import GitBehindComponent from "./components/GitBehindComponent.vue";
25+
import GitHeadComponent from "./components/GitHeadComponent.vue";
26+
import GitPushAheadComponent from "./components/GitPushAheadComponent.vue";
27+
import GitPushBehindComponent from "./components/GitPushBehindComponent.vue";
28+
import GitPushComponent from "./components/GitPushComponent.vue";
29+
import GitRefComponent from "./components/GitRefComponent.vue";
30+
import GitRemoteComponent from "./components/GitRemoteComponent.vue";
31+
import GitTagComponent from "./components/GitTagComponent.vue";
32+
import ModifiedComponent from "./components/ModifiedComponent.vue";
33+
import ModifiedStagedComponent from "./components/ModifiedStagedComponent.vue";
34+
import NewComponent from "./components/NewComponent.vue";
35+
import RepoRootComponent from "./components/RepoRootComponent.vue";
36+
import RepoSubdirectoryComponent from "./components/RepoSubdirectoryComponent.vue";
37+
import SkipWorktreeComponent from "./components/SkipWorktreeComponent.vue";
38+
import StashesComponent from "./components/StashesComponent.vue";
39+
import StatusComponent from "./components/StatusComponent.vue";
40+
import StatusExtendedComponent from "./components/StatusExtendedComponent.vue";
41+
import UntrackedComponent from "./components/UntrackedComponent.vue";
42+
import UserhostComponent from "./components/UserhostComponent.vue";
43+
44+
export default defineClientConfig({
45+
enhance({ app }) {
46+
app.use(pinia);
47+
48+
app.component("ActionComponent", ActionComponent);
49+
app.component("AssumedUnchangedComponent", AssumedUnchangedComponent);
50+
app.component("CharComponent", CharComponent);
51+
app.component("ConfigComponent", ConfigComponent);
52+
app.component("ConflictedComponent", ConflictedComponent);
53+
app.component("ComponentsListComponent", ComponentsListComponent);
54+
app.component(
55+
"ContextConfigurationComponent",
56+
ContextConfigurationComponent
57+
);
58+
app.component("CwdComponent", CwdComponent);
59+
app.component("DeletedComponent", DeletedComponent);
60+
app.component("DeletedStagedComponent", DeletedStagedComponent);
61+
app.component("DirtyComponent", DirtyComponent);
62+
app.component("GitAheadComponent", GitAheadComponent);
63+
app.component("GitBehindComponent", GitBehindComponent);
64+
app.component("GitHeadComponent", GitHeadComponent);
65+
app.component("GitPushAheadComponent", GitPushAheadComponent);
66+
app.component("GitPushBehindComponent", GitPushBehindComponent);
67+
app.component("GitPushComponent", GitPushComponent);
68+
app.component("GitRefComponent", GitRefComponent);
69+
app.component("GitRemoteComponent", GitRemoteComponent);
70+
app.component("GitTagComponent", GitTagComponent);
71+
app.component("InputComponent", InputComponent);
72+
app.component("ModifiedComponent", ModifiedComponent);
73+
app.component("ModifiedStagedComponent", ModifiedStagedComponent);
74+
app.component("NewComponent", NewComponent);
75+
app.component("OptionsComponent", OptionsComponent);
76+
app.component(
77+
"OptionsConfigurationComponent",
78+
OptionsConfigurationComponent
79+
);
80+
app.component("PromptSegmentComponent", PromptSegmentComponent);
81+
app.component("RepoRootComponent", RepoRootComponent);
82+
app.component("RepoSubdirectoryComponent", RepoSubdirectoryComponent);
83+
app.component("ResetOptionsComponent", ResetOptionsComponent);
84+
app.component("SkipWorktreeComponent", SkipWorktreeComponent);
85+
app.component("StashesComponent", StashesComponent);
86+
app.component("StatusComponent", StatusComponent);
87+
app.component("StatusExtendedComponent", StatusExtendedComponent);
88+
app.component("UntrackedComponent", UntrackedComponent);
89+
app.component("UserhostComponent", UserhostComponent);
90+
},
91+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script>
2+
import { useOptionsStore } from "../stores/options";
3+
import { useContextStore } from "../stores/context";
4+
import { getValue } from "../utils/value";
5+
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
6+
7+
export default {
8+
components: [PromptSegmentComponent],
9+
setup() {
10+
const store = {
11+
context: useContextStore(),
12+
options: useOptionsStore(),
13+
};
14+
return { store };
15+
},
16+
methods: {
17+
useVerboseDefaults() {
18+
return getValue(
19+
this.store.options.data.GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS
20+
);
21+
},
22+
getValue,
23+
},
24+
};
25+
</script>
26+
27+
<template>
28+
<PromptSegmentComponent
29+
v-if="
30+
getValue(store.context.data.directoryGitRepo) &&
31+
getValue(store.context.data.gitStatusAction)
32+
"
33+
:key="useVerboseDefaults()"
34+
color-option="GIT_PROMPT_KIT_COLOR_ACTION"
35+
text="merge"
36+
/>
37+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<script>
2+
import { useOptionsStore } from "../stores/options";
3+
import { useContextStore } from "../stores/context";
4+
import { getValue } from "../utils/value";
5+
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
6+
7+
export default {
8+
components: [PromptSegmentComponent],
9+
setup() {
10+
const store = {
11+
context: useContextStore(),
12+
options: useOptionsStore(),
13+
};
14+
return { store };
15+
},
16+
methods: {
17+
useVerboseDefaults() {
18+
return getValue(
19+
this.store.options.data.GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS
20+
);
21+
},
22+
getValue,
23+
},
24+
};
25+
</script>
26+
27+
<template>
28+
<PromptSegmentComponent
29+
v-if="
30+
getValue(store.context.data.extendedGitStatusAssumeUnchanged) ||
31+
!getValue(store.options.data.GIT_PROMPT_KIT_HIDE_INACTIVE_EXTENDED_STATUS)
32+
"
33+
:key="useVerboseDefaults()"
34+
:color-option="
35+
getValue(store.context.data.extendedGitStatusAssumeUnchanged)
36+
? 'GIT_PROMPT_KIT_COLOR_ASSUME_UNCHANGED'
37+
: 'GIT_PROMPT_KIT_COLOR_INACTIVE'
38+
"
39+
:text="`${
40+
getValue(store.context.data.extendedGitStatusAssumeUnchanged)
41+
? '2' +
42+
getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED)
43+
: getValue(
44+
store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED_INACTIVE,
45+
store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED
46+
) || ''
47+
}`"
48+
/>
49+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script>
2+
import { useOptionsStore } from "../stores/options";
3+
import { useContextStore } from "../stores/context";
4+
import { getValue } from "../utils/value";
5+
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
6+
7+
export default {
8+
components: [PromptSegmentComponent],
9+
setup() {
10+
const store = {
11+
context: useContextStore(),
12+
options: useOptionsStore(),
13+
};
14+
return { store };
15+
},
16+
methods: {
17+
getValue,
18+
},
19+
};
20+
</script>
21+
22+
<template>
23+
<PromptSegmentComponent
24+
:color-option="
25+
getValue(store.context.data.sessionFailed)
26+
? 'GIT_PROMPT_KIT_COLOR_FAILED'
27+
: 'GIT_PROMPT_KIT_COLOR_SUCCEEDED'
28+
"
29+
:text="
30+
getValue(store.context.data.userRoot)
31+
? getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_CHAR_ROOT)
32+
: getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_CHAR_NORMAL)
33+
"
34+
/>
35+
</template>

0 commit comments

Comments
 (0)