diff --git a/.github/scripts/update-readme-table.ts b/.github/scripts/update-readme-table.ts new file mode 100644 index 0000000..ea608eb --- /dev/null +++ b/.github/scripts/update-readme-table.ts @@ -0,0 +1,45 @@ +import fs from 'node:fs' +import path from 'node:path' +import process from 'node:process' + +const packageJsonPath = path.join(__dirname, '../../packages/nuxt-ui-vue/package.json') // Adjust the path based on your project structure +const readmePath = path.join(__dirname, '../../README.md') + +// Read the package.json file +fs.readFile(packageJsonPath, 'utf8', (err, packageJsonData) => { + if (err) { + console.error(err) + process.exit(1) + } + + const packageJson = JSON.parse(packageJsonData) + const newNuxtUIVueVersion = packageJson.version + + // Read the README file + fs.readFile(readmePath, 'utf8', (readmeErr, data) => { + if (readmeErr) { + console.error(readmeErr) + process.exit(1) + } + + // Regular expression to match the table row with nuxt-ui-vue version + const regex = /\| nuxt-ui\s+\| nuxt-ui-vue\s+\|\s+\| [^|]*\s+\| [^|]*\s+\|/ + + // Create the replacement table row with updated nuxt-ui-vue version + const newTableRow = `| nuxt-ui | nuxt-ui-vue |\n|------------------|------------------|\n| v2.7.0 | v${newNuxtUIVueVersion} |` + + // Replace the old table row with the new one + const updatedData = data.replace(regex, newTableRow) + + // Write the updated content back to the README file + fs.writeFile(readmePath, updatedData, 'utf8', (writeErr) => { + if (writeErr) { + console.error(writeErr) + process.exit(1) + } + + // eslint-disable-next-line no-console + console.log('README table updated successfully.') + }) + }) +}) diff --git a/README.md b/README.md index 07be53c..17b9b94 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@

Nuxt-UI-Vue

+## Current Versions + +With each release of `nuxt-ui-vue`, a parallel update will be applied to `nuxt-ui-vue`, ensuring that the library is up to date and providing you, as the developer, with a seamless experience. + +Below are the current versions of both libraries: + +| nuxt-ui | nuxt-ui-vue | +|------------------|------------------| +| v2.7.0 | v0.0.7 | + ## Features - 🦾 **TypeScript Support** - Built with TypeScript in mind and from the ground up.