-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create new module for bas extension (#544)
* feat: create new module for bas extension * fix: review comments
- Loading branch information
1 parent
36161c7
commit de4eb8a
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# A wrapper module for BAS simple extension | ||
|
||
This is a wrapper module for BAS simple extension around Language Support For SAPUI5. |
28 changes: 28 additions & 0 deletions
28
packages/vscode-ui5-language-assistant-bas-ext/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext", | ||
"description": "A wrapper module for BAS simple extension around Language Support For SAPUI5", | ||
"license": "Apache-2.0", | ||
"version": "3.3.1", | ||
"private": false, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SAP/ui5-language-assistant" | ||
}, | ||
"scripts": { | ||
"ci": "node ./scripts/copy" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"vscode-ui5-language-assistant": "3.3.1", | ||
"fs-extra": "10.1.0" | ||
}, | ||
"files": [ | ||
"*.vsix", | ||
"README.md", | ||
".reuse", | ||
"LICENSES" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/vscode-ui5-language-assistant-bas-ext/scripts/copy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const { copySync, readdirSync } = require("fs-extra"); | ||
const { join } = require("path"); | ||
|
||
const baseSrc = join(__dirname, "..", "..", "vscode-ui5-language-assistant"); | ||
const baseDes = join(__dirname, ".."); | ||
|
||
const vsixFiles = []; | ||
readdirSync(baseSrc).forEach((item) => { | ||
if (item.endsWith(".vsix")) { | ||
vsixFiles.push(item); | ||
return item; | ||
} | ||
}); | ||
if (vsixFiles.length > 1) { | ||
throw new Error( | ||
`Detected more than one ".vsix" files. There should be only one ".vsix" file. Please cross check and try again.`, | ||
{ cause: vsixFiles } | ||
); | ||
} | ||
const vsixFile = vsixFiles.pop(); | ||
if (!vsixFile) { | ||
console.log(`There is not vsix under ${baseSrc}`); | ||
throw new Error( | ||
`There is no ".vsix" file. Please make sure a recent ".vsix" file is build under ${baseSrc} and try again.`, | ||
{ cause: vsixFiles } | ||
); | ||
} | ||
const srcVsix = join(baseSrc, vsixFile); | ||
const destinationVsix = join(baseDes, vsixFile); | ||
console.log(`Copying from ${srcVsix} to ${destinationVsix}`); | ||
copySync(srcVsix, destinationVsix); | ||
console.log("Copying finished successfully"); |