From 1168e4cc8fdba01e61a55c27353a6e4909da59e1 Mon Sep 17 00:00:00 2001 From: Alexander Gilin Date: Wed, 20 Aug 2025 14:52:32 +0300 Subject: [PATCH] feat: package name is changed BREAKING CHANGE: VS Code Marketplace Publishing Support --- examples/vscode-snippet-contrib/package.json | 42 +++---- package.json | 64 +++++------ packages/backend/package.json | 110 +++++++++---------- packages/frontend/package.json | 14 +-- packages/types/package.json | 4 +- 5 files changed, 117 insertions(+), 117 deletions(-) diff --git a/examples/vscode-snippet-contrib/package.json b/examples/vscode-snippet-contrib/package.json index bd6b57a..a25a7b2 100644 --- a/examples/vscode-snippet-contrib/package.json +++ b/examples/vscode-snippet-contrib/package.json @@ -1,28 +1,26 @@ { "name": "vscode-snippet-contrib", "displayName": "vscode-snippet-contrib", - "description": "", "version": "1.3.1", - "publisher": "SAPOSS", "private": true, - "engines": { - "vscode": "^1.44.2" - }, + "description": "", + "categories": [ + "Other" + ], "repository": { "type": "git", "url": "https://github.com/SAP/code-snippet", "directory": "vscode-snippet-contrib" }, + "publisher": "SAPOSS", "main": "./out/src/extension.js", - "extensionDependencies": [ - "saposs.code-snippet" - ], - "categories": [ - "Other" - ], - "activationEvents": [ - "onCommand:extension.showCodeSnippetContrib" - ], + "scripts": { + "ci": "npm-run-all clean compile", + "clean": "rimraf ./dist", + "compile": "tsc -p .", + "package": "vsce package --yarn .", + "watch": "tsc -p . --watch" + }, "contributes": { "commands": [ { @@ -40,13 +38,9 @@ ] } }, - "scripts": { - "ci": "npm-run-all clean compile", - "clean": "rimraf ./dist", - "package": "vsce package --yarn .", - "compile": "tsc -p .", - "watch": "tsc -p . --watch" - }, + "activationEvents": [ + "onCommand:extension.showCodeSnippetContrib" + ], "dependencies": { "@sap-devx/code-snippet-types": "^1.1.3", "comment-json": "2.1.0", @@ -58,5 +52,11 @@ "@types/fs-extra": "7.0.0", "@types/lodash": "^4.14.150", "@types/vscode": "^1.48.0" + }, + "extensionDependencies": [ + "saposs.code-snippet-framework" + ], + "engines": { + "vscode": "^1.44.2" } } diff --git a/package.json b/package.json index dbe586b..c317654 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "private": true, "workspaces": { "packages": [ - "packages/*", - "examples/*" + "examples/*", + "packages/*" ], "nohoist": [ "**/@types/jest", @@ -13,20 +13,44 @@ ] }, "scripts": { - "release:version": "lerna version", - "release:publish": "lerna publish from-git --yes --no-verify-access", "ci": "npm-run-all coverage:clean legal:* format:validate lint:validate ci:subpackages coverage:merge", "ci:subpackages": "lerna run ci", "compile": "lerna run clean && tsc --build", "compile:watch": "lerna run clean && tsc --build --watch", + "coverage:clean": "rimraf ./coverage", + "coverage:merge": "lcov-result-merger \"./coverage/lcov*.info\" \"./coverage/lcov.info\"", "format:fix": "prettier --write \"**/*.@(js|ts|vue)\" --ignore-path=.gitignore", "format:validate": "prettier --check \"**/*.@(js|ts|vue)\" --ignore-path=.gitignore", + "legal:copy": "lerna exec \"shx cp -r ../../.reuse .reuse && shx cp -r ../../LICENSES LICENSES\"", + "legal:delete": "lerna exec \"shx rm -rf .reuse LICENSES\" || true", "lint:fix": "eslint . --ext=js,ts,vue --fix --max-warnings=0 --ignore-path=.gitignore", "lint:validate": "eslint . --ext=js,ts,vue --max-warnings=0 --ignore-path=.gitignore", - "coverage:clean": "rimraf ./coverage", - "coverage:merge": "lcov-result-merger \"./coverage/lcov*.info\" \"./coverage/lcov.info\"", - "legal:delete": "lerna exec \"shx rm -rf .reuse LICENSES\" || true", - "legal:copy": "lerna exec \"shx cp -r ../../.reuse .reuse && shx cp -r ../../LICENSES LICENSES\"" + "release:publish": "lerna publish from-git --yes --no-verify-access", + "release:version": "lerna version" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "lint-staged": { + "*.{ts,js,vue}": [ + "eslint --fix --max-warnings=0 --ignore-pattern=!.*" + ], + "*.{js,ts,vue}": [ + "prettier --write" + ] + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } }, "dependencies": {}, "devDependencies": { @@ -54,29 +78,5 @@ "rimraf": "3.0.2", "shx": "0.3.3", "typescript": "~4.5.0" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, - "lint-staged": { - "*.{ts,js,vue}": [ - "eslint --fix --max-warnings=0 --ignore-pattern=!.*" - ], - "*.{js,ts,vue}": [ - "prettier --write" - ] - }, - "config": { - "commitizen": { - "path": "cz-conventional-changelog" - } - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] } } diff --git a/packages/backend/package.json b/packages/backend/package.json index ee73f00..742e2ab 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,25 +1,9 @@ { - "name": "code-snippet", + "name": "code-snippet-framework", "displayName": "Code Snippet", "version": "1.6.0", - "description": "A VSCode extension that provides a simple way to add code snippets.", - "publisher": "SAPOSS", "private": true, - "author": { - "name": "SAP SE" - }, - "license": "Apache 2.0", - "repository": { - "type": "git", - "url": "https://github.com/SAP/code-snippet.git" - }, - "bugs": { - "url": "https://github.com/SAP/code-snippet/issues" - }, - "icon": "logo.png", - "engines": { - "vscode": "^1.44.2" - }, + "description": "A VSCode extension that provides a simple way to add code snippets.", "categories": [ "Other" ], @@ -30,8 +14,35 @@ "tool", "sap" ], - "activationEvents": [], + "bugs": { + "url": "https://github.com/SAP/code-snippet/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/SAP/code-snippet.git" + }, + "license": "Apache 2.0", + "author": { + "name": "SAP SE" + }, + "publisher": "SAPOSS", "main": "./dist/extension", + "scripts": { + "backend": "npm i && npm run compile", + "bundle": "webpack --mode production", + "bundle-dev": "webpack --mode development --watch", + "ci": "npm-run-all clean compile coverage bundle frontend:copy package coverage coverage:copy", + "clean": "rimraf ./dist ./coverage *.vsix", + "clean:frontend": "cd ./dist && shx rm -rf ./media", + "compile": "tsc -p ./", + "coverage": "nyc mocha -p tsconfig.json --recursive test/**/*.spec.ts", + "coverage:copy": "shx mkdir -p ../../coverage && shx cp -u ./reports/coverage/lcov.info ../../coverage/lcov_backend.info", + "frontend:copy": "npm-run-all clean:frontend && shx cp -r ../frontend/dist/. ./dist/media/", + "package": "vsce package --yarn .", + "test": "mocha -p tsconfig.json --recursive test/**/*.spec.ts", + "watch": "tsc -watch -p ./", + "ws:run": "node ./out/src/webSocketServer/index.js" + }, "contributes": { "commands": [ { @@ -47,25 +58,6 @@ } } ], - "menus": { - "commandPalette": [ - { - "command": "loadCodeSnippet", - "when": "false" - }, - { - "command": "codeSnippet.toggleOutput", - "when": "false" - } - ], - "editor/title": [ - { - "command": "codeSnippet.toggleOutput", - "group": "navigation", - "when": "codeSnippet.Focused" - } - ] - }, "configuration": { "type": "object", "title": "Code Snippet", @@ -92,24 +84,28 @@ "scope": "resource" } } + }, + "menus": { + "commandPalette": [ + { + "command": "loadCodeSnippet", + "when": "false" + }, + { + "command": "codeSnippet.toggleOutput", + "when": "false" + } + ], + "editor/title": [ + { + "command": "codeSnippet.toggleOutput", + "group": "navigation", + "when": "codeSnippet.Focused" + } + ] } }, - "scripts": { - "ci": "npm-run-all clean compile coverage bundle frontend:copy package coverage coverage:copy", - "clean": "rimraf ./dist ./coverage *.vsix", - "backend": "npm i && npm run compile", - "clean:frontend": "cd ./dist && shx rm -rf ./media", - "frontend:copy": "npm-run-all clean:frontend && shx cp -r ../frontend/dist/. ./dist/media/", - "bundle": "webpack --mode production", - "bundle-dev": "webpack --mode development --watch", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "package": "vsce package --yarn .", - "test": "mocha -p tsconfig.json --recursive test/**/*.spec.ts", - "coverage": "nyc mocha -p tsconfig.json --recursive test/**/*.spec.ts", - "coverage:copy": "shx mkdir -p ../../coverage && shx cp -u ./reports/coverage/lcov.info ../../coverage/lcov_backend.info", - "ws:run": "node ./out/src/webSocketServer/index.js" - }, + "activationEvents": [], "dependencies": { "@sap-devx/webview-rpc": "0.3.1", "@sap/swa-for-sapbas-vsx": "2.0.4", @@ -137,5 +133,9 @@ "vsce": "^1.73.0", "webpack": "^5.89.0", "webpack-cli": "5.1.4" - } + }, + "engines": { + "vscode": "^1.44.2" + }, + "icon": "logo.png" } diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 270433b..5ab0a68 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -2,20 +2,20 @@ "name": "code-snippet-frontend", "displayName": "Code Snippet Frontend", "version": "1.6.0", - "publisher": "SAP", - "license": "Apache 2.0", - "description": "Frontend for the Code Snippet framework", "private": true, + "description": "Frontend for the Code Snippet framework", + "license": "Apache 2.0", + "publisher": "SAP", "main": "index.js", "scripts": { - "ci": "npm-run-all clean build test coverage:copy", - "clean": "rimraf ./dist ./coverage", "build": "vite build", "build-dev": "vite build --mode development", + "ci": "npm-run-all clean build test coverage:copy", + "clean": "rimraf ./dist ./coverage", + "coverage:copy": "shx mkdir -p ../../coverage && shx cp -u ./coverage/lcov.info ../../coverage/lcov_frontend.info", "lint": "vue-cli-service lint", - "test": "jest -w 1 --colors", "serve": "vite", - "coverage:copy": "shx mkdir -p ../../coverage && shx cp -u ./coverage/lcov.info ../../coverage/lcov_frontend.info" + "test": "jest -w 1 --colors" }, "dependencies": { "@mdi/font": "5.1.45", diff --git a/packages/types/package.json b/packages/types/package.json index f689aca..3003900 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,12 +1,12 @@ { "name": "@sap-devx/code-snippet-types", - "description": "code-snippet types", "version": "1.1.3", - "license": "Apache-2.0", + "description": "code-snippet types", "repository": { "type": "git", "url": "https://github.com/SAP/code-snippet.git" }, + "license": "Apache-2.0", "typings": "./api.d.ts", "files": [ ".reuse",