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

Remove build-time EUI aliases in yarn clean #1061

Open
BSFishy opened this issue Oct 5, 2023 · 2 comments
Open

Remove build-time EUI aliases in yarn clean #1061

BSFishy opened this issue Oct 5, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@BSFishy
Copy link
Contributor

BSFishy commented Oct 5, 2023

Is your feature request related to a problem? Please describe.

It's not always desirable to go through the entire build process, for example, I may stop it early if I only want to see the Babel outputs. However, if I stop the build process early, I'll still have a huge number of EUI aliases in my files, which I don't want to push to my remote.

Describe the solution you'd like

It would be nice if the yarn clean script would also remove build-time EUI aliases. The code to do this is in the compile-oui.js file:

oui/scripts/compile-oui.js

Lines 160 to 175 in a1b9029

function euiBuildTimeAliasTearDown() {
console.log('Tearing down build-time EUI aliases');
shell.rm('-rf', 'src/eui_components');
// Remove any changes made at build time
shell.ls('src/components/**/*.*').forEach(file => {
if (/__snapshots__|\.d\.ts|\.test\.|\.scss/.test(file)) return;
let changed;
const content = fs.readFileSync(file, 'utf8')
.replace(/\n\/\* OUI -> EUI Aliases: Build-Time \*\/.*$/mg, () => {
changed = true;
return '';
});
if (changed) fs.writeFileSync(file, content, 'utf8');
});
}

Ideally, this is extracted into a utils.js file, and both the compile-oui.js file and compile-clean.js utilize.

Describe alternatives you've considered

Not doing this, but then I have to wait through the entire build process to get the aliases removed.

Additional context
N/a

@BSFishy BSFishy added the enhancement New feature or request label Oct 5, 2023
@BSFishy BSFishy added good first issue Good for newcomers and removed untriaged labels Oct 5, 2023
@AwesomeSauce42
Copy link

Hi, I would like to work on this issue!

@BSFishy
Copy link
Contributor Author

BSFishy commented Oct 8, 2023

Hi, I would like to work on this issue!

Great! I assigned it to you. Leave a comment if you get stuck anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants