Skip to content

Commit 80ec655

Browse files
committed
[release] 0.1.2 - Update package version, add client and noop entry points, and adjust build scripts
1 parent 23f4e61 commit 80ec655

4 files changed

Lines changed: 52 additions & 12 deletions

File tree

package.json

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
{
22
"name": "react-tw-breakpointer",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "A React component that displays the current Tailwind CSS breakpoint and viewport dimensions",
55
"type": "module",
6-
"main": "dist/index.cjs",
7-
"module": "dist/index.js",
8-
"types": "dist/index.d.ts",
6+
"main": "dist/client.cjs",
7+
"module": "dist/client.js",
8+
"types": "dist/client.d.ts",
99
"exports": {
1010
".": {
11-
"types": "./dist/index.d.ts",
12-
"import": "./dist/index.js",
13-
"require": "./dist/index.cjs"
11+
"types": "./dist/client.d.ts",
12+
"react-server": "./dist/noop.js",
13+
"development": "./dist/client.js",
14+
"production": "./dist/noop.js",
15+
"import": "./dist/client.js",
16+
"require": "./dist/client.cjs",
17+
"default": "./dist/client.js"
18+
},
19+
"./noop": {
20+
"import": "./dist/noop.js",
21+
"require": "./dist/noop.cjs"
22+
},
23+
"./client": {
24+
"import": "./dist/client.js",
25+
"require": "./dist/client.cjs"
1426
}
1527
},
1628
"files": ["dist", "README.md", "LICENSE"],
1729
"sideEffects": false,
1830
"scripts": {
19-
"build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --clean --external react,react-dom",
20-
"dev": "tsup src/index.ts --format esm,cjs --dts --sourcemap --watch --external react,react-dom",
31+
"build": "tsup --format esm,cjs --dts --sourcemap --clean --external react,react-dom",
32+
"dev": "tsup --format esm,cjs --dts --sourcemap --watch --external react,react-dom",
2133
"typecheck": "tsc --noEmit",
2234
"lint": "biome check --write .",
2335
"format": "biome format --write .",
@@ -26,7 +38,7 @@
2638
"publish:dry": "bun run build && npm pack --dry-run",
2739
"publish:npm": "bun run build && npm publish",
2840
"size": "bun run build && bundlesize",
29-
"analyze": "bun run build && echo 'ESM:' && gzip -c dist/index.js | wc -c && echo 'CJS:' && gzip -c dist/index.cjs | wc -c",
41+
"analyze": "bun run build && echo 'ESM:' && gzip -c dist/client.js | wc -c && echo 'CJS:' && gzip -c dist/client.cjs | wc -c",
3042
"test": "vitest",
3143
"test:ui": "vitest --ui",
3244
"test:run": "vitest run",

src/client.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { BreakPointer, type BreakPointerProps, type Position } from './BreakPointer';

src/noop.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type React from 'react';
2+
3+
export type Position =
4+
| 'bottom-center'
5+
| 'top-center'
6+
| 'top-left'
7+
| 'top-right'
8+
| 'bottom-left'
9+
| 'bottom-right';
10+
11+
export interface BreakPointerProps {
12+
initiallyVisible?: boolean;
13+
toggleKey?: string;
14+
position?: Position;
15+
zIndex?: number;
16+
hideInProduction?: boolean;
17+
showDimensions?: boolean;
18+
className?: string;
19+
style?: React.CSSProperties;
20+
fontFamily?: string;
21+
}
22+
23+
export const BreakPointer: React.FC<BreakPointerProps> = () => null;

tsup.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { defineConfig } from 'tsup';
22

33
export default defineConfig({
4-
entry: ['src/index.ts'],
4+
entry: {
5+
index: 'src/index.ts',
6+
client: 'src/client.tsx',
7+
noop: 'src/noop.ts',
8+
},
59
format: ['esm', 'cjs'],
10+
bundle: false,
611
dts: true,
712
sourcemap: true,
813
clean: true,
@@ -12,7 +17,6 @@ export default defineConfig({
1217
treeshake: true,
1318
target: 'es2020',
1419
platform: 'browser',
15-
// Remove globalName to avoid UMD build overhead
1620
esbuildOptions: (options) => {
1721
options.drop = ['console', 'debugger'];
1822
},

0 commit comments

Comments
 (0)