Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Bump PatternFly to v6
  • Loading branch information
fhlavac authored and nicolethoen committed Jun 17, 2024
commit a87e04d93c4b870ff81542fbd2468cf43d7b58e2
12 changes: 6 additions & 6 deletions fed-mini-modules.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const fse = require('fs-extra');
const glob = require('glob');
const { globSync } = require('glob');
const path = require('path');

const root = process.cwd();

const sourceFiles = glob
.sync(`${root}/src/*/`)
const sourceFiles = globSync(`${root}/src/*/`)
.map((name) => name.replace(/\/$/, ''));

const indexTypings = glob.sync(`${root}/src/index.d.ts`);
const indexTypings = globSync(`${root}/src/index.d.ts`);

async function copyTypings(files, dest) {
const cmds = [];
Expand All @@ -21,7 +20,7 @@ async function copyTypings(files, dest) {

async function createPackage(file) {
const fileName = file.split('/').pop();
const esmSource = glob.sync(`${root}/esm/${fileName}/**/index.js`)[0];
const esmSource = globSync(`${root}/esm/${fileName}/**/index.js`)[0];
/**
* Prevent creating package.json for directories with no JS files (like CSS directories)
*/
Expand All @@ -36,7 +35,7 @@ async function createPackage(file) {
main: 'index.js',
module: esmRelative,
};
const typings = glob.sync(`${root}/src/${fileName}/*.d.ts`);
const typings = globSync(`${root}/src/${fileName}/*.d.ts`);
const cmds = [];
content.typings = 'index.d.ts';
cmds.push(copyTypings(typings, `${root}/${fileName}`));
Expand All @@ -56,6 +55,7 @@ async function run(files) {
copyTypings(indexTypings, root);
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
process.exit(1);
}
Expand Down
10,680 changes: 4,964 additions & 5,716 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"eslint-plugin-react": "^7.21.4",
"eslint-plugin-react-hooks": "^4.6.0",
"fs-extra": "^9.1.0",
"glob": "^7.2.3",
"glob": "^10.4.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.2.2",
"jest-canvas-mock": "^2.4.0",
Expand All @@ -81,5 +81,9 @@
"ts-jest": "29.0.3",
"wait-on": "^7.2.0",
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@patternfly/react-tokens": "^6.0.0-alpha.24",
"sharp": "^0.33.4"
}
}
15 changes: 7 additions & 8 deletions packages/module/generate-fed-package-json.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const fse = require('fs-extra');
const glob = require('glob');
const { globSync } = require('glob');
const path = require('path');

const root = process.cwd();

const sourceFiles = glob
.sync(`${root}/src/*/`)
const sourceFiles = globSync(`${root}/src/*/`)
.map((name) => name.replace(/\/$/, ''));

const indexTypings = glob.sync(`${root}/src/index.d.ts`);
const indexTypings = globSync(`${root}/src/index.d.ts`);

const ENV_AGNOSTIC_ROOT = `${root}/dist/dynamic`

Expand All @@ -23,9 +22,9 @@ async function copyTypings(files, dest) {

async function createPackage(file) {
const fileName = file.split('/').pop();
const esmSource = glob.sync(`${root}/dist/esm/${fileName}/**/index.js`)[0];
const cjsSource = glob.sync(`${root}/dist/cjs/${fileName}/**/index.js`)[0];
const typingsSource = glob.sync(`${root}/dist/esm/${fileName}/**/index.d.ts`)[0]
const esmSource = globSync(`${root}/dist/esm/${fileName}/**/index.js`)[0];
const cjsSource = globSync(`${root}/dist/cjs/${fileName}/**/index.js`)[0];
const typingsSource = globSync(`${root}/dist/esm/${fileName}/**/index.d.ts`)[0]
/**
* Prevent creating package.json for directories with no JS files (like CSS directories)
*/
Expand All @@ -46,7 +45,7 @@ async function createPackage(file) {
main: cjsRelative,
module: esmRelative,
};
const typings = glob.sync(`${root}/src/${fileName}/*.d.ts`);
const typings = globSync(`${root}/src/${fileName}/*.d.ts`);
const cmds = [];
content.typings = tsRelative;
cmds.push(copyTypings(typings, `${root}/dist/${fileName}`));
Expand Down
4 changes: 2 additions & 2 deletions packages/module/generate-index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const fse = require('fs-extra');
const glob = require('glob');
const { globSync } = require('glob');
const path = require('path');

const root = process.cwd();

const ENV_AGNOSTIC_ROOT = `${root}/src`

const sourceFiles = glob.sync(path.resolve(__dirname, './src/*/index.ts'))
const sourceFiles = globSync(path.resolve(__dirname, './src/*/index.ts'))

async function generateIndex(files) {
// ensure the dynamic root exists
Expand Down
12 changes: 6 additions & 6 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"tag": "alpha"
},
"dependencies": {
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-icons": "^5.1.1",
"@patternfly/react-table": "^5.1.1",
"@patternfly/react-core": "^6.0.0-alpha.61",
"@patternfly/react-icons": "^6.0.0-alpha.24",
"@patternfly/react-table": "^6.0.0-alpha.61",
"react-jss": "^10.10.0",
"clsx": "^2.0.0"
},
Expand All @@ -43,9 +43,9 @@
},
"devDependencies": {
"@patternfly/patternfly-a11y": "^4.3.1",
"@patternfly/documentation-framework": "^2.0.0-alpha.57",
"@patternfly/patternfly": "^5.1.0",
"@patternfly/react-code-editor": "^5.1.1",
"@patternfly/documentation-framework": "^6.0.0-alpha.45",
"@patternfly/patternfly": "6.0.0-alpha.139",
"@patternfly/react-code-editor": "^6.0.0-alpha.61",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/react-router-dom": "^5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/module/patternfly-docs/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const centerStyle = {

const IndexPage = () => {
return (
<PageSection variant="light" style={centerStyle}>
<PageSection style={centerStyle}>
<div style={{ flex: 'none', textAlign: 'center' }}>
<Title size="4xl" headingLevel="h1">
My extension docs
Expand Down
14 changes: 7 additions & 7 deletions scripts/build-packages.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const fse = require('fs-extra');
const glob = require('glob');
const { globSync } = require('glob');
const path = require('path');

const root = process.cwd();

const foldersBlackList = [ '__snapshots__', '__mocks__' ];
const sourceFiles = glob
.sync(`${root}/src/*/`)
const sourceFiles = globSync(`${root}/src/*/`)
.filter((item) => !foldersBlackList.some((name) => item.includes(name)))
.map((name) => name.replace(/\/$/, ''));
const indexTypings = glob.sync(`${root}/src/index.d.ts`);
const indexTypings = globSync(`${root}/src/index.d.ts`);

async function copyTypings(files, dest) {
const cmds = [];
Expand All @@ -22,7 +21,7 @@ async function copyTypings(files, dest) {

async function createPackage(file, forceTypes) {
const fileName = file.split('/').pop();
const esmSource = glob.sync(`${root}/esm/${fileName}/**/index.js`)[0];
const esmSource = globSync(`${root}/esm/${fileName}/**/index.js`)[0];
/**
* Prevent creating package.json for directories with no JS files (like CSS directories)
*/
Expand All @@ -37,12 +36,12 @@ async function createPackage(file, forceTypes) {
main: 'index.js',
module: esmRelative,
};
const typings = glob.sync(`${root}/src/${fileName}/*.d.ts`);
const typings = globSync(`${root}/src/${fileName}/*.d.ts`);
const cmds = [];
if (forceTypes) {
content.typings = 'index.d.ts';
} else if (typings.length > 0) {
const hasIndex = glob.sync(`${root}/src/${fileName}/index.d.ts`).length > 0;
const hasIndex = globSync(`${root}/src/${fileName}/index.d.ts`).length > 0;
if (hasIndex) {
content.typings = 'index.d.ts';
}
Expand All @@ -67,6 +66,7 @@ async function run(files, forceTypes) {
copyTypings(indexTypings, root);
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
process.exit(1);
}
Expand Down