mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Merge branch 'main' into aggregation
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
return require('./dist/cli/index.js');
|
||||
require('./dist/cli/index.js');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "directus",
|
||||
"version": "9.0.0-rc.80",
|
||||
"version": "9.0.0-rc.81",
|
||||
"license": "GPL-3.0-only",
|
||||
"homepage": "https://github.com/directus/directus#readme",
|
||||
"description": "Directus is a real-time API and App dashboard for managing SQL database content.",
|
||||
@@ -69,15 +69,15 @@
|
||||
"example.env"
|
||||
],
|
||||
"dependencies": {
|
||||
"@directus/app": "9.0.0-rc.80",
|
||||
"@directus/drive": "9.0.0-rc.80",
|
||||
"@directus/drive-azure": "9.0.0-rc.80",
|
||||
"@directus/drive-gcs": "9.0.0-rc.80",
|
||||
"@directus/drive-s3": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/schema": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@directus/specs": "9.0.0-rc.80",
|
||||
"@directus/app": "9.0.0-rc.81",
|
||||
"@directus/drive": "9.0.0-rc.81",
|
||||
"@directus/drive-azure": "9.0.0-rc.81",
|
||||
"@directus/drive-gcs": "9.0.0-rc.81",
|
||||
"@directus/drive-s3": "9.0.0-rc.81",
|
||||
"@directus/format-title": "9.0.0-rc.81",
|
||||
"@directus/schema": "9.0.0-rc.81",
|
||||
"@directus/shared": "9.0.0-rc.81",
|
||||
"@directus/specs": "9.0.0-rc.81",
|
||||
"@godaddy/terminus": "^4.9.0",
|
||||
"@rollup/plugin-alias": "^3.1.2",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
@@ -89,7 +89,7 @@
|
||||
"busboy": "^0.3.1",
|
||||
"camelcase": "^6.2.0",
|
||||
"chalk": "^4.1.1",
|
||||
"commander": "^7.2.0",
|
||||
"commander": "^8.0.0",
|
||||
"cookie-parser": "^1.4.5",
|
||||
"cors": "^2.8.5",
|
||||
"csv-parser": "^3.0.0",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import program from 'commander';
|
||||
import { program } from 'commander';
|
||||
import start from '../start';
|
||||
import bootstrap from './commands/bootstrap';
|
||||
import count from './commands/count';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Knex } from 'knex';
|
||||
import logger from '../../logger';
|
||||
import SchemaInspector from 'knex-schema-inspector';
|
||||
|
||||
/**
|
||||
* Things to keep in mind:
|
||||
@@ -80,11 +81,23 @@ const updates = [
|
||||
];
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
const inspector = SchemaInspector(knex);
|
||||
|
||||
const foreignKeys = await inspector.foreignKeys();
|
||||
|
||||
for (const update of updates) {
|
||||
for (const constraint of update.constraints) {
|
||||
const existingForeignKey = foreignKeys.find(
|
||||
(fk) =>
|
||||
fk.table === update.table &&
|
||||
fk.column === constraint.column &&
|
||||
fk.foreign_key_table === constraint.references.split('.')[0] &&
|
||||
fk.foreign_key_column === constraint.references.split('.')[1]
|
||||
);
|
||||
|
||||
try {
|
||||
await knex.schema.alterTable(update.table, (table) => {
|
||||
table.dropForeign([constraint.column]);
|
||||
table.dropForeign([constraint.column], existingForeignKey?.constraint_name || undefined);
|
||||
});
|
||||
} catch (err) {
|
||||
logger.warn(`Couldn't drop foreign key ${update.table}.${constraint.column}->${constraint.references}`);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Knex } from 'knex';
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
await knex.schema.alterTable('directus_files', (table) => {
|
||||
table.bigInteger('filesize').nullable().defaultTo(null).alter();
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.alterTable('directus_files', (table) => {
|
||||
table.integer('filesize').nullable().defaultTo(null).alter();
|
||||
});
|
||||
}
|
||||
@@ -81,6 +81,7 @@
|
||||
- id
|
||||
- first_name
|
||||
- last_name
|
||||
- last_page
|
||||
- email
|
||||
- password
|
||||
- location
|
||||
|
||||
@@ -47,7 +47,7 @@ const defaults: Record<string, any> = {
|
||||
|
||||
CACHE_ENABLED: false,
|
||||
CACHE_STORE: 'memory',
|
||||
CACHE_TTL: '10m',
|
||||
CACHE_TTL: '5m',
|
||||
CACHE_NAMESPACE: 'system-cache',
|
||||
CACHE_AUTO_PURGE: false,
|
||||
CACHE_CONTROL_S_MAXAGE: '0',
|
||||
@@ -65,7 +65,7 @@ const defaults: Record<string, any> = {
|
||||
TELEMETRY: true,
|
||||
|
||||
ASSETS_CACHE_TTL: '30m',
|
||||
ASSETS_TRANSFORM_MAX_CONCURRENT: 4,
|
||||
ASSETS_TRANSFORM_MAX_CONCURRENT: 1,
|
||||
ASSETS_TRANSFORM_IMAGE_MAX_DIMENSION: 6000,
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import express, { Router } from 'express';
|
||||
import path from 'path';
|
||||
import { AppExtensionType, Extension, ExtensionType } from '@directus/shared/types';
|
||||
import {
|
||||
ensureExtensionsDirs,
|
||||
ensureExtensionDirs,
|
||||
generateExtensionsEntry,
|
||||
getLocalExtensions,
|
||||
getPackageExtensions,
|
||||
@@ -31,7 +31,7 @@ let extensions: Extension[] = [];
|
||||
let extensionBundles: Partial<Record<AppExtensionType, string>> = {};
|
||||
|
||||
export async function initializeExtensions(): Promise<void> {
|
||||
await ensureExtensionsDirs(env.EXTENSIONS_PATH);
|
||||
await ensureExtensionDirs(env.EXTENSIONS_PATH);
|
||||
extensions = await getExtensions();
|
||||
|
||||
if (!('DIRECTUS_DEV' in process.env)) {
|
||||
@@ -88,9 +88,10 @@ async function generateExtensionBundles() {
|
||||
const bundle = await rollup({
|
||||
input: 'entry',
|
||||
external: Object.values(sharedDepsMapping),
|
||||
makeAbsoluteExternalsRelative: false,
|
||||
plugins: [virtual({ entry }), alias({ entries: internalImports })],
|
||||
});
|
||||
const { output } = await bundle.generate({ format: 'es' });
|
||||
const { output } = await bundle.generate({ format: 'es', compact: true });
|
||||
|
||||
bundles[extensionType] = output[0].code;
|
||||
|
||||
@@ -102,13 +103,14 @@ async function generateExtensionBundles() {
|
||||
|
||||
async function getSharedDepsMapping(deps: string[]) {
|
||||
const appDir = await fse.readdir(path.join(resolvePackage('@directus/app'), 'dist'));
|
||||
const adminUrl = env.PUBLIC_URL.endsWith('/') ? env.PUBLIC_URL + 'admin' : env.PUBLIC_URL + '/admin';
|
||||
|
||||
const depsMapping: Record<string, string> = {};
|
||||
for (const dep of deps) {
|
||||
const depName = appDir.find((file) => dep.replace(/\//g, '_') === file.substring(0, file.indexOf('.')));
|
||||
|
||||
if (depName) {
|
||||
depsMapping[dep] = `${env.PUBLIC_URL}/admin/${depName}`;
|
||||
depsMapping[dep] = `${adminUrl}/${depName}`;
|
||||
} else {
|
||||
logger.warn(`Couldn't find shared extension dependency "${dep}"`);
|
||||
}
|
||||
|
||||
@@ -67,12 +67,7 @@ export class MailService {
|
||||
html = prettier.format(html as string, { parser: 'html', printWidth: 70, tabWidth: 0 });
|
||||
}
|
||||
|
||||
try {
|
||||
await this.mailer.sendMail({ ...emailOptions, from, html });
|
||||
} catch (error) {
|
||||
logger.warn('[Email] Unexpected error while sending an email:');
|
||||
logger.warn(error);
|
||||
}
|
||||
await this.mailer.sendMail({ ...emailOptions, from, html });
|
||||
}
|
||||
|
||||
private async renderTemplate(template: string, variables: Record<string, any>) {
|
||||
|
||||
Reference in New Issue
Block a user