fix: UI list and show (#1210)
This commit is contained in:
@@ -1,26 +1,97 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
import { baseConfig, mergeConfig } from '@tm/build-config';
|
||||
import { load as dotenvLoad } from 'dotenv-mono';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
dotenvLoad();
|
||||
|
||||
// Get all TM_PUBLIC_* env variables for build-time injection
|
||||
const getBuildTimeEnvs = () => {
|
||||
const envs: Record<string, string> = {};
|
||||
for (const [key, value] of Object.entries(process.env)) {
|
||||
if (key.startsWith('TM_PUBLIC_')) {
|
||||
// Return the actual value, not JSON.stringify'd
|
||||
envs[key] = value || '';
|
||||
}
|
||||
}
|
||||
return envs;
|
||||
};
|
||||
|
||||
export default defineConfig(
|
||||
mergeConfig(baseConfig, {
|
||||
entry: {
|
||||
'task-master': 'bin/task-master.js',
|
||||
'task-master': 'scripts/dev.js',
|
||||
'mcp-server': 'mcp-server/server.js'
|
||||
},
|
||||
outDir: 'dist',
|
||||
publicDir: 'public',
|
||||
// Bundle our monorepo packages but keep node_modules external
|
||||
noExternal: [/@tm\/.*/],
|
||||
// Ensure no code splitting
|
||||
splitting: false,
|
||||
// Better watch configuration
|
||||
ignoreWatch: [
|
||||
'dist',
|
||||
'node_modules',
|
||||
'.git',
|
||||
'tests',
|
||||
'*.test.*',
|
||||
'*.spec.*'
|
||||
]
|
||||
// Override the base config's external to bundle our workspace packages
|
||||
noExternal: [/^@tm\//],
|
||||
external: [
|
||||
/^@supabase\//, // Keep Supabase external to avoid dynamic require issues
|
||||
'marked',
|
||||
'marked-terminal'
|
||||
],
|
||||
env: getBuildTimeEnvs(),
|
||||
esbuildOptions(options) {
|
||||
// Set up path aliases for workspace packages
|
||||
options.alias = {
|
||||
'@tm/core': path.resolve(__dirname, 'packages/tm-core/src/index.ts'),
|
||||
'@tm/core/auth': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/auth/index.ts'
|
||||
),
|
||||
'@tm/core/storage': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/storage/index.ts'
|
||||
),
|
||||
'@tm/core/config': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/config/index.ts'
|
||||
),
|
||||
'@tm/core/providers': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/providers/index.ts'
|
||||
),
|
||||
'@tm/core/services': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/services/index.ts'
|
||||
),
|
||||
'@tm/core/errors': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/errors/index.ts'
|
||||
),
|
||||
'@tm/core/logger': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/logger/index.ts'
|
||||
),
|
||||
'@tm/core/types': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/types/index.ts'
|
||||
),
|
||||
'@tm/core/interfaces': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/interfaces/index.ts'
|
||||
),
|
||||
'@tm/core/utils': path.resolve(
|
||||
__dirname,
|
||||
'packages/tm-core/src/utils/index.ts'
|
||||
),
|
||||
'@tm/cli': path.resolve(__dirname, 'apps/cli/src/index.ts'),
|
||||
'@tm/cli/commands': path.resolve(
|
||||
__dirname,
|
||||
'apps/cli/src/commands/index.ts'
|
||||
),
|
||||
'@tm/cli/utils': path.resolve(__dirname, 'apps/cli/src/utils/index.ts'),
|
||||
'@tm/cli/ui': path.resolve(__dirname, 'apps/cli/src/ui/index.ts'),
|
||||
'@tm/build-config': path.resolve(
|
||||
__dirname,
|
||||
'packages/build-config/src/tsup.base.ts'
|
||||
)
|
||||
};
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user