Merge branch 'main' into aggregation

This commit is contained in:
rijkvanzanten
2021-06-16 11:32:01 -04:00
164 changed files with 1761 additions and 857 deletions

View File

@@ -2,6 +2,7 @@ const path = require('path');
const fse = require('fs-extra');
const dirTree = require('directory-tree');
// eslint-disable-next-line no-console
console.log('Building docs...');
const tree = dirTree('.', {
@@ -15,6 +16,7 @@ const index = `export default ${generateIndex(tree.children)};`;
fse.ensureDirSync('dist');
fse.writeFileSync('dist/index.js', index);
// eslint-disable-next-line no-console
console.log('Built docs');
function generateIndex(tree) {

View File

@@ -5,22 +5,25 @@
## Troubleshooting Steps
If you're experiencing issues or think you have found a problem in Directus, be sure to follow these steps before [Reporting a Bug](/contributing/introduction/#bug-reporting):
If you're experiencing issues or think you have found a problem in Directus, be sure to follow these steps before
[Reporting a Bug](/contributing/introduction/#bug-reporting):
1. Ensure your server/database meet the [minimum requirements](/guides/installation/cli/#_1-confirm-minimum-requirements)
1. Ensure your server/database meet the
[minimum requirements](/guides/installation/cli/#_1-confirm-minimum-requirements)
2. Ensure youre on the [latest version of Directus](https://github.com/directus/directus/releases/latest)
3. Stop (`CTRL+C`) and restart the server (`npx directus start`)
5. Run the database migration script: `directus database migrate:latest` (backup your database first)
6. Disable any data-caching within your project
7. Test any App issues with browser extensions and cache disabled (eg: Incognito Mode)
8. Confirm the issue is not related to your own custom code
9. Check for [existing Issues](https://github.com/directus/directus/issues?q=is%3Aissue) (and [Discussions](https://github.com/directus/directus/discussions)) that match your problem
4. Run the database migration script: `directus database migrate:latest` (backup your database first)
5. Disable any data-caching within your project
6. Test any App issues with browser extensions and cache disabled (eg: Incognito Mode)
7. Confirm the issue is not related to your own custom code
8. Check for [existing Issues](https://github.com/directus/directus/issues?q=is%3Aissue) (and
[Discussions](https://github.com/directus/directus/discussions)) that match your problem
::: tip Source Contributors
Those who have installed from source should also remove all dependencies (`npx lerna clean -y`) and then reinstall them (`npm install`).
:::
::: tip Source Contributors Those who have installed from source should also remove all dependencies
(`npx lerna clean -y`) and then reinstall them (`npm install`). :::
If you're still experiencing a problem after completing the above steps, you can chat through things on our [community support](#community-support) or [report a bug](/contributing/introduction/#bug-reporting).
If you're still experiencing a problem after completing the above steps, you can chat through things on our
[community support](#community-support) or [report a bug](/contributing/introduction/#bug-reporting).
## Community Support

View File

@@ -98,7 +98,7 @@ To be read by the Admin App, your custom display's Vue component must first be b
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
```bash
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup-plugin-terser rollup-plugin-vue@5 vue-template-compiler
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
```
You can then use the following Rollup configuration within `rollup.config.js`:
@@ -106,6 +106,7 @@ You can then use the following Rollup configuration within `rollup.config.js`:
```js
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';
@@ -115,7 +116,16 @@ export default {
format: 'es',
file: 'dist/index.js',
},
plugins: [vue(), nodeResolve(), commonjs(), terser()],
plugins: [
vue(),
nodeResolve(),
commonjs(),
replace({
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true,
}),
terser(),
],
};
```

View File

@@ -55,6 +55,7 @@ for more info on what can go into this object.
<script>
export default {
emits: ['input'],
props: {
value: String,
},
@@ -88,7 +89,7 @@ To be read by the Admin App, your custom interface's Vue component must first be
We recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
```bash
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup-plugin-terser rollup-plugin-vue@5 vue-template-compiler
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
```
You can then use the following Rollup configuration within `rollup.config.js`:
@@ -96,6 +97,7 @@ You can then use the following Rollup configuration within `rollup.config.js`:
```js
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';
@@ -105,7 +107,16 @@ export default {
format: 'es',
file: 'dist/index.js',
},
plugins: [vue(), nodeResolve(), commonjs(), terser()],
plugins: [
vue(),
nodeResolve(),
commonjs(),
replace({
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true,
}),
terser(),
],
};
```

View File

@@ -131,7 +131,7 @@ To be read by the Admin App, your custom layouts's Vue component must first be b
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
```bash
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup-plugin-terser rollup-plugin-vue@5 vue-template-compiler
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
```
You can then use the following Rollup configuration within `rollup.config.js`:
@@ -139,6 +139,7 @@ You can then use the following Rollup configuration within `rollup.config.js`:
```js
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';
@@ -148,7 +149,16 @@ export default {
format: 'es',
file: 'dist/index.js',
},
plugins: [vue(), nodeResolve(), commonjs(), terser()],
plugins: [
vue(),
nodeResolve(),
commonjs(),
replace({
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true,
}),
terser(),
],
};
```

View File

@@ -25,7 +25,7 @@ export default {
icon: 'box',
routes: [
{
path: '/',
path: '',
component: ModuleComponent,
},
],
@@ -35,7 +35,8 @@ export default {
- `id` — The unique key for this module. It is good practice to scope proprietary interfaces with an author prefix.
- `name` — The human-readable name for this module.
- `icon` — An icon name from the material icon set, or the extended list of Directus custom icons.
- `routes` — Details the routes in your module per the Vue router.
- `routes` — Details the routes in your module. The routes are registered as nested routes with the module's `id`
serving as the base path.
::: tip TypeScript
@@ -130,7 +131,7 @@ To be read by the Admin App, your custom module's Vue component must first be bu
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
```bash
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup-plugin-terser rollup-plugin-vue@5 vue-template-compiler
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
```
You can then use the following Rollup configuration within `rollup.config.js`:
@@ -138,6 +139,7 @@ You can then use the following Rollup configuration within `rollup.config.js`:
```js
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';
@@ -147,7 +149,16 @@ export default {
format: 'es',
file: 'dist/index.js',
},
plugins: [vue(), nodeResolve(), commonjs(), terser()],
plugins: [
vue(),
nodeResolve(),
commonjs(),
replace({
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true,
}),
terser(),
],
};
```

View File

@@ -1,7 +1,7 @@
{
"name": "@directus/docs",
"private": false,
"version": "9.0.0-rc.75",
"version": "9.0.0-rc.76",
"description": "",
"main": "dist/index.js",
"scripts": {
@@ -34,7 +34,7 @@
"fs-extra": "^10.0.0",
"lodash.get": "^4.4.2",
"micromark": "^2.10.1",
"npm-watch": "^0.9.0",
"npm-watch": "^0.10.0",
"slugify": "^1.5.3",
"vuepress": "^1.7.1",
"vuepress-plugin-clean-urls": "^1.1.2"

View File

@@ -125,13 +125,14 @@ needs, you can extend the above environment variables to configure any of
## Cache
| Variable | Description | Default Value |
| ------------------ | ----------------------------------------------------------------------- | ---------------- |
| `CACHE_ENABLED` | Whether or not caching is enabled. | `false` |
| `CACHE_TTL` | How long the cache is persisted. | `30m` |
| `CACHE_AUTO_PURGE` | Automatically purge the cache on `create`/`update`/`delete` actions. | `false` |
| `CACHE_NAMESPACE` | How to scope the cache data. | `directus-cache` |
| `CACHE_STORE` | Where to store the cache data. Either `memory`, `redis`, or `memcache`. | `memory` |
| Variable | Description | Default Value |
| ------------------------ | -------------------------------------------------------------------------------------- | ---------------- |
| `CACHE_ENABLED` | Whether or not caching is enabled. | `false` |
| `CACHE_TTL` | How long the cache is persisted. | `30m` |
| `CACHE_CONTROL_S_MAXAGE` | Whether to not to add the s-maxage expiration flag. Set to a number for a custom value | `0` |
| `CACHE_AUTO_PURGE` | Automatically purge the cache on `create`/`update`/`delete` actions. | `false` |
| `CACHE_NAMESPACE` | How to scope the cache data. | `directus-cache` |
| `CACHE_STORE` | Where to store the cache data. Either `memory`, `redis`, or `memcache`. | `memory` |
Based on the `CACHE_STORE` used, you must also provide the following configurations:

View File

@@ -68,6 +68,27 @@ The storage implementation. See [Storage](#storage) for more information.
Defaults to an instance of `MemoryStorage` when in node.js, and `LocalStorage` when in browsers.
**NOTE:**
If you plan to use multiple SDK instances at once, keep in mind that they will share the Storage across them, leading to unpredictable behaviors. This scenario might be a case while writing tests.
For example, the SDK instance that executed last the `login()` method writes the resulting `access_token` into the Storage and **overwrites** any prior fetched `access_token` from any other SDK instance. That might mix up your test scenario by granting false access rights to your previous logged-in users.
Adding prefixes to your Storage instances would solve this error:
```js
import { Directus, MemoryStorage } from "@directus/sdk";
import { randomBytes } from "crypto";
// ...
const prefix = randomBytes(8).toString("hex");
const storage = new MemoryStorage(prefix);
const url = `http://${host}:${port}`;
const directus = new Directus(url, { storage });
```
#### `options.transport`
The transport implementation. See [Transport](#transport) for more information.