Revert "Unify workspace dropdowns; Update layouts (#458)"
This reverts commit 4bc8448a1d.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
interface ComponentInfo {
|
||||
name: string;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { readFile, readdir, stat } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import postgres from 'postgres';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
const DATABASE_URL =
|
||||
process.env.DATABASE_URL ||
|
||||
|
||||
21
packages/mcp-server/src/tools/env/model.ts
vendored
21
packages/mcp-server/src/tools/env/model.ts
vendored
@@ -375,16 +375,6 @@ export const envVariables: EnvVariableModel[] = [
|
||||
return z.coerce.boolean().optional().safeParse(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_ONLY',
|
||||
displayName: 'Enable Team Accounts Only and disable persoanl accounts.',
|
||||
description: 'Force disable personal accounts for pure B2B SaaS',
|
||||
category: 'Features',
|
||||
type: 'boolean',
|
||||
validate: ({ value }) => {
|
||||
return z.coerce.boolean().optional().safeParse(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_CREATION',
|
||||
displayName: 'Enable Team Account Creation',
|
||||
@@ -415,17 +405,6 @@ export const envVariables: EnvVariableModel[] = [
|
||||
return z.coerce.boolean().optional().safeParse(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NEXT_PUBLIC_ENABLE_TEAMS_ACCOUNTS_ONLY',
|
||||
displayName: 'Enable Teams Accounts Only',
|
||||
description:
|
||||
'When enabled, disables personal accounts and only allows team accounts.',
|
||||
category: 'Features',
|
||||
type: 'boolean',
|
||||
validate: ({ value }) => {
|
||||
return z.coerce.boolean().optional().safeParse(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NEXT_PUBLIC_ENABLE_NOTIFICATIONS',
|
||||
displayName: 'Enable Notifications',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { readFile, readdir } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
import { crossExecFileSync } from '../lib/process-utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { mkdir, readFile, readdir, unlink, writeFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
// Custom phase for organizing user stories
|
||||
interface CustomPhase {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
interface PromptTemplate {
|
||||
name: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import * as z from 'zod/v3';
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
interface ScriptInfo {
|
||||
name: string;
|
||||
|
||||
@@ -91,7 +91,7 @@ function createDeps(
|
||||
|
||||
describe('KitTranslationsService.list', () => {
|
||||
it('lists and flattens translations with missing namespace fallback', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({
|
||||
@@ -122,7 +122,7 @@ describe('KitTranslationsService.list', () => {
|
||||
|
||||
describe('KitTranslationsService.update', () => {
|
||||
it('updates nested translation keys', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -143,7 +143,7 @@ describe('KitTranslationsService.update', () => {
|
||||
});
|
||||
|
||||
it('rejects paths outside locales root', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -164,7 +164,7 @@ describe('KitTranslationsService.update', () => {
|
||||
});
|
||||
|
||||
it('rejects namespace path segments', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -187,7 +187,7 @@ describe('KitTranslationsService.update', () => {
|
||||
|
||||
describe('KitTranslationsService.stats', () => {
|
||||
it('computes coverage using base locale keys', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({
|
||||
@@ -213,7 +213,7 @@ describe('KitTranslationsService.stats', () => {
|
||||
|
||||
describe('KitTranslationsService.addNamespace', () => {
|
||||
it('creates namespace JSON in all locale directories', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -237,7 +237,7 @@ describe('KitTranslationsService.addNamespace', () => {
|
||||
});
|
||||
|
||||
it('throws if namespace already exists', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -253,7 +253,7 @@ describe('KitTranslationsService.addNamespace', () => {
|
||||
});
|
||||
|
||||
it('throws if no locales exist', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
@@ -264,7 +264,7 @@ describe('KitTranslationsService.addNamespace', () => {
|
||||
});
|
||||
|
||||
it('rejects path traversal in namespace', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -286,7 +286,7 @@ describe('KitTranslationsService.addNamespace', () => {
|
||||
|
||||
describe('KitTranslationsService.addLocale', () => {
|
||||
it('creates locale directory with namespace files', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({ hello: 'Hello' }),
|
||||
@@ -310,7 +310,7 @@ describe('KitTranslationsService.addLocale', () => {
|
||||
});
|
||||
|
||||
it('throws if locale already exists', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -326,7 +326,7 @@ describe('KitTranslationsService.addLocale', () => {
|
||||
});
|
||||
|
||||
it('works when no namespaces exist yet', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
@@ -337,7 +337,7 @@ describe('KitTranslationsService.addLocale', () => {
|
||||
});
|
||||
|
||||
it('rejects path traversal in locale', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
@@ -354,7 +354,7 @@ describe('KitTranslationsService.addLocale', () => {
|
||||
|
||||
describe('KitTranslationsService.removeNamespace', () => {
|
||||
it('deletes namespace files from all locales', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -377,7 +377,7 @@ describe('KitTranslationsService.removeNamespace', () => {
|
||||
});
|
||||
|
||||
it('throws if namespace does not exist', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -393,7 +393,7 @@ describe('KitTranslationsService.removeNamespace', () => {
|
||||
});
|
||||
|
||||
it('rejects path traversal', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
@@ -406,7 +406,7 @@ describe('KitTranslationsService.removeNamespace', () => {
|
||||
|
||||
describe('KitTranslationsService.removeLocale', () => {
|
||||
it('deletes entire locale directory', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -426,7 +426,7 @@ describe('KitTranslationsService.removeLocale', () => {
|
||||
});
|
||||
|
||||
it('throws if locale does not exist', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
@@ -437,7 +437,7 @@ describe('KitTranslationsService.removeLocale', () => {
|
||||
});
|
||||
|
||||
it('throws when trying to delete base locale', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps(
|
||||
{
|
||||
[`${localesRoot}/en/common.json`]: JSON.stringify({}),
|
||||
@@ -454,7 +454,7 @@ describe('KitTranslationsService.removeLocale', () => {
|
||||
});
|
||||
|
||||
it('rejects path traversal', async () => {
|
||||
const localesRoot = '/repo/apps/web/i18n/messages';
|
||||
const localesRoot = '/repo/apps/web/public/locales';
|
||||
const deps = createDeps({}, [localesRoot]);
|
||||
|
||||
const service = createKitTranslationsService(deps);
|
||||
|
||||
@@ -408,7 +408,7 @@ export class KitTranslationsService {
|
||||
}
|
||||
|
||||
private getLocalesRoot() {
|
||||
return path.resolve(this.deps.rootPath, 'apps', 'web', 'i18n', 'messages');
|
||||
return path.resolve(this.deps.rootPath, 'apps', 'web', 'public', 'locales');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user