Skip to content

Commit 037ec16

Browse files
committed
add permission model
1 parent 8235b1b commit 037ec16

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/app-definition-generator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getEntityNameStrings, kebabCase } from './string-utils.js'
88
export interface App {
99
entities: AppEntity[]
1010
name: string
11+
permissionModel: string
1112
}
1213

1314
export interface AppEntityProperty {
@@ -117,7 +118,7 @@ function writeAppYamlToFileSystem({ app, appName, appDescription }: { app: App;
117118
description: appDescription, // `${app.name} App`,
118119
'x-codeGenie': {
119120
// region: 'us-west-2',
120-
// permissionModel: 'Global',
121+
permissionModel: app.permissionModel,
121122
defaultAuthRoute,
122123
entities,
123124
},
@@ -375,7 +376,7 @@ function getJsonSchemaProperties({ app, entity }: { app: App; entity: AppEntity
375376
}
376377
}
377378

378-
if (property.foreignKeyEntity) {
379+
if (property.foreignKeyEntity && !property.isIdProperty) {
379380
schemaProperties['x-codeGenie'] = {
380381
foreignKey: {
381382
referencedEntity: property.foreignKeyEntity,

src/commands/generate.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
145145
}
146146

147147
if (deploy) {
148-
await this.runInitDev({ appDir })
148+
await this.runInitDev({ appDir, appName })
149149
}
150150

151151
return {
@@ -350,8 +350,12 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
350350
ux.action.stop('✅')
351351
}
352352

353-
async runInitDev({ appDir }: { appDir: string }): Promise<undefined> {
354-
ux.action.start('🌩️ Deploying to AWS. The first deploy may take up to 10 minutes')
353+
async runInitDev({ appDir, appName }: { appDir: string; appName: string }): Promise<undefined> {
354+
ux.action.start('🌩️ Deploying to AWS')
355+
const appDirRelative = getAppOutputDir({ appName, absolute: false })
356+
this.log(
357+
`The first deploy may take up to 10 minutes, but you don't have to wait that long to get started! Open \`./${appDirRelative}\` in your favorite IDE like VS Code to explore your project source code. Tip: You may even be able to simply run \`code ./${appDirRelative}\` in a separate terminal to open it.`
358+
)
355359
execSync('npm run init:dev', {
356360
stdio: 'inherit',
357361
cwd: appDir,

0 commit comments

Comments
 (0)