create-jsc-vite-react-ts 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -53,11 +53,21 @@ const run = async () => {
53
53
  filter: (src) => {
54
54
  const basename = path.basename(src);
55
55
  return !["node_modules", "dist", "coverage", "yarn.lock"].includes(
56
- basename
56
+ basename,
57
57
  );
58
58
  },
59
59
  });
60
60
 
61
+ // Make files fromthe "scripts" folder executable
62
+ const scriptsDir = path.join(targetDir, "scripts");
63
+ if (fs.existsSync(scriptsDir)) {
64
+ const scriptFiles = fs.readdirSync(scriptsDir);
65
+ scriptFiles.forEach((file) => {
66
+ const filePath = path.join(scriptsDir, file);
67
+ fs.chmodSync(filePath, 0o755);
68
+ });
69
+ }
70
+
61
71
  const packageJsonPath = path.join(targetDir, "package.json");
62
72
  const packageJson = fs.readJsonSync(packageJsonPath);
63
73
  packageJson.name = projectName;
@@ -68,7 +78,7 @@ const run = async () => {
68
78
  const packageManager = await detectPackageManager();
69
79
 
70
80
  console.log(
71
- chalk.blue(`\nšŸ“¦ Installing dependencies with ${packageManager}...\n`)
81
+ chalk.blue(`\nšŸ“¦ Installing dependencies with ${packageManager}...\n`),
72
82
  );
73
83
 
74
84
  try {
@@ -79,10 +89,10 @@ const run = async () => {
79
89
  console.log(chalk.green("\nāœ“ Dependencies installed"));
80
90
  } catch (error) {
81
91
  console.log(
82
- chalk.yellow("\n⚠ Failed to install dependencies automatically")
92
+ chalk.yellow("\n⚠ Failed to install dependencies automatically"),
83
93
  );
84
94
  console.log(
85
- chalk.yellow(` Please run "${packageManager} install" manually\n`)
95
+ chalk.yellow(` Please run "${packageManager} install" manually\n`),
86
96
  );
87
97
  }
88
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jsc-vite-react-ts",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Create a modern React app with TypeScript, Vite, Tailwind CSS, and Vitest",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,10 @@
11
11
  "test": "vitest",
12
12
  "test:ui": "vitest --ui",
13
13
  "test:coverage": "vitest --coverage",
14
- "format": "prettier --write ."
14
+ "format": "prettier --write .",
15
+ "update-version": "./scripts/update-version.sh",
16
+ "create-tag": "./scripts/create-tag.sh",
17
+ "full-tag": "yarn update-version && yarn create-tag"
15
18
  },
16
19
  "dependencies": {
17
20
  "react": "^19.2.0",
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ echo "šŸ·ļø Creating new git tag"
3
+
4
+ . "$(dirname "$0")/get-tag.sh"
5
+ git tag "v$NEW_TAG"
6
+ echo "šŸ”– New tag created: v$NEW_TAG"
7
+ git push origin
8
+ git push origin "v$NEW_TAG"
9
+ echo "šŸš€ Tag creation completed."
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ # Get the latest git tag that starts with 'v'
4
+ LATEST_TAG=$(git tag -l --sort=version:refname | grep "^v" | tail -1)
5
+
6
+ # Increment the patch version of the latest tag
7
+ if [ -z "$LATEST_TAG" ]; then
8
+ NEW_TAG="0.0.1"
9
+ else
10
+ MAJOR=$(echo "$LATEST_TAG" | sed 's/^v//' | awk -F"." '{print $1}')
11
+ MINOR=$(echo "$LATEST_TAG" | sed 's/^v//' | awk -F"." '{print $2}')
12
+ PATCH=$(echo "$LATEST_TAG" | sed 's/^v//' | awk -F"." '{print $3}')
13
+ PATCH=$((PATCH + 1))
14
+ NEW_TAG="$MAJOR.$MINOR.$PATCH"
15
+ fi
16
+
17
+ export NEW_TAG
@@ -0,0 +1,24 @@
1
+ # !/bin/bash
2
+
3
+ echo "šŸš€ Updating version"
4
+
5
+ . "$(dirname "$0")/get-tag.sh"
6
+
7
+ # Echo the new tag version
8
+ echo "šŸ†• New tag version will be: $NEW_TAG"
9
+
10
+ # Update the version field in package.json
11
+ PACKAGE_JSON_PATH="package.json"
12
+ if [ -f "$PACKAGE_JSON_PATH" ]; then
13
+ # Use jq to update the version field
14
+ jq --arg new_version "$NEW_TAG" '.version = $new_version' "$PACKAGE_JSON_PATH" > "${PACKAGE_JSON_PATH}.tmp" && mv "${PACKAGE_JSON_PATH}.tmp" "$PACKAGE_JSON_PATH"
15
+ echo "šŸ“¦ Updated package.json version to $NEW_TAG"
16
+ fi
17
+
18
+ git add "$PACKAGE_JSON_PATH"
19
+ git commit -m "chore: bump version to $NEW_TAG"
20
+
21
+ # Echo a message indicating the pre-push hook is running with emoji
22
+ echo "šŸš€ Version updated."
23
+
24
+ exit 0