@ui5/builder 3.0.0-alpha.1 → 3.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,17 +10,25 @@ const minifier = require("../processors/minifier");
10
10
  * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil
11
11
  * @param {object} parameters.options Options
12
12
  * @param {string} parameters.options.pattern Pattern to locate the files to be processed
13
+ * @param {boolean} [parameters.options.omitSourceMapResources=true] Whether source map resources shall
14
+ * be tagged as "OmitFromBuildResult" and no sourceMappingURL shall be added to the minified resource
13
15
  * @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
14
16
  */
15
- module.exports = async function({workspace, taskUtil, options: {pattern}}) {
17
+ module.exports = async function({workspace, taskUtil, options: {pattern, omitSourceMapResources = true}}) {
16
18
  const resources = await workspace.byGlob(pattern);
17
- const processedResources = await minifier({resources});
19
+ const processedResources = await minifier({
20
+ resources,
21
+ addSourceMappingUrl: !omitSourceMapResources
22
+ });
18
23
 
19
24
  return Promise.all(processedResources.map(async ({resource, dbgResource, sourceMapResource}) => {
20
25
  if (taskUtil) {
21
26
  taskUtil.setTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant);
22
27
  taskUtil.setTag(dbgResource, taskUtil.STANDARD_TAGS.IsDebugVariant);
23
- taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.OmitFromBuildResult);
28
+ taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.HasDebugVariant);
29
+ if (omitSourceMapResources) {
30
+ taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.OmitFromBuildResult);
31
+ }
24
32
  }
25
33
  return Promise.all([
26
34
  workspace.write(resource),
@@ -28,7 +28,7 @@ class LibraryBuilder extends AbstractBuilder {
28
28
  workspace: resourceCollections.workspace,
29
29
  options: {
30
30
  copyright: project.metadata.copyright,
31
- pattern: "/resources/**/*.{js,library,less,theme}"
31
+ pattern: "/**/*.{js,library,css,less,theme,html}"
32
32
  }
33
33
  });
34
34
  });
@@ -38,7 +38,7 @@ class LibraryBuilder extends AbstractBuilder {
38
38
  workspace: resourceCollections.workspace,
39
39
  options: {
40
40
  version: project.version,
41
- pattern: "/resources/**/*.{js,json,library,less,theme}"
41
+ pattern: "/**/*.{js,json,library,less,theme,html}"
42
42
  }
43
43
  });
44
44
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/builder",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "UI5 Tooling - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -37,13 +37,14 @@
37
37
  "jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
38
38
  "jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
39
39
  "preversion": "npm test",
40
- "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
40
+ "version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
41
41
  "postversion": "git push --follow-tags",
42
- "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
42
+ "release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
43
43
  "depcheck": "depcheck --ignores docdash"
44
44
  },
45
45
  "files": [
46
46
  "index.js",
47
+ "CHANGELOG.md",
47
48
  "CONTRIBUTING.md",
48
49
  "jsdoc.json",
49
50
  "lib/**",
@@ -109,7 +110,7 @@
109
110
  "cheerio": "1.0.0-rc.9",
110
111
  "escape-unicode": "^0.2.0",
111
112
  "escope": "^3.6.0",
112
- "espree": "^9.3.0",
113
+ "espree": "^9.3.1",
113
114
  "globby": "^11.1.0",
114
115
  "graceful-fs": "^4.2.9",
115
116
  "jsdoc": "^3.6.7",
@@ -120,6 +121,7 @@
120
121
  "replacestream": "^4.0.3",
121
122
  "rimraf": "^3.0.2",
122
123
  "semver": "^7.3.5",
124
+ "sourcemap-codec": "^1.4.8",
123
125
  "terser": "^5.10.0",
124
126
  "xml2js": "^0.4.23",
125
127
  "yazl": "^2.5.1"