When trying to publish the extension, receive error: Part URI is not valid per rules defined in the Open Packaging Conventions specification
NadavShaked opened this issue · 2 comments
Hi,
I use your repo for creating an extension for Azure Devops, and now I'm trying to upload an extension that I created by running the command 'npm run build' by using vsce command (' vsce publish --packagePath "NadavShaked.my-first-extension-1.0.972.vsix" ').
but I received this error:
What causes this problem?
see this reference, but I didn't succeed to fix it.
this is my azure-devops-extension.json file:
{ "manifestVersion": 1, "id": "my-first-extension", "publisher": "NadavShaked", "version": "1.0.968", "name": "my-first-extension", "description": "Azure DevOps Extension", "categories": [ "Azure Repos", "Azure Boards", "Azure Pipelines", "Azure Test Plans", "Azure Artifacts" ], "targets": [ { "id": "Microsoft.VisualStudio.Services" } ], "icons": { "default": "logo.png" }, "content": { "details": { "path": "overview.md" } }, "files": [ { "path": "dist", "addressable": true } ] }
this is my package.json file:
{ "id": "my-first-extension", "name": "my-first-extension", "publisher": "NadavShaked", "version": "1.0.968", "description": "Azure DevOps Extension", "keywords": [ "extensions", "Azure DevOps", "Visual Studio Team Services" ], "engines": { "vscode": "^1.8.0" }, "license": "MIT", "repository": { "type": "git", "url": "" }, "scripts": { "clean": "rimraf ./dist", "compile": "npm run clean && npm run test && webpack --mode production", "compile:dev": "npm run clean && npm run test && webpack --mode development", "build": "npm run compile", "build:dev": "npm run compile:dev && npm run postbuild", "postbuild": "npm run package-extension -- --rev-version", "package-extension": "tfx extension create --manifest-globs azure-devops-extension.json src/Samples/**/*.json", "publish-extension": "tfx extension publish --manifest-globs azure-devops-extension.json src/Samples/**/*.json", "test": "set TEST_REPORT_FILENAME=test-results.xml && jest --verbose" }, "dependencies": { "@fluentui/react": "^8.36.3", "azure-devops-extension-api": "~1.157.0", "azure-devops-extension-sdk": "~2.0.11", "azure-devops-ui": "~2.164.0", "react": "~16.13.1", "react-dom": "~16.13.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.11.0", "@testing-library/react": "^10.4.4", "@types/jest": "^26.0.3", "@types/react": "~16.8.2", "@types/react-dom": "~16.8.0", "copy-webpack-plugin": "^7.0.0", "base64-inline-loader": "~1.1.1", "css-loader": "~1.0.0", "jest": "^26.1.0", "jest-junit-reporter": "^1.1.0", "node-sass": "^5.0.0", "rimraf": "~2.6.2", "sass-loader": "~10.0.5", "style-loader": "~0.23.1", "tfx-cli": "^0.6.3", "ts-jest": "^26.1.1", "ts-loader": "~5.2.2", "typescript": "^3.9.6", "webpack": "^5.23.0", "webpack-cli": "^4.5.0" }, "jest": { "transform": { "^.+\\.(js|ts|tsx|jsx)$": "ts-jest" }, "transformIgnorePatterns": [ "node_modules/(?!(react-native|azure-devops-ui|azure-devops-extension-sdk)/)" ], "moduleNameMapper": { "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js", "\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js" }, "preset": "ts-jest/presets/js-with-babel", "testResultsProcessor": "./node_modules/jest-junit-reporter", "collectCoverage": true, "coverageReporters": [ "json", "html", "cobertura" ], "globals": { "ts-jest": { "tsconfig": "tsconfig.test.json" } } } }
I upload to git my repo:
https://github.com/NadavShaked/vstsExtension/tree/master/vsts%20extension
this is the extension by run: 'vsce package'
https://easyupload.io/skwmep
this is the extension by run: 'npm run build'
https://easyupload.io/kzopux
I prefer to publish the second extension.
vsce
is definitely not the right command to publish to Azure devops.
As you can see in your package.json
, you should use npm run publish-extension
or better npm run package-extension
and publish it by hands.
the command npm run publish-extension
works, thank!