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:
@@ -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() {
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user