import type { ObjectKeyOrder } from '@alexaegis/common'; import { type CwdOption, type WriteJsonOptions } from '@alexaegis/fs'; import { type LoggerOption } from '@alexaegis/logging'; import { type AutoCopyLicenseOptions } from '../helpers/auto-copy-license.class.options.js'; import { type AutoMetadataOptions } from '../helpers/auto-metadata.class.options.js'; export declare const DEFAULT_SRC_DIR = "src"; export declare enum PackageJsonKind { /** * Used in the repository as the source packageJson */ DEVELOPMENT = "development", /** * The packageJson that will be in the distributed package */ DISTRIBUTION = "distribution" } export declare enum PackageJsonExportTarget { /** * This targets the source files. * * For example the `development` packageJson targets the local entry points * for types */ SOURCE = "source", /** * This targets the directory where compiled files end up in. Wherever * `outDir` points to. * * For example both the `development` and `distribution` packageJson files * target this for the actual imports. */ DIST = "dist", /** * The shim folder is used for local bins * * For example the `development` packageJson files bin entries target the * shim directory. So pnpm can link them event before the package is built. */ SHIM = "shim" } export interface AutolibPluginOptions extends WriteJsonOptions, CwdOption, LoggerOption { /** * source root, relative to cwd * @defaultValue 'src' */ src?: string; /** * packageJson to modify and put in the artifact, relative to `cwd` * @defaultValue './package.json' */ sourcePackageJson?: string; /** * Generates exports entries form rollup inputs, from a directory relative * to `srcDir` * * If autoExport is disabled, the plugin expects you to either set * `build.lib.entry` yourself or have a `src/index.ts` file as the entry * point * * @defaultValue ["."] */ autoEntryDir?: string | false; /** * Automatically export the content of a directory as is * * @defaultValue ["export/**", "static/**"] */ autoExportStaticGlobs?: string[] | false; /** * Automatically order the keys in the packageJson files. * * @defaultValue DEFAULT_PACKAGE_JSON_ORDER_PREFERENCE */ autoOrderPackageJson?: ObjectKeyOrder | false; /** * Generates bin entries from files under `srcDir` + `autoBinDirectory` * It also treats all files named as npm hooks as npm hooks, prefixing them * and adding them as hooks for the npm artifact * * For example a file called `postinstall.ts` in a package called * `@org/name`, it will generate an npm script entry as such: * `"postinstall": "bin/postinstall.js"`. The hook is still treated as a * `bin` so you can invoke it directly. To avoid name collisions, all * "hookbins" are prefixed with the normalized packagename like so: * `org-name-postinstall` * * @defaultValue ["./bin/*.ts"] */ autoBin?: AutoLibraryAutoBinOptions | false; /** * Fills out packageJson fields of the distributed packageJson based on * either manually defined key-value pairs or a set of keys that then will * be read from the workspace packageJson file. Or both, in which case if a * key is defined in both the manual takes precedence. */ autoMetadata?: AutoMetadataOptions | false; /** * Automatically copies the license file to the outDir so it can be part * of the distributed package. It uses the license file you defined in the * root of your project. Or if you wish to override it, place one into * the packages folder. * * @defaultValue true */ autoCopyLicense?: AutoCopyLicenseOptions | false; /** * Removes duplicated dependency and peerDependency entries leaving only * the peerDependencies behind. * * The point of this is to let peerDependencies install locally too by * defining them twice, once as a peerDependency, and once as a normal * dependency. This step will remove the one that was meant to only be * present locally. * * @defaultValue true */ autoPeer?: boolean; } export declare const normalizeAutolibOptions: (options?: AutolibPluginOptions) => Required; export interface AutoLibraryAutoBinOptions { binDir?: string; shimDir?: string; } export declare const normalizeAutoBinOption: (autoBin?: AutoLibraryAutoBinOptions | false) => Required | false; //# sourceMappingURL=autolib.plugin.options.d.ts.map