Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form cli #255

Merged
merged 168 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 167 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
9b38e20
feat: add api uri to stack output
sdstolworthy Aug 25, 2023
ac18f6e
fix: update API.md
sdstolworthy Aug 25, 2023
6a2d000
fix: pass graphql uri to unified config
sdstolworthy Aug 25, 2023
c35a826
codegen: add model generator
sdstolworthy Sep 6, 2023
db6c0a7
codegen: add coverage
sdstolworthy Sep 6, 2023
b97e5d3
codegen: fix lint and api
sdstolworthy Sep 6, 2023
1c85615
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-mo…
sdstolworthy Sep 6, 2023
f3ce015
codegen: add coverage
sdstolworthy Sep 6, 2023
498e4d0
codegen: package-lock
sdstolworthy Sep 6, 2023
eb61d43
fix: remove api url
sdstolworthy Sep 6, 2023
889e429
fix: remove api url, rename ModelGenerator -> GraphqlModelGenerator
sdstolworthy Sep 6, 2023
5ce0fa0
fix: update dictionary
sdstolworthy Sep 6, 2023
0cc548d
fix: update api
sdstolworthy Sep 6, 2023
7ad8ddd
fix: update api
sdstolworthy Sep 6, 2023
cc68d7f
fix: export example graphql schema from ts file
sdstolworthy Sep 6, 2023
0421e08
fix: export example graphql schema from ts file
sdstolworthy Sep 6, 2023
6a7d171
codegen: add form generator
sdstolworthy Sep 6, 2023
d8930db
codegen: add form generator
sdstolworthy Sep 6, 2023
3d1baab
codegen: refactor form generation
sdstolworthy Sep 6, 2023
700708f
codegen: update eslint rule; break out codegen service responses into…
sdstolworthy Sep 7, 2023
0ff1d34
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 7, 2023
b85bc3d
lint: update for new linting rule
sdstolworthy Sep 7, 2023
cae1e4e
api: update api description files
sdstolworthy Sep 7, 2023
c81f521
api: update api description files
sdstolworthy Sep 7, 2023
cf87b25
codegen: rename types for uniformity; move outDir and language to fun…
sdstolworthy Sep 7, 2023
943f33e
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-mo…
sdstolworthy Sep 7, 2023
1270dd0
codegen: standardize naming; fix new lints from main
sdstolworthy Sep 7, 2023
7568fc1
Merge branch 'add-model-gen' into add-form-gen
sdstolworthy Sep 7, 2023
2d6a1a4
api: update api description files
sdstolworthy Sep 7, 2023
e1b742a
api: update api description files
sdstolworthy Sep 7, 2023
f1a531b
Merge branch 'add-model-gen' into add-form-gen
sdstolworthy Sep 7, 2023
428a4fc
cli: initial migration of command from formgen POC
sdstolworthy Sep 7, 2023
0fedd44
formgen: fix typo in codegen job waiter
sdstolworthy Sep 7, 2023
1178c1a
example: update example code to use generated client
sdstolworthy Sep 7, 2023
b6a3924
codegen: progress
sdstolworthy Sep 8, 2023
30c75e9
codegen: respond to PR comments
sdstolworthy Sep 8, 2023
88c11ba
codegen: respond to PR comments
sdstolworthy Sep 8, 2023
9efed24
codegen: respond to PR comments
sdstolworthy Sep 8, 2023
7d8f787
codegen: respond to PR comments
sdstolworthy Sep 8, 2023
17f5606
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-mo…
sdstolworthy Sep 8, 2023
984ead9
npm: more fun deps issues
sdstolworthy Sep 8, 2023
9533ca5
npm: more fun deps issues
sdstolworthy Sep 8, 2023
32e701a
codegen: promisify format
sdstolworthy Sep 8, 2023
2538ef6
codegen: add changeset
sdstolworthy Sep 8, 2023
cc77a10
codegen: update package-lock
sdstolworthy Sep 8, 2023
b4c272c
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
b0fe138
formgen: update example Ui
sdstolworthy Sep 8, 2023
24c06a8
codegen: update test snapshots
sdstolworthy Sep 8, 2023
5550dae
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
a3da6d7
codegen: merge model gen change, update example form
sdstolworthy Sep 8, 2023
2ab0912
tests: update snapshots
sdstolworthy Sep 8, 2023
91d387d
tests: update snapshots
sdstolworthy Sep 8, 2023
4049c9a
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
6facb2a
codegen: add changeset, migrate to fs/promises
sdstolworthy Sep 8, 2023
e3098d4
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-mo…
sdstolworthy Sep 8, 2023
5e293a1
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
dfb989c
codegen: bump form and model gen dependencies
sdstolworthy Sep 8, 2023
449cfa0
package: fix package-lock
sdstolworthy Sep 8, 2023
2fba70b
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
9512f2d
codegen: remove extraneous test file
sdstolworthy Sep 8, 2023
891bc9c
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-mo…
sdstolworthy Sep 8, 2023
9b25295
codegen: use test asset
sdstolworthy Sep 8, 2023
ae9fee7
Merge branch 'add-model-gen' into add-form-cli
sdstolworthy Sep 8, 2023
aa43e60
codegen: add logger
sdstolworthy Sep 8, 2023
caa5909
Merge branch 'add-model-gen' into add-form-gen
sdstolworthy Sep 8, 2023
fdc1f07
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 8, 2023
1d33131
packages: remove tiny-async-pool
sdstolworthy Sep 8, 2023
bb0352c
codegen: add changeset
sdstolworthy Sep 8, 2023
716346c
codegen: add app name resolution
sdstolworthy Sep 11, 2023
3dba28d
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 11, 2023
fb22ff8
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 13, 2023
45f9ddd
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 13, 2023
ee4b95f
lint: fix lints
sdstolworthy Sep 13, 2023
c16b752
feat: allow configurable output directories
sdstolworthy Sep 13, 2023
74a190d
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 13, 2023
aac700e
feat: allow configurable output directories
sdstolworthy Sep 13, 2023
49c5001
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 13, 2023
0982244
feat: configurable output directories
sdstolworthy Sep 13, 2023
d7a822d
Merge branch 'main' into add-form-cli
sdstolworthy Sep 18, 2023
c344700
npm: update package-lock
sdstolworthy Sep 18, 2023
bb40177
Merge branch 'main' into add-form-gen
sdstolworthy Sep 18, 2023
9ffaaf6
codegen: rely on uibuilder formgen locally
sdstolworthy Sep 19, 2023
01cdf1a
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 19, 2023
101f789
codegen: remove service generator
sdstolworthy Sep 19, 2023
3058644
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 19, 2023
1ff5397
codegen: remove extraneous options
sdstolworthy Sep 19, 2023
a0109d5
codegen: remove schema mappers
sdstolworthy Sep 19, 2023
4c1c178
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 19, 2023
7217e7a
eslint: remove duplicate spell check entry
sdstolworthy Sep 19, 2023
f2c4b61
tests: remove test directive from subpackage
sdstolworthy Sep 19, 2023
032d6de
api: update api description files
sdstolworthy Sep 19, 2023
f27b6e6
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 19, 2023
0f41b83
api: simplify exported api, update api description files
sdstolworthy Sep 19, 2023
e860973
fix: delete unused import
sdstolworthy Sep 19, 2023
e77b72b
codegen: return a generation result object
sdstolworthy Sep 19, 2023
5bce561
refactor: add ResultBuilder to form generator
sdstolworthy Sep 20, 2023
04ebf4b
tests: fix broken test
sdstolworthy Sep 20, 2023
1bed20f
fix: update url parser, remove deprecated types, fix naming
sdstolworthy Sep 20, 2023
d3df4d9
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 20, 2023
35bd35c
fix: integrate new changes from form generator
sdstolworthy Sep 20, 2023
313ec94
fix: fix write permissions for opened file
sdstolworthy Sep 20, 2023
0c3f3c7
Merge branch 'add-form-gen' into add-form-cli
sdstolworthy Sep 20, 2023
18b650f
Merge branch 'main' into add-api-uri
sdstolworthy Sep 20, 2023
05a59e1
fix: correctly persist api info in client config
sdstolworthy Sep 20, 2023
92b80d1
fix: tests
sdstolworthy Sep 20, 2023
ac31c8f
refactor: remove api url from client config
sdstolworthy Sep 20, 2023
e3080e3
tests: fix broken test
sdstolworthy Sep 20, 2023
e26d1ad
Merge branch 'add-api-uri' into add-form-cli
sdstolworthy Sep 20, 2023
0f47bdc
feat: allow retrieval of backend outputs without persisting to client…
sdstolworthy Sep 20, 2023
d991b62
Merge branch 'main' of github.com:aws-amplify/samsara-cli into stack-…
sdstolworthy Sep 20, 2023
f2cd27f
Update packages/client-config/src/client_config_generator_factory.ts
sdstolworthy Sep 20, 2023
2fd0151
refactor: export single utility method that retrieves the stack outputs
sdstolworthy Sep 20, 2023
111246f
refactor: move stack output resolvers to own package
sdstolworthy Sep 21, 2023
5e361c0
refactor: move stack output resolvers to own package
sdstolworthy Sep 21, 2023
34d13ef
Merge branch 'main' into add-form-cli
sdstolworthy Sep 21, 2023
3641d52
fix: remove graphql models
sdstolworthy Sep 21, 2023
64b294e
fix: remove amplify configuration
sdstolworthy Sep 21, 2023
3e2c5b2
Merge branch 'main' into stack-resolver-factory
sdstolworthy Sep 21, 2023
155421a
npm: update package-lock
sdstolworthy Sep 21, 2023
988fdb0
fix: add missing exports
sdstolworthy Sep 21, 2023
0b7c5b9
Merge branch 'main' of github.com:aws-amplify/samsara-cli into stack-…
sdstolworthy Sep 21, 2023
d0f1fa7
npm: update package-lock
sdstolworthy Sep 21, 2023
0a07970
refactor: export client class instead of method
sdstolworthy Sep 21, 2023
53007db
Merge branch 'stack-resolver-factory' into add-form-cli
sdstolworthy Sep 21, 2023
c6e99e3
refactor: integrate stack outputs changes
sdstolworthy Sep 21, 2023
89246a1
refactor: integrate stack outputs changes
sdstolworthy Sep 21, 2023
b2ff0af
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 21, 2023
c4fb1f7
Merge branch 'main' into add-form-cli
sdstolworthy Sep 21, 2023
d1bdb00
api: update api description files
sdstolworthy Sep 21, 2023
2058bd5
npm: update package-lock
sdstolworthy Sep 21, 2023
87e76d7
fix: fixed old straggling changes
sdstolworthy Sep 21, 2023
a07c2c0
changeset: add changeset
sdstolworthy Sep 21, 2023
140bba9
Apply suggestions from code review
sdstolworthy Sep 21, 2023
0f63252
npm: update package-lock
sdstolworthy Sep 21, 2023
f7f6207
Merge branch 'add-form-cli' of github.com:sdstolworthy/samsara-cli in…
sdstolworthy Sep 21, 2023
e3a69fe
fix: fixed incomplete variable renaming
sdstolworthy Sep 21, 2023
d2a441a
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 22, 2023
85cd8f2
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 22, 2023
4d6137f
Merge branch 'main' into add-form-cli
sdstolworthy Sep 25, 2023
a94e8b2
fix: updated tsconfig
sdstolworthy Sep 25, 2023
cb0f829
fix: refactor for tests
sdstolworthy Sep 25, 2023
6dfef13
fix: add tests, rename input parameters
sdstolworthy Sep 25, 2023
eb61726
fix: add tests, rename input parameters
sdstolworthy Sep 25, 2023
732d7fc
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 25, 2023
6c544ec
fix: refactor missing args errors
sdstolworthy Sep 25, 2023
4f026d9
fix: remove unnecessary validations
sdstolworthy Sep 25, 2023
727b81b
fix: await model generation promise
sdstolworthy Sep 25, 2023
090fefe
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 25, 2023
7c6fa22
deps: add required dep
sdstolworthy Sep 25, 2023
ea11d6e
fix: updated tsconfig
sdstolworthy Sep 25, 2023
ad97f35
revert: Reverts #256; fixes linting errors
sdstolworthy Sep 25, 2023
771902f
changeset: add changeset
sdstolworthy Sep 25, 2023
164a274
Merge branch 'revert-eslint-config' into add-form-cli
sdstolworthy Sep 25, 2023
acc4a67
lint: fix lints
sdstolworthy Sep 25, 2023
e57b97d
npm: update package-lock
sdstolworthy Sep 25, 2023
c5eaeb1
fix: package update fixes typo
sdstolworthy Sep 25, 2023
c6a72da
fix: ignore test promises
sdstolworthy Sep 25, 2023
e6ad96c
fix: package-lock
sdstolworthy Sep 25, 2023
ac49470
Merge branch 'revert-eslint-config' into add-form-cli
sdstolworthy Sep 25, 2023
8d7a51a
npm: update package-lock
sdstolworthy Sep 25, 2023
3040262
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 25, 2023
2600896
npm: update package-lock
sdstolworthy Sep 25, 2023
9674adc
fix: updated tsconfig
sdstolworthy Sep 25, 2023
9014015
npm: update package-lock
sdstolworthy Sep 26, 2023
143c3ae
fix: updated tsconfig
sdstolworthy Sep 26, 2023
a8c60d9
fix: lint
sdstolworthy Sep 26, 2023
86d2e87
fix: lint
sdstolworthy Sep 26, 2023
f4f53f3
Merge branch 'main' of github.com:aws-amplify/samsara-cli into add-fo…
sdstolworthy Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/moody-melons-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-cli': minor
---

Add form generation interface
3 changes: 3 additions & 0 deletions examples/simple_react/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ yarn-error.log*

cdk.out
src/amplifyconfiguration.js
src/ui-components/
src/graphql/

24,267 changes: 11,142 additions & 13,125 deletions examples/simple_react/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/simple_react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"@aws-amplify/backend": "file:../../packages/backend",
"@aws-amplify/backend-auth": "file:../../packages/backend-auth",
"@aws-amplify/backend-graphql": "file:../../packages/backend-graphql",
"@aws-amplify/cli": "file:../../packages/cli"
"@aws-amplify/cli": "file:../../packages/cli",
"@aws-amplify/api": "^5.4.5"
},
"scripts": {
"start": "react-scripts start",
Expand Down
42 changes: 15 additions & 27 deletions examples/simple_react/src/components/todos/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ import {
Divider,
TextField,
} from '@aws-amplify/ui-react';
import { GraphQLQuery } from '@aws-amplify/api';
import { BiTrash } from 'react-icons/bi';
import { Todo } from '../../models';
import style from './style';
import { listTodos } from '../../graphql/queries';
import { API } from 'aws-amplify';
import { deleteTodo } from '../../graphql/mutations';
import { TodoCreateForm } from '../../ui-components';

const initialState = { name: '', description: '' };

Expand All @@ -26,8 +31,14 @@ function TodoView() {

const fetchTodos = async () => {
try {
const todos = await DataStore.query(Todo);
setTodos(todos);
const {
data: {
listTodos: { items },
},
} = await API.graphql<GraphQLQuery<any>>({
query: listTodos,
});
setTodos(items);
} catch (error) {
console.log('error fetching todos:', error);
}
Expand All @@ -51,10 +62,7 @@ function TodoView() {

const removeTodo = async (id: string) => {
try {
const toDelete = await DataStore.query(Todo, id);
if (toDelete) {
await DataStore.delete(toDelete);
}
await API.graphql({ query: deleteTodo, variables: { input: { id } } });
fetchTodos();
} catch (error) {
console.log('error removing todo:', error);
Expand Down Expand Up @@ -87,27 +95,7 @@ function TodoView() {
</Card>
)}
</Collection>
<View style={style.form}>
<TextField
labelHidden
label="Name"
placeholder="Name"
style={style.form.textInput}
value={formState.name}
onChange={(event) => setInput('name', event.target.value)}
/>
<TextField
labelHidden
label="Description"
placeholder="Description"
style={style.form.textInput}
value={formState.description}
onChange={(event) => setInput('description', event.target.value)}
/>
</View>
<Button variation="primary" onClick={addTodo}>
Create Todo
</Button>
<TodoCreateForm onSuccess={() => fetchTodos()} />
</Card>
);
}
Expand Down
Loading