Skip to content

Commit

Permalink
examples: Fix sourcemapping in kitchen-sink. (#9086)
Browse files Browse the repository at this point in the history
## Description

The TypeScript strategy on this example wouldn't take you to source. It
does now!
  • Loading branch information
anthonyshew authored Aug 30, 2024
1 parent b376b39 commit 2f8ff7b
Show file tree
Hide file tree
Showing 10 changed files with 6,927 additions and 4,887 deletions.
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/admin/src/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import "./styles.css";
import { CounterButton, Link } from "@repo/ui";
import { CounterButton } from "@repo/ui/counter-button";
import { Link } from "@repo/ui/link";

function App(): JSX.Element {
return (
Expand Down
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/blog/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CounterButton, Link } from "@repo/ui";
import { CounterButton } from "@repo/ui/counter-button";
import { Link } from "@repo/ui/link";

export default function Index(): JSX.Element {
return (
Expand Down
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/storefront/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { log } from "@repo/logger";
import { CounterButton, Link } from "@repo/ui";
import { Link } from "@repo/ui/link";
import { CounterButton } from "@repo/ui/counter-button";

export const metadata = {
title: "Store | Kitchen Sink",
Expand Down
17 changes: 13 additions & 4 deletions examples/kitchen-sink/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@
"private": true,
"license": "MIT",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
"./counter-button": {
"require": "./dist/counter-button/index.js",
"import": "./dist/counter-button/index.mjs",
"types": "./src/counter-button/index.tsx"
},
"./link": {
"require": "./dist/link/index.js",
"import": "./dist/link/index.mjs",
"types": "./src/link/index.tsx"
}
},
"scripts": {
"build": "tsup",
"clean": "rm -rf dist",
Expand All @@ -35,4 +44,4 @@
"tsup": "^8.0.2",
"typescript": "^5.3.3"
}
}
}
2 changes: 0 additions & 2 deletions examples/kitchen-sink/packages/ui/src/index.tsx

This file was deleted.

1 change: 1 addition & 0 deletions examples/kitchen-sink/packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"lib": ["dom", "ES2015"],
"sourceMap": true,
"types": ["jest", "node"]
},
"include": ["."],
Expand Down
3 changes: 1 addition & 2 deletions examples/kitchen-sink/packages/ui/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { defineConfig, type Options } from "tsup";

export default defineConfig((options: Options) => ({
entry: ["./src/index.tsx"],
entry: ["./src/link/index.tsx", "./src/counter-button/index.tsx"],
format: ["cjs", "esm"],
dts: true,
external: ["react"],
banner: {
js: "'use client'",
Expand Down
8 changes: 2 additions & 6 deletions examples/kitchen-sink/packages/ui/turbo.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": [
"//"
],
"extends": ["//"],
"tasks": {
"build": {
"outputs": [
"dist/**"
]
"outputs": ["dist/**"]
}
}
}
Loading

0 comments on commit 2f8ff7b

Please sign in to comment.