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

Fix/react core pkg #4204

Merged
merged 3 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-gorillas-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/react": patch
---

Fix double 'use client'
3 changes: 2 additions & 1 deletion packages/core/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
},
"scripts": {
"build": "tsup --dts",
"postbuild": "node src/scripts/postbuild.js",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup",
"prepack": "clean-package",
"postbuild": "node src/scripts/postbuild.js",
"prebuild": "node src/scripts/prebuild.js",
"postpack": "clean-package restore"
},
"dependencies": {
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
Loading