-
Notifications
You must be signed in to change notification settings - Fork 73
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
New file utils.js, moved teardown function #1080
Draft
AwesomeSauce42
wants to merge
10
commits into
opensearch-project:main
Choose a base branch
from
AwesomeSauce42:feat/shash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ce2a223
New file utils.js, moved teardown function
AwesomeSauce42 00207b5
Update scripts/compile-clean.js
AwesomeSauce42 4affdde
Update scripts/utils.js
AwesomeSauce42 cc445de
Update compile-oui.js
AwesomeSauce42 b224097
Changed CHANGELOG file
AwesomeSauce42 6ce4c04
made changes to CHANGELOG.md
AwesomeSauce42 c26371d
Merge branch 'main' into feat/shash
AwesomeSauce42 a7c05ad
made changes to CHANGELOG.md
AwesomeSauce42 f6bce76
Merge branch 'feat/shash' of https://github.com/AwesomeSauce42/oui in…
AwesomeSauce42 90119ac
made changes to CHANGELOG.md
AwesomeSauce42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ const path = require('path'); | |
const glob = require('glob'); | ||
const fs = require('fs'); | ||
const dtsGenerator = require('dts-generator').default; | ||
const { euiBuildTimeAliasTearDown} = require('./utils'); // Import the utility functions | ||
|
||
/* OUI -> EUI Aliases */ | ||
function euiBuildTimeAliasSetup() { | ||
|
@@ -157,24 +158,6 @@ function euiBuildTimeAliasTypeDef(file) { | |
fs.writeFileSync(file, '\n' + reExportStatements.join('\n'), { flag: 'a', encoding: 'utf8' }); | ||
} | ||
|
||
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'); | ||
}); | ||
} | ||
/* End of Aliases */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This marker should remain in the codebase |
||
|
||
function compileLib() { | ||
shell.mkdir( | ||
'-p', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const shell = require('shelljs'); | ||
const fs = require('fs'); | ||
|
||
<<<<<<< HEAD | ||
|
||
======= | ||
>>>>>>> cc445de2f11c9b8239d710133673ddc534d73b8f | ||
Comment on lines
+4
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there's a merge conflict remnant here |
||
/* OUI -> EUI Aliases */ | ||
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'); | ||
}); | ||
} | ||
AwesomeSauce42 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/* End of Aliases */ | ||
|
||
module.exports = { | ||
euiBuildTimeAliasTearDown, | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should also get an empty line at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright will change this