fix: package.mjs to correspond to taskmaster AI pre-releases in extensions (what vscode expects)

- chore: run format
This commit is contained in:
Ralph Khreish
2025-08-07 15:47:55 +02:00
parent 5ca1d2c710
commit 41612dd7c6
4 changed files with 42 additions and 37 deletions

View File

@@ -9,17 +9,9 @@
"engines": { "engines": {
"vscode": "^1.93.0" "vscode": "^1.93.0"
}, },
"categories": [ "categories": ["AI", "Visualization", "Education", "Other"],
"AI",
"Visualization",
"Education",
"Other"
],
"main": "./dist/extension.js", "main": "./dist/extension.js",
"activationEvents": [ "activationEvents": ["onStartupFinished", "workspaceContains:.taskmaster/**"],
"onStartupFinished",
"workspaceContains:.taskmaster/**"
],
"contributes": { "contributes": {
"viewsContainers": { "viewsContainers": {
"activitybar": [ "activitybar": [
@@ -147,11 +139,7 @@
}, },
"taskmaster.ui.theme": { "taskmaster.ui.theme": {
"type": "string", "type": "string",
"enum": [ "enum": ["auto", "light", "dark"],
"auto",
"light",
"dark"
],
"default": "auto", "default": "auto",
"description": "UI theme preference" "description": "UI theme preference"
}, },
@@ -212,12 +200,7 @@
}, },
"taskmaster.debug.logLevel": { "taskmaster.debug.logLevel": {
"type": "string", "type": "string",
"enum": [ "enum": ["error", "warn", "info", "debug"],
"error",
"warn",
"info",
"debug"
],
"default": "info", "default": "info",
"description": "Logging level" "description": "Logging level"
}, },

View File

@@ -64,23 +64,49 @@ try {
fs.readFileSync(publishPackagePath, 'utf8') fs.readFileSync(publishPackagePath, 'utf8')
); );
// Check if versions are in sync // Handle RC versions for VS Code Marketplace
if (devPackage.version !== publishPackage.version) { let finalVersion = devPackage.version;
if (finalVersion.includes('-rc.')) {
console.log( console.log(
` - Version sync needed: ${publishPackage.version}${devPackage.version}` ' - Detected RC version, transforming for VS Code Marketplace...'
); );
publishPackage.version = devPackage.version;
// Update the source package.publish.json file // Extract base version and RC number
const baseVersion = finalVersion.replace(/-rc\.\d+$/, '');
const rcMatch = finalVersion.match(/rc\.(\d+)/);
const rcNumber = rcMatch ? parseInt(rcMatch[1]) : 0;
// For each RC iteration, increment the patch version
// This ensures unique versions in VS Code Marketplace
if (rcNumber > 0) {
const [major, minor, patch] = baseVersion.split('.').map(Number);
finalVersion = `${major}.${minor}.${patch + rcNumber}`;
console.log(
` - RC version mapping: ${devPackage.version}${finalVersion}`
);
} else {
finalVersion = baseVersion;
console.log(
` - RC version mapping: ${devPackage.version}${finalVersion}`
);
}
}
// Check if versions need updating
if (publishPackage.version !== finalVersion) {
console.log(
` - Version sync needed: ${publishPackage.version}${finalVersion}`
);
publishPackage.version = finalVersion;
// Update the source package.publish.json file with the final version
fs.writeFileSync( fs.writeFileSync(
publishPackagePath, publishPackagePath,
JSON.stringify(publishPackage, null, '\t') + '\n' JSON.stringify(publishPackage, null, '\t') + '\n'
); );
console.log( console.log(` - Updated package.publish.json version to ${finalVersion}`);
` - Updated package.publish.json version to ${devPackage.version}`
);
} else { } else {
console.log(` - Versions already in sync: ${devPackage.version}`); console.log(` - Versions already in sync: ${finalVersion}`);
} }
// Copy the (now synced) package.publish.json as package.json // Copy the (now synced) package.publish.json as package.json
@@ -124,8 +150,7 @@ try {
`cd vsix-build && npx vsce package --no-dependencies` `cd vsix-build && npx vsce package --no-dependencies`
); );
// Use the synced version for output // Use the transformed version for output
const finalVersion = devPackage.version;
console.log( console.log(
`\nYour extension will be packaged to: vsix-build/task-master-${finalVersion}.vsix` `\nYour extension will be packaged to: vsix-build/task-master-${finalVersion}.vsix`
); );

View File

@@ -2,7 +2,7 @@
"name": "task-master-hamster", "name": "task-master-hamster",
"displayName": "Taskmaster AI", "displayName": "Taskmaster AI",
"description": "A visual Kanban board interface for Taskmaster projects in VS Code", "description": "A visual Kanban board interface for Taskmaster projects in VS Code",
"version": "0.23.0", "version": "0.23.1",
"publisher": "Hamster", "publisher": "Hamster",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"engines": { "engines": {

View File

@@ -9,10 +9,7 @@
"task-master-mcp": "mcp-server/server.js", "task-master-mcp": "mcp-server/server.js",
"task-master-ai": "mcp-server/server.js" "task-master-ai": "mcp-server/server.js"
}, },
"workspaces": [ "workspaces": ["apps/*", "."],
"apps/*",
"."
],
"scripts": { "scripts": {
"test": "node --experimental-vm-modules node_modules/.bin/jest", "test": "node --experimental-vm-modules node_modules/.bin/jest",
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures", "test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",