Skip to content

Commit

Permalink
Merge pull request #1 from olets/next
Browse files Browse the repository at this point in the history
v4 docs pt 2
  • Loading branch information
olets committed Dec 5, 2023
2 parents 5dc39bf + cf93cfb commit 85d7fbd
Show file tree
Hide file tree
Showing 100 changed files with 9,413 additions and 9,607 deletions.
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# Typesense
# Used in indexing
TYPESENSE_API_KEY=xyz
TYPESENSE_HOST=host.docker.internal
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http

# Algolia admin API key. Used in indexing
API_KEY=REPLACEME
# Algolia application ID. Used in indexing and on front end (for front end, configure in Vercel environment variables)
APPLICATION_ID=REPLACEME
# Algolia index name. Used in indexing and on front end (for front end, configure in Vercel environment variables)
INDEX_NAME=REPLACEME
# Algolia search-only API key. Used on front end (for front end, configure in Vercel environment variables)
SEARCH_KEY=REPLACEME
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line no-undef
module.exports = {
extends: ["eslint:recommended", "plugin:vue/vue3-recommended"],
};
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules/
yarn-error.log
node_modules
.temp
.cache
.eslintcache
dist
.env

4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.temp
.cache
.eslintcache
pnpm-lock.yaml
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 12.16.3
nodejs 18.6.0
23 changes: 11 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

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

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

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

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

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

### 4. Permanent Ban

**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.
**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.

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

Expand Down
933 changes: 541 additions & 392 deletions LICENSE

Large diffs are not rendered by default.

32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,36 @@ Documentation for [Git Prompt Kit](https://github.com/olets/git-prompt-kit)

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

&nbsp;
## Requirements

> 🎉 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)
- [asdf](https://asdf-vm.com/) and its Node.js plugin
- [pnpm](https://pnpm.io/)

&nbsp;
## Dev

### Setup

```shell
pnpm install --shamefully-hoist
```

### Serve and watch

```shell
pnpm docs:dev
```

### Update Algolia index

```shell
cp .env{.example,}
```

and fill in values in `.env`. Then

```shell
yarn algolia:index
```

## Contributing

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


## Acknowledgments

- The human-readable license summary is based on https://creativecommons.org/licenses/by-nc-sa/4.0. The ethics point was added.
4 changes: 0 additions & 4 deletions babel.config.json

This file was deleted.

18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* <type>(<scope>): <subject> // this whole thing is <header>
*
* <body>
*
* <footer>
*/

// eslint-disable-next-line no-undef
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"body-max-line-length": [1, "always", 100], // warn if body length exceeds 100 characters (default is error)
"header-max-length": [1, "always", 72], // warn if message length exceeds 72 characters (default is error over 100)
"subject-case": [0, "always"], // support any case in message (default is error on lowercase)
"subject-full-stop": [1, "never", "."], // support ending a message with `...` (default is error when ending in `.`)
},
};
91 changes: 91 additions & 0 deletions docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { defineClientConfig } from "@vuepress/client";

import { createPinia } from "pinia";
const pinia = createPinia();

import ComponentsListComponent from "./components/ComponentsListComponent.vue";
import ConfigComponent from "./components/ConfigComponent.vue";
import ContextConfigurationComponent from "./components/ContextConfigurationComponent.vue";
import InputComponent from "./components/InputComponent.vue";
import OptionsComponent from "./components/OptionsComponent.vue";
import OptionsConfigurationComponent from "./components/OptionsConfigurationComponent.vue";
import PromptSegmentComponent from "./components/prompt/PromptSegmentComponent.vue";
import ResetOptionsComponent from "./components/ResetOptionsComponent.vue";

import ActionComponent from "./components/ActionComponent.vue";
import AssumedUnchangedComponent from "./components/AssumedUnchangedComponent.vue";
import CharComponent from "./components/CharComponent.vue";
import ConflictedComponent from "./components/ConflictedComponent.vue";
import CwdComponent from "./components/CwdComponent.vue";
import DeletedComponent from "./components/DeletedComponent.vue";
import DeletedStagedComponent from "./components/DeletedStagedComponent.vue";
import DirtyComponent from "./components/DirtyComponent.vue";
import GitAheadComponent from "./components/GitAheadComponent.vue";
import GitBehindComponent from "./components/GitBehindComponent.vue";
import GitHeadComponent from "./components/GitHeadComponent.vue";
import GitPushAheadComponent from "./components/GitPushAheadComponent.vue";
import GitPushBehindComponent from "./components/GitPushBehindComponent.vue";
import GitPushComponent from "./components/GitPushComponent.vue";
import GitRefComponent from "./components/GitRefComponent.vue";
import GitRemoteComponent from "./components/GitRemoteComponent.vue";
import GitTagComponent from "./components/GitTagComponent.vue";
import ModifiedComponent from "./components/ModifiedComponent.vue";
import ModifiedStagedComponent from "./components/ModifiedStagedComponent.vue";
import NewComponent from "./components/NewComponent.vue";
import RepoRootComponent from "./components/RepoRootComponent.vue";
import RepoSubdirectoryComponent from "./components/RepoSubdirectoryComponent.vue";
import SkipWorktreeComponent from "./components/SkipWorktreeComponent.vue";
import StashesComponent from "./components/StashesComponent.vue";
import StatusComponent from "./components/StatusComponent.vue";
import StatusExtendedComponent from "./components/StatusExtendedComponent.vue";
import UntrackedComponent from "./components/UntrackedComponent.vue";
import UserhostComponent from "./components/UserhostComponent.vue";

export default defineClientConfig({
enhance({ app }) {
app.use(pinia);

app.component("ActionComponent", ActionComponent);
app.component("AssumedUnchangedComponent", AssumedUnchangedComponent);
app.component("CharComponent", CharComponent);
app.component("ConfigComponent", ConfigComponent);
app.component("ConflictedComponent", ConflictedComponent);
app.component("ComponentsListComponent", ComponentsListComponent);
app.component(
"ContextConfigurationComponent",
ContextConfigurationComponent
);
app.component("CwdComponent", CwdComponent);
app.component("DeletedComponent", DeletedComponent);
app.component("DeletedStagedComponent", DeletedStagedComponent);
app.component("DirtyComponent", DirtyComponent);
app.component("GitAheadComponent", GitAheadComponent);
app.component("GitBehindComponent", GitBehindComponent);
app.component("GitHeadComponent", GitHeadComponent);
app.component("GitPushAheadComponent", GitPushAheadComponent);
app.component("GitPushBehindComponent", GitPushBehindComponent);
app.component("GitPushComponent", GitPushComponent);
app.component("GitRefComponent", GitRefComponent);
app.component("GitRemoteComponent", GitRemoteComponent);
app.component("GitTagComponent", GitTagComponent);
app.component("InputComponent", InputComponent);
app.component("ModifiedComponent", ModifiedComponent);
app.component("ModifiedStagedComponent", ModifiedStagedComponent);
app.component("NewComponent", NewComponent);
app.component("OptionsComponent", OptionsComponent);
app.component(
"OptionsConfigurationComponent",
OptionsConfigurationComponent
);
app.component("PromptSegmentComponent", PromptSegmentComponent);
app.component("RepoRootComponent", RepoRootComponent);
app.component("RepoSubdirectoryComponent", RepoSubdirectoryComponent);
app.component("ResetOptionsComponent", ResetOptionsComponent);
app.component("SkipWorktreeComponent", SkipWorktreeComponent);
app.component("StashesComponent", StashesComponent);
app.component("StatusComponent", StatusComponent);
app.component("StatusExtendedComponent", StatusExtendedComponent);
app.component("UntrackedComponent", UntrackedComponent);
app.component("UserhostComponent", UserhostComponent);
},
});
37 changes: 37 additions & 0 deletions docs/.vuepress/components/ActionComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script>
import { useOptionsStore } from "../stores/options";
import { useContextStore } from "../stores/context";
import { getValue } from "../utils/value";
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
export default {
components: [PromptSegmentComponent],
setup() {
const store = {
context: useContextStore(),
options: useOptionsStore(),
};
return { store };
},
methods: {
useVerboseDefaults() {
return getValue(
this.store.options.data.GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS
);
},
getValue,
},
};
</script>

<template>
<PromptSegmentComponent
v-if="
getValue(store.context.data.directoryGitRepo) &&
getValue(store.context.data.gitStatusAction)
"
:key="useVerboseDefaults()"
color-option="GIT_PROMPT_KIT_COLOR_ACTION"
text="merge"
/>
</template>
49 changes: 49 additions & 0 deletions docs/.vuepress/components/AssumedUnchangedComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<script>
import { useOptionsStore } from "../stores/options";
import { useContextStore } from "../stores/context";
import { getValue } from "../utils/value";
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
export default {
components: [PromptSegmentComponent],
setup() {
const store = {
context: useContextStore(),
options: useOptionsStore(),
};
return { store };
},
methods: {
useVerboseDefaults() {
return getValue(
this.store.options.data.GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS
);
},
getValue,
},
};
</script>

<template>
<PromptSegmentComponent
v-if="
getValue(store.context.data.extendedGitStatusAssumeUnchanged) ||
!getValue(store.options.data.GIT_PROMPT_KIT_HIDE_INACTIVE_EXTENDED_STATUS)
"
:key="useVerboseDefaults()"
:color-option="
getValue(store.context.data.extendedGitStatusAssumeUnchanged)
? 'GIT_PROMPT_KIT_COLOR_ASSUME_UNCHANGED'
: 'GIT_PROMPT_KIT_COLOR_INACTIVE'
"
:text="`${
getValue(store.context.data.extendedGitStatusAssumeUnchanged)
? '2' +
getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED)
: getValue(
store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED_INACTIVE,
store.options.data.GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED
) || ''
}`"
/>
</template>
35 changes: 35 additions & 0 deletions docs/.vuepress/components/CharComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script>
import { useOptionsStore } from "../stores/options";
import { useContextStore } from "../stores/context";
import { getValue } from "../utils/value";
import PromptSegmentComponent from "./prompt/PromptSegmentComponent.vue";
export default {
components: [PromptSegmentComponent],
setup() {
const store = {
context: useContextStore(),
options: useOptionsStore(),
};
return { store };
},
methods: {
getValue,
},
};
</script>

<template>
<PromptSegmentComponent
:color-option="
getValue(store.context.data.sessionFailed)
? 'GIT_PROMPT_KIT_COLOR_FAILED'
: 'GIT_PROMPT_KIT_COLOR_SUCCEEDED'
"
:text="
getValue(store.context.data.userRoot)
? getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_CHAR_ROOT)
: getValue(store.options.data.GIT_PROMPT_KIT_SYMBOL_CHAR_NORMAL)
"
/>
</template>
Loading

0 comments on commit 85d7fbd

Please sign in to comment.