@rslib/core 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { type RsbuildConfig, type RsbuildInstance } from '@rsbuild/core';
2
- import type { AutoExternal, Format, PkgJson, RslibConfig, RslibConfigAsyncFn, RslibConfigExport, RslibConfigSyncFn } from './types';
2
+ import type { AutoExternal, BannerAndFooter, Format, PkgJson, RslibConfig, RslibConfigAsyncFn, RslibConfigExport, RslibConfigSyncFn } from './types';
3
3
  /**
4
4
  * This function helps you to autocomplete configuration types.
5
5
  * It accepts a Rslib config object, or a function that returns a config.
@@ -18,6 +18,8 @@ export declare const composeAutoExternalConfig: (options: {
18
18
  pkgJson?: PkgJson;
19
19
  userExternals?: NonNullable<RsbuildConfig["output"]>["externals"];
20
20
  }) => RsbuildConfig;
21
+ export declare function composeMinifyConfig(minify: NonNullable<RsbuildConfig['output']>['minify']): RsbuildConfig;
22
+ export declare function composeBannerFooterConfig(banner: BannerAndFooter, footer: BannerAndFooter): RsbuildConfig;
21
23
  export declare function createConstantRsbuildConfig(): Promise<RsbuildConfig>;
22
24
  export declare const composeModuleImportWarn: (request: string) => string;
23
25
  export declare function composeCreateRsbuildConfig(rslibConfig: RslibConfig, path?: string): Promise<{
@@ -1,2 +1,3 @@
1
1
  export declare const DEFAULT_CONFIG_NAME = "rslib.config";
2
2
  export declare const DEFAULT_EXTENSIONS: readonly [".js", ".ts", ".mjs", ".mts", ".cjs", ".cts"];
3
+ export declare const SWC_HELPERS = "@swc/helpers";
@@ -12,15 +12,21 @@ export type AutoExternal = boolean | {
12
12
  devDependencies?: boolean;
13
13
  peerDependencies?: boolean;
14
14
  };
15
+ export type BannerAndFooter = {
16
+ js?: string;
17
+ css?: string;
18
+ dts?: string;
19
+ };
15
20
  export interface LibConfig extends RsbuildConfig {
16
21
  bundle?: boolean;
17
22
  format?: Format;
18
23
  autoExtension?: boolean;
19
24
  autoExternal?: AutoExternal;
20
- output?: RsbuildConfig['output'] & {
21
- /** Support esX and browserslist query */
22
- syntax?: Syntax;
23
- };
25
+ /** Support esX and browserslist query */
26
+ syntax?: Syntax;
27
+ externalHelpers?: boolean;
28
+ banner?: BannerAndFooter;
29
+ footer?: BannerAndFooter;
24
30
  dts?: Dts;
25
31
  }
26
32
  export interface RslibConfig extends RsbuildConfig {
@@ -8,8 +8,7 @@ export declare const nodeBuiltInModules: Array<string | RegExp>;
8
8
  export declare function calcLongestCommonPath(absPaths: string[]): Promise<string | null>;
9
9
  export declare const readPackageJson: (rootPath: string) => undefined | PkgJson;
10
10
  export declare const isObject: (obj: unknown) => obj is Record<string, any>;
11
- type OmitDeep<T, K extends string[]> = T extends (infer U)[] ? OmitDeep<U, K>[] : T extends Record<any, any> ? {
12
- [P in keyof T as P extends K[number] ? never : P]: OmitDeep<T[P], K>;
13
- } : T;
14
- export declare function omitDeep<T extends object, K extends string[]>(obj: T, keys: K): OmitDeep<T, K>;
11
+ export declare const isEmptyObject: (obj: object) => boolean;
12
+ export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>): Pick<T, U>;
13
+ export declare function omit<T extends object, U extends keyof T>(obj: T, keys: ReadonlyArray<U>): Omit<T, U>;
15
14
  export { color };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "The Rspack-based library build tool.",
5
5
  "homepage": "https://rslib.dev",
6
6
  "bugs": {
@@ -32,8 +32,8 @@
32
32
  "compiled"
33
33
  ],
34
34
  "dependencies": {
35
- "@rsbuild/core": "1.0.1-rc.0",
36
- "rsbuild-plugin-dts": "0.0.4"
35
+ "@rsbuild/core": "1.0.1-rc.4",
36
+ "rsbuild-plugin-dts": "0.0.5"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/fs-extra": "^11.0.4",
@@ -41,10 +41,10 @@
41
41
  "fast-glob": "^3.3.2",
42
42
  "fs-extra": "^11.2.0",
43
43
  "memfs": "^4.11.1",
44
- "picocolors": "1.0.1",
44
+ "picocolors": "1.1.0",
45
45
  "prebundle": "1.2.2",
46
- "rslib": "npm:@rslib/core@0.0.3",
47
- "rslog": "^1.2.2",
46
+ "rslib": "npm:@rslib/core@0.0.4",
47
+ "rslog": "^1.2.3",
48
48
  "typescript": "^5.5.4",
49
49
  "@rslib/tsconfig": "0.0.1"
50
50
  },