Skip to content

Commit

Permalink
Merge pull request #22 from olliethedev/feat/blog-plugin
Browse files Browse the repository at this point in the history
Feat/blog plugin
  • Loading branch information
olliethedev authored Oct 28, 2023
2 parents bb892fd + b9933ac commit 356fb8d
Show file tree
Hide file tree
Showing 12 changed files with 653 additions and 17 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.18",
"version": "1.1.19",
"private": true,
"workspaces": [
"./packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-graphql-amplifiers-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplifiers/amplify-graphql-amplifiers-core",
"version": "1.1.18",
"version": "1.1.19",
"description": "Amplify GraphQL @createModel transformer. This directive is intended to be used for creating a new model once a Cognito Event is fired.",
"keywords": [
"aws",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplifiers/amplify-graphql-create-model-transformer",
"version": "1.1.18",
"version": "1.1.19",
"description": "Amplify GraphQL @createModel transformer. This directive is intended to be used for creating a new model once a Cognito Event is fired.",
"keywords": [
"aws",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplifiers/amplify-graphql-process-image-transformer",
"version": "1.1.18",
"version": "1.1.19",
"description": "This directive allows you to process images.",
"keywords": [
"aws",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplifiers/amplify-graphql-send-email-transformer",
"version": "1.1.18",
"version": "1.1.19",
"description": "Amplify GraphQL @sendEmail transformer.",
"keywords": [
"aws",
Expand Down
6 changes: 6 additions & 0 deletions packages/amplify-util-blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ To use this plugin, you need to install it globally:
```bash
npm install -g @amplifiers/amplify-util-blog
```
The plugin uses typesense transformer for search and amplify-ui components for ui, so we will also need to install the following:
```bash
npm install -s amplify-graphql-typesense-transformer @aws-amplify/ui-react @aws-amplify/ui-react-storage aws-amplify react-markdown remark-gfm remark-math
```

Then, you can use the `amplify plugin add` command to add it to your Amplify CLI:
```bash
Expand All @@ -32,6 +36,8 @@ amplify plugin add /usr/local/lib/node_modules/@amplifiers/amplify-util-blog

Follow the prompts to add the `amplify-util-blog` plugin.

Remember to update the typesense api key and endpoint in your `parameters.json` if you plan to use search.

## Usage

To add blog functionality to your project, run:
Expand Down
5 changes: 3 additions & 2 deletions packages/amplify-util-blog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplifiers/amplify-util-blog",
"version": "1.1.18",
"version": "1.1.19",
"description": "Amplify Util Blog is a utility plugin for the Amplify CLI that helps you add blog functionality to your Amplify project.",
"keywords": [
"aws",
Expand All @@ -21,7 +21,8 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"compile": "echo WIP"
},"dependencies": {
},
"dependencies": {
"fs-extra": "^11.1.1"
},
"author": "olliethedev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as React from "react";
import { Post } from "../../../models";
import { EscapeHatchProps } from "@aws-amplify/ui-react/internal";
import { FlexProps, TextProps } from "@aws-amplify/ui-react";
import { MyIconProps } from "../../MyIcon";
import { MyIconProps } from "../icons/MyIcon";
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
export declare type PostCardOverridesProps = {
PostCard?: PrimitiveOverrideProps<FlexProps>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useNavigateAction,
} from "@aws-amplify/ui-react/internal";
import { Flex, Text } from "@aws-amplify/ui-react";
import MyIcon from "../../MyIcon";
import MyIcon from "../icons/MyIcon";
export default function PostCard(props) {
const { post, imageContainer, overrides, ...rest } = props;
const readMoreLayoutOnClick = useNavigateAction({
Expand Down
19 changes: 19 additions & 0 deletions packages/amplify-util-blog/ui-components/blog/icons/MyIcon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/***************************************************************************
* The contents of this file were generated with Amplify Studio. *
* Please refrain from making any modifications to this file. *
* Any changes to this file will be overwritten when running amplify pull. *
**************************************************************************/

import * as React from "react";
import { EscapeHatchProps } from "@aws-amplify/ui-react/internal";
import { IconProps } from "@aws-amplify/ui-react";
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
export declare type MyIconOverridesProps = {
MyIcon?: PrimitiveOverrideProps<IconProps>;
} & EscapeHatchProps;
export declare type MyIconProps = React.PropsWithChildren<Partial<IconProps> & {
type?: "alert" | "arrow-right" | "authentication" | "bookmark_border" | "chat" | "chat-bubble-outline" | "checkmark" | "close" | "content" | "dashboard" | "data" | "delete" | "edit" | "email" | "favorite" | "favorite_border" | "file" | "function" | "group" | "home" | "info" | "instagram" | "location" | "more_horiz" | "more_vert" | "notification" | "phone" | "reply" | "send" | "settings" | "share" | "shopping_bag" | "shuffle" | "storage" | "twitter" | "warning";
} & {
overrides?: MyIconOverridesProps | undefined | null;
}>;
export default function MyIcon(props: MyIconProps): React.ReactElement;
Loading

0 comments on commit 356fb8d

Please sign in to comment.