Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d4e3718

Browse files
committedDec 1, 2024·
chore: restore postbuild script
1 parent e189b9e commit d4e3718

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
 

‎packages/core/react/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// only for development purpose, this directive is added by tsup at build time
2+
"use client";
23

34
export * from "@nextui-org/system";
45
export * from "@nextui-org/theme";

‎packages/core/react/src/scripts/postbuild.js

+19
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const docsComponentsDir = path.resolve(rootDir, 'apps/docs/content/docs/componen
1818
const themeDir = path.resolve(packagesDir, 'core/theme'); // Theme directory path
1919

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

2225
const EXCLUDE_LIST = ['.DS_Store'];
2326

@@ -70,6 +73,22 @@ function generateComponents() {
7073
function main() {
7174
// Generate the components meta data
7275
try {
76+
// Restore the original file from the backup
77+
fs.copyFile(backupFilePath, filePath, (err) => {
78+
if (err) {
79+
return console.log(err);
80+
}
81+
console.log('The original file has been restored.');
82+
83+
// Delete the backup file
84+
fs.unlink(backupFilePath, (err) => {
85+
if (err) {
86+
return console.log(err);
87+
}
88+
console.log('The backup file has been deleted.');
89+
});
90+
});
91+
7392
generateComponents()
7493
} catch (error) {
7594
console.error(chalk.red(`Generate the components Error: ${error}`))

0 commit comments

Comments
 (0)
Please sign in to comment.