@naganpm/fetch-prompts 1.0.1 → 1.0.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/bin/index.js +4 -4
- package/package.json +5 -2
package/bin/index.js
CHANGED
|
@@ -12,7 +12,7 @@ if (fs.existsSync(envPath)) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Configuration - update these with your GitLab details
|
|
15
|
-
const GITLAB_PROJECT = '
|
|
15
|
+
const GITLAB_PROJECT = 'npm-packages713505/prompt-manager'; // group/project
|
|
16
16
|
const GITLAB_BRANCH = 'main'; // or 'master'
|
|
17
17
|
const PROMPTS_PATH = 'prompts'; // folder in your GitLab repo
|
|
18
18
|
const GITLAB_HOST = 'gitlab.com'; // or your self-hosted GitLab domain
|
|
@@ -91,12 +91,12 @@ async function fetchPrompts() {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
for (const file of mdFiles) {
|
|
94
|
-
// GitLab
|
|
95
|
-
const
|
|
94
|
+
// Use GitLab API to get file content (works with PRIVATE-TOKEN)
|
|
95
|
+
const fileApiUrl = `https://${GITLAB_HOST}/api/v4/projects/${encodeURIComponent(GITLAB_PROJECT)}/repository/files/${encodeURIComponent(`${PROMPTS_PATH}/${file.name}`)}/raw?ref=${GITLAB_BRANCH}`;
|
|
96
96
|
const destPath = path.join(process.cwd(), 'prompts', file.name);
|
|
97
97
|
|
|
98
98
|
console.log(`Downloading ${file.name}...`);
|
|
99
|
-
await downloadFile(
|
|
99
|
+
await downloadFile(fileApiUrl, destPath, GITLAB_TOKEN);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
console.log(`\n✓ Downloaded ${mdFiles.length} prompt(s) to ./prompts/`);
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naganpm/fetch-prompts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Fetch prompts from GitLab repository",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fetch-prompts": "bin/index.js"
|
|
7
7
|
},
|
|
8
|
-
"keywords": [
|
|
8
|
+
"keywords": [
|
|
9
|
+
"prompts",
|
|
10
|
+
"gitlab"
|
|
11
|
+
],
|
|
9
12
|
"license": "MIT",
|
|
10
13
|
"engines": {
|
|
11
14
|
"node": ">=14"
|