Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = {
rules: {
'no-console': [0],
'react/prop-types': [0],
'react/jsx-uses-react': 'off', // Not needed with new JSX transform
'react/react-in-jsx-scope': 'off', // Not needed with new JSX transform
'import/no-named-as-default': 0,
'import/order': [
'error',
Expand Down Expand Up @@ -89,6 +91,8 @@ module.exports = {
},
rules: {
'no-duplicate-imports': [0], // handled by @typescript-eslint
'react/jsx-uses-react': 'off', // Not needed with new JSX transform
'react/react-in-jsx-scope': 'off', // Not needed with new JSX transform
'@typescript-eslint/ban-types': [0], // TODO enable in future
'@typescript-eslint/no-non-null-assertion': [0],
'@typescript-eslint/consistent-type-imports': 'error',
Expand Down
28 changes: 22 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ const svgo = {

function presets() {
return [
'@babel/preset-react',
...(!isESM ? [['@babel/preset-env', {}]] : []),
[
'@emotion/babel-preset-css-prop',
'@babel/preset-react',
{
autoLabel: 'always',
runtime: 'automatic',
importSource: '@emotion/react',
},
],
...(!isESM ? [['@babel/preset-env', {}]] : []),
'@babel/preset-typescript',
];
}
Expand All @@ -64,6 +64,7 @@ function plugins() {
if (isESM) {
return [
...defaultPlugins,
'@emotion/babel-plugin',
[
'transform-define',
{
Expand All @@ -89,6 +90,7 @@ function plugins() {
if (isTest) {
return [
...defaultPlugins,
'@emotion/babel-plugin',
[
'inline-react-svg',
{
Expand All @@ -99,13 +101,27 @@ function plugins() {
}

if (!isProduction) {
return [...defaultPlugins];
return [...defaultPlugins, '@emotion/babel-plugin'];
}

return defaultPlugins;
return [...defaultPlugins, '@emotion/babel-plugin'];
}

module.exports = {
presets: presets(),
plugins: plugins(),
overrides: [
{
test: /slate\.spec\.js$/,
presets: [
[
'@babel/preset-react',
{
runtime: 'classic',
pragma: 'h',
},
],
],
},
],
};
35 changes: 6 additions & 29 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"mock:server:start": "node -e 'require(\"./cypress/utils/mock-server\").start()'",
"mock:server:stop": "node -e 'require(\"./cypress/utils/mock-server\").stop()'",
"lint": "run-p -c --aggregate-output \"lint:*\"",
"lint-quiet": "run-p -c --aggregate-output \"lint:* --quiet\"",
"lint-quiet": "run-p -c --aggregate-output \"lint:*\"",
"lint:css": "stylelint --ignore-path .gitignore \"packages/**/*.{css,js,jsx,ts,tsx}\"",
"lint:js": "eslint --color --ignore-path .gitignore \"{{packages,scripts}/**/,}*.{js,jsx,ts,tsx}\"",
"lint:format": "prettier \"{{packages,scripts}/**/,}*.{js,jsx,ts,tsx,css}\" --list-different",
Expand Down Expand Up @@ -59,6 +59,7 @@
"@babel/preset-typescript": "^7.10.4",
"@commitlint/cli": "^16.0.0",
"@commitlint/config-conventional": "^16.0.0",
"@emotion/babel-plugin": "^11.13.5",
"@emotion/eslint-plugin": "^11.0.0",
"@emotion/jest": "^11.11.0",
"@octokit/rest": "^16.28.7",
Expand Down Expand Up @@ -158,7 +159,6 @@
},
"private": true,
"dependencies": {
"@emotion/babel-preset-css-prop": "^11.11.0",
"ajv": "^8.17.1",
"ajv-errors": "^3.0.0",
"ajv-keywords": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { PkceAuthenticator } from 'decap-cms-lib-auth';
Expand All @@ -8,7 +8,7 @@ const LoginButtonIcon = styled(Icon)`
margin-right: 18px;
`;

export default class GenericPKCEAuthenticationPage extends React.Component {
export default class GenericPKCEAuthenticationPage extends Component {
static propTypes = {
inProgress: PropTypes.bool,
config: PropTypes.object.isRequired,
Expand Down Expand Up @@ -72,9 +72,9 @@ export default class GenericPKCEAuthenticationPage extends React.Component {
logo={config.logo}
siteUrl={config.site_url}
renderButtonContent={() => (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="link" /> {inProgress ? t('auth.loggingIn') : t('auth.login')}
</React.Fragment>
</Fragment>
)}
t={t}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import { GitHubBackend } from 'decap-cms-backend-github';
import { PKCEAuthenticationPage } from 'decap-cms-ui-auth';

Expand Down
8 changes: 4 additions & 4 deletions packages/decap-cms-backend-azure/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { ImplicitAuthenticator } from 'decap-cms-lib-auth';
Expand All @@ -8,7 +8,7 @@ const LoginButtonIcon = styled(Icon)`
margin-right: 18px;
`;

export default class AzureAuthenticationPage extends React.Component {
export default class AzureAuthenticationPage extends Component {
static propTypes = {
onLogin: PropTypes.func.isRequired,
inProgress: PropTypes.bool,
Expand Down Expand Up @@ -76,10 +76,10 @@ export default class AzureAuthenticationPage extends React.Component {
logoUrl={config.logo_url} // Deprecated, replaced by `logo.src`
logo={config.logo}
renderButtonContent={() => (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="azure" />
{inProgress ? t('auth.loggingIn') : t('auth.loginWithAzure')}
</React.Fragment>
</Fragment>
)}
t={t}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { NetlifyAuthenticator, ImplicitAuthenticator } from 'decap-cms-lib-auth';
Expand All @@ -8,7 +8,7 @@ const LoginButtonIcon = styled(Icon)`
margin-right: 18px;
`;

export default class BitbucketAuthenticationPage extends React.Component {
export default class BitbucketAuthenticationPage extends Component {
static propTypes = {
onLogin: PropTypes.func.isRequired,
inProgress: PropTypes.bool,
Expand Down Expand Up @@ -91,10 +91,10 @@ export default class BitbucketAuthenticationPage extends React.Component {
logo={config.logo}
siteUrl={config.site_url}
renderButtonContent={() => (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="bitbucket" />
{inProgress ? t('auth.loggingIn') : t('auth.loginWithBitbucket')}
</React.Fragment>
</Fragment>
)}
t={t}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import minimatch from 'minimatch';
import { minimatch } from 'minimatch';
import { unsentRequest } from 'decap-cms-lib-util';

import type { ApiRequest, PointerFile } from 'decap-cms-lib-util';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { flow, fromPairs, map } from 'lodash/fp';
import isPlainObject from 'lodash/isPlainObject';
import isEmpty from 'lodash/isEmpty';
import minimatch from 'minimatch';
import { minimatch } from 'minimatch';
import { unsentRequest } from 'decap-cms-lib-util';

import type { ApiRequest, PointerFile } from 'decap-cms-lib-util';
Expand Down
8 changes: 4 additions & 4 deletions packages/decap-cms-backend-gitea/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { PkceAuthenticator } from 'decap-cms-lib-auth';
Expand All @@ -8,7 +8,7 @@ const LoginButtonIcon = styled(Icon)`
margin-right: 18px;
`;

export default class GiteaAuthenticationPage extends React.Component {
export default class GiteaAuthenticationPage extends Component {
static propTypes = {
inProgress: PropTypes.bool,
config: PropTypes.object.isRequired,
Expand Down Expand Up @@ -68,10 +68,10 @@ export default class GiteaAuthenticationPage extends React.Component {
logo={config.logo}
siteUrl={config.site_url}
renderButtonContent={() => (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="gitea" />{' '}
{inProgress ? t('auth.loggingIn') : t('auth.loginWithGitea')}
</React.Fragment>
</Fragment>
)}
t={t}
/>
Expand Down
8 changes: 4 additions & 4 deletions packages/decap-cms-backend-github/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { NetlifyAuthenticator } from 'decap-cms-lib-auth';
Expand All @@ -21,7 +21,7 @@ const ForkButtonsContainer = styled.div`
align-items: center;
`;

export default class GitHubAuthenticationPage extends React.Component {
export default class GitHubAuthenticationPage extends Component {
static propTypes = {
onLogin: PropTypes.func.isRequired,
inProgress: PropTypes.bool,
Expand Down Expand Up @@ -107,10 +107,10 @@ export default class GitHubAuthenticationPage extends React.Component {
return inProgress || this.state.findingFork ? (
t('auth.loggingIn')
) : (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="github" />
{t('auth.loginWithGitHub')}
</React.Fragment>
</Fragment>
);
};

Expand Down
1 change: 0 additions & 1 deletion packages/decap-cms-backend-github/src/implementation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import semaphore from 'semaphore';
import trimStart from 'lodash/trimStart';
import { stripIndent } from 'common-tags';
Expand Down
8 changes: 4 additions & 4 deletions packages/decap-cms-backend-gitlab/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import {
Expand Down Expand Up @@ -39,7 +39,7 @@ const clientSideAuthenticators = {
}),
};

export default class GitLabAuthenticationPage extends React.Component {
export default class GitLabAuthenticationPage extends Component {
static propTypes = {
onLogin: PropTypes.func.isRequired,
inProgress: PropTypes.bool,
Expand Down Expand Up @@ -114,10 +114,10 @@ export default class GitLabAuthenticationPage extends React.Component {
logo={config.logo}
siteUrl={config.site_url}
renderButtonContent={() => (
<React.Fragment>
<Fragment>
<LoginButtonIcon type="gitlab" />{' '}
{inProgress ? t('auth.loggingIn') : t('auth.loginWithGitLab')}
</React.Fragment>
</Fragment>
)}
t={t}
/>
Expand Down
Loading
Loading