Skip to content

Commit

Permalink
🐛 (.git/hooks/husky.local.sh) Fixing pre-commit hook not running
Browse files Browse the repository at this point in the history
post install script was set to all workspaces to reset husky.local.sh -> see typicode/husky#677
  • Loading branch information
Romain Lambert committed Jan 23, 2021
1 parent e7e3069 commit 44182ec
Show file tree
Hide file tree
Showing 12 changed files with 147,701 additions and 488 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = {
jest: true,
},
rules: {
'global-require': 0,
'react/prop-types': 'off', // Disable prop-types as we use TypeScript for type checking
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
Expand Down
147,191 changes: 147,191 additions & 0 deletions .yarn/releases/yarn-1.19.0.cjs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# https://github.com/yarnpkg/yarn/issues/8405


yarn-path ".yarn/releases/yarn-1.19.0.cjs"
19 changes: 19 additions & 0 deletions projects/namur/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ module.exports = {
`gatsby-plugin-typescript`,
`gatsby-plugin-sitemap`,
`gatsby-transformer-sharp`,
'gatsby-plugin-extract-schema',
'gatsby-plugin-react-axe',
{
resolve: `gatsby-plugin-graphql-codegen`,
options: {
documentPaths: [`./src/**/*.{ts,tsx}`],
},
},
{
resolve: 'gatsby-source-prismic',
options: {
repositoryName: process.env.GATSBY_PRISMIC_REPOSITORY_NAME,
accessToken: `${process.env.PRISMIC_API_KEY}`,
// Put your prismic schemas here !
schemas: {
navigation: require('./src/schemas/layout/navigation.json'),
},
},
},
{
resolve: `gatsby-source-contentful`,
options: {
Expand Down
5 changes: 4 additions & 1 deletion projects/namur/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
"gatsby-image": "^2.9.0",
"gatsby-plugin-catch-links": "^2.8.0",
"gatsby-plugin-emotion": "5.2.0",
"gatsby-plugin-extract-schema": "^0.0.5",
"gatsby-plugin-google-analytics": "^2.9.0",
"gatsby-plugin-graphql-codegen": "^2.7.1",
"gatsby-plugin-manifest": "^2.10.0",
"gatsby-plugin-netlify": "^2.9.0",
"gatsby-plugin-offline": "^3.8.0",
"gatsby-plugin-polyfill-io": "^1.1.0",
"gatsby-plugin-react-axe": "^0.5.0",
"gatsby-plugin-react-helmet": "^3.8.0",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-robots-txt": "^1.5.5",
Expand Down Expand Up @@ -52,7 +54,8 @@
"build": "gatsby build",
"update": "ncu -u",
"lint": "eslint --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\"",
"format": "prettier --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\" --write"
"format": "prettier --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\" --write",
"postinstall": "if [[ -f ../../.git/hooks/husky.local.sh ]]; then sed -i '' -E 's/cd \".+\"/cd \".\"/' ../../.git/hooks/husky.local.sh; fi"
},
"repository": {
"type": "git",
Expand Down
34 changes: 34 additions & 0 deletions projects/namur/src/components/atoms/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { forwardRef } from 'react';
import { GatsbyLinkProps, Link as GatsbyLink } from 'gatsby';

const LinkComponent = (
{ to, target, children, ...rest }: GatsbyLinkProps<any>,
ref: React.LegacyRef<HTMLAnchorElement>,
): JSX.Element => {
// If external
if (to.indexOf('http') !== -1) {
return (
<a
ref={ref}
href={to}
target={target}
rel="noreferrer noopener"
{...rest}
>
{children}
</a>
);
}

// If internal
return (
// @ts-ignore
<GatsbyLink ref={ref} to={`/${to}`} target={target} {...rest}>
{children}
</GatsbyLink>
);
};

const Link = forwardRef(LinkComponent);

export default Link;
1 change: 1 addition & 0 deletions projects/namur/src/components/atoms/Link/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Link';
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React from 'react';
import Header from '@/components/organisms/layout/Header';

interface LayoutProps {
children: React.ReactNode;
}

const PrimaryLayout = ({ children }: LayoutProps): JSX.Element => (
<main role="main">{children}</main>
<>
<Header />
<main role="main">{children}</main>
</>
);

export default PrimaryLayout;
27 changes: 27 additions & 0 deletions projects/namur/src/schemas/layout/navigation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"Main": {
"links": {
"type": "Group",
"config": {
"fields": {
"label": {
"type": "Text",
"config": {
"label": "label",
"placeholder": "Link label"
}
},
"path": {
"type": "Link",
"config": {
"allowTargetBlank": true,
"label": "path",
"placeholder": "Link path"
}
}
},
"label": "links"
}
}
}
}
7 changes: 7 additions & 0 deletions projects/namur/src/types/link.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface LinkProps {
label: string;
path: string;
target?: string;
}

export default LinkProps;
3 changes: 2 additions & 1 deletion projects/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"build": "gatsby build",
"update": "ncu -u",
"lint": "eslint --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\"",
"format": "prettier --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\" --write"
"format": "prettier --ignore-path ../../.gitignore \"**/*.+(ts|js|tsx)\" --write",
"postinstall": "if [[ -f ../../.git/hooks/husky.local.sh ]]; then sed -i '' -E 's/cd \".+\"/cd \".\"/' ../../.git/hooks/husky.local.sh; fi"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 44182ec

Please sign in to comment.