@ui5/builder
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,4 +5,14 @@ # Changelog | ||
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v1.0.2...HEAD). | ||
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v1.0.3...HEAD). | ||
<a name="v1.0.3"></a> | ||
## [v1.0.3] - 2019-03-21 | ||
### Dependency Updates | ||
- Bump [@ui5](https://github.com/ui5)/fs from 1.0.1 to 1.0.2 ([#214](https://github.com/SAP/ui5-builder/issues/214)) [`eb85e0a`](https://github.com/SAP/ui5-builder/commit/eb85e0afa1e5e82571312448ce8ab7ef87a7bcbc) | ||
- Bump [@ui5](https://github.com/ui5)/logger from 1.0.0 to 1.0.1 ([#212](https://github.com/SAP/ui5-builder/issues/212)) [`20557e8`](https://github.com/SAP/ui5-builder/commit/20557e85ac0de835b5d5ff455d613d102521d3c7) | ||
### Features | ||
- Add JSDoc build functionalities ([#42](https://github.com/SAP/ui5-builder/issues/42)) [`293a4b0`](https://github.com/SAP/ui5-builder/commit/293a4b0ae44706490fb568be69d4032150a2891a) | ||
<a name="v1.0.2"></a> | ||
@@ -129,2 +139,3 @@ ## [v1.0.2] - 2019-02-28 | ||
[v1.0.3]: https://github.com/SAP/ui5-builder/compare/v1.0.2...v1.0.3 | ||
[v1.0.2]: https://github.com/SAP/ui5-builder/compare/v1.0.1...v1.0.2 | ||
@@ -131,0 +142,0 @@ [v1.0.1]: https://github.com/SAP/ui5-builder/compare/v1.0.0...v1.0.1 |
@@ -16,2 +16,5 @@ /** | ||
moduleBundler: require("./lib/processors/bundlers/moduleBundler"), | ||
apiIndexGenerator: require("./lib/processors/jsdoc/apiIndexGenerator"), | ||
jsdocGenerator: require("./lib/processors/jsdoc/jsdocGenerator"), | ||
sdkTransformer: require("./lib/processors/jsdoc/sdkTransformer"), | ||
bootstrapHtmlTransformer: require("./lib/processors/bootstrapHtmlTransformer"), | ||
@@ -39,2 +42,5 @@ debugFileCreator: require("./lib/processors/debugFileCreator"), | ||
createDebugFiles: require("./lib/tasks/createDebugFiles"), | ||
executeJsdocSdkTransformation: require("./lib/tasks/jsdoc/executeJsdocSdkTransformation"), | ||
generateApiIndex: require("./lib/tasks/jsdoc/generateApiIndex"), | ||
generateJsdoc: require("./lib/tasks/jsdoc/generateJsdoc"), | ||
generateVersionInfo: require("./lib/tasks/generateVersionInfo"), | ||
@@ -41,0 +47,0 @@ replaceCopyright: require("./lib/tasks/replaceCopyright"), |
const log = require("@ui5/logger").getGroupLogger("builder:builder"); | ||
const resourceFactory = require("@ui5/fs").resourceFactory; | ||
const MemAdapter = require("@ui5/fs").adapters.Memory; | ||
const typeRepository = require("../types/typeRepository"); | ||
@@ -39,2 +40,3 @@ const taskRepository = require("../tasks/taskRepository"); | ||
* @param {boolean} parameters.selfContained True if a the build should be self-contained or false for prelead build bundles | ||
* @param {boolean} parameters.jsdoc True if a JSDoc build should be executed | ||
* @param {Array} parameters.includedTasks Task list to be included from build | ||
@@ -44,3 +46,3 @@ * @param {Array} parameters.excludedTasks Task list to be excluded from build | ||
*/ | ||
function composeTaskList({dev, selfContained, includedTasks, excludedTasks}) { | ||
function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}) { | ||
let selectedTasks = Object.keys(definedTasks).reduce((list, key) => { | ||
@@ -51,6 +53,9 @@ list[key] = true; | ||
// Exclude tasks: manifestBundler | ||
// Exclude non default tasks | ||
selectedTasks.generateManifestBundle = false; | ||
selectedTasks.generateStandaloneAppBundle = false; | ||
selectedTasks.transformBootstrapHtml = false; | ||
selectedTasks.generateJsdoc = false; | ||
selectedTasks.executeJsdocSdkTransformation = false; | ||
selectedTasks.generateApiIndex = false; | ||
@@ -65,2 +70,23 @@ if (selfContained) { | ||
if (jsdoc) { | ||
// Include JSDoc tasks | ||
selectedTasks.generateJsdoc = true; | ||
selectedTasks.executeJsdocSdkTransformation = true; | ||
selectedTasks.generateApiIndex = true; | ||
// Include theme build as required for SDK | ||
selectedTasks.buildThemes = true; | ||
// Exclude all tasks not relevant to JSDoc generation | ||
selectedTasks.replaceCopyright = false; | ||
selectedTasks.replaceVersion = false; | ||
selectedTasks.generateComponentPreload = false; | ||
selectedTasks.generateLibraryPreload = false; | ||
selectedTasks.generateLibraryManifest = false; | ||
selectedTasks.createDebugFiles = false; | ||
selectedTasks.uglify = false; | ||
selectedTasks.generateFlexChangesBundle = false; | ||
selectedTasks.generateManifestBundle = false; | ||
} | ||
// Only run essential tasks in development mode, it is not desired to run time consuming tasks during development. | ||
@@ -130,2 +156,3 @@ if (dev) { | ||
* @param {boolean} [parameters.selfContained=false] Flag to activate self contained build | ||
* @param {boolean} [parameters.jsdoc=false] Flag to activate JSDoc build | ||
* @param {Array} [parameters.includedTasks=[]] List of tasks to be included | ||
@@ -138,3 +165,3 @@ * @param {Array} [parameters.excludedTasks=[]] List of tasks to be excluded. If the wildcard '*' is provided, only the included tasks will be executed. | ||
tree, destPath, | ||
buildDependencies = false, dev = false, selfContained = false, | ||
buildDependencies = false, dev = false, selfContained = false, jsdoc = false, | ||
includedTasks = [], excludedTasks = [], devExcludeProject = [] | ||
@@ -147,3 +174,3 @@ }) { | ||
const selectedTasks = composeTaskList({dev, selfContained, includedTasks, excludedTasks}); | ||
const selectedTasks = composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}); | ||
@@ -157,2 +184,3 @@ const fsTarget = resourceFactory.createAdapter({ | ||
const projects = {}; // Unique project index to prevent building the same project multiple times | ||
const projectWriters = {}; // Collection of memory adapters of already built libraries | ||
@@ -198,6 +226,17 @@ const projectCountMarker = {}; | ||
const resourceCollections = resourceFactory.createCollectionsForTree(project, { | ||
useNamespaces: true | ||
useNamespaces: true, | ||
virtualReaders: projectWriters | ||
}); | ||
const writer = new MemAdapter({ | ||
virBasePath: "/" | ||
}); | ||
// Store project writer as virtual reader for parent projects | ||
// so they can access the build results of this project | ||
projectWriters[project.metadata.name] = writer; | ||
// TODO: Add getter for writer of DuplexColection | ||
const workspace = resourceFactory.createWorkspace({ | ||
virBasePath: "/", | ||
writer, | ||
reader: resourceCollections.source, | ||
@@ -210,2 +249,3 @@ name: project.metadata.name | ||
} | ||
return projectType.build({ | ||
@@ -212,0 +252,0 @@ resourceCollections: { |
@@ -5,2 +5,5 @@ const tasks = { | ||
createDebugFiles: require("./createDebugFiles"), | ||
executeJsdocSdkTransformation: require("./jsdoc/executeJsdocSdkTransformation"), | ||
generateApiIndex: require("./jsdoc/generateApiIndex"), | ||
generateJsdoc: require("./jsdoc/generateJsdoc"), | ||
uglify: require("./uglify"), | ||
@@ -7,0 +10,0 @@ buildThemes: require("./buildThemes"), |
@@ -16,3 +16,4 @@ const AbstractBuilder = require("../AbstractBuilder"); | ||
transformBootstrapHtml: require("../../tasks/transformBootstrapHtml"), | ||
uglify: require("../../tasks/uglify") | ||
uglify: require("../../tasks/uglify"), | ||
generateApiIndex: require("../../tasks/jsdoc/generateApiIndex") | ||
}; | ||
@@ -163,2 +164,12 @@ | ||
}); | ||
this.addTask("generateApiIndex", () => { | ||
return tasks.generateApiIndex({ | ||
workspace: resourceCollections.workspace, | ||
dependencies: resourceCollections.dependencies, | ||
options: { | ||
projectName: project.metadata.name | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -165,0 +176,0 @@ } |
@@ -11,2 +11,4 @@ const AbstractBuilder = require("../AbstractBuilder"); | ||
createDebugFiles: require("../../tasks/createDebugFiles"), | ||
generateJsdoc: require("../../tasks/jsdoc/generateJsdoc"), | ||
executeJsdocSdkTransformation: require("../../tasks/jsdoc/executeJsdocSdkTransformation"), | ||
generateLibraryManifest: require("../../tasks/generateLibraryManifest"), | ||
@@ -43,2 +45,41 @@ generateVersionInfo: require("../../tasks/generateVersionInfo"), | ||
this.addTask("generateJsdoc", () => { | ||
const generateJsdoc = tasks.generateJsdoc; | ||
const patterns = ["/resources/**/*.js"]; | ||
// Add excludes | ||
if (project.builder && project.builder.jsdoc && project.builder.jsdoc.excludes) { | ||
const excludes = project.builder.jsdoc.excludes.map((pattern) => { | ||
return `!/resources/${pattern}`; | ||
}); | ||
patterns.push(...excludes); | ||
} | ||
const namespace = project.metadata.name.replace(/\./g, "/"); | ||
return generateJsdoc({ | ||
workspace: resourceCollections.workspace, | ||
dependencies: resourceCollections.dependencies, | ||
options: { | ||
projectName: project.metadata.name, | ||
namespace, | ||
version: project.version, | ||
pattern: patterns | ||
} | ||
}); | ||
}); | ||
this.addTask("executeJsdocSdkTransformation", () => { | ||
const executeJsdocSdkTransformation = tasks.executeJsdocSdkTransformation; | ||
return executeJsdocSdkTransformation({ | ||
workspace: resourceCollections.workspace, | ||
dependencies: resourceCollections.dependencies, | ||
options: { | ||
projectName: project.metadata.name, | ||
dotLibraryPattern: "/resources/**/*.library", | ||
} | ||
}); | ||
}); | ||
const componentPreload = project.builder && project.builder.componentPreload; | ||
@@ -45,0 +86,0 @@ if (componentPreload) { |
{ | ||
"name": "@ui5/builder", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "UI5 Tooling - Builder", | ||
@@ -62,3 +62,4 @@ "author": "SAP SE (https://www.sap.com)", | ||
"coverage/**", | ||
"test/**" | ||
"test/**", | ||
"lib/processors/jsdoc/lib/**" | ||
], | ||
@@ -96,6 +97,6 @@ "check-coverage": true, | ||
"dependencies": { | ||
"@ui5/fs": "^1.0.1", | ||
"@ui5/logger": "^1.0.0", | ||
"@ui5/fs": "^1.0.2", | ||
"@ui5/logger": "^1.0.1", | ||
"cheerio": "^0.22.0", | ||
"escodegen": "^1.11.0", | ||
"escodegen": "^1.11.1", | ||
"escope": "^3.6.0", | ||
@@ -106,3 +107,5 @@ "esprima": "^4.0.1", | ||
"graceful-fs": "^4.1.15", | ||
"jsdoc": "^3.5.5", | ||
"less-openui5": "^0.6.0", | ||
"make-dir": "^2.0.0", | ||
"pretty-data": "^0.40.0", | ||
@@ -112,2 +115,3 @@ "pretty-hrtime": "^1.0.3", | ||
"semver": "^5.6.0", | ||
"tmp": "0.0.33", | ||
"uglify-es": "^3.2.2", | ||
@@ -121,10 +125,9 @@ "xml2js": "^0.4.17", | ||
"chai-fs": "^2.0.0", | ||
"coveralls": "^3.0.1", | ||
"coveralls": "^3.0.3", | ||
"cross-env": "^5.1.1", | ||
"docdash": "^1.0.2", | ||
"eslint": "^5.13.0", | ||
"eslint-config-google": "^0.11.0", | ||
"eslint-plugin-jsdoc": "^4.0.1", | ||
"docdash": "^1.0.3", | ||
"eslint": "^5.15.1", | ||
"eslint-config-google": "^0.12.0", | ||
"eslint-plugin-jsdoc": "^4.1.1", | ||
"extract-zip": "^1.6.7", | ||
"jsdoc": "^3.5.5", | ||
"mock-require": "^3.0.3", | ||
@@ -135,5 +138,5 @@ "nyc": "^13.3.0", | ||
"rimraf": "^2.6.3", | ||
"sinon": "^7.2.3", | ||
"sinon": "^7.2.7", | ||
"tap-nyan": "^1.1.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
575469
17
82
15269
20
5
1
+ Addedjsdoc@^3.5.5
+ Addedmake-dir@^2.0.0
+ Addedtmp@0.0.33
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.3(transitive)
+ Added@babel/types@7.26.3(transitive)
+ Added@types/linkify-it@5.0.0(transitive)
+ Added@types/markdown-it@12.2.3(transitive)
+ Added@types/mdurl@2.0.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedcatharsis@0.9.0(transitive)
+ Addedentities@2.1.0(transitive)
+ Addedescape-string-regexp@2.0.0(transitive)
+ Addedjs2xmlparser@4.0.2(transitive)
+ Addedjsdoc@3.6.11(transitive)
+ Addedklaw@3.0.0(transitive)
+ Addedlinkify-it@3.0.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmake-dir@2.1.0(transitive)
+ Addedmarkdown-it@12.3.2(transitive)
+ Addedmarkdown-it-anchor@8.6.7(transitive)
+ Addedmarked@4.3.0(transitive)
+ Addedmdurl@1.0.1(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedpify@4.0.1(transitive)
+ Addedrequizzle@0.2.4(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedtaffydb@2.6.2(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addeduc.micro@1.0.6(transitive)
+ Addedunderscore@1.13.7(transitive)
+ Addedxmlcreate@2.0.4(transitive)
Updated@ui5/fs@^1.0.2
Updated@ui5/logger@^1.0.1
Updatedescodegen@^1.11.1