chore: Replace references to deprecated services

This commit is contained in:
Dries Augustyns
2025-12-31 15:08:26 +01:00
parent 289c633189
commit 7648f6e1eb
51 changed files with 163 additions and 183 deletions
+7 -11
View File
@@ -1,24 +1,20 @@
import { visit } from 'unist-util-visit';
import {visit} from 'unist-util-visit';
// Default URLs that will be replaced at container startup by sed
const API_URL = process.env.NEXT_PUBLIC_API_URI || 'https://api.useplunk.com';
const DASHBOARD_URL = process.env.NEXT_PUBLIC_DASHBOARD_URI || 'https://app.useplunk.com';
const API_URL = process.env.NEXT_PUBLIC_API_URI || 'https://next-api.useplunk.com';
const DASHBOARD_URL = process.env.NEXT_PUBLIC_DASHBOARD_URI || 'https://next-app.useplunk.com';
export function remarkReplaceEnv() {
return (tree) => {
visit(tree, ['code', 'inlineCode', 'text', 'link'], (node) => {
return tree => {
visit(tree, ['code', 'inlineCode', 'text', 'link'], node => {
// Replace in text values
if (node.value && typeof node.value === 'string') {
node.value = node.value
.replace(/\{\{API_URL\}\}/g, API_URL)
.replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
node.value = node.value.replace(/\{\{API_URL\}\}/g, API_URL).replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
}
// Replace in link URLs
if (node.url && typeof node.url === 'string') {
node.url = node.url
.replace(/\{\{API_URL\}\}/g, API_URL)
.replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
node.url = node.url.replace(/\{\{API_URL\}\}/g, API_URL).replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
}
});
};