create-jsc-vite-react-ts 1.1.0 ā 1.2.0
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
package/template/package.json
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"test": "vitest",
|
|
12
12
|
"test:ui": "vitest --ui",
|
|
13
13
|
"test:coverage": "vitest --coverage",
|
|
14
|
-
|
|
14
|
+
"format": "prettier --write .",
|
|
15
|
+
"update-version": "./update-version.sh",
|
|
16
|
+
"create-tag": "./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,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
|