From 759a41b3b3dd0fa18d9552f3a8895955bff5bca9 Mon Sep 17 00:00:00 2001 From: Alex van der Valk <21194068+alexvdvalk@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:08:31 +0200 Subject: [PATCH 1/3] replace BSL texts --- src/commands/apply.ts | 16 ++++++++-------- src/commands/extract.ts | 8 ++++---- src/lib/constants.ts | 9 ++++----- src/lib/init/index.ts | 8 ++++---- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/commands/apply.ts b/src/commands/apply.ts index 8ac93358..56a93635 100644 --- a/src/commands/apply.ts +++ b/src/commands/apply.ts @@ -4,7 +4,7 @@ import chalk from 'chalk' import * as path from 'pathe' import * as customFlags from '../flags/common.js' -import {BSL_LICENSE_CTA, BSL_LICENSE_HEADLINE, BSL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR } from '../lib/constants.js' +import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR } from '../lib/constants.js' import {type ApplyFlags, validateInteractiveFlags, validateProgrammaticFlags} from '../lib/load/apply-flags.js' import apply from '../lib/load/index.js' import {animatedBunny} from '../lib/utils/animated-bunny.js' @@ -244,9 +244,9 @@ static flags = { ux.stdout(SEPARATOR) - log.warn(BSL_LICENSE_HEADLINE) - log.info(BSL_LICENSE_TEXT) - log.info(BSL_LICENSE_CTA) + log.warn(MSCL_LICENSE_HEADLINE) + log.info(MSCL_LICENSE_TEXT) + log.info(MSCL_LICENSE_CTA) ux.stdout('Template applied successfully.') if (!validatedFlags.noExit) process.exit(0) @@ -337,10 +337,10 @@ static flags = { ux.stdout('Template applied successfully.') if (!validatedFlags.noExit) process.exit(0) - // Hide BSL license info if running programatically for now - // log.warn(BSL_LICENSE_HEADLINE) - // log.info(BSL_LICENSE_TEXT) - // log.info(BSL_LICENSE_CTA) + // Hide MSCL license info if running programatically for now + // log.warn(MSCL_LICENSE_HEADLINE) + // log.info(MSCL_LICENSE_TEXT) + // log.info(MSCL_LICENSE_CTA) } /** diff --git a/src/commands/extract.ts b/src/commands/extract.ts index 773dc7cd..67027cd0 100644 --- a/src/commands/extract.ts +++ b/src/commands/extract.ts @@ -6,7 +6,7 @@ import fs from 'node:fs' import path from 'pathe' import * as customFlags from '../flags/common.js' -import {BSL_LICENSE_CTA, BSL_LICENSE_HEADLINE, BSL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR} from '../lib/constants.js' +import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR} from '../lib/constants.js' import extract from '../lib/extract/index.js' import {animatedBunny} from '../lib/utils/animated-bunny.js' import {getDirectusEmailAndPassword, getDirectusToken, getDirectusUrl, initializeDirectusApi, validateAuthFlags} from '../lib/utils/auth.js' @@ -129,9 +129,9 @@ static flags = { await shutdown(); } - log.warn(BSL_LICENSE_HEADLINE) - log.info(BSL_LICENSE_TEXT) - log.info(BSL_LICENSE_CTA) + log.warn(MSCL_LICENSE_HEADLINE) + log.info(MSCL_LICENSE_TEXT) + log.info(MSCL_LICENSE_CTA) ux.stdout(SEPARATOR) ux.stdout('Template extracted successfully.') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 8bb60dcf..6f97cd93 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -25,12 +25,11 @@ export const POSTHOG_HOST = 'https://us.i.posthog.com' export const DEFAULT_BRANCH = 'main' -export const BSL_LICENSE_URL = 'https://directus.io/bsl' -export const BSL_EMAIL = 'licensing@directus.io' +export const MSCL_LICENSE_URL = 'https://directus.com/license' -export const BSL_LICENSE_HEADLINE = 'You REQUIRE a license to use Directus if your organization has more than $5MM USD a year in revenue and/or funding.' -export const BSL_LICENSE_TEXT = 'For all organizations with less than $5MM USD a year in revenue and funding, Directus is free for personal projects, hobby projects and in production. This second group does not require a license. Directus is licensed under BSL 1.1.' +export const MSCL_LICENSE_HEADLINE = 'Directus is licensed under MSCL-1.0-GPL. A Competing Use—making the Software available in a way that competes with Directus\'s paid commercial offerings—is not permitted.' +export const MSCL_LICENSE_TEXT = 'Permitted uses include internal use, non-commercial education and research, and professional services to deploy or host Directus for licensees. You must not disable or circumvent license key functionality. Four years after release, the Software is also available under GPL-3.0.' -export const BSL_LICENSE_CTA = `Visit ${pinkText(BSL_LICENSE_URL)} for more information or reach out to us at ${pinkText(BSL_EMAIL)}.` +export const MSCL_LICENSE_CTA = `Visit ${pinkText(MSCL_LICENSE_URL)} for the full license terms.` export const DEFAULT_DIRECTUS_URL = 'http://localhost:8055' diff --git a/src/lib/init/index.ts b/src/lib/init/index.ts index 61f1ac72..4bfe2b80 100644 --- a/src/lib/init/index.ts +++ b/src/lib/init/index.ts @@ -12,7 +12,7 @@ import type {InitFlags} from '../../commands/init.js' import ApplyCommand from '../../commands/apply.js' import {createDocker} from '../../services/docker.js' -import {BSL_LICENSE_CTA, BSL_LICENSE_HEADLINE, BSL_LICENSE_TEXT, pinkText} from '../constants.js' +import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, pinkText} from '../constants.js' import catchError from '../utils/catch-error.js' import {createGigetString, parseGitHubUrl} from '../utils/parse-github-url.js' import {readTemplateConfig} from '../utils/template-config.js' @@ -202,9 +202,9 @@ export async function init({dir, flags}: {dir: string, flags: InitFlags}) { note(nextSteps, 'Next Steps') - clackLog.warn(BSL_LICENSE_HEADLINE) - clackLog.info(BSL_LICENSE_TEXT) - clackLog.info(BSL_LICENSE_CTA) + clackLog.warn(MSCL_LICENSE_HEADLINE) + clackLog.info(MSCL_LICENSE_TEXT) + clackLog.info(MSCL_LICENSE_CTA) outro(`Problems or questions? Hop into the community at ${pinkText('https://directus.chat')}`) } catch (error) { From c4ed3576f60d21e419bca7b5ef966da88d77e547 Mon Sep 17 00:00:00 2001 From: Alex van der Valk <21194068+alexvdvalk@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:17:06 +0200 Subject: [PATCH 2/3] add email --- src/lib/constants.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 6f97cd93..f53db3f4 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -24,12 +24,14 @@ export const POSTHOG_HOST = 'https://us.i.posthog.com' export const DEFAULT_BRANCH = 'main' - export const MSCL_LICENSE_URL = 'https://directus.com/license' +export const MSCL_EMAIL = 'licensing@directus.com' -export const MSCL_LICENSE_HEADLINE = 'Directus is licensed under MSCL-1.0-GPL. A Competing Use—making the Software available in a way that competes with Directus\'s paid commercial offerings—is not permitted.' -export const MSCL_LICENSE_TEXT = 'Permitted uses include internal use, non-commercial education and research, and professional services to deploy or host Directus for licensees. You must not disable or circumvent license key functionality. Four years after release, the Software is also available under GPL-3.0.' +export const MSCL_LICENSE_HEADLINE = + "Directus is licensed under MSCL-1.0-GPL. A Competing Use—making the Software available in a way that competes with Directus's paid commercial offerings—is not permitted." +export const MSCL_LICENSE_TEXT = + 'Permitted uses include internal use, non-commercial education and research, and professional services to deploy or host Directus for licensees. You must not disable or circumvent license key functionality. Four years after release, the Software is also available under GPL-3.0.' -export const MSCL_LICENSE_CTA = `Visit ${pinkText(MSCL_LICENSE_URL)} for the full license terms.` +export const MSCL_LICENSE_CTA = `Visit ${pinkText(MSCL_LICENSE_URL)} or reach out to us at ${pinkText(MSCL_EMAIL)} for the full license terms.` export const DEFAULT_DIRECTUS_URL = 'http://localhost:8055' From ab3df1827175c80973c1ec077a9a40c1251e6402 Mon Sep 17 00:00:00 2001 From: Alex van der Valk <21194068+alexvdvalk@users.noreply.github.com> Date: Thu, 4 Jun 2026 10:21:21 +0200 Subject: [PATCH 3/3] add Directus version check --- src/commands/apply.ts | 13 +++++-------- src/commands/extract.ts | 7 +++---- src/lib/constants.ts | 10 ++++++++++ src/lib/init/index.ts | 7 +++---- src/lib/license/index.ts | 29 +++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 src/lib/license/index.ts diff --git a/src/commands/apply.ts b/src/commands/apply.ts index 56a93635..336b8f0e 100644 --- a/src/commands/apply.ts +++ b/src/commands/apply.ts @@ -4,7 +4,8 @@ import chalk from 'chalk' import * as path from 'pathe' import * as customFlags from '../flags/common.js' -import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR } from '../lib/constants.js' +import {DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR } from '../lib/constants.js' +import { displayLicenseBanner } from '../lib/license/index.js' import {type ApplyFlags, validateInteractiveFlags, validateProgrammaticFlags} from '../lib/load/apply-flags.js' import apply from '../lib/load/index.js' import {animatedBunny} from '../lib/utils/animated-bunny.js' @@ -244,9 +245,7 @@ static flags = { ux.stdout(SEPARATOR) - log.warn(MSCL_LICENSE_HEADLINE) - log.info(MSCL_LICENSE_TEXT) - log.info(MSCL_LICENSE_CTA) + await displayLicenseBanner() ux.stdout('Template applied successfully.') if (!validatedFlags.noExit) process.exit(0) @@ -337,10 +336,8 @@ static flags = { ux.stdout('Template applied successfully.') if (!validatedFlags.noExit) process.exit(0) - // Hide MSCL license info if running programatically for now - // log.warn(MSCL_LICENSE_HEADLINE) - // log.info(MSCL_LICENSE_TEXT) - // log.info(MSCL_LICENSE_CTA) + // Hide license info if running programatically for now + // await displayLicenseBanner() } /** diff --git a/src/commands/extract.ts b/src/commands/extract.ts index 67027cd0..a3008d85 100644 --- a/src/commands/extract.ts +++ b/src/commands/extract.ts @@ -6,8 +6,9 @@ import fs from 'node:fs' import path from 'pathe' import * as customFlags from '../flags/common.js' -import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR} from '../lib/constants.js' +import {DIRECTUS_PINK, DIRECTUS_PURPLE, SEPARATOR} from '../lib/constants.js' import extract from '../lib/extract/index.js' +import {displayLicenseBanner} from '../lib/license/index.js' import {animatedBunny} from '../lib/utils/animated-bunny.js' import {getDirectusEmailAndPassword, getDirectusToken, getDirectusUrl, initializeDirectusApi, validateAuthFlags} from '../lib/utils/auth.js' import catchError from '../lib/utils/catch-error.js' @@ -129,9 +130,7 @@ static flags = { await shutdown(); } - log.warn(MSCL_LICENSE_HEADLINE) - log.info(MSCL_LICENSE_TEXT) - log.info(MSCL_LICENSE_CTA) + await displayLicenseBanner() ux.stdout(SEPARATOR) ux.stdout('Template extracted successfully.') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f53db3f4..923cf43e 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -34,4 +34,14 @@ export const MSCL_LICENSE_TEXT = export const MSCL_LICENSE_CTA = `Visit ${pinkText(MSCL_LICENSE_URL)} or reach out to us at ${pinkText(MSCL_EMAIL)} for the full license terms.` +export const BSL_LICENSE_URL = 'https://directus.io/bsl' +export const BSL_EMAIL = 'licensing@directus.io' + +export const BSL_LICENSE_HEADLINE = + 'You REQUIRE a license to use Directus if your organization has more than $5MM USD a year in revenue and/or funding.' +export const BSL_LICENSE_TEXT = + 'For all organizations with less than $5MM USD a year in revenue and funding, Directus is free for personal projects, hobby projects and in production. This second group does not require a license. Directus is licensed under BSL 1.1.' + +export const BSL_LICENSE_CTA = `Visit ${pinkText(BSL_LICENSE_URL)} for more information or reach out to us at ${pinkText(BSL_EMAIL)}.` + export const DEFAULT_DIRECTUS_URL = 'http://localhost:8055' diff --git a/src/lib/init/index.ts b/src/lib/init/index.ts index 4bfe2b80..de62fc97 100644 --- a/src/lib/init/index.ts +++ b/src/lib/init/index.ts @@ -12,7 +12,8 @@ import type {InitFlags} from '../../commands/init.js' import ApplyCommand from '../../commands/apply.js' import {createDocker} from '../../services/docker.js' -import {MSCL_LICENSE_CTA, MSCL_LICENSE_HEADLINE, MSCL_LICENSE_TEXT, pinkText} from '../constants.js' +import {pinkText} from '../constants.js' +import {displayLicenseBanner} from '../license/index.js' import catchError from '../utils/catch-error.js' import {createGigetString, parseGitHubUrl} from '../utils/parse-github-url.js' import {readTemplateConfig} from '../utils/template-config.js' @@ -202,9 +203,7 @@ export async function init({dir, flags}: {dir: string, flags: InitFlags}) { note(nextSteps, 'Next Steps') - clackLog.warn(MSCL_LICENSE_HEADLINE) - clackLog.info(MSCL_LICENSE_TEXT) - clackLog.info(MSCL_LICENSE_CTA) + await displayLicenseBanner() outro(`Problems or questions? Hop into the community at ${pinkText('https://directus.chat')}`) } catch (error) { diff --git a/src/lib/license/index.ts b/src/lib/license/index.ts new file mode 100644 index 00000000..49623724 --- /dev/null +++ b/src/lib/license/index.ts @@ -0,0 +1,29 @@ +import {serverHealth} from '@directus/sdk' + +import { + BSL_LICENSE_CTA, + BSL_LICENSE_HEADLINE, + BSL_LICENSE_TEXT, + MSCL_LICENSE_CTA, + MSCL_LICENSE_HEADLINE, + MSCL_LICENSE_TEXT, +} from '../constants.js' +import {api} from '../sdk.js' + +export const displayLicenseBanner = async () => { + const {releaseId} = await api.client.request(serverHealth()) + + const mainVersion = Number(releaseId.split('.')[0]) + + const isMSCL = mainVersion >= 12 + + if (isMSCL) { + console.warn(MSCL_LICENSE_HEADLINE) + console.info(MSCL_LICENSE_TEXT) + console.info(MSCL_LICENSE_CTA) + } else { + console.warn(BSL_LICENSE_HEADLINE) + console.info(BSL_LICENSE_TEXT) + console.info(BSL_LICENSE_CTA) + } +}