File tree Expand file tree Collapse file tree 4 files changed +98
-0
lines changed Expand file tree Collapse file tree 4 files changed +98
-0
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ "env" : {
3
+ "node" : true ,
4
+ "es6" : true
5
+ } ,
6
+ "parserOptions" : {
7
+ "ecmaVersion" : 8
8
+ } ,
9
+ "extends" : [ "eslint:recommended" , "google" ] ,
10
+ "rules" : {
11
+ "indent" : [
12
+ "error" ,
13
+ "tab"
14
+ ] ,
15
+ "linebreak-style" : [
16
+ "error" ,
17
+ "unix"
18
+ ] ,
19
+ "quotes" : [
20
+ "error" ,
21
+ "double" ,
22
+ { "allowTemplateLiterals" : true }
23
+ ] ,
24
+ "semi" : [
25
+ "error" ,
26
+ "always"
27
+ ] ,
28
+ "no-negated-condition" : "off" ,
29
+ "require-jsdoc" : "off" ,
30
+ "no-mixed-requires" : "off" ,
31
+ "max-len" : [ "warn" , 120 ] ,
32
+ "no-implicit-coercion" : [
33
+ 2 ,
34
+ { "allow" : [ "!!" ] }
35
+ ] ,
36
+ "comma-dangle" : "off" ,
37
+ "no-tabs" : "off" ,
38
+ "no-console" : "off" , // sometimes needed by CLI
39
+ 'valid-jsdoc' : [
40
+ 2 ,
41
+ {
42
+ requireParamDescription : false ,
43
+ requireReturnDescription : false ,
44
+ requireReturn : false ,
45
+ prefer : { return : 'returns' } ,
46
+ }
47
+ ] ,
48
+ } ,
49
+ "root" : true
50
+ } ;
Original file line number Diff line number Diff line change
1
+ const stringReplacer = require ( "@ui5/builder" ) . processors . stringReplacer ;
2
+
3
+ /**
4
+ * Generates "sap-ui-messagebundle-preload.js" file for all found message bundles
5
+ *
6
+ * @param {Object } parameters Parameters
7
+ * @param {DuplexCollection } parameters.workspace DuplexCollection to read and write files
8
+ * @param {AbstractReader } parameters.dependencies Reader or Collection to read dependency files
9
+ * @param {Object } parameters.options Options
10
+ * @param {string } parameters.options.projectName Project name
11
+ * @param {string } [parameters.options.configuration] Task configuration if given in ui5.yaml
12
+ * @returns {Promise<undefined> } Promise resolving with undefined once data has been written
13
+ */
14
+ module . exports = function ( { workspace, options} ) {
15
+ const pattern = options . configuration . pattern || "the" ;
16
+
17
+ return workspace . byGlob ( "/**/*.{js,json,html}" )
18
+ . then ( ( processedResources ) => {
19
+ return stringReplacer ( {
20
+ resources : processedResources ,
21
+ options : {
22
+ pattern : new RegExp ( pattern ) ,
23
+ replacement : "pony"
24
+ }
25
+ } ) ;
26
+ } )
27
+ . then ( ( processedResources ) => {
28
+ return Promise . all ( processedResources . map ( ( resource ) => {
29
+ return workspace . write ( resource ) ;
30
+ } ) ) ;
31
+ } ) ;
32
+ } ;
Original file line number Diff line number Diff line change 18
18
"@openui5/themelib_sap_belize" : " ^1.52.5"
19
19
},
20
20
"devDependencies" : {
21
+ "@ui5/builder" : " ^0.2.4" ,
21
22
"@ui5/cli" : " ^0.2.1" ,
22
23
"eslint" : " ^4.19.1" ,
24
+ "eslint-config-google" : " ^0.11.0" ,
23
25
"karma" : " ^2.0.5" ,
24
26
"karma-chrome-launcher" : " ^2.2.0" ,
25
27
"karma-coverage" : " ^1.1.2" ,
Original file line number Diff line number Diff line change @@ -2,3 +2,17 @@ specVersion: '0.1'
2
2
metadata :
3
3
name : openui5-sample-app
4
4
type : application
5
+ builder :
6
+ customTasks :
7
+ - name : ponyInserter
8
+ beforeTask : uglify
9
+ configuration :
10
+ pattern : the
11
+ ---
12
+ specVersion : " 0.1"
13
+ kind : extension
14
+ type : task
15
+ metadata :
16
+ name : ponyInserter
17
+ task :
18
+ path : lib/tasks/ponyInserter.js
You can’t perform that action at this time.
0 commit comments