wirejs-deploy-amplify-basic 0.0.25 → 0.0.27

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.
@@ -0,0 +1,7 @@
1
+ import { defineAuth } from '@aws-amplify/backend';
2
+
3
+ export const auth = defineAuth({
4
+ loginWith: {
5
+ email: true,
6
+ },
7
+ });
@@ -5,8 +5,10 @@ import { RemovalPolicy } 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 { api } from './functions/api/resource';
8
+ import { auth } from './auth/resources';
8
9
 
9
10
  const backend = defineBackend({
11
+ auth,
10
12
  api,
11
13
  });
12
14
 
@@ -18,7 +20,11 @@ const bucket = new Bucket(backend.stack, 'data', {
18
20
  bucket.grantReadWrite(backend.api.resources.lambda);
19
21
 
20
22
  backend.api.addEnvironment(
21
- 'BUCKET', bucket.bucketName
23
+ 'BUCKET', bucket.bucketName,
24
+ );
25
+
26
+ backend.api.addEnvironment(
27
+ 'COGNITO_CLIENT_ID', backend.auth.resources.userPoolClient.userPoolClientId
22
28
  );
23
29
 
24
30
  const apiUrl = backend.api.resources.lambda.addFunctionUrl({
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.38",
6
- "wirejs-resources": "^0.1.9"
6
+ "wirejs-resources": "^0.1.10"
7
7
  }
8
8
  }
package/build.js CHANGED
@@ -61,9 +61,12 @@ async function installDeps() {
61
61
  'esbuild': '^0.24.2',
62
62
  'tsx': '^4.19.2',
63
63
  'typescript': '^5.7.3',
64
- 'wirejs-resources': `file:${SELF_DIR}`
65
64
  }
66
65
  };
66
+ packageData.dependencies = {
67
+ ...(packageData.dependencies || {}),
68
+ 'wirejs-resources': `file:${SELF_DIR}`
69
+ };
67
70
  await fs.promises.writeFile(
68
71
  path.join(CWD, 'package.json'),
69
72
  JSON.stringify(packageData, null, 2)
@@ -153,10 +156,15 @@ if (action === 'prebuild') {
153
156
  } else if (action === 'inject-backend') {
154
157
  console.log("starting inject-backend");
155
158
  const config = JSON.parse(await fs.promises.readFile(path.join('.', 'amplify_outputs.json')));
159
+
156
160
  const apiUrl = config.custom.api;
161
+ const auth = {
162
+
163
+ };
157
164
 
158
165
  const configJSON = JSON.stringify({
159
- apiUrl
166
+ apiUrl,
167
+ auth
160
168
  });
161
169
  const configJS = `const config = ${configJSON};\nexport default config;`;
162
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "wirejs-deploy-amplify-basic": "build.js"
23
23
  },
24
24
  "dependencies": {
25
+ "@aws-sdk/client-cognito-identity-provider": "^3.741.0",
25
26
  "@aws-sdk/client-s3": "^3.738.0",
26
27
  "copy": "^0.3.2",
27
28
  "esbuild": "^0.24.2",
@@ -29,7 +30,7 @@
29
30
  "recursive-copy": "^2.0.14",
30
31
  "rimraf": "^6.0.1",
31
32
  "wirejs-dom": "^1.0.38",
32
- "wirejs-resources": "^0.1.9-alpha"
33
+ "wirejs-resources": "^0.1.10"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@aws-amplify/backend": "^1.14.0",