Skip to content

Commit 2f8ff7b

Browse files
authored
examples: Fix sourcemapping in kitchen-sink. (#9086)
## Description The TypeScript strategy on this example wouldn't take you to source. It does now!
1 parent b376b39 commit 2f8ff7b

File tree

10 files changed

+6927
-4887
lines changed

10 files changed

+6927
-4887
lines changed

examples/kitchen-sink/apps/admin/src/app/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import "./styles.css";
3-
import { CounterButton, Link } from "@repo/ui";
3+
import { CounterButton } from "@repo/ui/counter-button";
4+
import { Link } from "@repo/ui/link";
45

56
function App(): JSX.Element {
67
return (

examples/kitchen-sink/apps/blog/app/routes/_index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CounterButton, Link } from "@repo/ui";
1+
import { CounterButton } from "@repo/ui/counter-button";
2+
import { Link } from "@repo/ui/link";
23

34
export default function Index(): JSX.Element {
45
return (

examples/kitchen-sink/apps/storefront/src/app/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { log } from "@repo/logger";
2-
import { CounterButton, Link } from "@repo/ui";
2+
import { Link } from "@repo/ui/link";
3+
import { CounterButton } from "@repo/ui/counter-button";
34

45
export const metadata = {
56
title: "Store | Kitchen Sink",

examples/kitchen-sink/packages/ui/package.json

+13-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@
44
"private": true,
55
"license": "MIT",
66
"sideEffects": false,
7-
"main": "./dist/index.js",
8-
"module": "./dist/index.mjs",
9-
"types": "./dist/index.d.ts",
107
"files": [
118
"dist/**"
129
],
10+
"exports": {
11+
"./counter-button": {
12+
"require": "./dist/counter-button/index.js",
13+
"import": "./dist/counter-button/index.mjs",
14+
"types": "./src/counter-button/index.tsx"
15+
},
16+
"./link": {
17+
"require": "./dist/link/index.js",
18+
"import": "./dist/link/index.mjs",
19+
"types": "./src/link/index.tsx"
20+
}
21+
},
1322
"scripts": {
1423
"build": "tsup",
1524
"clean": "rm -rf dist",
@@ -35,4 +44,4 @@
3544
"tsup": "^8.0.2",
3645
"typescript": "^5.3.3"
3746
}
38-
}
47+
}

examples/kitchen-sink/packages/ui/src/index.tsx

-2
This file was deleted.

examples/kitchen-sink/packages/ui/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "@repo/typescript-config/react-library.json",
33
"compilerOptions": {
44
"lib": ["dom", "ES2015"],
5+
"sourceMap": true,
56
"types": ["jest", "node"]
67
},
78
"include": ["."],

examples/kitchen-sink/packages/ui/tsup.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { defineConfig, type Options } from "tsup";
22

33
export default defineConfig((options: Options) => ({
4-
entry: ["./src/index.tsx"],
4+
entry: ["./src/link/index.tsx", "./src/counter-button/index.tsx"],
55
format: ["cjs", "esm"],
6-
dts: true,
76
external: ["react"],
87
banner: {
98
js: "'use client'",
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"extends": [
3-
"//"
4-
],
2+
"extends": ["//"],
53
"tasks": {
64
"build": {
7-
"outputs": [
8-
"dist/**"
9-
]
5+
"outputs": ["dist/**"]
106
}
117
}
128
}

0 commit comments

Comments
 (0)