Skip to content

Commit

Permalink
generate .d.ts, add exports field on package
Browse files Browse the repository at this point in the history
  • Loading branch information
AkifumiSato committed Aug 27, 2023
1 parent 849fdf3 commit 590b4a4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/example-next/src/app/_components/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { LocationStateProvider, NavigationSyncer } from "@location-state/core";
import unsafeNavigation from "@location-state/unsafe-navigation";
import { unsafeNavigation } from "@location-state/core/unsafe-navigation";

export function Providers({ children }: { children: React.ReactNode }) {
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/configs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true
"jsx": "react-jsx"
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["../../node_modules"]
Expand Down
15 changes: 13 additions & 2 deletions packages/location-state-core/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
{
"name": "@location-state/core",
"version": "0.0.0-alpha",
"types": "./src/index.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./unsafe-navigation": {
"require": "./dist/unsafe-navigation.js",
"import": "./dist/unsafe-navigation.js",
"types": "./dist/unsafe-navigation.d.ts"
}
},
"scripts": {
"build": "tsup src/index.ts",
"build": "tsup src/index.ts src/unsafe-navigation.ts --dts",
"typecheck": "tsc --noEmit",
"test": "jest",
"lint": "eslint . --ext .ts,.tsx"
Expand Down
10 changes: 8 additions & 2 deletions packages/location-state-next/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "@location-state/next",
"version": "0.0.0-alpha",
"types": "./src/index.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "tsup src/index.ts",
"build": "tsup src/index.ts --dts",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .ts,.tsx"
},
Expand Down

0 comments on commit 590b4a4

Please sign in to comment.