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

Gatsby v2.3.14 #210

Merged
merged 44 commits into from May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ed1539d
chore(deps): update babel monorepo
renovate-bot May 2, 2019
eebb2ab
fix(deps): update gatsby
renovate-bot May 3, 2019
f676e09
Merge pull request #177 from alxshelepenok/renovate/gatsby
alxshelepenok May 8, 2019
765f1d1
Merge pull request #160 from alxshelepenok/renovate/babel-monorepo
alxshelepenok May 8, 2019
762c132
fix(deps): update dependency gatsby-plugin-netlify-cms to v4
renovate-bot May 8, 2019
97ab088
Merge branch 'gatsby-v2.3.14' into renovate/major-gatsby
alxshelepenok May 8, 2019
807ce24
Merge pull request #204 from alxshelepenok/renovate/major-gatsby
alxshelepenok May 8, 2019
192e0d2
fix(deps): update dependency node-sass to ^4.12.0
renovate-bot May 8, 2019
5a2e49a
Merge branch 'gatsby-v2.3.14' into renovate/node-sass-4.x
alxshelepenok May 8, 2019
356ef2d
Merge pull request #198 from alxshelepenok/renovate/node-sass-4.x
alxshelepenok May 8, 2019
6b1ee3a
chore(deps): update jest monorepo to v24
renovate-bot May 8, 2019
a7fd425
Merge branch 'gatsby-v2.3.14' into renovate/major-jest-monorepo
alxshelepenok May 8, 2019
235396f
Merge pull request #111 from alxshelepenok/renovate/major-jest-monorepo
alxshelepenok May 8, 2019
ce18826
chore: migrate to .eslintrc.json
alxshelepenok May 8, 2019
420e422
fix: error when navigating to a post that has no tags
alxshelepenok May 8, 2019
d12a922
fix: cannot build gatsby sitemap #199
alxshelepenok May 8, 2019
55ace3b
chore: rebuilt yarn.lock
alxshelepenok May 8, 2019
514e485
chore: all scripts are replaced by the standard-version package
alxshelepenok May 8, 2019
d5ec42d
chore: move flow dir to root
alxshelepenok May 8, 2019
91ca37f
chore: migrate to .stylelintrc.json
alxshelepenok May 8, 2019
42d6377
fix: change path of css-module-stub
alxshelepenok May 8, 2019
32351b3
chore: update mocks, move configs to jest dir
alxshelepenok May 8, 2019
89192b7
fix: update path
alxshelepenok May 8, 2019
5df41ec
fix: update .stylelintrc.json
alxshelepenok May 8, 2019
7684644
test: improved coverage
alxshelepenok May 9, 2019
5b3dcd9
test: add fixtures
alxshelepenok May 9, 2019
4eeaea4
chore: rename file-mock
alxshelepenok May 9, 2019
d0c4809
chore: minor fixes in the config
alxshelepenok May 9, 2019
e59a4f9
chore: minor fixes in css-module-stub
alxshelepenok May 9, 2019
cb4d08f
chore: rebuilt yarn.lock
alxshelepenok May 9, 2019
4ada925
refactor: using react hooks
alxshelepenok May 9, 2019
b9aaa81
fix: add flow-typed
alxshelepenok May 9, 2019
083e7ce
fix: mistakes in the config
alxshelepenok May 9, 2019
30e7e9d
fix: save flow-typed to cache
alxshelepenok May 9, 2019
93b478b
fix: save flow-typed to cache
alxshelepenok May 9, 2019
a7846ea
fix: update config
alxshelepenok May 9, 2019
7271951
fix: update config
alxshelepenok May 9, 2019
1b04d2a
lint: ignore flow-typed
alxshelepenok May 9, 2019
add08f7
lint: add .eslintignore
alxshelepenok May 9, 2019
8e03721
chore: update post data
alxshelepenok May 9, 2019
091834f
chore: change netlify cms module path
alxshelepenok May 9, 2019
35f2170
improvement: flow coverage
alxshelepenok May 9, 2019
63675a6
chore: remove old node versions from .travis.yml
alxshelepenok May 9, 2019
46743e9
fix: use aliase #199
alxshelepenok May 10, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .circleci/config.yml
Expand Up @@ -19,13 +19,32 @@ jobs:
- node_modules
key: dependencies-{{ checksum "yarn.lock" }}

flow-typed:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- flow-typed-{{ checksum "yarn.lock" }}
- run: yarn flow-typed
- save_cache:
paths:
- flow-typed
key: flow-typed-{{ checksum "yarn.lock" }}

lint:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- flow-typed-{{ checksum "yarn.lock" }}
- run: yarn lint

test:
Expand Down Expand Up @@ -68,8 +87,12 @@ workflows:
test:
jobs:
- install
- flow-typed:
requires:
- install
- lint:
requires:
- flow-typed
- install
- test:
requires:
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
/flow-typed/*
/public/*
/node_modules/*
File renamed without changes.
3 changes: 2 additions & 1 deletion .flowconfig
Expand Up @@ -3,11 +3,12 @@
[include]

[libs]
flow-typed

[lints]

[options]
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/src/flow/CSSModuleStub.js'
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/flow/css-module-stub.js'
server.max_workers=4

[strict]
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
node_modules/
flow-typed/
.cache/
public/
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion .stylelintrc → .stylelintrc.json
Expand Up @@ -14,7 +14,7 @@
"no-duplicate-selectors": true,
"font-family-no-missing-generic-family-keyword": null,
"property-no-unknown": [true, {
ignoreProperties: ["/^lost-/"]
"ignoreProperties": ["/^lost-/"]
}]
},
"ignoreFiles": [
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,16 +1,16 @@
language: node_js
node_js:
- '8'
- '9'
- '10'
install:
- npm install -g codecov
script:
- yarn install
- yarn flow-typed
- yarn lint
- yarn test:coverage --runInBand --no-cache
- yarn test --runInBand --no-cache
- codecov
cache:
directories:
- node_modules
- node_modules
- flow-typed
Expand Up @@ -5,10 +5,6 @@ template: "post"
draft: false
slug: "/posts/the-origins-of-social-stationery-lettering"
category: "Design Culture"
tags:
- "Typefaces"
- "Lettering"
- "History"
description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante."
---

Expand Down
2 changes: 2 additions & 0 deletions src/flow/CSSModuleStub.js → flow/css-module-stub.js
Expand Up @@ -2,5 +2,7 @@
type CSSModule = {
[key: string]: string,
};

const emptyCSSModule: CSSModule = {};

export default emptyCSSModule;
6 changes: 3 additions & 3 deletions gatsby-config.js
Expand Up @@ -119,7 +119,7 @@ module.exports = {
{
resolve: 'gatsby-plugin-netlify-cms',
options: {
modulePath: `${__dirname}/src/cms/cms.js`,
modulePath: `${__dirname}/src/cms/index.js`,
}
},
{
Expand All @@ -138,7 +138,7 @@ module.exports = {
{
site {
siteMetadata {
url
siteUrl: url
}
}
allSitePage(
Expand All @@ -156,7 +156,7 @@ module.exports = {
`,
output: '/sitemap.xml',
serialize: ({ site, allSitePage }) => allSitePage.edges.map((edge) => ({
url: site.siteMetadata.url + edge.node.path,
url: site.siteMetadata.siteUrl + edge.node.path,
changefreq: 'daily',
priority: 0.7
}))
Expand Down
46 changes: 46 additions & 0 deletions jest/__fixtures__/all-markdown-remark.js
@@ -0,0 +1,46 @@
'use strict';

module.exports = {
allMarkdownRemark: {
group: [
{
fieldValue: 'test_0',
totalCount: 1
},
{
fieldValue: 'test_1',
totalCount: 2
}
],
edges: [
{
node: {
fields: {
slug: '/test_0',
categorySlug: '/test'
},
frontmatter: {
date: '2016-09-01',
description: 'test_0',
category: 'test',
title: 'test_0'
}
}
},
{
node: {
fields: {
slug: '/test_1',
categorySlug: '/test'
},
frontmatter: {
date: '2016-09-01',
description: 'test_1',
category: 'test',
title: 'test_1'
}
}
}
]
}
};
23 changes: 23 additions & 0 deletions jest/__fixtures__/markdown-remark.js
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
markdownRemark: {
id: 'test-123',
html: '<p>test</p>',
fields: {
tagSlugs: [
'/test_0',
'/test_1'
]
},
frontmatter: {
date: '2016-09-01',
description: 'test',
title: 'test',
tags: [
'test_0',
'test_1'
]
}
}
};
13 changes: 13 additions & 0 deletions jest/__fixtures__/page-context.js
@@ -0,0 +1,13 @@
'use strict';

module.exports = {
pageContext: {
tag: 'test',
category: 'test',
currentPage: 1,
prevPagePath: '/page/1',
nextPagePath: '/page/3',
hasNextPage: true,
hasPrevPage: true
}
};
41 changes: 41 additions & 0 deletions jest/__fixtures__/site-metadata.js
@@ -0,0 +1,41 @@
'use strict';

module.exports = {
site: {
siteMetadata: {
url: 'http://localhost',
title: 'Test title',
subtitle: 'Test subtitle',
copyright: 'Test copyright',
disqusShortname: '',
postsPerPage: 4,
menu: [
{
label: 'Test label 1',
path: '/test/1/'
},
{
label: 'Test label 2',
path: '/test/2/'
},
{
label: 'Test label 3',
path: '/test/3/'
}
],
author: {
name: 'Test name',
photo: '/test.jpg',
bio: 'Test bio',
contacts: {
email: '#',
telegram: '#',
twitter: '#',
github: '#',
rss: '#',
vkontakte: '#'
}
}
}
}
};
File renamed without changes.
29 changes: 29 additions & 0 deletions jest/__mocks__/gatsby.js
@@ -0,0 +1,29 @@
'use strict';

const React = require('react');

const gatsby = jest.requireActual('gatsby');

module.exports = {
...gatsby,
graphql: jest.fn(),
Link: jest.fn().mockImplementation(
({
activeClassName,
activeStyle,
getProps,
innerRef,
ref,
replace,
to,
...rest
}) => (
React.createElement('a', {
...rest,
href: to,
})
)
),
StaticQuery: jest.fn(),
useStaticQuery: jest.fn()
};
6 changes: 3 additions & 3 deletions tests/jest-config.js → jest/jest-config.js
Expand Up @@ -3,12 +3,12 @@
module.exports = {
rootDir: '../',
transform: {
'^.+\\.js?$': '<rootDir>/tests/jest-preprocess.js'
'^.+\\.js?$': '<rootDir>/jest/jest-preprocess.js'
},
testMatch: ['**/__tests__/**/*.js', '**/?(*.)test.js'],
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/tests/__mocks__/fileMock.js'
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/jest/__mocks__/file-mock.js'
},
testPathIgnorePatterns: ['node_modules', '.cache', 'public'],
transformIgnorePatterns: [
Expand All @@ -17,5 +17,5 @@ module.exports = {
globals: {
__PATH_PREFIX__: ''
},
testURL: 'http://localhost/'
setupFiles: ['<rootDir>/jest/loadershim.js']
};
6 changes: 5 additions & 1 deletion tests/jest-preprocess.js → jest/jest-preprocess.js
@@ -1,7 +1,11 @@
'use strict';

const babelOptions = {
presets: ['@babel/react', '@babel/env'],
presets: [
'@babel/react',
'@babel/env',
'babel-preset-gatsby'
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-class-properties',
Expand Down
5 changes: 5 additions & 0 deletions jest/loadershim.js
@@ -0,0 +1,5 @@
'use strict';

global.___loader = {
enqueue: jest.fn(),
};