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

chore: remove obsolete packages #2097

Merged
merged 1 commit into from
Nov 4, 2024
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: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
{
files: ['*.ct.js', '*.ct.jsx', '*.ct.ts', '*.ct.tsx', '*.cy.js', '*.cy.jsx', '*.cy.ts', '*.cy.tsx'],
extends: ['plugin:cypress/recommended'],
}
},
],
rules: {
'@nx/dependency-checks': 'off',
Expand Down
128 changes: 9 additions & 119 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,120 +1,10 @@
require.extensions['.css'] = () => undefined;
const path = require('path');
const glob = require('glob');

const mapper = {
TextVariants: 'Text',
ButtonVariant: 'Button',
PaginationVariant: 'Pagination',
SelectVariant: 'selectConstants',
EmptyStateVariant: 'EmptyState',
DropdownPosition: 'dropdownConstants',
TextListVariants: 'TextList',
TextListItemVariants: 'TextListItem',
ClipboardCopyVariant: 'ClipboardCopy',
TooltipPosition: 'Tooltip'
};

const iconMapper = {
AnsibeTowerIcon: 'ansibeTower-icon',
ChartSpikeIcon: 'chartSpike-icon',
CloudServerIcon: 'cloudServer-icon'
};

const createPfReactTransform = (env) => [
'transform-imports',
{
'@patternfly/react-core': {
transform: (importName) => {
let res;
const pathname = path.resolve(__dirname, `node_modules/@patternfly/react-core/dist/${env}/**/${mapper[importName] || importName}.js`);
const files = glob.sync(pathname);
if (files.length > 0) {
res = files[0];
} else {
throw new Error(`File with importName ${importName} does not exist. Glob path: ${pathname}`);
}

res = res.split('/node_modules/').pop();
res = res.replace(/^\//, '');
return res;
},
preventFullImport: false,
skipDefaultConversion: true
},
'@patternfly/react-icons': {
transform: (importName) =>
`@patternfly/react-icons/dist/${env}/icons/${iconMapper[importName] || importName
.split(/(?=[A-Z])/)
.join('-')
.toLowerCase()}`,
preventFullImport: true
},
'patternfly-react': {
transform: (importName) => {
let res;
const files = glob.sync(path.resolve(__dirname, `../../node_modules/patternfly-react/dist/${env}/**/${importName}.js`));
if (files.length > 0) {
res = files[0];
} else {
throw new Error(`File with importName ${importName} does not exist`);
}

res = res.split('/node_modules/').pop();
res = res.replace(/^\//, '');
return res;
},
preventFullImport: false,
skipDefaultConversion: false
}
},
`pf-react-${env}`
];

module.exports = {
presets: [
[
'@babel/env',
{
targets: '> 0.25%, not dead'
}
],
'@babel/preset-react'
],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
'@babel/plugin-transform-runtime',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-object-rest-spread',
'babel-plugin-lodash',
'@babel/plugin-transform-react-display-name',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining'
],
env: {
cjs: {
presets: [ [ '@babel/preset-env', { modules: 'commonjs' }] ],
plugins: [
'./plugins/transform-scss-plugin',
createPfReactTransform('js')
]
},
esm: {
presets: [ [ '@babel/preset-env', { modules: false }] ],
plugins: [
[
'./plugins/transform-scss-plugin',
{
esm: true
}
],
createPfReactTransform('esm')
]
}
}
};
presets: [
[
'@babel/env',
{
targets: '> 0.25%, not dead'
}
]
]
}
14 changes: 0 additions & 14 deletions config/comment-bot.js

This file was deleted.

3 changes: 0 additions & 3 deletions config/globalSetup.js

This file was deleted.

53 changes: 0 additions & 53 deletions config/push-bot.js

This file was deleted.

134 changes: 0 additions & 134 deletions config/release.js

This file was deleted.

Loading
Loading