This commit is contained in:
Alex
2024-08-02 15:51:10 -04:00
parent 3ac5f91988
commit ba20685f2e
13 changed files with 825 additions and 969 deletions

View File

@ -71,6 +71,7 @@ function bundle(
.replace('./packages/', './dist/')
.replace('src/', '')
.replace('.ts', '.js'),
options?: esbuild.BuildOptions,
) {
return esbuild.build({
entryPoints: [entry],
@ -87,6 +88,7 @@ function bundle(
banner: {
js: '/* eslint-disable */',
},
...options,
});
}
@ -143,6 +145,7 @@ async function main() {
bundle('./src/index.ts', './dist/index.js'),
bundle('./src/types.ts', './dist/types.js'),
bundle('./src/prettier.ts', './dist/prettier.js'),
bundle('./src/install.ts', './dist/install.js', { minify: false }),
editPackageJson(),
]);

View File

@ -3,12 +3,10 @@ import glob from 'fast-glob';
import fs from 'fs';
import { builtinModules } from 'module';
import { uniq } from 'lodash';
import { dependencies, peerDependencies, overrides } from '../dist/package.json';
import { dependencies, peerDependencies } from '../dist/package.json';
function checkImports() {
const deps = Object.keys({ ...dependencies, ...peerDependencies, ...overrides }).concat(
'eslint',
);
const deps = Object.keys({ ...dependencies, ...peerDependencies }).concat('eslint');
const builtIn = new Set(builtinModules.flatMap(module => [module, `node:${module}`]));
function findRequires(text: string) {