repomeld 3.0.2 → 3.0.3
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/package.json +4 -4
- package/src/utils/constants.js +3 -2
- package/src/utils/version.js +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repomeld",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Meld your entire repo into a single file — perfect for AI context & code reviews",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/
|
|
35
|
+
"url": "git+https://github.com/sakshsky/repomeld.git"
|
|
36
36
|
},
|
|
37
37
|
"bugs": {
|
|
38
|
-
"url": "https://github.com/
|
|
38
|
+
"url": "https://github.com/sakshsky/repomeld/issues"
|
|
39
39
|
},
|
|
40
|
-
"homepage": "https://github.com/
|
|
40
|
+
"homepage": "https://github.com/sakshsky/repomeld#readme"
|
|
41
41
|
}
|
package/src/utils/constants.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
+
const { getVersion } = require("./version");
|
|
2
3
|
|
|
3
4
|
// Normalize paths for cross-platform compatibility
|
|
4
5
|
const normalizePath = (p) => p.split(path.sep).join('/');
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const PACKAGE_NAME =
|
|
7
|
+
// Auto-read version from package.json
|
|
8
|
+
const { version: VERSION, name: PACKAGE_NAME } = getVersion();
|
|
8
9
|
|
|
9
10
|
const DEFAULT_IGNORE = [
|
|
10
11
|
"node_modules", ".git", ".env", ".env.local", ".env.production",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
|
|
4
|
+
// Cache the version to avoid reading file multiple times
|
|
5
|
+
let cachedVersion = null;
|
|
6
|
+
let cachedPackageName = null;
|
|
7
|
+
|
|
8
|
+
function getVersion() {
|
|
9
|
+
if (!cachedVersion) {
|
|
10
|
+
try {
|
|
11
|
+
const packageJsonPath = path.join(__dirname, "../../package.json");
|
|
12
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
13
|
+
cachedVersion = packageJson.version;
|
|
14
|
+
cachedPackageName = packageJson.name;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.warn(`⚠️ Could not read package.json: ${error.message}`);
|
|
17
|
+
cachedVersion = "0.0.0";
|
|
18
|
+
cachedPackageName = "repomeld";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return { version: cachedVersion, name: cachedPackageName };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = { getVersion };
|