fix: simplify the SHA-1 hash function in api.netlify-deploy.ts by using the crypto module directly this allows it to work in both dev and prod environments.

also extract Netlify and Vercel deploy logic into separate components

Move the Netlify and Vercel deployment logic from HeaderActionButtons.client.tsx into dedicated components (NetlifyDeploy.client.tsx and VercelDeploy.client.tsx) to improve code maintainability and reusability.
This commit is contained in:
KevIsDev
2025-04-02 16:47:04 +01:00
parent 53a674dc58
commit c63732d2f4
5 changed files with 401 additions and 328 deletions

View File

@@ -11,6 +11,7 @@ import { join } from 'path';
dotenv.config();
// Get detailed git info with fallbacks
const getGitInfo = () => {
try {
return {
@@ -39,6 +40,7 @@ const getGitInfo = () => {
}
};
// Read package.json with detailed dependency info
const getPackageJson = () => {
try {
const pkgPath = join(process.cwd(), 'package.json');
@@ -91,53 +93,11 @@ export default defineConfig((config) => {
},
build: {
target: 'esnext',
rollupOptions: {
output: {
format: 'esm',
},
},
commonjsOptions: {
transformMixedEsModules: true,
},
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
},
resolve: {
alias: {
buffer: 'vite-plugin-node-polyfills/polyfills/buffer',
crypto: 'crypto-browserify',
stream: 'stream-browserify',
},
},
plugins: [
nodePolyfills({
include: ['buffer', 'process', 'util', 'stream', 'crypto'],
globals: {
Buffer: true,
process: true,
global: true,
},
protocolImports: true,
exclude: ['child_process', 'fs', 'path'],
include: ['path', 'buffer', 'process'],
}),
{
name: 'buffer-polyfill',
transform(code, id) {
if (id.includes('env.mjs')) {
return {
code: `import { Buffer } from 'buffer';\n${code}`,
map: null,
};
}
return null;
},
},
config.mode !== 'test' && remixCloudflareDevProxy(),
remixVitePlugin({
future: {
@@ -193,4 +153,4 @@ function chrome129IssuePlugin() {
});
},
};
}
}