diff --git a/src/assets/readme.md b/src/assets/readme.md new file mode 100644 index 0000000000..43f641c415 --- /dev/null +++ b/src/assets/readme.md @@ -0,0 +1,3 @@ +# Assets + +Static assets that are used in the app. Primarily used for logos and fonts. diff --git a/src/components/readme.md b/src/components/readme.md new file mode 100644 index 0000000000..7e9931b5d4 --- /dev/null +++ b/src/components/readme.md @@ -0,0 +1,19 @@ +# Components + +Components are custom elements that can reused in various other places. + +## Storybook / Tests + +Every component should have an entry in Storybook, and should have unit tests where appropriate. + +## Naming + +Components must always have a `-` in the name. This makes sure we don't run into any conflicts with HTML element names. + +## Base Components + +The core-most base-components are prefixed with `v-` (for example `v-icon` and `v-button`). These components can not rely on any global store. + +## Private Components + +Every now and again, it makes sense to split up a bigger component in smaller sub-parts for code maintainability and organization reasons. These "internal private components" are prefixed with a `_` and should never be used standalone. diff --git a/src/compositions/readme.md b/src/compositions/readme.md new file mode 100644 index 0000000000..8c8877858e --- /dev/null +++ b/src/compositions/readme.md @@ -0,0 +1,50 @@ +# Compositions + +Compositions are reusable snippets of functionality that can be used in Vue components. + +## Table of Contents + +* [Event Listener](#event-listener) +* [Window Size](#window-size) + +## Event Listener + +The event listener composition allows you to bound event listeners to global elements. + +**Note:** You should rely on Vue's event handlers like `@click` whenever possible. This composition acts as an escape hatch for triggering things based on out-of-component events. + +The composition removes the event handler whenever the component is unmounted. + +### Usage + +```js +import { createComponent } from '@vue/composition-api'; +import useEventListener from '@/compositions/event-listener'; + +export default createComponent({ + setup() { + useEventListener(window, 'scroll', onScroll); + + function onScroll(event) { + console.log(event); + } + } +}); +``` + +## Window Size + +Returns a `ref` of `width` and `height` of the current window size. Updates the value on window resizes. + +### Usage + +```js +import { createComponent } from '@vue/composition-api'; +import useWindowSize from '@/compositions/window-size'; + +export default createComponent({ + setup() { + const { width, height } = useWindowSize(); + } +}); +``` diff --git a/src/interfaces/readme.md b/src/interfaces/readme.md new file mode 100644 index 0000000000..7fffa10138 --- /dev/null +++ b/src/interfaces/readme.md @@ -0,0 +1,3 @@ +# Interfaces + +Interfaces are the way of inputting, editing and viewing data. The most easy way to understand interface is a datepicker. It allows you to represent the date in specified format & you can validate the inputs. It renders the date in better way by providing a different UI than just a normal text. In Database terms, interface represents the column's value. diff --git a/src/lang/readme.md b/src/lang/readme.md new file mode 100644 index 0000000000..bc25ebc586 --- /dev/null +++ b/src/lang/readme.md @@ -0,0 +1,3 @@ +# Lang (i18n) + +Contains the vue-i18n configuration and constructor, and the actual translation files for each language. The language translations themselves are managed by [Crowdin](https://locales.directus.io). diff --git a/src/layouts/readme.md b/src/layouts/readme.md new file mode 100644 index 0000000000..e85b2672a0 --- /dev/null +++ b/src/layouts/readme.md @@ -0,0 +1,3 @@ +# Layouts + +Layouts are different ways to view and interact with collection data. diff --git a/src/modules/readme.md b/src/modules/readme.md new file mode 100644 index 0000000000..ba8ae27798 --- /dev/null +++ b/src/modules/readme.md @@ -0,0 +1,3 @@ +# Modules + +Modules are the top-level "sections" of the application. Each module has its own navigation and pages. diff --git a/src/stores/readme.md b/src/stores/readme.md new file mode 100644 index 0000000000..b810f37467 --- /dev/null +++ b/src/stores/readme.md @@ -0,0 +1,4 @@ +# Stores + +Global data stores that can be used to access data that's used in multiple other components. For example the available collections within the current project. + diff --git a/src/styles/readme.md b/src/styles/readme.md new file mode 100644 index 0000000000..15e076b246 --- /dev/null +++ b/src/styles/readme.md @@ -0,0 +1,5 @@ +# Styles + +The global styles of the application. Even though everything is based around scoped styles in the components, there's still a need to have a certain set of global styles. Most importantly the global reset ([_base.scss](./_base.scss)) and CSS Custom Properties (variables) ([_variables.scss](./_variables.scss)). + +There are a couple of plugins (v-tooltip / codemirror / etc) that expect their styles to be global. This folder can be used for that as well. diff --git a/src/utils/readme.md b/src/utils/readme.md new file mode 100644 index 0000000000..5aaa49364e --- /dev/null +++ b/src/utils/readme.md @@ -0,0 +1,7 @@ +# Utils + +Various utility functions that can be reused across components. + +## Testing + +Please make sure that new utils have unit tests where appropriate.