Skip to content

Commit

Permalink
chore(server-store): Alias imports for getting request details to `@r…
Browse files Browse the repository at this point in the history
…edwoodjs/web/request` (redwoodjs#10904)
  • Loading branch information
dac09 authored Jul 6, 2024
1 parent 421a843 commit 32d9b63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
"types": "./dist/components/ServerInject.d.ts",
"default": "./dist/components/ServerInject.js"
},
"./request": {
"require": "./dist/cjs/server/request.js",
"import": "./dist/server/request.js",
"types": "./dist/server/request.d.ts"
},
"./dist/components/*": {
"require": "./dist/cjs/components/*.js",
"import": "./dist/components/*.js"
Expand Down Expand Up @@ -96,6 +101,7 @@
"@apollo/client": "3.9.9",
"@babel/runtime-corejs3": "7.24.5",
"@redwoodjs/auth": "workspace:*",
"@redwoodjs/server-store": "workspace:*",
"core-js": "3.37.1",
"graphql": "16.8.1",
"graphql-sse": "2.5.3",
Expand Down
13 changes: 13 additions & 0 deletions packages/web/src/server/request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This just proxies the `@redwoodjs/server-store` package.
// Our builds are specifically configured _not_ to bundle server-store

// This is mainly so that the import looks clean to the user e.g.
// import { getRequestCookies } from '@redwoodjs/web/request'
// server store doesn't make sense outside the framework

export {
getRequestCookies,
getRequestHeaders,
getLocation,
getAuthState,
} from '@redwoodjs/server-store'
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8751,6 +8751,7 @@ __metadata:
"@babel/runtime-corejs3": "npm:7.24.5"
"@redwoodjs/auth": "workspace:*"
"@redwoodjs/framework-tools": "workspace:*"
"@redwoodjs/server-store": "workspace:*"
"@rollup/plugin-babel": "npm:6.0.4"
"@testing-library/jest-dom": "npm:6.4.6"
"@testing-library/react": "npm:14.3.1"
Expand Down

0 comments on commit 32d9b63

Please sign in to comment.