Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Rewrite Gatsby API from gatsby folder to TS #369

Merged
merged 9 commits into from
Jul 19, 2019

Conversation

magicmatatjahu
Copy link
Contributor

Description

Changes proposed in this pull request:

  • Rewrite Gatsby API from gatsby folder to TS

Related issue(s)
#287

@magicmatatjahu magicmatatjahu added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 6, 2019
@netlify
Copy link

netlify bot commented Jul 6, 2019

Deploy preview ready! ( ͡° ͜ʖ ͡°)

Built with commit c43443d

https://deploy-preview-369--kyma-project.netlify.com

@magicmatatjahu magicmatatjahu added the area/core-and-supporting Issues or PRs related to core and supporting label Jul 6, 2019
@@ -132,8 +134,7 @@
"git add"
],
"src/**/*.{ts,tsx}": [
"tslint -c tslint.json --project tsconfig.json --format verbose --fix",
"prettier --config .prettierrc --write",
"npm run lint-fix",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run lint-fix does not accept arguments, it's just a command. previous instruction lints just those files that are commited

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run lint-fix is short command of tslint and pretiier, so I think it works like with options.

gatsby/index.js Outdated Show resolved Hide resolved
options: {
source: `${__dirname}/../../content`,
destination: "/assets",
extensions: ["jpeg", "jpg", "gif", "png", "svg", "json", "yaml", "yml"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract this to const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use it in one place, so extracting is unnecessary.

interface OnCreateDocsNode {
node: Node;
relativePath: string;
createNodeField: Function;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use Function type


module.exports = async ({ graphql, createPage, createRedirect }) => {
export const getPosts = async (graphql: Function): Promise<PostQL[]> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function

@@ -31,6 +31,6 @@
},
"jsRules": {},
"linterOptions": {
"exclude": ["node_modules/**/*", "tools/**/*"]
"exclude": ["*/node_modules/**/*"]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this:

    "ban-types": [
      true,
      ["Object", "Use {} instead."],
      ["String"],
      ["Function", "Use more precise type"]
    ]

to rules please

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though it doesn't lint ./gatsby, just for the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that String object may be used in code 😄

excerpt: string;
html: string;
fields: {
slug: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slug: string?, at least from what you said to me

@magicmatatjahu magicmatatjahu merged commit 20eb9e8 into kyma-project:master Jul 19, 2019
@magicmatatjahu magicmatatjahu deleted the restructuring branch July 19, 2019 08:52
m00g3n pushed a commit to m00g3n/website that referenced this pull request Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/core-and-supporting Issues or PRs related to core and supporting kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants