9 Commits

Author SHA1 Message Date
Carlos
f0c2a50c18 🔖 1.1.3 2024-08-13 21:40:56 -04:00
Carlos
4d6195699e 📚 docs: adding repository on package 2024-08-13 21:40:48 -04:00
Carlos
657608fce1 🔖 1.1.2 2024-08-13 21:37:34 -04:00
Carlos
bc086a466f 🐛 fix: fixing loop on publish on master 2024-08-13 21:37:26 -04:00
Carlos
9c57d891b8 🐛 fix: fixing loop on publish 2024-08-13 21:36:50 -04:00
Carlos
5b270f037f 🔖 1.1.1 2024-08-13 21:34:19 -04:00
Carlos
5efdad0b6b 🔖 1.1.0 2024-08-13 21:34:08 -04:00
Carlos
1500b39d92 feat: adding script on package json 2024-08-13 21:33:51 -04:00
Carlos
da424119c8 feat: adding versioning script on master and publish 2024-08-13 21:32:57 -04:00
3 changed files with 30 additions and 12 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "react-crafter",
"version": "1.0.4",
"version": "1.1.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "react-crafter",
"version": "1.0.4",
"version": "1.1.3",
"dependencies": {
"chalk": "^4.1.0",
"commander": "^7.2.0",

View File

@@ -1,6 +1,6 @@
{
"name": "react-crafter",
"version": "1.0.4",
"version": "1.1.3",
"description": "A CLI tool to quickly scaffold a React application with TypeScript, Ant Design, Sass, Webpack, and essential development tools like Husky and linters pre-configured. Perfect for kickstarting modern React projects with best practices.",
"main": "index.js",
"bin": {
@@ -24,9 +24,14 @@
"npx"
],
"author": "Carlos Gutierrez <cargdev@gmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/CarGDev/reactwizard"
},
"scripts": {
"start": "node index.js",
"test": "jest",
"publish": "node release.js",
"lint:prettier": "node check-format.js",
"pretty-quick": "pretty-quick",
"prettier": "prettier --write . --config .prettierrc",

View File

@@ -6,12 +6,22 @@ const chalk = require('chalk');
async function run() {
try {
// Prevent the script from running during npm lifecycle hooks
if (process.env.npm_lifecycle_event) {
console.log(
chalk.yellow(
'⚠️ Script is running in an npm lifecycle hook, exiting...'
)
);
return;
}
// Check if working directory is clean
const status = execSync('git status --porcelain').toString().trim();
if (status) {
console.error(
chalk.red(
'Error: Your working directory is not clean. Please commit or stash your changes first.'
'Error: Your working directory is not clean. Please commit or stash your changes first.'
)
);
process.exit(1);
@@ -19,7 +29,7 @@ async function run() {
// Pull the latest changes
console.log(
chalk.blue('Pulling the latest changes from the remote repository...')
chalk.blue('🔄 Pulling the latest changes from the remote repository...')
);
execSync('git pull origin master', { stdio: 'inherit' });
@@ -28,29 +38,32 @@ async function run() {
{
type: 'list',
name: 'versionType',
message: 'Select the type of version bump:',
message: '🔢 Select the type of version bump:',
choices: ['patch', 'minor', 'major'],
},
]);
// Bump the version
console.log(chalk.blue(`Bumping the ${versionType} version...`));
console.log(chalk.blue(`📦 Bumping the ${versionType} version...`));
execSync(`npm version ${versionType}`, { stdio: 'inherit' });
// Commit and push changes
console.log(chalk.blue('Pushing changes to the remote repository...'));
console.log(chalk.blue('🚀 Pushing changes to the remote repository...'));
execSync('git push origin master --follow-tags', { stdio: 'inherit' });
// Publish the package
//console.log(chalk.blue('Publishing the package to npm...'));
//execSync('npm publish', { stdio: 'inherit' });
console.log(chalk.blue('📤 Publishing the package to npm...'));
execSync('npm publish', { stdio: 'inherit' });
console.log(
chalk.green(`🚀 Successfully released a new ${versionType} version!`)
chalk.green(`🚀 Successfully released a new ${versionType} version!`)
);
// Exit the process to avoid any potential loops
process.exit(0);
} catch (error) {
console.error(
chalk.red('An error occurred during the release process:'),
chalk.red('An error occurred during the release process:'),
error.message
);
process.exit(1);