orangeslice 2.1.4-beta.1 → 2.1.4-beta.2
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/dist/cli.js +16 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -48,6 +48,16 @@ const CONFIG_PATH = path.join(CONFIG_DIR, "config.json");
|
|
|
48
48
|
const AGENTS_IMPORT_LINE = "@orangeslice-docs/AGENTS.md";
|
|
49
49
|
const CLAUDE_IMPORT_LINE = "@orangeslice-docs/CLAUDE.md";
|
|
50
50
|
const SUPPORTED_RUNNERS = ["npm", "bun", "pnpm", "yarn"];
|
|
51
|
+
function getOwnVersion() {
|
|
52
|
+
try {
|
|
53
|
+
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
54
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
55
|
+
return pkg.version || "latest";
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return "latest";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
51
61
|
function isDir(p) {
|
|
52
62
|
try {
|
|
53
63
|
return fs.statSync(p).isDirectory();
|
|
@@ -126,13 +136,15 @@ function getRunnerCommand(packageManager, suffix = "") {
|
|
|
126
136
|
return suffix ? `${command} ${suffix}` : command;
|
|
127
137
|
}
|
|
128
138
|
function getInstallCommand(packageManager) {
|
|
139
|
+
const version = getOwnVersion();
|
|
140
|
+
const spec = version === "latest" ? "orangeslice" : `orangeslice@${version}`;
|
|
129
141
|
if (packageManager === "bun")
|
|
130
|
-
return
|
|
142
|
+
return `bun add ${spec}`;
|
|
131
143
|
if (packageManager === "pnpm")
|
|
132
|
-
return
|
|
144
|
+
return `pnpm add ${spec}`;
|
|
133
145
|
if (packageManager === "yarn")
|
|
134
|
-
return
|
|
135
|
-
return
|
|
146
|
+
return `yarn add ${spec}`;
|
|
147
|
+
return `npm install ${spec}`;
|
|
136
148
|
}
|
|
137
149
|
function getSupportedRunnerExamples() {
|
|
138
150
|
return SUPPORTED_RUNNERS.map((packageManager) => getRunnerCommand(packageManager));
|