Skip to content

Commit cd48b08

Browse files
committed
fix: Update package.json and publish script for correct URLs and improved publishing process
1 parent 8c7422e commit cd48b08

2 files changed

Lines changed: 29 additions & 22 deletions

File tree

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
"license": "BUSL-1.1",
99
"repository": {
1010
"type": "git",
11-
"url": "git@github.com:ControlForge-Systems/controlforge-structured-text.git"
11+
"url": "https://github.com/ControlForge-Systems/controlforge-structured-text"
1212
},
1313
"bugs": {
1414
"url": "https://github.com/ControlForge-Systems/controlforge-structured-text/issues"
1515
},
1616
"homepage": "https://controlforge.dev/",
1717
"icon": "icon.png",
18+
"baseContentUrl": "https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main",
19+
"baseImagesUrl": "https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main/images",
1820
"engines": {
1921
"vscode": "^1.100.0"
2022
},
@@ -85,11 +87,8 @@
8587
"vscode:prepublish": "npm run compile",
8688
"compile": "tsc -p ./",
8789
"watch": "tsc -watch -p ./",
88-
"package": "vsce package",
89-
"publish": "vsce publish",
90-
"set-pat": "vsce login ControlForgeSystems",
91-
"publish:secure": "./publish-extension.sh",
92-
"publish:pat": "vsce publish -p $VSCE_PAT"
90+
"package": "vsce package --baseContentUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main --baseImagesUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main/images",
91+
"publish": "vsce publish --baseContentUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main --baseImagesUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main/images"
9392
},
9493
"dependencies": {
9594
"vscode-languageclient": "^9.0.1",
@@ -108,4 +107,4 @@
108107
"mocha": "^11.6.0",
109108
"typescript": "^4.9.4"
110109
}
111-
}
110+
}

publish-extension.sh

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
#!/bin/bash
2-
# Script for securely publishing VS Code extension
32

4-
# Check if PAT is provided
5-
if [ -z "$1" ]; then
6-
echo "Error: Personal Access Token (PAT) is required"
7-
echo "Usage: ./publish-extension.sh <your-pat>"
8-
exit 1
9-
fi
3+
# Script to package and publish the ControlForge Structured Text extension
4+
5+
# Ensure script exits on error
6+
set -e
107

11-
# Export PAT as environment variable
12-
export VSCE_PAT="$1"
8+
# Display info
9+
echo "=== ControlForge Structured Text Extension Packaging ==="
10+
echo "Building and packaging extension..."
1311

14-
# Package and publish
12+
# Compile the extension
1513
npm run compile
16-
npm run package
17-
vsce publish -p "$VSCE_PAT"
1814

19-
# Clear the PAT from environment after publishing
20-
unset VSCE_PAT
15+
# Package the extension with correct image URLs
16+
vsce package --baseContentUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main --baseImagesUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main/images
17+
18+
# Ask if user wants to publish
19+
read -p "Do you want to publish the extension to VS Code Marketplace? (y/n): " PUBLISH
20+
21+
if [[ $PUBLISH == "y" || $PUBLISH == "Y" ]]; then
22+
echo "Publishing extension to VS Code Marketplace..."
23+
vsce publish --baseContentUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main --baseImagesUrl=https://github.com/ControlForge-Systems/controlforge-structured-text/raw/main/images
24+
echo "Extension published successfully!"
25+
else
26+
echo "Extension packaged but not published."
27+
echo "To publish manually, run: npm run publish"
28+
fi
2129

22-
echo "Extension published successfully!"
30+
echo "Done!"

0 commit comments

Comments
 (0)