-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[drizzle-kit] Reduce drizzle-kit bundle size #2722
Comments
We should replace because it used only for non first-class feature import envPaths from 'env-paths';
import { mkdirSync } from 'fs';
import { access, readFile } from 'fs/promises';
import { join } from 'path';
import { $ } from 'zx';
const p = envPaths('drizzle-studio', {
suffix: '',
});
$.verbose = false;
$.cwd = p.data;
mkdirSync(p.data, { recursive: true });
export const certs = async () => {
const res = await $`mkcert --help`.nothrow();
// ~/.local/share/drizzle-studio
const keyPath = join(p.data, 'localhost-key.pem');
const certPath = join(p.data, 'localhost.pem');
if (res.exitCode === 0) {
try {
await Promise.all([access(keyPath), access(certPath)]);
} catch (e) {
await $`mkcert localhost`.nothrow();
}
const [key, cert] = await Promise.all([
readFile(keyPath, { encoding: 'utf-8' }),
readFile(certPath, { encoding: 'utf-8' }),
]);
return key && cert ? { key, cert } : null;
}
return null;
};
certs(); https://bundlephobia.com/package/[email protected] https://npmgraph.js.org/?q=zx#deps=devDependencies A lot of dependencies in bundle come from it zx 7.2.2 zx 7.2.2 But zx 7.2.2 So we have two glob packages And etc |
https://npmgraph.js.org/?q=drizzle-kit#zoom=h&deps=devDependencies
for now unpacked size is too much - 8.41 MB
By reducing dependencies and their weight, we will put ourselves on the path to the future of JS, as well as increase the performance of the CLI
Continuation of this issue drizzle-team/drizzle-kit-mirror#485
bin.cjs
size analyzeHow to use metafile and analyze
Optimization list
chalk
withpicocolors
#2736 blocked by feat: bright colors variants alexeyraspopov/picocolors#55node-fetch
with native fetch #2735 ready to be mergedzx
with nativechild_process
#2734 ready to be mergedThe text was updated successfully, but these errors were encountered: