-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update workflow to bundle from lib * fix: update postbundling name * fix: delete yarn install * chore: delete exports for bundling workflow
- Loading branch information
1 parent
f9b390f
commit bf118f6
Showing
5 changed files
with
61 additions
and
7 deletions.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"outputFilesTmpFolder": "tmp-lib", | ||
"outputFilesFolder": "lib" | ||
} |
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,37 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// Path to the directories | ||
const CONSTANTS = require('./constants.json'); | ||
const outputDir = `./${CONSTANTS.outputFilesFolder}`; | ||
const tmpOutputDir = `./${CONSTANTS.outputFilesTmpFolder}`; | ||
|
||
// Function to rename a directory | ||
function renameBundledFolder() { | ||
if (fs.existsSync(tmpOutputDir)) { | ||
fs.rename(tmpOutputDir, outputDir, (err) => { | ||
if (err) { | ||
return console.error(`Error renaming folder: ${err}`); | ||
} | ||
console.log(`Folder renamed from ${tmpOutputDir} to ${outputDir}`); | ||
}); | ||
} else { | ||
console.error(`${tmpOutputDir} does not exist, cannot rename.`); | ||
} | ||
} | ||
|
||
// delete the original compiled files | ||
function deleteOriginalLib() { | ||
if (fs.existsSync(outputDir)) { | ||
fs.rm(outputDir, { recursive: true, force: true }, (err) => { | ||
if (err) { | ||
return console.error(`Error deleting folder: ${err}`); | ||
} | ||
console.log(`${outputDir} is deleted.`); | ||
renameBundledFolder(); | ||
}); | ||
} | ||
} | ||
|
||
// Start the process | ||
deleteOriginalLib(); |
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