@aws/nx-plugin 0.114.0 → 0.114.1
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.
- package/package.json +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/strands-agent/files/ag-ui/main.py.template +17 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/strands-agent/__snapshots__/generator.spec.ts.snap +4 -13
- package/src/ts/strands-agent/files/http/init.ts.template +1 -12
- package/src/ts/strands-agent/files/http/router.ts.template +3 -1
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__functionNameKebabCase__/__functionNameKebabCase__.tf.template +1 -1
- package/src/utils/pnpm-workspace.d.ts +11 -0
- package/src/utils/pnpm-workspace.js +28 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/shared-shadcn.js +2 -19
- package/src/utils/shared-shadcn.js.map +1 -1
package/package.json
CHANGED
|
@@ -2275,7 +2275,7 @@ data "archive_file" "lambda_zip" {
|
|
|
2275
2275
|
|
|
2276
2276
|
resource "aws_s3_object" "lambda_zip" {
|
|
2277
2277
|
bucket = var.asset_bucket_name
|
|
2278
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
2278
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
2279
2279
|
source = data.archive_file.lambda_zip.output_path
|
|
2280
2280
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
2281
2281
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -2936,7 +2936,7 @@ data "archive_file" "lambda_zip" {
|
|
|
2936
2936
|
|
|
2937
2937
|
resource "aws_s3_object" "lambda_zip" {
|
|
2938
2938
|
bucket = var.asset_bucket_name
|
|
2939
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
2939
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
2940
2940
|
source = data.archive_file.lambda_zip.output_path
|
|
2941
2941
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
2942
2942
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -3584,7 +3584,7 @@ data "archive_file" "lambda_zip" {
|
|
|
3584
3584
|
|
|
3585
3585
|
resource "aws_s3_object" "lambda_zip" {
|
|
3586
3586
|
bucket = var.asset_bucket_name
|
|
3587
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
3587
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
3588
3588
|
source = data.archive_file.lambda_zip.output_path
|
|
3589
3589
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
3590
3590
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -4249,7 +4249,7 @@ data "archive_file" "lambda_zip" {
|
|
|
4249
4249
|
|
|
4250
4250
|
resource "aws_s3_object" "lambda_zip" {
|
|
4251
4251
|
bucket = var.asset_bucket_name
|
|
4252
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
4252
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
4253
4253
|
source = data.archive_file.lambda_zip.output_path
|
|
4254
4254
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
4255
4255
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -5065,7 +5065,7 @@ data "archive_file" "lambda_zip" {
|
|
|
5065
5065
|
|
|
5066
5066
|
resource "aws_s3_object" "lambda_zip" {
|
|
5067
5067
|
bucket = var.asset_bucket_name
|
|
5068
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
5068
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
5069
5069
|
source = data.archive_file.lambda_zip.output_path
|
|
5070
5070
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
5071
5071
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -5883,7 +5883,7 @@ data "archive_file" "lambda_zip" {
|
|
|
5883
5883
|
|
|
5884
5884
|
resource "aws_s3_object" "lambda_zip" {
|
|
5885
5885
|
bucket = var.asset_bucket_name
|
|
5886
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
5886
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
5887
5887
|
source = data.archive_file.lambda_zip.output_path
|
|
5888
5888
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
5889
5889
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -188,7 +188,7 @@ data "archive_file" "lambda_zip" {
|
|
|
188
188
|
|
|
189
189
|
resource "aws_s3_object" "lambda_zip" {
|
|
190
190
|
bucket = var.asset_bucket_name
|
|
191
|
-
key = "lambdas/test-project-test-function/\${data.archive_file.lambda_zip.
|
|
191
|
+
key = "lambdas/test-project-test-function/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
192
192
|
source = data.archive_file.lambda_zip.output_path
|
|
193
193
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
194
194
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -369,7 +369,7 @@ data "archive_file" "lambda_zip" {
|
|
|
369
369
|
|
|
370
370
|
resource "aws_s3_object" "lambda_zip" {
|
|
371
371
|
bucket = var.asset_bucket_name
|
|
372
|
-
key = "lambdas/test-project-snapshot-function/\${data.archive_file.lambda_zip.
|
|
372
|
+
key = "lambdas/test-project-snapshot-function/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
373
373
|
source = data.archive_file.lambda_zip.output_path
|
|
374
374
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
375
375
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import uuid
|
|
2
3
|
|
|
3
4
|
from ag_ui_strands import StrandsAgent, create_strands_app
|
|
5
|
+
from fastapi import Request
|
|
6
|
+
from <%- agentConnectionModuleName %> import session_id_context
|
|
7
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
4
8
|
|
|
5
9
|
from .agent import get_agent
|
|
6
10
|
|
|
7
11
|
logging.basicConfig(level=logging.INFO)
|
|
8
12
|
|
|
13
|
+
SESSION_ID_HEADER = "x-amzn-bedrock-agentcore-runtime-session-id"
|
|
14
|
+
|
|
9
15
|
# Create AG-UI agent wrapper
|
|
10
16
|
_agent_ctx = get_agent()
|
|
11
17
|
_agent = _agent_ctx.__enter__()
|
|
@@ -16,5 +22,16 @@ agui_agent = StrandsAgent(
|
|
|
16
22
|
description="A Strands Agent exposed via the AG-UI protocol.",
|
|
17
23
|
)
|
|
18
24
|
|
|
25
|
+
|
|
26
|
+
class _SessionIdMiddleware(BaseHTTPMiddleware):
|
|
27
|
+
"""Bind the session ID for this request so downstream MCP / A2A clients forward it on outbound calls."""
|
|
28
|
+
|
|
29
|
+
async def dispatch(self, request: Request, call_next):
|
|
30
|
+
session_id = request.headers.get(SESSION_ID_HEADER) or str(uuid.uuid4())
|
|
31
|
+
with session_id_context(session_id):
|
|
32
|
+
return await call_next(request)
|
|
33
|
+
|
|
34
|
+
|
|
19
35
|
# Create FastAPI app with AG-UI endpoint and health check
|
|
20
36
|
app = create_strands_app(agui_agent, path="/invocations")
|
|
37
|
+
app.add_middleware(_SessionIdMiddleware)
|
|
@@ -776,7 +776,7 @@ data "archive_file" "lambda_zip" {
|
|
|
776
776
|
|
|
777
777
|
resource "aws_s3_object" "lambda_zip" {
|
|
778
778
|
bucket = var.asset_bucket_name
|
|
779
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
779
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
780
780
|
source = data.archive_file.lambda_zip.output_path
|
|
781
781
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
782
782
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -1970,7 +1970,7 @@ data "archive_file" "lambda_zip" {
|
|
|
1970
1970
|
|
|
1971
1971
|
resource "aws_s3_object" "lambda_zip" {
|
|
1972
1972
|
bucket = var.asset_bucket_name
|
|
1973
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
1973
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
1974
1974
|
source = data.archive_file.lambda_zip.output_path
|
|
1975
1975
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
1976
1976
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -2755,7 +2755,7 @@ data "archive_file" "lambda_zip" {
|
|
|
2755
2755
|
|
|
2756
2756
|
resource "aws_s3_object" "lambda_zip" {
|
|
2757
2757
|
bucket = var.asset_bucket_name
|
|
2758
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
2758
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
2759
2759
|
source = data.archive_file.lambda_zip.output_path
|
|
2760
2760
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
2761
2761
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -3276,7 +3276,7 @@ data "archive_file" "lambda_zip" {
|
|
|
3276
3276
|
|
|
3277
3277
|
resource "aws_s3_object" "lambda_zip" {
|
|
3278
3278
|
bucket = var.asset_bucket_name
|
|
3279
|
-
key = "apis/custom-api/\${data.archive_file.lambda_zip.
|
|
3279
|
+
key = "apis/custom-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
3280
3280
|
source = data.archive_file.lambda_zip.output_path
|
|
3281
3281
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
3282
3282
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -3279,7 +3279,7 @@ data "archive_file" "lambda_zip" {
|
|
|
3279
3279
|
|
|
3280
3280
|
resource "aws_s3_object" "lambda_zip" {
|
|
3281
3281
|
bucket = var.asset_bucket_name
|
|
3282
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
3282
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
3283
3283
|
source = data.archive_file.lambda_zip.output_path
|
|
3284
3284
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
3285
3285
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -3922,7 +3922,7 @@ data "archive_file" "lambda_zip" {
|
|
|
3922
3922
|
|
|
3923
3923
|
resource "aws_s3_object" "lambda_zip" {
|
|
3924
3924
|
bucket = var.asset_bucket_name
|
|
3925
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
3925
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
3926
3926
|
source = data.archive_file.lambda_zip.output_path
|
|
3927
3927
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
3928
3928
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -4552,7 +4552,7 @@ data "archive_file" "lambda_zip" {
|
|
|
4552
4552
|
|
|
4553
4553
|
resource "aws_s3_object" "lambda_zip" {
|
|
4554
4554
|
bucket = var.asset_bucket_name
|
|
4555
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
4555
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
4556
4556
|
source = data.archive_file.lambda_zip.output_path
|
|
4557
4557
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
4558
4558
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -5199,7 +5199,7 @@ data "archive_file" "lambda_zip" {
|
|
|
5199
5199
|
|
|
5200
5200
|
resource "aws_s3_object" "lambda_zip" {
|
|
5201
5201
|
bucket = var.asset_bucket_name
|
|
5202
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
5202
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
5203
5203
|
source = data.archive_file.lambda_zip.output_path
|
|
5204
5204
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
5205
5205
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -5985,7 +5985,7 @@ data "archive_file" "lambda_zip" {
|
|
|
5985
5985
|
|
|
5986
5986
|
resource "aws_s3_object" "lambda_zip" {
|
|
5987
5987
|
bucket = var.asset_bucket_name
|
|
5988
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
5988
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
5989
5989
|
source = data.archive_file.lambda_zip.output_path
|
|
5990
5990
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
5991
5991
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -6773,7 +6773,7 @@ data "archive_file" "lambda_zip" {
|
|
|
6773
6773
|
|
|
6774
6774
|
resource "aws_s3_object" "lambda_zip" {
|
|
6775
6775
|
bucket = var.asset_bucket_name
|
|
6776
|
-
key = "apis/test-api/\${data.archive_file.lambda_zip.
|
|
6776
|
+
key = "apis/test-api/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
6777
6777
|
source = data.archive_file.lambda_zip.output_path
|
|
6778
6778
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
6779
6779
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -257,7 +257,7 @@ data "archive_file" "lambda_zip" {
|
|
|
257
257
|
|
|
258
258
|
resource "aws_s3_object" "lambda_zip" {
|
|
259
259
|
bucket = var.asset_bucket_name
|
|
260
|
-
key = "lambdas/test-project-test-function/\${data.archive_file.lambda_zip.
|
|
260
|
+
key = "lambdas/test-project-test-function/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
261
261
|
source = data.archive_file.lambda_zip.output_path
|
|
262
262
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
263
263
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -438,7 +438,7 @@ data "archive_file" "lambda_zip" {
|
|
|
438
438
|
|
|
439
439
|
resource "aws_s3_object" "lambda_zip" {
|
|
440
440
|
bucket = var.asset_bucket_name
|
|
441
|
-
key = "lambdas/test-project-snapshot-function/\${data.archive_file.lambda_zip.
|
|
441
|
+
key = "lambdas/test-project-snapshot-function/\${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
442
442
|
source = data.archive_file.lambda_zip.output_path
|
|
443
443
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
444
444
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -913,7 +913,6 @@ console.log(\`TRPC server listening on port \${PORT}\`);
|
|
|
913
913
|
|
|
914
914
|
exports[`ts#strands-agent generator > should match snapshot for generated files > strands-agent-init.ts 1`] = `
|
|
915
915
|
"import { initTRPC } from '@trpc/server';
|
|
916
|
-
import { enterSessionContext } from ':proj/agent-connection';
|
|
917
916
|
|
|
918
917
|
export interface Context {
|
|
919
918
|
sessionId: string;
|
|
@@ -921,17 +920,7 @@ export interface Context {
|
|
|
921
920
|
|
|
922
921
|
export const t = initTRPC.context<Context>().create();
|
|
923
922
|
|
|
924
|
-
|
|
925
|
-
* Bind the inbound session onto the current async flow so downstream MCP /
|
|
926
|
-
* A2A clients forward it on outbound calls. Uses \`enterWith\` so the binding
|
|
927
|
-
* persists across subscription iterations.
|
|
928
|
-
*/
|
|
929
|
-
const sessionMiddleware = t.middleware(({ ctx, next }) => {
|
|
930
|
-
enterSessionContext(ctx.sessionId);
|
|
931
|
-
return next();
|
|
932
|
-
});
|
|
933
|
-
|
|
934
|
-
export const publicProcedure = t.procedure.use(sessionMiddleware);
|
|
923
|
+
export const publicProcedure = t.procedure;
|
|
935
924
|
"
|
|
936
925
|
`;
|
|
937
926
|
|
|
@@ -939,7 +928,7 @@ exports[`ts#strands-agent generator > should match snapshot for generated files
|
|
|
939
928
|
"import { publicProcedure, t } from './init.js';
|
|
940
929
|
import { z } from 'zod';
|
|
941
930
|
import { zAsyncIterable } from './schema/z-async-iterable.js';
|
|
942
|
-
import { withSessionId } from ':proj/agent-connection';
|
|
931
|
+
import { enterSessionContext, withSessionId } from ':proj/agent-connection';
|
|
943
932
|
import { getAgent } from './agent.js';
|
|
944
933
|
|
|
945
934
|
export const router = t.router;
|
|
@@ -956,6 +945,8 @@ export const appRouter = router({
|
|
|
956
945
|
}),
|
|
957
946
|
)
|
|
958
947
|
.subscription(async function* (opts) {
|
|
948
|
+
// Bind the session ID for this subscription so downstream MCP / A2A clients forward it on outbound calls.
|
|
949
|
+
enterSessionContext(opts.ctx.sessionId);
|
|
959
950
|
for await (const event of agent.stream(opts.input.message)) {
|
|
960
951
|
if (
|
|
961
952
|
event.type === 'modelStreamUpdateEvent' &&
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { initTRPC } from '@trpc/server';
|
|
2
|
-
import { enterSessionContext } from '<%- agentConnectionImport %>';
|
|
3
2
|
|
|
4
3
|
export interface Context {
|
|
5
4
|
sessionId: string;
|
|
@@ -7,14 +6,4 @@ export interface Context {
|
|
|
7
6
|
|
|
8
7
|
export const t = initTRPC.context<Context>().create();
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
* Bind the inbound session onto the current async flow so downstream MCP /
|
|
12
|
-
* A2A clients forward it on outbound calls. Uses `enterWith` so the binding
|
|
13
|
-
* persists across subscription iterations.
|
|
14
|
-
*/
|
|
15
|
-
const sessionMiddleware = t.middleware(({ ctx, next }) => {
|
|
16
|
-
enterSessionContext(ctx.sessionId);
|
|
17
|
-
return next();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const publicProcedure = t.procedure.use(sessionMiddleware);
|
|
9
|
+
export const publicProcedure = t.procedure;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { publicProcedure, t } from './init.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { zAsyncIterable } from './schema/z-async-iterable.js';
|
|
4
|
-
import { withSessionId } from '<%- agentConnectionImport %>';
|
|
4
|
+
import { enterSessionContext, withSessionId } from '<%- agentConnectionImport %>';
|
|
5
5
|
import { getAgent } from './agent.js';
|
|
6
6
|
|
|
7
7
|
export const router = t.router;
|
|
@@ -18,6 +18,8 @@ export const appRouter = router({
|
|
|
18
18
|
}),
|
|
19
19
|
)
|
|
20
20
|
.subscription(async function* (opts) {
|
|
21
|
+
// Bind the session ID for this subscription so downstream MCP / A2A clients forward it on outbound calls.
|
|
22
|
+
enterSessionContext(opts.ctx.sessionId);
|
|
21
23
|
for await (const event of agent.stream(opts.input.message)) {
|
|
22
24
|
if (
|
|
23
25
|
event.type === 'modelStreamUpdateEvent' &&
|
|
@@ -108,7 +108,7 @@ data "archive_file" "lambda_zip" {
|
|
|
108
108
|
|
|
109
109
|
resource "aws_s3_object" "lambda_zip" {
|
|
110
110
|
bucket = var.asset_bucket_name
|
|
111
|
-
key = "apis/<%- apiNameKebabCase %>/${data.archive_file.lambda_zip.
|
|
111
|
+
key = "apis/<%- apiNameKebabCase %>/${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
112
112
|
source = data.archive_file.lambda_zip.output_path
|
|
113
113
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
114
114
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -98,7 +98,7 @@ data "archive_file" "lambda_zip" {
|
|
|
98
98
|
|
|
99
99
|
resource "aws_s3_object" "lambda_zip" {
|
|
100
100
|
bucket = var.asset_bucket_name
|
|
101
|
-
key = "apis/<%- apiNameKebabCase %>/${data.archive_file.lambda_zip.
|
|
101
|
+
key = "apis/<%- apiNameKebabCase %>/${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
102
102
|
source = data.archive_file.lambda_zip.output_path
|
|
103
103
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
104
104
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -120,7 +120,7 @@ data "archive_file" "lambda_zip" {
|
|
|
120
120
|
|
|
121
121
|
resource "aws_s3_object" "lambda_zip" {
|
|
122
122
|
bucket = var.asset_bucket_name
|
|
123
|
-
key = "lambdas/<%- functionNameKebabCase %>/${data.archive_file.lambda_zip.
|
|
123
|
+
key = "lambdas/<%- functionNameKebabCase %>/${data.archive_file.lambda_zip.output_sha256}.zip"
|
|
124
124
|
source = data.archive_file.lambda_zip.output_path
|
|
125
125
|
source_hash = data.archive_file.lambda_zip.output_base64sha256
|
|
126
126
|
etag = data.archive_file.lambda_zip.output_md5
|
|
@@ -20,3 +20,14 @@ import { Tree } from '@nx/devkit';
|
|
|
20
20
|
* allowlist has no equivalent of the `false` decision).
|
|
21
21
|
*/
|
|
22
22
|
export declare const registerPnpmBuiltDependencies: (tree: Tree, entries: Record<string, boolean>) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Set `ignoreWorkspaceRootCheck: true` in `pnpm-workspace.yaml` so `pnpm add`
|
|
25
|
+
* from the workspace root does not error with `ERR_PNPM_ADDING_TO_ROOT`.
|
|
26
|
+
*
|
|
27
|
+
* pnpm 11 no longer honours `ignore-workspace-root-check=true` in `.npmrc`;
|
|
28
|
+
* it must live in `pnpm-workspace.yaml` as the camelCased key. pnpm 10 also
|
|
29
|
+
* accepts the yaml form, so writing it here works for both majors.
|
|
30
|
+
*
|
|
31
|
+
* No-op for non-pnpm workspaces or when `pnpm-workspace.yaml` is absent.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ensurePnpmIgnoresWorkspaceRootCheck: (tree: Tree) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerPnpmBuiltDependencies = void 0;
|
|
3
|
+
exports.ensurePnpmIgnoresWorkspaceRootCheck = exports.registerPnpmBuiltDependencies = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -55,4 +55,31 @@ const registerPnpmBuiltDependencies = (tree, entries) => {
|
|
|
55
55
|
tree.write(WORKSPACE_FILE, js_yaml_1.default.dump(parsed, { quotingType: "'" }));
|
|
56
56
|
};
|
|
57
57
|
exports.registerPnpmBuiltDependencies = registerPnpmBuiltDependencies;
|
|
58
|
+
/**
|
|
59
|
+
* Set `ignoreWorkspaceRootCheck: true` in `pnpm-workspace.yaml` so `pnpm add`
|
|
60
|
+
* from the workspace root does not error with `ERR_PNPM_ADDING_TO_ROOT`.
|
|
61
|
+
*
|
|
62
|
+
* pnpm 11 no longer honours `ignore-workspace-root-check=true` in `.npmrc`;
|
|
63
|
+
* it must live in `pnpm-workspace.yaml` as the camelCased key. pnpm 10 also
|
|
64
|
+
* accepts the yaml form, so writing it here works for both majors.
|
|
65
|
+
*
|
|
66
|
+
* No-op for non-pnpm workspaces or when `pnpm-workspace.yaml` is absent.
|
|
67
|
+
*/
|
|
68
|
+
const ensurePnpmIgnoresWorkspaceRootCheck = (tree) => {
|
|
69
|
+
if ((0, devkit_1.detectPackageManager)(tree.root) !== 'pnpm') {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (!tree.exists(WORKSPACE_FILE)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const original = tree.read(WORKSPACE_FILE, 'utf-8') ?? '';
|
|
76
|
+
const parsed = js_yaml_1.default.load(original) ?? {};
|
|
77
|
+
if (parsed.ignoreWorkspaceRootCheck === true) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
parsed.ignoreWorkspaceRootCheck = true;
|
|
81
|
+
tree.write(WORKSPACE_FILE, js_yaml_1.default.dump(parsed, { quotingType: "'" }));
|
|
82
|
+
return true;
|
|
83
|
+
};
|
|
84
|
+
exports.ensurePnpmIgnoresWorkspaceRootCheck = ensurePnpmIgnoresWorkspaceRootCheck;
|
|
58
85
|
//# sourceMappingURL=pnpm-workspace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm-workspace.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/pnpm-workspace.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAAwD;AACxD,8DAA2B;AAE3B,MAAM,cAAc,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"pnpm-workspace.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/pnpm-workspace.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAAwD;AACxD,8DAA2B;AAE3B,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAS7C;;;;;;;;;;;;;;;GAeG;AACI,MAAM,6BAA6B,GAAG,CAC3C,IAAU,EACV,OAAgC,EAC1B,EAAE;IACR,IAAI,IAAA,6BAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1D,MAAM,MAAM,GAAI,iBAAI,CAAC,IAAI,CAAC,QAAQ,CAA8B,IAAI,EAAE,CAAC;IAEvE,MAAM,WAAW,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC;IACtD,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;IAC1E,IAAI,OAAO,GAAG,KAAK,CAAC;IA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B,IAAI,EAAE,CAAC;IAEvE,IAAI,MAAM,CAAC,wBAAwB,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,wBAAwB,GAAG,IAAI,CAAC;IACvC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,iBAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAlBW,QAAA,mCAAmC,uCAkB9C"}
|
|
@@ -14,6 +14,7 @@ const npm_scope_1 = require("./npm-scope");
|
|
|
14
14
|
const ast_1 = require("./ast");
|
|
15
15
|
const shared_constructs_constants_1 = require("./shared-constructs-constants");
|
|
16
16
|
const versions_1 = require("./versions");
|
|
17
|
+
const pnpm_workspace_1 = require("./pnpm-workspace");
|
|
17
18
|
const SHADCN_DEPS = [
|
|
18
19
|
'class-variance-authority',
|
|
19
20
|
'clsx',
|
|
@@ -22,24 +23,6 @@ const SHADCN_DEPS = [
|
|
|
22
23
|
'tw-animate-css',
|
|
23
24
|
'radix-ui',
|
|
24
25
|
];
|
|
25
|
-
const NPMRC_IGNORE_WORKSPACE_ROOT_CHECK = 'ignore-workspace-root-check=true';
|
|
26
|
-
const ensureNpmrcIgnoresWorkspaceRoot = (tree) => {
|
|
27
|
-
const npmrcPath = '.npmrc';
|
|
28
|
-
if (tree.exists(npmrcPath)) {
|
|
29
|
-
const npmrcContent = tree.read(npmrcPath, 'utf-8');
|
|
30
|
-
const alreadyConfigured = npmrcContent
|
|
31
|
-
.split(/\r?\n/)
|
|
32
|
-
.some((line) => line.trim() === NPMRC_IGNORE_WORKSPACE_ROOT_CHECK);
|
|
33
|
-
if (alreadyConfigured) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
const needsTrailingNewline = npmrcContent.length > 0 && !npmrcContent.endsWith('\n');
|
|
37
|
-
tree.write(npmrcPath, `${npmrcContent}${needsTrailingNewline ? '\n' : ''}${NPMRC_IGNORE_WORKSPACE_ROOT_CHECK}\n`);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
tree.write(npmrcPath, `${NPMRC_IGNORE_WORKSPACE_ROOT_CHECK}\n`);
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
43
26
|
const addSharedShadcnEslintRules = async (tree, eslintConfigPath) => {
|
|
44
27
|
if (!tree.exists(eslintConfigPath)) {
|
|
45
28
|
return;
|
|
@@ -57,7 +40,7 @@ async function sharedShadcnGenerator(tree) {
|
|
|
57
40
|
const libraryRoot = (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_SHADCN_DIR);
|
|
58
41
|
const shadcnSrcRoot = (0, devkit_1.joinPathFragments)(libraryRoot, 'src');
|
|
59
42
|
const eslintConfigPath = (0, devkit_1.joinPathFragments)(libraryRoot, 'eslint.config.mjs');
|
|
60
|
-
|
|
43
|
+
(0, pnpm_workspace_1.ensurePnpmIgnoresWorkspaceRootCheck)(tree);
|
|
61
44
|
if (!tree.exists((0, devkit_1.joinPathFragments)(libraryRoot, 'project.json'))) {
|
|
62
45
|
await (0, generator_1.default)(tree, {
|
|
63
46
|
name: shared_constructs_constants_1.SHARED_SHADCN_NAME,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-shadcn.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/shared-shadcn.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"shared-shadcn.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/shared-shadcn.ts"],"names":[],"mappings":";;AAoDA,sDAoGC;;AAxJD;;;GAGG;AACH,uCAOoB;AACpB,4EAAqD;AACrD,iEAAgE;AAChE,qCAAgD;AAChD,2CAA8D;AAC9D,+BAAoC;AACpC,+EAIuC;AACvC,yCAAyD;AACzD,qDAAuE;AAEvE,MAAM,WA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