fix: additional linting fixes for GitHub deployment components
- Fix formatting issues in DeployButton.tsx - Resolve linting errors in GitHubDeploy.client.tsx - Ensure all components meet code quality standards
This commit is contained in:
@@ -129,7 +129,9 @@ export const DeployButton = ({ onVercelDeploy, onNetlifyDeploy, onGitHubDeploy }
|
|||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
src="https://cdn.simpleicons.org/netlify"
|
src="https://cdn.simpleicons.org/netlify"
|
||||||
/>
|
/>
|
||||||
<span className="mx-auto">{!netlifyConn.user ? 'No Netlify Account Connected' : 'Deploy to Netlify'}</span>
|
<span className="mx-auto">
|
||||||
|
{!netlifyConn.user ? 'No Netlify Account Connected' : 'Deploy to Netlify'}
|
||||||
|
</span>
|
||||||
{netlifyConn.user && <NetlifyDeploymentLink />}
|
{netlifyConn.user && <NetlifyDeploymentLink />}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export function useGitHubDeploy() {
|
|||||||
|
|
||||||
// Notify that build succeeded and deployment preparation is starting
|
// Notify that build succeeded and deployment preparation is starting
|
||||||
deployArtifact.runner.handleDeployAction('deploying', 'running', {
|
deployArtifact.runner.handleDeployAction('deploying', 'running', {
|
||||||
source: 'github'
|
source: 'github',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get all project files instead of just the build directory since we're deploying to a repository
|
// Get all project files instead of just the build directory since we're deploying to a repository
|
||||||
@@ -89,31 +89,32 @@ export function useGitHubDeploy() {
|
|||||||
|
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const fullPath = path.join(dirPath, entry.name);
|
const fullPath = path.join(dirPath, entry.name);
|
||||||
|
|
||||||
// Create a relative path without the leading slash for GitHub
|
// Create a relative path without the leading slash for GitHub
|
||||||
const relativePath = basePath ? `${basePath}/${entry.name}` : entry.name;
|
const relativePath = basePath ? `${basePath}/${entry.name}` : entry.name;
|
||||||
|
|
||||||
// Skip node_modules, .git directories and other common excludes
|
// Skip node_modules, .git directories and other common excludes
|
||||||
if (entry.isDirectory() && (
|
if (
|
||||||
entry.name === 'node_modules' ||
|
entry.isDirectory() &&
|
||||||
entry.name === '.git' ||
|
(entry.name === 'node_modules' ||
|
||||||
entry.name === 'dist' ||
|
entry.name === '.git' ||
|
||||||
entry.name === 'build' ||
|
entry.name === 'dist' ||
|
||||||
entry.name === '.cache' ||
|
entry.name === 'build' ||
|
||||||
entry.name === '.next'
|
entry.name === '.cache' ||
|
||||||
)) {
|
entry.name === '.next')
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.isFile()) {
|
if (entry.isFile()) {
|
||||||
// Skip binary files, large files and other common excludes
|
// Skip binary files, large files and other common excludes
|
||||||
if (entry.name.endsWith('.DS_Store') ||
|
if (entry.name.endsWith('.DS_Store') || entry.name.endsWith('.log') || entry.name.startsWith('.env')) {
|
||||||
entry.name.endsWith('.log') ||
|
|
||||||
entry.name.startsWith('.env')) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const content = await container.fs.readFile(fullPath, 'utf-8');
|
const content = await container.fs.readFile(fullPath, 'utf-8');
|
||||||
|
|
||||||
// Store the file with its relative path, not the full system path
|
// Store the file with its relative path, not the full system path
|
||||||
files[relativePath] = content;
|
files[relativePath] = content;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -131,23 +132,28 @@ export function useGitHubDeploy() {
|
|||||||
|
|
||||||
const fileContents = await getAllFiles('/');
|
const fileContents = await getAllFiles('/');
|
||||||
|
|
||||||
// Show GitHub deployment dialog here - it will handle the actual deployment
|
/*
|
||||||
// and will receive these files to deploy
|
* Show GitHub deployment dialog here - it will handle the actual deployment
|
||||||
|
* and will receive these files to deploy
|
||||||
|
*/
|
||||||
|
|
||||||
// For now, we'll just complete the deployment with a success message
|
/*
|
||||||
// Notify that deployment preparation is complete
|
* For now, we'll just complete the deployment with a success message
|
||||||
|
* Notify that deployment preparation is complete
|
||||||
|
*/
|
||||||
deployArtifact.runner.handleDeployAction('deploying', 'complete', {
|
deployArtifact.runner.handleDeployAction('deploying', 'complete', {
|
||||||
source: 'github'
|
source: 'github',
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
files: fileContents,
|
files: fileContents,
|
||||||
projectName: artifact.title || 'bolt-project'
|
projectName: artifact.title || 'bolt-project',
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('GitHub deploy error:', err);
|
console.error('GitHub deploy error:', err);
|
||||||
toast.error(err instanceof Error ? err.message : 'GitHub deployment preparation failed');
|
toast.error(err instanceof Error ? err.message : 'GitHub deployment preparation failed');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
setIsDeploying(false);
|
setIsDeploying(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user