@fnd-platform/cli 1.0.0-alpha.24 → 1.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bin/fnd.js +101 -4
- package/lib/bin/fnd.js.map +1 -1
- package/lib/commands/add.js +72 -75
- package/lib/commands/add.js.map +1 -1
- package/lib/commands/build.js +29 -34
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/deploy.d.ts +13 -5
- package/lib/commands/deploy.d.ts.map +1 -1
- package/lib/commands/deploy.js +94 -75
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/destroy.js +33 -38
- package/lib/commands/destroy.js.map +1 -1
- package/lib/commands/index.d.ts +1 -0
- package/lib/commands/index.d.ts.map +1 -1
- package/lib/commands/index.js +7 -15
- package/lib/commands/index.js.map +1 -1
- package/lib/commands/new.js +46 -50
- package/lib/commands/new.js.map +1 -1
- package/lib/commands/synth.d.ts +8 -1
- package/lib/commands/synth.d.ts.map +1 -1
- package/lib/commands/synth.js +82 -22
- package/lib/commands/synth.js.map +1 -1
- package/lib/commands/test.d.ts +73 -0
- package/lib/commands/test.d.ts.map +1 -0
- package/lib/commands/test.js +193 -0
- package/lib/commands/test.js.map +1 -0
- package/lib/index.d.ts +11 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +29 -18
- package/lib/index.js.map +1 -1
- package/lib/lib/deploy-utils.d.ts.map +1 -1
- package/lib/lib/deploy-utils.js +73 -72
- package/lib/lib/deploy-utils.js.map +1 -1
- package/lib/lib/infra-generator.js +55 -63
- package/lib/lib/infra-generator.js.map +1 -1
- package/lib/lib/logger.js +23 -29
- package/lib/lib/logger.js.map +1 -1
- package/lib/lib/nx-stats.js +12 -18
- package/lib/lib/nx-stats.js.map +1 -1
- package/lib/lib/project.js +7 -11
- package/lib/lib/project.js.map +1 -1
- package/lib/lib/templates.js +2 -6
- package/lib/lib/templates.js.map +1 -1
- package/lib/lib/timer.js +2 -7
- package/lib/lib/timer.js.map +1 -1
- package/lib/lib/validation.d.ts +135 -0
- package/lib/lib/validation.d.ts.map +1 -0
- package/lib/lib/validation.js +233 -0
- package/lib/lib/validation.js.map +1 -0
- package/lib/tui/App.d.ts +11 -0
- package/lib/tui/App.d.ts.map +1 -0
- package/lib/tui/App.js +98 -0
- package/lib/tui/App.js.map +1 -0
- package/lib/tui/components/branding/AsciiBanner.d.ts +21 -0
- package/lib/tui/components/branding/AsciiBanner.d.ts.map +1 -0
- package/lib/tui/components/branding/AsciiBanner.js +15 -0
- package/lib/tui/components/branding/AsciiBanner.js.map +1 -0
- package/lib/tui/components/branding/index.d.ts +5 -0
- package/lib/tui/components/branding/index.d.ts.map +1 -0
- package/lib/tui/components/branding/index.js +5 -0
- package/lib/tui/components/branding/index.js.map +1 -0
- package/lib/tui/components/feedback/Notification.d.ts +51 -0
- package/lib/tui/components/feedback/Notification.d.ts.map +1 -0
- package/lib/tui/components/feedback/Notification.js +89 -0
- package/lib/tui/components/feedback/Notification.js.map +1 -0
- package/lib/tui/components/feedback/ProgressBar.d.ts +46 -0
- package/lib/tui/components/feedback/ProgressBar.d.ts.map +1 -0
- package/lib/tui/components/feedback/ProgressBar.js +30 -0
- package/lib/tui/components/feedback/ProgressBar.js.map +1 -0
- package/lib/tui/components/feedback/ProgressSteps.d.ts +35 -0
- package/lib/tui/components/feedback/ProgressSteps.d.ts.map +1 -0
- package/lib/tui/components/feedback/ProgressSteps.js +37 -0
- package/lib/tui/components/feedback/ProgressSteps.js.map +1 -0
- package/lib/tui/components/feedback/Spinner.d.ts +18 -0
- package/lib/tui/components/feedback/Spinner.d.ts.map +1 -0
- package/lib/tui/components/feedback/Spinner.js +28 -0
- package/lib/tui/components/feedback/Spinner.js.map +1 -0
- package/lib/tui/components/feedback/index.d.ts +8 -0
- package/lib/tui/components/feedback/index.d.ts.map +1 -0
- package/lib/tui/components/feedback/index.js +8 -0
- package/lib/tui/components/feedback/index.js.map +1 -0
- package/lib/tui/components/index.d.ts +8 -0
- package/lib/tui/components/index.d.ts.map +1 -0
- package/lib/tui/components/index.js +8 -0
- package/lib/tui/components/index.js.map +1 -0
- package/lib/tui/components/input/Checkbox.d.ts +26 -0
- package/lib/tui/components/input/Checkbox.d.ts.map +1 -0
- package/lib/tui/components/input/Checkbox.js +20 -0
- package/lib/tui/components/input/Checkbox.js.map +1 -0
- package/lib/tui/components/input/SelectInput.d.ts +41 -0
- package/lib/tui/components/input/SelectInput.d.ts.map +1 -0
- package/lib/tui/components/input/SelectInput.js +53 -0
- package/lib/tui/components/input/SelectInput.js.map +1 -0
- package/lib/tui/components/input/TextInput.d.ts +30 -0
- package/lib/tui/components/input/TextInput.d.ts.map +1 -0
- package/lib/tui/components/input/TextInput.js +48 -0
- package/lib/tui/components/input/TextInput.js.map +1 -0
- package/lib/tui/components/input/index.d.ts +7 -0
- package/lib/tui/components/input/index.d.ts.map +1 -0
- package/lib/tui/components/input/index.js +7 -0
- package/lib/tui/components/input/index.js.map +1 -0
- package/lib/tui/components/layout/Breadcrumbs.d.ts +11 -0
- package/lib/tui/components/layout/Breadcrumbs.d.ts.map +1 -0
- package/lib/tui/components/layout/Breadcrumbs.js +34 -0
- package/lib/tui/components/layout/Breadcrumbs.js.map +1 -0
- package/lib/tui/components/layout/Footer.d.ts +11 -0
- package/lib/tui/components/layout/Footer.d.ts.map +1 -0
- package/lib/tui/components/layout/Footer.js +20 -0
- package/lib/tui/components/layout/Footer.js.map +1 -0
- package/lib/tui/components/layout/Header.d.ts +21 -0
- package/lib/tui/components/layout/Header.d.ts.map +1 -0
- package/lib/tui/components/layout/Header.js +21 -0
- package/lib/tui/components/layout/Header.js.map +1 -0
- package/lib/tui/components/layout/Screen.d.ts +27 -0
- package/lib/tui/components/layout/Screen.d.ts.map +1 -0
- package/lib/tui/components/layout/Screen.js +11 -0
- package/lib/tui/components/layout/Screen.js.map +1 -0
- package/lib/tui/components/layout/index.d.ts +8 -0
- package/lib/tui/components/layout/index.d.ts.map +1 -0
- package/lib/tui/components/layout/index.js +8 -0
- package/lib/tui/components/layout/index.js.map +1 -0
- package/lib/tui/hooks/index.d.ts +20 -0
- package/lib/tui/hooks/index.d.ts.map +1 -0
- package/lib/tui/hooks/index.js +18 -0
- package/lib/tui/hooks/index.js.map +1 -0
- package/lib/tui/hooks/useAddPackage.d.ts +120 -0
- package/lib/tui/hooks/useAddPackage.d.ts.map +1 -0
- package/lib/tui/hooks/useAddPackage.js +347 -0
- package/lib/tui/hooks/useAddPackage.js.map +1 -0
- package/lib/tui/hooks/useCreateProject.d.ts +66 -0
- package/lib/tui/hooks/useCreateProject.d.ts.map +1 -0
- package/lib/tui/hooks/useCreateProject.js +156 -0
- package/lib/tui/hooks/useCreateProject.js.map +1 -0
- package/lib/tui/hooks/useDeploy.d.ts +93 -0
- package/lib/tui/hooks/useDeploy.d.ts.map +1 -0
- package/lib/tui/hooks/useDeploy.js +252 -0
- package/lib/tui/hooks/useDeploy.js.map +1 -0
- package/lib/tui/hooks/useKeyboard.d.ts +66 -0
- package/lib/tui/hooks/useKeyboard.d.ts.map +1 -0
- package/lib/tui/hooks/useKeyboard.js +101 -0
- package/lib/tui/hooks/useKeyboard.js.map +1 -0
- package/lib/tui/hooks/useNavigation.d.ts +33 -0
- package/lib/tui/hooks/useNavigation.d.ts.map +1 -0
- package/lib/tui/hooks/useNavigation.js +27 -0
- package/lib/tui/hooks/useNavigation.js.map +1 -0
- package/lib/tui/hooks/useProject.d.ts +36 -0
- package/lib/tui/hooks/useProject.d.ts.map +1 -0
- package/lib/tui/hooks/useProject.js +47 -0
- package/lib/tui/hooks/useProject.js.map +1 -0
- package/lib/tui/index.d.ts +15 -0
- package/lib/tui/index.d.ts.map +1 -0
- package/lib/tui/index.js +16 -0
- package/lib/tui/index.js.map +1 -0
- package/lib/tui/lib/add-package-tui.d.ts +127 -0
- package/lib/tui/lib/add-package-tui.d.ts.map +1 -0
- package/lib/tui/lib/add-package-tui.js +467 -0
- package/lib/tui/lib/add-package-tui.js.map +1 -0
- package/lib/tui/lib/create-project-tui.d.ts +84 -0
- package/lib/tui/lib/create-project-tui.d.ts.map +1 -0
- package/lib/tui/lib/create-project-tui.js +141 -0
- package/lib/tui/lib/create-project-tui.js.map +1 -0
- package/lib/tui/lib/deploy-tui.d.ts +131 -0
- package/lib/tui/lib/deploy-tui.d.ts.map +1 -0
- package/lib/tui/lib/deploy-tui.js +347 -0
- package/lib/tui/lib/deploy-tui.js.map +1 -0
- package/lib/tui/screens/AddPackageScreen.d.ts +12 -0
- package/lib/tui/screens/AddPackageScreen.d.ts.map +1 -0
- package/lib/tui/screens/AddPackageScreen.js +436 -0
- package/lib/tui/screens/AddPackageScreen.js.map +1 -0
- package/lib/tui/screens/CreateProjectScreen.d.ts +12 -0
- package/lib/tui/screens/CreateProjectScreen.d.ts.map +1 -0
- package/lib/tui/screens/CreateProjectScreen.js +252 -0
- package/lib/tui/screens/CreateProjectScreen.js.map +1 -0
- package/lib/tui/screens/DeployScreen.d.ts +11 -0
- package/lib/tui/screens/DeployScreen.d.ts.map +1 -0
- package/lib/tui/screens/DeployScreen.js +224 -0
- package/lib/tui/screens/DeployScreen.js.map +1 -0
- package/lib/tui/screens/ProjectDashboard.d.ts +11 -0
- package/lib/tui/screens/ProjectDashboard.d.ts.map +1 -0
- package/lib/tui/screens/ProjectDashboard.js +42 -0
- package/lib/tui/screens/ProjectDashboard.js.map +1 -0
- package/lib/tui/screens/WelcomeScreen.d.ts +11 -0
- package/lib/tui/screens/WelcomeScreen.d.ts.map +1 -0
- package/lib/tui/screens/WelcomeScreen.js +26 -0
- package/lib/tui/screens/WelcomeScreen.js.map +1 -0
- package/lib/tui/screens/index.d.ts +9 -0
- package/lib/tui/screens/index.d.ts.map +1 -0
- package/lib/tui/screens/index.js +9 -0
- package/lib/tui/screens/index.js.map +1 -0
- package/lib/tui/services/ConfigService.d.ts +133 -0
- package/lib/tui/services/ConfigService.d.ts.map +1 -0
- package/lib/tui/services/ConfigService.js +221 -0
- package/lib/tui/services/ConfigService.js.map +1 -0
- package/lib/tui/services/ProjectService.d.ts +55 -0
- package/lib/tui/services/ProjectService.d.ts.map +1 -0
- package/lib/tui/services/ProjectService.js +179 -0
- package/lib/tui/services/ProjectService.js.map +1 -0
- package/lib/tui/services/index.d.ts +6 -0
- package/lib/tui/services/index.d.ts.map +1 -0
- package/lib/tui/services/index.js +6 -0
- package/lib/tui/services/index.js.map +1 -0
- package/lib/tui/state/AppContext.d.ts +58 -0
- package/lib/tui/state/AppContext.d.ts.map +1 -0
- package/lib/tui/state/AppContext.js +75 -0
- package/lib/tui/state/AppContext.js.map +1 -0
- package/lib/tui/state/index.d.ts +7 -0
- package/lib/tui/state/index.d.ts.map +1 -0
- package/lib/tui/state/index.js +7 -0
- package/lib/tui/state/index.js.map +1 -0
- package/lib/tui/state/reducer.d.ts +13 -0
- package/lib/tui/state/reducer.d.ts.map +1 -0
- package/lib/tui/state/reducer.js +136 -0
- package/lib/tui/state/reducer.js.map +1 -0
- package/lib/tui/state/types.d.ts +132 -0
- package/lib/tui/state/types.d.ts.map +1 -0
- package/lib/tui/state/types.js +38 -0
- package/lib/tui/state/types.js.map +1 -0
- package/lib/tui/utils/ascii.d.ts +42 -0
- package/lib/tui/utils/ascii.d.ts.map +1 -0
- package/lib/tui/utils/ascii.js +63 -0
- package/lib/tui/utils/ascii.js.map +1 -0
- package/lib/tui/utils/colors.d.ts +65 -0
- package/lib/tui/utils/colors.d.ts.map +1 -0
- package/lib/tui/utils/colors.js +65 -0
- package/lib/tui/utils/colors.js.map +1 -0
- package/lib/tui/utils/index.d.ts +6 -0
- package/lib/tui/utils/index.d.ts.map +1 -0
- package/lib/tui/utils/index.js +6 -0
- package/lib/tui/utils/index.js.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welcome screen for the FND TUI.
|
|
3
|
+
*
|
|
4
|
+
* Shown when running `fnd` in an empty directory or without a project.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
/**
|
|
8
|
+
* Welcome screen component.
|
|
9
|
+
*/
|
|
10
|
+
export declare function WelcomeScreen(): React.ReactElement;
|
|
11
|
+
//# sourceMappingURL=WelcomeScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeScreen.d.ts","sourceRoot":"","sources":["../../../src/tui/screens/WelcomeScreen.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;GAEG;AACH,wBAAgB,aAAa,IAAI,KAAK,CAAC,YAAY,CAsFlD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { Screen } from '../components/layout/Screen.js';
|
|
4
|
+
import { useNavigation } from '../hooks/useNavigation.js';
|
|
5
|
+
import { useProject } from '../hooks/useProject.js';
|
|
6
|
+
import { colors } from '../utils/colors.js';
|
|
7
|
+
import { ProjectService } from '../services/ProjectService.js';
|
|
8
|
+
/**
|
|
9
|
+
* Welcome screen component.
|
|
10
|
+
*/
|
|
11
|
+
export function WelcomeScreen() {
|
|
12
|
+
const { navigate } = useNavigation();
|
|
13
|
+
const { project, isLoading } = useProject();
|
|
14
|
+
const directoryName = ProjectService.getDirectoryName();
|
|
15
|
+
// Handle Enter key to continue
|
|
16
|
+
useInput((input, key) => {
|
|
17
|
+
if (key.return) {
|
|
18
|
+
navigate('create-project');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
if (isLoading) {
|
|
22
|
+
return (_jsx(Screen, { showBanner: true, children: _jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: colors.muted, children: "Detecting project..." }) }) }));
|
|
23
|
+
}
|
|
24
|
+
return (_jsx(Screen, { showBanner: true, children: _jsxs(Box, { flexDirection: "column", alignItems: "center", gap: 1, children: [project.context === 'new' && (_jsxs(Box, { flexDirection: "column", alignItems: "center", gap: 1, children: [_jsxs(Text, { children: ["Welcome! This directory (", _jsx(Text, { color: colors.accent, children: directoryName }), ") is empty."] }), _jsx(Text, { color: colors.muted, children: "Perfect for a new fnd-platform project." })] })), project.context === 'unknown' && (_jsxs(Box, { flexDirection: "column", alignItems: "center", gap: 1, children: [_jsx(Text, { children: "This directory is not an fnd-platform project." }), _jsx(Text, { color: colors.muted, children: "You can create a new project here or navigate to an existing one." })] })), project.context === 'legacy' && (_jsxs(Box, { flexDirection: "column", alignItems: "center", gap: 1, children: [_jsx(Text, { color: colors.warning, children: "Found a legacy fnd-platform project." }), _jsxs(Text, { color: colors.muted, children: ["Project: ", _jsx(Text, { color: colors.accent, children: project.name })] }), _jsxs(Text, { color: colors.muted, children: ["Run ", _jsx(Text, { color: colors.primary, children: "fnd migrate" }), " to enable TUI features."] })] })), _jsx(Box, { marginTop: 2, children: _jsx(Box, { borderStyle: "round", borderColor: colors.primary, paddingX: 2, paddingY: 1, children: _jsxs(Text, { children: ["Press ", _jsx(Text, { color: colors.primary, bold: true, children: "Enter" }), " to get started"] }) }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: colors.muted, children: ["Or use ", _jsx(Text, { color: colors.accent, children: "fnd new my-app" }), " for quick project creation"] }) })] }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=WelcomeScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeScreen.js","sourceRoot":"","sources":["../../../src/tui/screens/WelcomeScreen.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MA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jectDashboard.js';
|
|
6
|
+
export * from './CreateProjectScreen.js';
|
|
7
|
+
export * from './AddPackageScreen.js';
|
|
8
|
+
export * from './DeployScreen.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/screens/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI screen exports.
|
|
3
|
+
*/
|
|
4
|
+
export * from './WelcomeScreen.js';
|
|
5
|
+
export * from './ProjectDashboard.js';
|
|
6
|
+
export * from './CreateProjectScreen.js';
|
|
7
|
+
export * from './AddPackageScreen.js';
|
|
8
|
+
export * from './DeployScreen.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tui/screens/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration service for the FND TUI.
|
|
3
|
+
*
|
|
4
|
+
* Manages the .fnd/ folder structure and configuration files.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* FND configuration stored in .fnd/config.json.
|
|
8
|
+
*/
|
|
9
|
+
export interface FndConfig {
|
|
10
|
+
/** Project name */
|
|
11
|
+
projectName: string;
|
|
12
|
+
/** Project version */
|
|
13
|
+
version: string;
|
|
14
|
+
/** Creation timestamp */
|
|
15
|
+
createdAt: string;
|
|
16
|
+
/** Last modified timestamp */
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
/** User preferences */
|
|
19
|
+
preferences: {
|
|
20
|
+
/** Default deployment stage */
|
|
21
|
+
defaultStage: string;
|
|
22
|
+
/** Whether to show ASCII banner */
|
|
23
|
+
showBanner: boolean;
|
|
24
|
+
/** Color theme */
|
|
25
|
+
theme: 'auto' | 'dark' | 'light';
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Environment state stored in .fnd/environment.json.
|
|
30
|
+
*/
|
|
31
|
+
export interface EnvironmentState {
|
|
32
|
+
/** Current active stage */
|
|
33
|
+
currentStage: string | null;
|
|
34
|
+
/** Stage history */
|
|
35
|
+
stageHistory: string[];
|
|
36
|
+
/** Last deployment timestamp per stage */
|
|
37
|
+
lastDeployments: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Service for managing FND configuration files.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ConfigService {
|
|
43
|
+
private readonly projectRoot;
|
|
44
|
+
private readonly fndDir;
|
|
45
|
+
private readonly configPath;
|
|
46
|
+
private readonly environmentPath;
|
|
47
|
+
private readonly deploymentsDir;
|
|
48
|
+
private readonly cacheDir;
|
|
49
|
+
private readonly logsDir;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new ConfigService.
|
|
52
|
+
*
|
|
53
|
+
* @param projectRoot - Path to the project root
|
|
54
|
+
*/
|
|
55
|
+
constructor(projectRoot: string);
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the .fnd folder exists.
|
|
58
|
+
*/
|
|
59
|
+
exists(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if a config.json file exists.
|
|
62
|
+
*/
|
|
63
|
+
hasConfig(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Initializes the .fnd folder structure.
|
|
66
|
+
*
|
|
67
|
+
* @param projectName - Name of the project
|
|
68
|
+
*/
|
|
69
|
+
initialize(projectName: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Loads the configuration file.
|
|
72
|
+
*
|
|
73
|
+
* @returns Configuration or null if not found
|
|
74
|
+
*/
|
|
75
|
+
loadConfig(): FndConfig | null;
|
|
76
|
+
/**
|
|
77
|
+
* Saves the configuration file.
|
|
78
|
+
*
|
|
79
|
+
* @param config - Configuration to save
|
|
80
|
+
*/
|
|
81
|
+
saveConfig(config: FndConfig): void;
|
|
82
|
+
/**
|
|
83
|
+
* Updates specific configuration values.
|
|
84
|
+
*
|
|
85
|
+
* @param updates - Partial configuration to merge
|
|
86
|
+
*/
|
|
87
|
+
updateConfig(updates: Partial<FndConfig>): void;
|
|
88
|
+
/**
|
|
89
|
+
* Loads the environment state.
|
|
90
|
+
*
|
|
91
|
+
* @returns Environment state or default if not found
|
|
92
|
+
*/
|
|
93
|
+
loadEnvironment(): EnvironmentState;
|
|
94
|
+
/**
|
|
95
|
+
* Saves the environment state.
|
|
96
|
+
*
|
|
97
|
+
* @param environment - Environment state to save
|
|
98
|
+
*/
|
|
99
|
+
saveEnvironment(environment: EnvironmentState): void;
|
|
100
|
+
/**
|
|
101
|
+
* Sets the current stage.
|
|
102
|
+
*
|
|
103
|
+
* @param stage - Stage name
|
|
104
|
+
*/
|
|
105
|
+
setCurrentStage(stage: string): void;
|
|
106
|
+
/**
|
|
107
|
+
* Records a deployment.
|
|
108
|
+
*
|
|
109
|
+
* @param stage - Stage that was deployed
|
|
110
|
+
*/
|
|
111
|
+
recordDeployment(stage: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the .fnd directory path.
|
|
114
|
+
*/
|
|
115
|
+
getFndDir(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the deployments directory path.
|
|
118
|
+
*/
|
|
119
|
+
getDeploymentsDir(): string;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the cache directory path.
|
|
122
|
+
*/
|
|
123
|
+
getCacheDir(): string;
|
|
124
|
+
/**
|
|
125
|
+
* Gets the logs directory path.
|
|
126
|
+
*/
|
|
127
|
+
getLogsDir(): string;
|
|
128
|
+
/**
|
|
129
|
+
* Updates .gitignore to include .fnd folder.
|
|
130
|
+
*/
|
|
131
|
+
private updateGitignore;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=ConfigService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigService.d.ts","sourceRoot":"","sources":["../../../src/tui/services/ConfigService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,WAAW,EAAE;QACX,+BAA+B;QAC/B,YAAY,EAAE,MAAM,CAAC;QACrB,mCAAmC;QACnC,UAAU,EAAE,OAAO,CAAC;QACpB,kBAAkB;QAClB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KAClC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,oBAAoB;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,0CAA0C;IAC1C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAuBD;;GAEG;AACH,qBAAa,aAAa;IAaZ,OAAO,CAAC,QAAQ,CAAC,WAAW;IAZxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;OAIG;gBAC0B,WAAW,EAAE,MAAM;IAShD;;OAEG;IACH,MAAM,IAAI,OAAO;IAIjB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;OAIG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAwBrC;;;;OAIG;IACH,UAAU,IAAI,SAAS,GAAG,IAAI;IAa9B;;;;OAIG;IACH,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAKnC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;IAQ/C;;;;OAIG;IACH,eAAe,IAAI,gBAAgB;IAanC;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,gBAAgB,GAAG,IAAI;IAIpD;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAgBpC;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMrC;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAI3B;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,OAAO,CAAC,eAAe;CAaxB"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration service for the FND TUI.
|
|
3
|
+
*
|
|
4
|
+
* Manages the .fnd/ folder structure and configuration files.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
/**
|
|
9
|
+
* Default configuration values.
|
|
10
|
+
*/
|
|
11
|
+
const DEFAULT_CONFIG = {
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
preferences: {
|
|
14
|
+
defaultStage: 'dev',
|
|
15
|
+
showBanner: true,
|
|
16
|
+
theme: 'auto',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Default environment state.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_ENVIRONMENT = {
|
|
23
|
+
currentStage: null,
|
|
24
|
+
stageHistory: [],
|
|
25
|
+
lastDeployments: {},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Service for managing FND configuration files.
|
|
29
|
+
*/
|
|
30
|
+
export class ConfigService {
|
|
31
|
+
projectRoot;
|
|
32
|
+
fndDir;
|
|
33
|
+
configPath;
|
|
34
|
+
environmentPath;
|
|
35
|
+
deploymentsDir;
|
|
36
|
+
cacheDir;
|
|
37
|
+
logsDir;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new ConfigService.
|
|
40
|
+
*
|
|
41
|
+
* @param projectRoot - Path to the project root
|
|
42
|
+
*/
|
|
43
|
+
constructor(projectRoot) {
|
|
44
|
+
this.projectRoot = projectRoot;
|
|
45
|
+
this.fndDir = join(projectRoot, '.fnd');
|
|
46
|
+
this.configPath = join(this.fndDir, 'config.json');
|
|
47
|
+
this.environmentPath = join(this.fndDir, 'environment.json');
|
|
48
|
+
this.deploymentsDir = join(this.fndDir, 'deployments');
|
|
49
|
+
this.cacheDir = join(this.fndDir, 'cache');
|
|
50
|
+
this.logsDir = join(this.fndDir, 'logs');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Checks if the .fnd folder exists.
|
|
54
|
+
*/
|
|
55
|
+
exists() {
|
|
56
|
+
return existsSync(this.fndDir);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks if a config.json file exists.
|
|
60
|
+
*/
|
|
61
|
+
hasConfig() {
|
|
62
|
+
return existsSync(this.configPath);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Initializes the .fnd folder structure.
|
|
66
|
+
*
|
|
67
|
+
* @param projectName - Name of the project
|
|
68
|
+
*/
|
|
69
|
+
initialize(projectName) {
|
|
70
|
+
// Create directory structure
|
|
71
|
+
mkdirSync(this.fndDir, { recursive: true });
|
|
72
|
+
mkdirSync(this.deploymentsDir, { recursive: true });
|
|
73
|
+
mkdirSync(this.cacheDir, { recursive: true });
|
|
74
|
+
mkdirSync(this.logsDir, { recursive: true });
|
|
75
|
+
// Create config.json
|
|
76
|
+
const now = new Date().toISOString();
|
|
77
|
+
const config = {
|
|
78
|
+
...DEFAULT_CONFIG,
|
|
79
|
+
projectName,
|
|
80
|
+
createdAt: now,
|
|
81
|
+
updatedAt: now,
|
|
82
|
+
};
|
|
83
|
+
this.saveConfig(config);
|
|
84
|
+
// Create environment.json
|
|
85
|
+
this.saveEnvironment(DEFAULT_ENVIRONMENT);
|
|
86
|
+
// Add .fnd to .gitignore if it doesn't exist
|
|
87
|
+
this.updateGitignore();
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Loads the configuration file.
|
|
91
|
+
*
|
|
92
|
+
* @returns Configuration or null if not found
|
|
93
|
+
*/
|
|
94
|
+
loadConfig() {
|
|
95
|
+
if (!existsSync(this.configPath)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const content = readFileSync(this.configPath, 'utf-8');
|
|
100
|
+
return JSON.parse(content);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Saves the configuration file.
|
|
108
|
+
*
|
|
109
|
+
* @param config - Configuration to save
|
|
110
|
+
*/
|
|
111
|
+
saveConfig(config) {
|
|
112
|
+
config.updatedAt = new Date().toISOString();
|
|
113
|
+
writeFileSync(this.configPath, JSON.stringify(config, null, 2));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Updates specific configuration values.
|
|
117
|
+
*
|
|
118
|
+
* @param updates - Partial configuration to merge
|
|
119
|
+
*/
|
|
120
|
+
updateConfig(updates) {
|
|
121
|
+
const config = this.loadConfig();
|
|
122
|
+
if (config) {
|
|
123
|
+
const updated = { ...config, ...updates };
|
|
124
|
+
this.saveConfig(updated);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Loads the environment state.
|
|
129
|
+
*
|
|
130
|
+
* @returns Environment state or default if not found
|
|
131
|
+
*/
|
|
132
|
+
loadEnvironment() {
|
|
133
|
+
if (!existsSync(this.environmentPath)) {
|
|
134
|
+
return DEFAULT_ENVIRONMENT;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const content = readFileSync(this.environmentPath, 'utf-8');
|
|
138
|
+
return JSON.parse(content);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return DEFAULT_ENVIRONMENT;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Saves the environment state.
|
|
146
|
+
*
|
|
147
|
+
* @param environment - Environment state to save
|
|
148
|
+
*/
|
|
149
|
+
saveEnvironment(environment) {
|
|
150
|
+
writeFileSync(this.environmentPath, JSON.stringify(environment, null, 2));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Sets the current stage.
|
|
154
|
+
*
|
|
155
|
+
* @param stage - Stage name
|
|
156
|
+
*/
|
|
157
|
+
setCurrentStage(stage) {
|
|
158
|
+
const env = this.loadEnvironment();
|
|
159
|
+
env.currentStage = stage;
|
|
160
|
+
// Add to history if not already the most recent
|
|
161
|
+
if (env.stageHistory[env.stageHistory.length - 1] !== stage) {
|
|
162
|
+
env.stageHistory.push(stage);
|
|
163
|
+
// Keep only last 10 entries
|
|
164
|
+
if (env.stageHistory.length > 10) {
|
|
165
|
+
env.stageHistory = env.stageHistory.slice(-10);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
this.saveEnvironment(env);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Records a deployment.
|
|
172
|
+
*
|
|
173
|
+
* @param stage - Stage that was deployed
|
|
174
|
+
*/
|
|
175
|
+
recordDeployment(stage) {
|
|
176
|
+
const env = this.loadEnvironment();
|
|
177
|
+
env.lastDeployments[stage] = new Date().toISOString();
|
|
178
|
+
this.saveEnvironment(env);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets the .fnd directory path.
|
|
182
|
+
*/
|
|
183
|
+
getFndDir() {
|
|
184
|
+
return this.fndDir;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Gets the deployments directory path.
|
|
188
|
+
*/
|
|
189
|
+
getDeploymentsDir() {
|
|
190
|
+
return this.deploymentsDir;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Gets the cache directory path.
|
|
194
|
+
*/
|
|
195
|
+
getCacheDir() {
|
|
196
|
+
return this.cacheDir;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Gets the logs directory path.
|
|
200
|
+
*/
|
|
201
|
+
getLogsDir() {
|
|
202
|
+
return this.logsDir;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Updates .gitignore to include .fnd folder.
|
|
206
|
+
*/
|
|
207
|
+
updateGitignore() {
|
|
208
|
+
const gitignorePath = join(this.projectRoot, '.gitignore');
|
|
209
|
+
const fndEntry = '\n# FND CLI\n.fnd/\n';
|
|
210
|
+
if (existsSync(gitignorePath)) {
|
|
211
|
+
const content = readFileSync(gitignorePath, 'utf-8');
|
|
212
|
+
if (!content.includes('.fnd/')) {
|
|
213
|
+
writeFileSync(gitignorePath, content + fndEntry);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
writeFileSync(gitignorePath, fndEntry.trim() + '\n');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=ConfigService.js.map
|
|
@@ -0,0 +1 @@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aAAa,EAAE,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/B,aAAa,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project detection service for the FND TUI.
|
|
3
|
+
*
|
|
4
|
+
* Detects project context and gathers project information.
|
|
5
|
+
*/
|
|
6
|
+
import type { PackageInfo, ProjectState } from '../state/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Service for detecting and managing project state.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ProjectService {
|
|
11
|
+
/**
|
|
12
|
+
* Detects the project context for the given directory.
|
|
13
|
+
*
|
|
14
|
+
* @param cwd - Current working directory
|
|
15
|
+
* @returns Project state information
|
|
16
|
+
*/
|
|
17
|
+
static detectProject(cwd?: string): ProjectState;
|
|
18
|
+
/**
|
|
19
|
+
* Detects packages in a project.
|
|
20
|
+
*
|
|
21
|
+
* @param projectRoot - Path to project root
|
|
22
|
+
* @returns Array of package information
|
|
23
|
+
*/
|
|
24
|
+
static detectPackages(projectRoot: string): PackageInfo[];
|
|
25
|
+
/**
|
|
26
|
+
* Detects the type of a package based on its name and contents.
|
|
27
|
+
*
|
|
28
|
+
* @param name - Package directory name
|
|
29
|
+
* @param packagePath - Full path to package
|
|
30
|
+
* @returns Package type
|
|
31
|
+
*/
|
|
32
|
+
static detectPackageType(name: string, packagePath: string): PackageInfo['type'];
|
|
33
|
+
/**
|
|
34
|
+
* Gets the display name for a package type.
|
|
35
|
+
*
|
|
36
|
+
* @param type - Package type
|
|
37
|
+
* @returns Human-readable type name
|
|
38
|
+
*/
|
|
39
|
+
static getPackageTypeLabel(type: PackageInfo['type']): string;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the directory name from a path.
|
|
42
|
+
*
|
|
43
|
+
* @param cwd - Current working directory
|
|
44
|
+
* @returns Directory name
|
|
45
|
+
*/
|
|
46
|
+
static getDirectoryName(cwd?: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if a directory is empty or nearly empty.
|
|
49
|
+
*
|
|
50
|
+
* @param dir - Directory to check
|
|
51
|
+
* @returns True if directory is empty or only has hidden files
|
|
52
|
+
*/
|
|
53
|
+
static isEmptyDirectory(dir: string): boolean;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ProjectService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectService.d.ts","sourceRoot":"","sources":["../../../src/tui/services/ProjectService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAkB,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;GAEG;AACH,qBAAa,cAAc;IACzB;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,YAAY;IAwD/D;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,EAAE;IA4BzD;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAuBhF;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;IAY7D;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM;IAI5D;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAQ9C"}
|