Update rules

This commit is contained in:
Alex
2024-08-25 16:28:34 -04:00
parent b0cc4a1525
commit 0138cabb27
18 changed files with 325 additions and 236 deletions

View File

@ -1,13 +1,16 @@
#!/usr/bin/env tsx
import { promises as fs } from 'node:fs';
import { resolve, relative } from 'node:path';
import { isBuiltin } from 'node:module';
import { relative, resolve } from 'node:path';
import esbuild from 'esbuild';
import type { Plugin } from 'esbuild';
import { memoize } from 'lodash';
import { gray, green } from 'picocolors';
import { minify_sync } from 'terser';
import { dependencies } from '../dist/package.json';
import { buildLocalRules } from './build-local-rules';
import { dts } from './dts';
import { babelPlugin } from './modifier';
@ -160,7 +163,6 @@ async function main() {
bundleType('./src/types.ts', './dist/types.d.ts');
const unminify = { minify: false };
const treeShake = { treeShaking: true, minify: false };
console.log('Building packages…');
await Promise.all([
@ -173,7 +175,13 @@ async function main() {
bundle('./src/index.ts', './dist/index.js', unminify),
bundle('./src/types.ts', './dist/types.js', unminify),
bundle('./src/prettier.ts', './dist/prettier.js', unminify),
bundle('./src/install.ts', './dist/install.js', treeShake),
bundle('./src/install.ts', './dist/install.js', {
treeShaking: true,
minify: false,
banner: {
js: '#!/usr/bin/env node\n/* eslint-disable */',
},
}),
editPackageJson(),
]);