Skip to content

Commit 3f75bd7

Browse files
committed
paramter.ts から branding.ts に切り出し
1 parent 7c01d5b commit 3f75bd7

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

packages/cdk/branding.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
3+
4+
// Branding configuration interface
5+
interface BrandingConfig {
6+
logoPath?: string;
7+
title?: string;
8+
}
9+
10+
// Load branding configuration from JSON file
11+
export const loadBrandingConfig = (): BrandingConfig => {
12+
const brandingPath = path.join(__dirname, 'branding.json');
13+
try {
14+
if (fs.existsSync(brandingPath)) {
15+
const brandingData = fs.readFileSync(brandingPath, 'utf8');
16+
return JSON.parse(brandingData);
17+
}
18+
} catch (error) {
19+
console.warn('Failed to load branding.json, using defaults:', error);
20+
}
21+
return {};
22+
};

packages/cdk/parameter.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
11
import * as cdk from 'aws-cdk-lib';
2-
import * as fs from 'fs';
3-
import * as path from 'path';
42
import {
53
StackInput,
64
stackInputSchema,
75
ProcessedStackInput,
86
} from './lib/stack-input';
97
import { ModelConfiguration } from 'generative-ai-use-cases';
10-
11-
// Branding configuration interface
12-
interface BrandingConfig {
13-
logoPath?: string;
14-
title?: string;
15-
}
16-
17-
// Load branding configuration from JSON file
18-
const loadBrandingConfig = (): BrandingConfig => {
19-
const brandingPath = path.join(__dirname, 'branding.json');
20-
try {
21-
if (fs.existsSync(brandingPath)) {
22-
const brandingData = fs.readFileSync(brandingPath, 'utf8');
23-
return JSON.parse(brandingData);
24-
}
25-
} catch (error) {
26-
console.warn('Failed to load branding.json, using defaults:', error);
27-
}
28-
return {};
29-
};
8+
import { loadBrandingConfig } from './branding';
309

3110
// Get parameters from CDK Context
3211
const getContext = (app: cdk.App): StackInput => {

0 commit comments

Comments
 (0)