Skip to content

Commit

Permalink
fix: improve validations
Browse files Browse the repository at this point in the history
- Issues in mta.yaml are now marked as errors
- Path validation is removed (since the path can be created during the
  build)
- Yaml syntax highlighting for mtaext files

Fix:
- mta executable is downloaded if not available for the purpose of
  validations (it's still required for generators)
  • Loading branch information
tal-sapan committed Jan 18, 2021
1 parent 9b77e30 commit 9ec6f82
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ dist
out
*.vsix


unpacked_bin
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Make sure the following tools are installed in your environment:
- [Cloud MTA Build Tool](https://github.com/SAP/cloud-mta-build-tool) to build MTA project.
- [Cloud Foundry CLI](https://github.com/cloudfoundry/cli) to work with Cloud Foundry.
- [MultiApps CF CLI Plugin](https://github.com/cloudfoundry-incubator/multiapps-cli-plugin) to deploy MTA archive to Cloud Fountry.
- [MTA tool](https://github.com/SAP/cloud-mta) for exploring and validating the multitarget application descriptor.
- [Yeoman-ui extension](https://github.com/SAP/yeoman-ui) to work with wizard.
- [MTA tool](https://github.com/SAP/cloud-mta) to add MTA modules.
- [Yeoman-ui extension](https://github.com/SAP/yeoman-ui) to add MTA modules.

### Download and Installation

Expand Down
50 changes: 43 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"*"
],
"extensionDependencies": [
"sapos.yeoman-ui"
"sapos.yeoman-ui",
"vscode.yaml"
],
"main": "./dist/extension.js",
"contributes": {
Expand All @@ -33,6 +34,14 @@
"label": "Validate MTA development descriptor and extension files"
}
],
"languages": [
{
"id": "yaml",
"extensions": [
".mtaext"
]
}
],
"jsonValidation": [
{
"fileMatch": [
Expand Down Expand Up @@ -139,7 +148,7 @@
"fs-extra": "9.0.1",
"@vscode-logging/logger": "1.2.2",
"@sap/swa-for-sapbas-vsx": "1.1.11",
"@sap/mta-lib": "1.6.5"
"@sap/mta-lib": "1.6.6"
},
"devDependencies": {
"@commitlint/cli": "11.0.0",
Expand All @@ -158,6 +167,7 @@
"chai": "4.2.0",
"conventional-changelog-cli": "2.1.1",
"conventional-recommended-bump": "6.1.0",
"copy-webpack-plugin": "7.0.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "7.17.0",
"eslint-config-prettier": "7.1.0",
Expand Down
20 changes: 20 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use strict";

const path = require("path");
const fs = require("fs");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const distPath = path.resolve(__dirname, "dist");

/**@type {import('webpack').Configuration}*/
Expand Down Expand Up @@ -36,5 +38,23 @@ const config = {
},
],
},
node: {
__dirname: false,
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: path.join(require.resolve("mta-local"), "..", "bin"),
to: path.resolve(distPath, "bin"),
},
],
}),
function (compiler) {
compiler.hooks.done.tap("ExecuteChmodOnBinMta", () => {
fs.chmodSync(path.resolve(distPath, "bin", "mta"), "755");
});
},
],
};
module.exports = config;

0 comments on commit 9ec6f82

Please sign in to comment.