wirejs-deploy-amplify-basic 0.0.111-realtime → 0.0.112-realtime

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  defineBackend,
3
3
  } from '@aws-amplify/backend';
4
- import { RemovalPolicy } from "aws-cdk-lib";
4
+ import { RemovalPolicy, NestedStack } from "aws-cdk-lib";
5
5
  import { FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
6
6
  import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
7
7
  import { Table, AttributeType, BillingMode } from 'aws-cdk-lib/aws-dynamodb';
@@ -72,13 +72,21 @@ const PKFieldTypes = {
72
72
  'number': AttributeType.NUMBER,
73
73
  }
74
74
 
75
+ const allTablesStack = new NestedStack(backend.stack, 'tables', {
76
+ description: 'DynamoDB tables for distributed resources',
77
+ });
78
+
75
79
  // TODO: Need to get AttributeType from customer definition.
76
80
  for (const resource of generated) {
77
81
  if (isDistributedTable(resource)) {
82
+ const tableStack = new NestedStack(allTablesStack, resource.options.absoluteId, {
83
+ description: `DynamoDB table for ${resource.options.absoluteId}`
84
+ });
85
+
78
86
  const sanitizedId = resource.options.absoluteId.replace(/[^a-zA-Z0-9-_]/g, '_');
79
87
  const tableName = `${TABLE_NAME_PREFIX}${sanitizedId}`
80
88
 
81
- const table = new Table(backend.stack, sanitizedId, {
89
+ const table = new Table(tableStack, sanitizedId, {
82
90
  tableName,
83
91
  partitionKey: {
84
92
  name: resource.options.partitionKey.field,
@@ -93,7 +101,7 @@ for (const resource of generated) {
93
101
  pointInTimeRecovery: true,
94
102
  });
95
103
 
96
- new TableIndexes(backend.stack, `${tableName}Indexes`,
104
+ new TableIndexes(tableStack, `${tableName}Indexes`,
97
105
  {
98
106
  tableName,
99
107
  indexes: (resource.options.indexes ?? []).map((index) => ({
@@ -137,7 +145,10 @@ function isRealtimeService(resource: any): resource is {
137
145
  }
138
146
 
139
147
  if (generated.some(isRealtimeService)) {
140
- const realtime = new RealtimeService(backend.stack, 'realtime', {
148
+ const realtimeStack = new NestedStack(backend.stack, 'realtime', {
149
+ description: 'Realtime service for distributed resources',
150
+ });
151
+ const realtime = new RealtimeService(realtimeStack, 'realtime', {
141
152
  appId: APP_ID!,
142
153
  branchId: BRANCH_ID,
143
154
  publisher: backend.api,
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.41",
6
- "wirejs-resources": "^0.1.79-realtime"
6
+ "wirejs-resources": "^0.1.80-realtime"
7
7
  }
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.111-realtime",
3
+ "version": "0.0.112-realtime",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "recursive-copy": "^2.0.14",
42
42
  "rimraf": "^6.0.1",
43
43
  "wirejs-dom": "^1.0.41",
44
- "wirejs-resources": "^0.1.79-realtime"
44
+ "wirejs-resources": "^0.1.80-realtime"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-amplify/backend": "^1.14.0",