From 768db367280c9f6f6c8d92e1e1675516a7c4f793 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Tue, 3 Jan 2023 21:11:04 +0100 Subject: [PATCH] refactor(remix-architect): use `@architect/functions`' built-in types (#4898) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): use @architect/functions built-in types As of @architect/functions@5.2.0, types are included in the package itself and there is no longer a need for @types/architect__functions. * chore: update `yarn.lock` * Create modern-pumas-hide.md Co-authored-by: Michaƫl De Boey Co-authored-by: Logan McAnsh --- .changeset/modern-pumas-hide.md | 6 +++++ packages/remix-architect/package.json | 3 +-- .../sessions/arcTableSessionStorage.ts | 10 ++++--- yarn.lock | 26 ++++++++----------- 4 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 .changeset/modern-pumas-hide.md diff --git a/.changeset/modern-pumas-hide.md b/.changeset/modern-pumas-hide.md new file mode 100644 index 00000000000..cd11003ddae --- /dev/null +++ b/.changeset/modern-pumas-hide.md @@ -0,0 +1,6 @@ +--- +"remix": patch +"@remix-run/architect": patch +--- + +use `@architect/functions`' built-in types diff --git a/packages/remix-architect/package.json b/packages/remix-architect/package.json index 2d2bd7beb95..2162cadf707 100644 --- a/packages/remix-architect/package.json +++ b/packages/remix-architect/package.json @@ -14,12 +14,11 @@ "main": "dist/index.js", "typings": "dist/index.d.ts", "dependencies": { - "@architect/functions": "^5.0.2", + "@architect/functions": "^5.2.0", "@remix-run/node": "1.9.0", "@types/aws-lambda": "^8.10.82" }, "devDependencies": { - "@types/architect__functions": "^3.13.6", "@types/lambda-tester": "^3.6.1", "lambda-tester": "^4.0.1" }, diff --git a/packages/remix-architect/sessions/arcTableSessionStorage.ts b/packages/remix-architect/sessions/arcTableSessionStorage.ts index a91f20245df..9c2909886e9 100644 --- a/packages/remix-architect/sessions/arcTableSessionStorage.ts +++ b/packages/remix-architect/sessions/arcTableSessionStorage.ts @@ -1,8 +1,12 @@ import * as crypto from "crypto"; -import type { SessionStorage, SessionIdStorageStrategy } from "@remix-run/node"; +import type { + SessionData, + SessionStorage, + SessionIdStorageStrategy, +} from "@remix-run/node"; import { createSessionStorage } from "@remix-run/node"; import arc from "@architect/functions"; -import type { ArcTable } from "@architect/functions/tables"; +import type { ArcTable } from "@architect/functions/types/tables"; interface ArcTableSessionStorageOptions { /** @@ -15,7 +19,7 @@ interface ArcTableSessionStorageOptions { * The table used to store sessions, or its name as it appears in your * project's app.arc file. */ - table: ArcTable | string; + table: ArcTable | string; /** * The name of the DynamoDB attribute used to store the session ID. diff --git a/yarn.lock b/yarn.lock index d8b2b1eb8a1..c184e8d82aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,12 +9,12 @@ dependencies: "@jridgewell/trace-mapping" "^0.3.0" -"@architect/functions@^5.0.2": - version "5.0.3" - resolved "https://registry.npmjs.org/@architect/functions/-/functions-5.0.3.tgz" - integrity sha512-C9+yqNAthyhXfhKl0BxLabNlbLo3ReefN598pr7OidMXU/wkSjR72xlpBmr/pnnZYGlJ8+yNr9OxU99d4S/hZQ== +"@architect/functions@^5.2.0": + version "5.3.3" + resolved "https://registry.npmjs.org/@architect/functions/-/functions-5.3.3.tgz#b70d20c723e62dd984da90b23a51495ebbdc551e" + integrity sha512-q9ePtpw7SIl14B0KFIJGm4StL6jOWWYgGpD1HR7zkTKKiUIL/W0tkrAZnBhU8WPXRHPmpf5BcEjIXHQKyvz9Hg== dependencies: - cookie "^0.4.2" + cookie "^0.5.0" cookie-signature "^1.2.0" csrf "^3.1.0" node-webtokens "^1.0.4" @@ -2399,15 +2399,6 @@ dependencies: "@types/estree" "*" -"@types/architect__functions@^3.13.6": - version "3.13.6" - resolved "https://registry.npmjs.org/@types/architect__functions/-/architect__functions-3.13.6.tgz" - integrity sha512-1XggtRqhJ7Hy47gAg3qcPZMSDeJuQNp3obL5OJEVt2oo+8CsfU4vk1GU385AHs/xkBGOp1cfgKcDTyBrDbqJdA== - dependencies: - "@types/aws-lambda" "*" - "@types/express" "*" - aws-sdk "^2.820.0" - "@types/aria-query@^4.2.0": version "4.2.2" resolved "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz" @@ -3804,7 +3795,7 @@ available-typed-arrays@^1.0.5: resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-sdk@^2.1055.0, aws-sdk@^2.820.0: +aws-sdk@^2.1055.0: version "2.1069.0" resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1069.0.tgz" integrity sha512-AF7/5JotrVd8g/D3WWHgQto+IryB1V7iudIYm+H+qxmkGOU3xvL63ChhEoLTY/CxuK/diayg0oWILEsXUn3dfw== @@ -4703,6 +4694,11 @@ cookie@0.4.2, cookie@^0.4.1, cookie@^0.4.2: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== +cookie@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + cookiejar@^2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz"