-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from awslabs/lbrinker/first-commit
Migrate all project files to the GitHub repo.
- Loading branch information
Showing
12 changed files
with
33,457 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.1.0] - 2022-02-25 | ||
|
||
### Added | ||
|
||
- First release for a public beta | ||
- Includes the following functionality: | ||
- local and remote seeding for the following Authentication types: AWS_IAM, API_KEY and Cognito User pools | ||
- ability to link into amplify hooks to enable commands like `amplify mock --seed` | ||
|
||
[0.0.1]: https://github.com/awslabs/amplify-graphql-seed-plugin/releases/tag/v0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "graphql-seed", | ||
"type": "util", | ||
"commands": [ | ||
"version", | ||
"help", | ||
"run", | ||
"init", | ||
"delete-mock", | ||
"remove" | ||
], | ||
"eventHandlers": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import fs from 'fs' | ||
|
||
const fsPromises = fs.promises | ||
|
||
const utils = require('../utils/directory-functions') | ||
|
||
async function run (context) { | ||
const mockDirectory = utils.getMockDirectory(context) | ||
|
||
if (!fs.existsSync(mockDirectory)) { | ||
return context.print.error('No mock-data folder found at amplify/mock-data') | ||
} | ||
|
||
await fsPromises.rm(mockDirectory, { recursive: true }) | ||
} | ||
|
||
module.exports = { | ||
run | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { showHelp } = require('../utils/help') | ||
|
||
async function run (context) { | ||
// print out the help message of your plugin | ||
context.print.info('') | ||
|
||
const commands = [ | ||
{ | ||
name: 'Usage', | ||
description: 'amplify graphql-seed [command] [options]\n \n' | ||
}, | ||
{ | ||
name: 'Commands:', | ||
description: '' | ||
}, | ||
{ | ||
name: 'init', | ||
description: 'Initializes the project, creates all the configuration files and all the sample files.' | ||
}, | ||
{ | ||
name: 'run', | ||
description: 'Runs the seeding script using the data from seed-data.js file and using the mutations from mutations.js file.', | ||
flags: [{ argument: '--remote, -r', description: '' }] | ||
}, | ||
{ | ||
name: 'delete-mock', | ||
description: 'Deletes data from the local database.', | ||
flags: [] | ||
} | ||
|
||
] | ||
|
||
showHelp(commands, context) | ||
} | ||
|
||
module.exports = { | ||
run | ||
} |
Oops, something went wrong.