Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ coverage
**/Generated
**/build
css
packages/react-icons/src/index.js
packages/react-icons/src/icons

# package managers
yarn-error.log
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"jest": "24.1.0",
"jest-cli": "24.1.0",
"lerna": "3.16.2",
"minimist": "^1.2.0",
"mutation-observer": "^1.0.3",
"plop": "^2.0.0",
"prettier": "^1.18.2",
Expand All @@ -75,7 +74,7 @@
"generate": "yarn plop",
"lint:md": "yarn eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache",
"lint:ts": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --ext js,jsx,ts,tsx --cache",
"lint:versions": "node ./scripts/verifyCoreVersions.js",
"lint:versions": "node ./scripts/verifyPatternflyVersions.js",
"prettier": "node node_modules/.bin/prettier --write \"packages/**/*.{js,ts,tsx}\" \"scripts/**/*.{js,ts,tsx}\"",
"serve:docs": "lerna run serve",
"serve:integration": "lerna run serve:demo-app",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-catalog-view-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-styles": "^4.0.2",
"classnames": "^2.2.5",
"patternfly": "^3.59.4"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"homepage": "https://github.com/patternfly/patternfly-react#readme",
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-tokens": "^4.0.2",
"hoist-non-react-statics": "^3.3.0",
"lodash": "^4.17.15",
"victory": "^33.0.5",
Expand Down
5 changes: 5 additions & 0 deletions packages/react-charts/src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ declare module 'victory-core' {
export const Path: any;
export const TextSize: any;
}

declare module 'hoist-non-react-statics' {
const hoist: any;
export default hoist;
}
1 change: 0 additions & 1 deletion packages/react-codemods/transforms/pf3-pf4.button.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { EOL as SYSTEM_EOL } from 'os';
import prettier from 'prettier';
import { defineInlineTest } from 'jscodeshift/dist/testUtils';
import transform from './pf3-pf4';
Expand Down
35 changes: 35 additions & 0 deletions packages/react-codemods/transforms/pf3-pf4.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ try {
const oldPackage = 'patternfly-react';
const newPackage = '@patternfly/react-core';

/**
* @param {string} specifiedComponents glob of specified components
*/
function getFilteredComponentConfig(specifiedComponents = '*') {
if (specifiedComponents === '*') {
return componentConfigs;
Expand All @@ -37,6 +40,10 @@ module.exports = (file, api, options) => {
const root = j(file.source);
const filteredConfig = getFilteredComponentConfig(options.components);

/**
* @param {string} importName import name
* @param {string} localName local name
*/
function addComponentToReactCoreImport(importName, localName) {
const reactCoreImport = getReactCoreImport();
if (reactCoreImport.length > 0) {
Expand Down Expand Up @@ -66,6 +73,9 @@ module.exports = (file, api, options) => {
}
}

/**
* @returns {string} import after react core
*/
function findImportAfterReactCore() {
let target;
let targetName;
Expand All @@ -81,18 +91,28 @@ module.exports = (file, api, options) => {
return target;
}

/**
* @returns {object} @patternfly/react-core import
*/
function getReactCoreImport() {
return root.find(j.ImportDeclaration, {
source: { value: newPackage }
});
}

/**
* @returns {object} patternfly-react import
*/
function getPatternflyReactImport() {
return root.find(j.ImportDeclaration, {
source: { value: oldPackage }
});
}

/**
* @param {object[]} jsxElements array of JSX Elements
* @param {object[]} unsupportedProps deprecated props
*/
function verifyNoUnsupportedPropReferences(jsxElements, unsupportedProps) {
let hasSupportedPropReferences = false;
jsxElements.find(j.JSXAttribute).forEach(attrPath => {
Expand All @@ -106,11 +126,20 @@ module.exports = (file, api, options) => {
return hasSupportedPropReferences;
}

/**
* @param {object} componentConfig component config
* @param {string} propName prop name
*/
function getConfigForProp(componentConfig, propName) {
const propConfig = componentConfig.props[propName];
return typeof propConfig === 'string' ? { name: propConfig } : propConfig;
}

/**
* @param {string} prop property
* @param {string} jsxElementPath element path
* @param {object} propConfig property config
*/
function transformProp(prop, jsxElementPath, propConfig) {
const propInstances = j(jsxElementPath).find(j.JSXAttribute, {
name: { name: prop }
Expand All @@ -133,6 +162,9 @@ module.exports = (file, api, options) => {
});
}

/**
* Removes patternfly-react import
*/
function removePatternflyReactImport() {
getPatternflyReactImport().forEach(path => {
if (path.node.specifiers.length === 0) {
Expand All @@ -141,6 +173,9 @@ module.exports = (file, api, options) => {
});
}

/**
* @returns {string} pretty babel'ed version of source
*/
function getPrettySource() {
const transformedSource = root.toSource({
quote: 'auto',
Expand Down
1 change: 0 additions & 1 deletion packages/react-codemods/transforms/pf3-pf4.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { EOL as SYSTEM_EOL } from 'os';
import prettier from 'prettier';
import { defineInlineTest, runInlineTest } from 'jscodeshift/dist/testUtils';
import transform from './pf3-pf4';
Expand Down
6 changes: 3 additions & 3 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"gen:tests": "yo tsx-docgen"
},
"dependencies": {
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-tokens": "^4.0.2",
"emotion": "^9.2.9",
"exenv": "^1.2.2",
"focus-trap-react": "^4.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export const DrawerPanelContent: React.SFC<DrawerPanelContentProps> = ({
...props
}: DrawerPanelContentProps) => (
<aside className={css(styles.drawerPanel, className)} {...props}>
<div className={css(styles.drawerPanelBody, noPadding && styles.modifiers.noPadding)}>{children}</div>
<div className={css(styles.drawerBody, noPadding && styles.modifiers.noPadding)}>{children}</div>
</aside>
);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`Drawer isExpanded = false and isInline = false 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -50,7 +50,7 @@ exports[`Drawer isExpanded = false and isInline = true 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -80,7 +80,7 @@ exports[`Drawer isExpanded = true and isInline = false 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -110,7 +110,7 @@ exports[`Drawer isExpanded = true and isInline = true 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`DrawerPanelContent should match snapshot (auto-generated) 1`] = `
className="pf-c-drawer__panel ''"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
<div>
ReactNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`Drawer isExpanded = false and isInline = false 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -50,7 +50,7 @@ exports[`Drawer isExpanded = false and isInline = true 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -80,7 +80,7 @@ exports[`Drawer isExpanded = true and isInline = false 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down Expand Up @@ -110,7 +110,7 @@ exports[`Drawer isExpanded = true and isInline = true 1`] = `
className="pf-c-drawer__panel"
>
<div
className="pf-c-drawer__panel-body"
className="pf-c-drawer__body"
>
drawer-panel
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export interface TabProps extends Omit<React.HTMLProps<HTMLAnchorElement | HTMLB
tabContentRef?: React.RefObject<any>;
}

export const Tab: React.FunctionComponent<TabProps> = ({ className = '' }: TabProps) => null;
export const Tab: React.FunctionComponent<TabProps> = () => null;
22 changes: 11 additions & 11 deletions packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"@mdx-js/mdx": "^1.1.5",
"@mdx-js/react": "^1.1.5",
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-catalog-view-extension": "^1.4.21",
"@patternfly/react-charts": "^5.3.9",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-inline-edit-extension": "^2.17.21",
"@patternfly/react-styled-system": "^3.8.8",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-table": "^2.28.2",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-topology": "^2.14.21",
"@patternfly/react-virtualized-extension": "^1.4.22",
"@patternfly/react-catalog-view-extension": "^4.0.2",
"@patternfly/react-charts": "^6.0.1",
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-inline-edit-extension": "^4.0.3",
"@patternfly/react-styled-system": "^4.0.2",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-table": "^4.0.3",
"@patternfly/react-tokens": "^4.0.2",
"@patternfly/react-topology": "^4.0.3",
"@patternfly/react-virtualized-extension": "^4.0.3",
"gatsby": "2.19.12",
"gatsby-cli": "2.8.29",
"gatsby-theme-patternfly-org": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/src/createIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const createIcon = iconDefinition => {
id = `icon-title-${currentId++}`;

render() {
const { size, color, title, noStyle, noVerticalAlign, ...props } = this.props;
const { size, color, title, noVerticalAlign, ...props } = this.props;

const hasTitle = Boolean(title);
const heightWidth = getSize(size);
Expand Down
8 changes: 4 additions & 4 deletions packages/react-inline-edit-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/",
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-table": "^2.28.2",
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-table": "^4.0.3",
"classnames": "^2.2.5",
"exenv": "^1.2.2",
"reactabular-table": "^8.14.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-integration/demo-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start:demo-app": "react-scripts start"
},
"dependencies": {
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-core": "^4.0.3",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react-router": "^4.3.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-styled-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"develop": "yarn build:babel:esm --skip-initial-build --watch --verbose"
},
"dependencies": {
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-tokens": "^4.0.2",
"emotion-theming": "^9.2.9",
"react-emotion": "^9.2.9",
"styled-system": "^3.1.11"
Expand Down
8 changes: 4 additions & 4 deletions packages/react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/react-table#readme",
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-styles": "^4.0.2",
"@patternfly/react-tokens": "^4.0.2",
"classnames": "^2.2.5",
"exenv": "^1.2.2",
"lodash": "^4.17.15"
Expand Down
8 changes: 4 additions & 4 deletions packages/react-topology/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/react-topology#readme",
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-styles": "^3.7.6"
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-styles": "^4.0.2"
},
"peerDependencies": {
"prop-types": "^15.6.1",
Expand All @@ -54,7 +54,7 @@
"@babel/plugin-transform-typescript": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@patternfly/react-tokens": "^2.8.6",
"@patternfly/react-tokens": "^4.0.2",
"@types/prop-types": "^15.7.0",
"@types/react": "^16.4.0",
"@types/react-dom": "^16.4.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/react-virtualized-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/react-virtualized-extension/",
"dependencies": {
"@patternfly/patternfly": "4.0.4",
"@patternfly/react-core": "^3.142.2",
"@patternfly/react-icons": "^3.15.7",
"@patternfly/react-styles": "^3.7.6",
"@patternfly/react-core": "^4.0.3",
"@patternfly/react-icons": "^4.0.1",
"@patternfly/react-styles": "^4.0.2",
"@types/react-virtualized": "^9.21.5",
"clsx": "^1.0.1",
"dom-helpers": "^2.4.0 || ^3.0.0",
Expand Down
Loading