Skip to content

Commit

Permalink
chore: restore postbuild script
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Dec 1, 2024
1 parent e189b9e commit d4e3718
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// only for development purpose, this directive is added by tsup at build time
"use client";

export * from "@nextui-org/system";
export * from "@nextui-org/theme";
Expand Down
19 changes: 19 additions & 0 deletions packages/core/react/src/scripts/postbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const docsComponentsDir = path.resolve(rootDir, 'apps/docs/content/docs/componen
const themeDir = path.resolve(packagesDir, 'core/theme'); // Theme directory path

const baseDocs = 'https://nextui.org/docs/components';
const filePath = './src/index.ts'; // Updated file path
const backupFilePath = filePath + '.backup.ts'; // Backup file


const EXCLUDE_LIST = ['.DS_Store'];

Expand Down Expand Up @@ -70,6 +73,22 @@ function generateComponents() {
function main() {
// Generate the components meta data
try {
// Restore the original file from the backup
fs.copyFile(backupFilePath, filePath, (err) => {
if (err) {
return console.log(err);
}
console.log('The original file has been restored.');

// Delete the backup file
fs.unlink(backupFilePath, (err) => {
if (err) {
return console.log(err);
}
console.log('The backup file has been deleted.');
});
});

generateComponents()
} catch (error) {
console.error(chalk.red(`Generate the components Error: ${error}`))
Expand Down

0 comments on commit d4e3718

Please sign in to comment.