@everystack/cli 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/aws.ts +22 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everystack/cli",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "CLI and OTA updates for Expo apps on everystack",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
package/src/cli/aws.ts CHANGED
@@ -136,6 +136,16 @@ export async function createInvalidation(
136
136
  /**
137
137
  * Write a versioning key to CloudFront KeyValueStore.
138
138
  * KVS requires ETag for optimistic concurrency — DescribeKeyValueStore first.
139
+ *
140
+ * KVS endpoints require SigV4a (asymmetric) signing. The SDK discovers the
141
+ * SigV4a implementation via a mutable singleton in @smithy/signature-v4 that
142
+ * @smithy/signature-v4a populates as a side-effect import. When the dependency
143
+ * tree resolves duplicate copies of @smithy/signature-v4, the singleton splits:
144
+ * the signer registers into one copy while the KVS client reads from another.
145
+ *
146
+ * We bypass this entirely by constructing SignatureV4a explicitly and passing it
147
+ * as `signer` to the client. When `config.signer` is set, resolveAwsSdkSigV4Config
148
+ * uses it directly — SignatureV4MultiRegion and the container are never consulted.
139
149
  */
140
150
  export async function putKvsKey(
141
151
  region: string,
@@ -143,15 +153,24 @@ export async function putKvsKey(
143
153
  key: string,
144
154
  value: string,
145
155
  ): Promise<void> {
146
- // KVS requires SigV4a (asymmetric) signing — load pure-JS implementation
147
- await import('@aws-sdk/signature-v4a');
156
+ const { SignatureV4a } = await import('@aws-sdk/signature-v4a');
157
+ const { defaultProvider } = await import('@aws-sdk/credential-provider-node');
158
+ const { Hash } = await import('@smithy/core/serde');
148
159
  const {
149
160
  CloudFrontKeyValueStoreClient,
150
161
  DescribeKeyValueStoreCommand,
151
162
  PutKeyCommand,
152
163
  } = await import('@aws-sdk/client-cloudfront-keyvaluestore');
153
164
 
154
- if (!kvsClient) kvsClient = new CloudFrontKeyValueStoreClient({ region });
165
+ if (!kvsClient) {
166
+ const signer = new SignatureV4a({
167
+ credentials: defaultProvider(),
168
+ region: '*',
169
+ service: 'cloudfront-keyvaluestore',
170
+ sha256: Hash.bind(null, 'sha256'),
171
+ });
172
+ kvsClient = new CloudFrontKeyValueStoreClient({ region, signer });
173
+ }
155
174
 
156
175
  const desc = await kvsClient.send(
157
176
  new DescribeKeyValueStoreCommand({ KvsARN: kvsArn })