forked from SAP/openui5-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test UI5 Tooling Task Extensibility Feature
Under development. Depends on: SAP/ui5-project#64 SAP/ui5-builder#106
- Loading branch information
1 parent
07f901c
commit dd992d8
Showing
4 changed files
with
98 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,50 @@ | ||
module.exports = { | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 8 | ||
}, | ||
"extends": ["eslint:recommended", "google"], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
"tab" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double", | ||
{ "allowTemplateLiterals": true } | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"no-negated-condition": "off", | ||
"require-jsdoc": "off", | ||
"no-mixed-requires": "off", | ||
"max-len": ["warn", 120], | ||
"no-implicit-coercion": [ | ||
2, | ||
{ "allow": ["!!"] } | ||
], | ||
"comma-dangle": "off", | ||
"no-tabs": "off", | ||
"no-console": "off", // sometimes needed by CLI | ||
'valid-jsdoc': [ | ||
2, | ||
{ | ||
requireParamDescription: false, | ||
requireReturnDescription: false, | ||
requireReturn: false, | ||
prefer: {return: 'returns'}, | ||
} | ||
], | ||
}, | ||
"root": true | ||
}; |
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 stringReplacer = require("@ui5/builder").processors.stringReplacer; | ||
|
||
/** | ||
* Generates "sap-ui-messagebundle-preload.js" file for all found message bundles | ||
* | ||
* @param {Object} parameters Parameters | ||
* @param {DuplexCollection} parameters.workspace DuplexCollection to read and write files | ||
* @param {AbstractReader} parameters.dependencies Reader or Collection to read dependency files | ||
* @param {Object} parameters.options Options | ||
* @param {string} parameters.options.projectName Project name | ||
* @param {string} [parameters.options.configuration] Task configuration if given in ui5.yaml | ||
* @returns {Promise<undefined>} Promise resolving with undefined once data has been written | ||
*/ | ||
module.exports = function({workspace, options}) { | ||
const pattern = options.configuration.pattern || "the"; | ||
|
||
return workspace.byGlob("/**/*.{js,json,html}") | ||
.then((processedResources) => { | ||
return stringReplacer({ | ||
resources: processedResources, | ||
options: { | ||
pattern: new RegExp(pattern), | ||
replacement: "pony" | ||
} | ||
}); | ||
}) | ||
.then((processedResources) => { | ||
return Promise.all(processedResources.map((resource) => { | ||
return workspace.write(resource); | ||
})); | ||
}); | ||
}; |
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
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