Skip to content

Commit cd18b52

Browse files
authored
Merge pull request #898 from aws-amplify/main
chore: release codegen plugin
2 parents 45baf1d + 5065e36 commit cd18b52

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@
133133
"graphql": "15.8.0",
134134
"xml2js": "0.5.0",
135135
"axios": "^1.7.4",
136-
"**/@aws-amplify/amplify-codegen-e2e-tests/**/fast-xml-parser": "^4.4.1"
136+
"**/@aws-amplify/amplify-codegen-e2e-tests/**/fast-xml-parser": "^4.4.1",
137+
"**/@aws-amplify/amplify-codegen-e2e-tests/**/cookie": "^0.7.0"
137138
},
138139
"config": {
139140
"commitizen": {

packages/amplify-codegen-e2e-core/src/init/initProjectHelper.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nspawn as spawn, getCLIPath, singleSelect, addCITags } from '..';
2-
import { KEY_DOWN_ARROW, AmplifyFrontend } from '../utils';
2+
import { KEY_DOWN_ARROW, AmplifyFrontend, ExecutionContext } from '../utils';
33
import { amplifyRegions } from '../configure';
44
import { v4 as uuid } from 'uuid';
55

@@ -44,6 +44,7 @@ export function initJSProjectWithProfile(cwd: string, settings: Object = {}): Pr
4444

4545
return new Promise((resolve, reject) => {
4646
const chain = spawn(getCLIPath(), cliArgs, { cwd, stripColors: true, env, disableCIDetection: s.disableCIDetection })
47+
confirmUsingGen1Amplify(chain)
4748
.wait('Enter a name for the project')
4849
.sendLine(s.name)
4950
.wait('Initialize the project with the above configuration?')
@@ -91,19 +92,28 @@ export function initJSProjectWithProfile(cwd: string, settings: Object = {}): Pr
9192
});
9293
}
9394

95+
export const confirmUsingGen1Amplify = (executionContext: ExecutionContext): ExecutionContext => {
96+
return executionContext
97+
.wait('Do you want to continue with Amplify Gen 1?')
98+
.sendConfirmYes()
99+
.wait('Why would you like to use Amplify Gen 1?')
100+
.sendCarriageReturn()
101+
}
102+
94103
export function initAndroidProjectWithProfile(cwd: string, settings: Object): Promise<void> {
95104
const s = { ...defaultSettings, ...settings };
96105

97106
addCITags(cwd);
98107

99108
return new Promise((resolve, reject) => {
100-
spawn(getCLIPath(), ['init'], {
109+
const chain = spawn(getCLIPath(), ['init'], {
101110
cwd,
102111
stripColors: true,
103112
env: {
104113
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
105114
},
106115
})
116+
confirmUsingGen1Amplify(chain)
107117
.wait('Enter a name for the project')
108118
.sendLine(s.name)
109119
.wait('Initialize the project with the above configuration?')
@@ -141,13 +151,14 @@ export function initIosProjectWithProfile(cwd: string, settings: Object): Promis
141151
addCITags(cwd);
142152

143153
return new Promise((resolve, reject) => {
144-
spawn(getCLIPath(), ['init'], {
154+
const chain = spawn(getCLIPath(), ['init'], {
145155
cwd,
146156
stripColors: true,
147157
env: {
148158
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
149159
},
150160
})
161+
confirmUsingGen1Amplify(chain)
151162
.wait('Enter a name for the project')
152163
.sendLine(s.name)
153164
.wait('Initialize the project with the above configuration?')
@@ -178,6 +189,7 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Object): Pr
178189

179190
return new Promise((resolve, reject) => {
180191
let chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true })
192+
confirmUsingGen1Amplify(chain)
181193
.wait('Enter a name for the project')
182194
.sendLine(s.name)
183195
.wait('Initialize the project with the above configuration?')
@@ -228,6 +240,7 @@ export function initProjectWithAccessKey(
228240
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
229241
},
230242
})
243+
confirmUsingGen1Amplify(chain)
231244
.wait('Enter a name for the project')
232245
.sendLine(s.name)
233246
.wait('Initialize the project with the above configuration?')

packages/amplify-codegen-e2e-core/src/utils/pinpoint.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Pinpoint } from 'aws-sdk';
2-
import { getCLIPath, nspawn as spawn, singleSelect, amplifyRegions, addCITags, KEY_DOWN_ARROW } from '..';
2+
import { getCLIPath, nspawn as spawn, singleSelect, amplifyRegions, addCITags, KEY_DOWN_ARROW, confirmUsingGen1Amplify } from '..';
33
import _ from 'lodash';
44

55
const settings = {
@@ -80,6 +80,7 @@ export function initProjectForPinpoint(cwd: string): Promise<void> {
8080
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
8181
},
8282
})
83+
confirmUsingGen1Amplify(chain)
8384
.wait('Enter a name for the project')
8485
.sendLine(settings.name)
8586
.wait('Initialize the project with the above configuration?')

packages/amplify-codegen-e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@aws-amplify/amplify-codegen-e2e-core": "1.6.5",
27-
"@aws-amplify/graphql-schema-test-library": "^2.2.28",
27+
"@aws-amplify/graphql-schema-test-library": "^3.0.0",
2828
"amazon-cognito-identity-js": "^6.3.6",
2929
"aws-amplify": "^5.3.3",
3030
"aws-appsync": "^4.1.9",

packages/amplify-codegen-e2e-tests/src/init-special-cases/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { nspawn as spawn, getCLIPath, singleSelect, amplifyRegions, addCITags, KEY_DOWN_ARROW } from '@aws-amplify/amplify-codegen-e2e-core';
2+
import { nspawn as spawn, getCLIPath, singleSelect, amplifyRegions, addCITags, KEY_DOWN_ARROW, confirmUsingGen1Amplify } from '@aws-amplify/amplify-codegen-e2e-core';
33
import fs from 'fs-extra';
44
import os from 'os';
55

@@ -52,6 +52,7 @@ async function initWorkflow(cwd: string, settings: { accessKeyId: string; secret
5252
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
5353
},
5454
})
55+
confirmUsingGen1Amplify(chain)
5556
.wait('Enter a name for the project')
5657
.sendCarriageReturn()
5758
.wait('Initialize the project with the above configuration?')

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,10 @@
583583
graphql-transformer-common "4.30.1"
584584
immer "^9.0.12"
585585

586-
"@aws-amplify/graphql-schema-test-library@^2.2.28":
587-
version "2.2.28"
588-
resolved "https://registry.yarnpkg.com/@aws-amplify/graphql-schema-test-library/-/graphql-schema-test-library-2.2.28.tgz#a60ae3fd2d9e5d4bd154899a6e0d28a48af0a855"
589-
integrity sha512-1ZFFGKICIINhZkbkHC9lrPD9nMa5uLppmUyL1cJR2TKqneVKO8l0B88nnqhwjq/9yREFEP06VklORfm1XBKeUQ==
586+
"@aws-amplify/graphql-schema-test-library@^3.0.0":
587+
version "3.0.4"
588+
resolved "https://registry.npmjs.org/@aws-amplify/graphql-schema-test-library/-/graphql-schema-test-library-3.0.4.tgz#05bcb53a0b6364e49eec1fb526dfca2cad79097c"
589+
integrity sha512-KM7HMrAP3wPHuKD1Rd/Z00bkVqtNbRNmTMmNOTDkommwnirrjBAFtZCLCp5GL1zdhxqsheCSuFZur+RGYAQqqA==
590590

591591
"@aws-amplify/[email protected]":
592592
version "2.7.1"
@@ -9580,10 +9580,10 @@ convert-source-map@^2.0.0:
95809580
resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
95819581
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
95829582

9583-
cookie@^0.4.0:
9584-
version "0.4.2"
9585-
resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
9586-
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
9583+
cookie@^0.4.0, cookie@^0.7.0:
9584+
version "0.7.2"
9585+
resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7"
9586+
integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==
95879587

95889588
copyfiles@^2.2.0:
95899589
version "2.4.1"

0 commit comments

Comments
 (0)