Skip to content

Commit

Permalink
use the new preserveEntrySignatures option recommended for libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Jun 21, 2023
1 parent bf161a4 commit 2ccaed7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions packages/core/src/package-utils/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const createDtsBundle = async (
if (log.code === 'EMPTY_BUNDLE') return false;
defaultHandler(level, log);
},
preserveEntrySignatures: 'strict',
});

await bundle.write({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ exports.Box = Box;


/* #region dist/css-more.d.ts */
export { Box, Breakpoint, breakpointNames, breakpoints } from './index.js';
declare const breakpointNames: readonly ["mobile", "tablet", "desktop", "wide"];
declare const breakpoints: {
readonly mobile: 0;
readonly tablet: 740;
readonly desktop: 992;
readonly wide: 1200;
};
type Breakpoint = keyof typeof breakpoints;

declare const Box: () => null;

export { Box, Breakpoint, breakpointNames, breakpoints };
/* #endregion */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.Box = cssMore.Box;


/* #region dist/css.d.ts */
export { Box } from './index.js';
export { Box } from './css-more.js';
/* #endregion */


Expand Down
12 changes: 1 addition & 11 deletions tests/__snapshots__/package/with-side-effects/dist/index.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@ if (process.env.NODE_ENV === "development") {


/* #region dist/index.d.ts */
declare const breakpointNames: readonly ["mobile", "tablet", "desktop", "wide"];
declare const breakpoints: {
readonly mobile: 0;
readonly tablet: 740;
readonly desktop: 992;
readonly wide: 1200;
};
type Breakpoint = keyof typeof breakpoints;

declare const Box: () => null;

export { Box, Breakpoint, breakpointNames, breakpoints };
export { }
/* #endregion */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.breakpoints = styles_lib_breakpoints_cjs.breakpoints;


/* #region dist/reset.d.ts */
export { Breakpoint, breakpointNames, breakpoints } from './index.js';
export { Breakpoint, breakpointNames, breakpoints } from './css-more.js';
/* #endregion */


Expand Down

0 comments on commit 2ccaed7

Please sign in to comment.