Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
6633686
feat(fs): Enhance API for incremental build, add tracking readers/wri…
RandomByte Nov 18, 2025
1ef1b89
feat(server): Use incremental build in server
RandomByte Nov 18, 2025
efc0d0d
feat(builder): Adapt tasks for incremental build
RandomByte Nov 18, 2025
2ad5db1
refactor(project): Align getReader API internals with ComponentProjects
RandomByte Nov 18, 2025
c1fc387
refactor(project): Refactor specification-internal workspace handling
RandomByte Nov 18, 2025
a1e5512
refactor(project): Implement basic incremental build functionality
RandomByte Nov 18, 2025
579963f
refactor(cli): Use cache in ui5 build
RandomByte Nov 18, 2025
03c204c
refactor(project): Use cacache
RandomByte Nov 24, 2025
b13447f
refactor(project): Add cache manager
RandomByte Nov 28, 2025
ed1345b
refactor(fs): Refactor Resource internals
RandomByte Nov 27, 2025
0cf61dc
refactor(fs): Provide createBuffer factory in FileSystem adapter
RandomByte Dec 1, 2025
766be40
refactor(project): Refactor cache classes
RandomByte Dec 1, 2025
cc54a0e
refactor(fs): Add Proxy reader
RandomByte Dec 4, 2025
375e18f
refactor(project): API refactoring
RandomByte Dec 8, 2025
0aeddf2
refactor(builder): Rename task param 'buildCache' to 'cacheUtil'
RandomByte Dec 10, 2025
a5e7dda
refactor(project): Cleanup
RandomByte Dec 10, 2025
c9ade5e
refactor(project): Move resource comparison to util
RandomByte Dec 12, 2025
1bbbb37
refactor(project): Refactor stage handling
RandomByte Dec 16, 2025
653fcfa
refactor(project): Fix cache handling
RandomByte Dec 16, 2025
37af1ec
refactor(fs): Remove contentAccess mutex timeout from Resource
RandomByte Dec 16, 2025
e07e2b0
refactor(project): Cleanup obsolete code/comments
RandomByte Dec 16, 2025
13616ba
refactor(server): Cleanup obsolete code
RandomByte Dec 16, 2025
62cebbf
refactor(project): Rename watch handler events
RandomByte Dec 16, 2025
294be4b
refactor: Fix linting issues
matz3 Dec 17, 2025
e560144
test(fs): Adjust getIntegrity tests
matz3 Dec 17, 2025
c9c6745
refactor: Integrity handling
matz3 Dec 17, 2025
af53104
test(fs): Adjust getIntegrity tests again
matz3 Dec 17, 2025
3a5b477
refactor: Consider npm-shrinkwrap.json
matz3 Dec 17, 2025
ddc479d
refactor: Rename Tracker => MonitoredReader
RandomByte Dec 17, 2025
acf3642
refactor(project): Use workspace version in stage name
RandomByte Dec 17, 2025
ec1b8b1
refactor(project): Fix stage writer order
RandomByte Dec 17, 2025
fd5fc56
refactor(fs): Add Switch reader
RandomByte Dec 17, 2025
c4d4b3d
refactor(project): Cleanup WatchHandler debounce
RandomByte Dec 17, 2025
b6841f7
refactor(project): Fix outdated API call
RandomByte Dec 17, 2025
0224593
refactor(project): Fix build signature calculation
RandomByte Dec 17, 2025
03a6fc9
refactor(fs): Pass integrity to cloned resource
RandomByte Dec 17, 2025
724375e
refactor(project): Fix pattern matching and resource comparison
RandomByte Dec 17, 2025
696cc8d
refactor(project): Import/overwrite stages from cache after saving
RandomByte Dec 18, 2025
08e034e
test(builder): Sort files/folders
matz3 Dec 19, 2025
004d741
refactor(builder): Prevent duplicate entries on app build from cache
matz3 Dec 19, 2025
4736785
refactor(fs): Refactor MonitorReader API
RandomByte Dec 23, 2025
0012edd
refactor(fs): Always calculate integrity on clone
RandomByte Dec 24, 2025
73c259b
refactor(fs): Add getter to WriterCollection
RandomByte Dec 29, 2025
bc8bf96
refactor(builder): Remove cache handling from tasks
RandomByte Dec 24, 2025
a1db303
refactor(builder): Add env variable for disabling workers
RandomByte Dec 30, 2025
ca83169
refactor(project): Track resource changes using hash trees
RandomByte Dec 23, 2025
26dc101
refactor(project): Compress cache using gzip
RandomByte Jan 2, 2026
22b2ead
refactor(fs): Ensure writer collection uses unique readers
RandomByte Jan 2, 2026
ed89e70
refactor(fs): Remove write tracking from MonitoredReaderWriter
RandomByte Jan 2, 2026
d3df77b
refactor(project): Identify written resources using stage writer
RandomByte Jan 2, 2026
f589b95
refactor(project): Add basic differential update functionality
RandomByte Jan 2, 2026
35eb1c5
refactor(builder): Re-add cache handling in tasks
RandomByte Jan 7, 2026
a3855fb
refactor(project): Cleanup HashTree implementation
RandomByte Jan 7, 2026
4881d34
refactor(project): Make WatchHandler wait for build to finish before …
RandomByte Jan 7, 2026
a2ea751
refactor(project): Use cleanup hooks in update builds
RandomByte Jan 7, 2026
ba6d71f
refactor(logger): Log skipped projects/tasks info in grey color
RandomByte Jan 7, 2026
d22f3c7
refactor(project): Fix cache update mechanism
RandomByte Jan 7, 2026
4e304d8
refactor(project): WatchHandler emit error event
RandomByte Jan 7, 2026
d440e45
refactor(server): Exit process on rebuild error
RandomByte Jan 7, 2026
997836e
refactor(project): Fix delta indices
RandomByte Jan 7, 2026
0c76a16
refactor(logger): Support differential update task logging
RandomByte Jan 8, 2026
23a081c
refactor(project): Provide differential update flag to logger
RandomByte Jan 8, 2026
59b7d45
refactor(server): Log error stack on build error
RandomByte Jan 8, 2026
ab46fb1
refactor(project): Add chokidar
RandomByte Jan 8, 2026
a2d0031
refactor(project): Limit build signature to project name and config
RandomByte Jan 8, 2026
e4d0295
refactor(project): Improve ResourceRequestGraph handling
RandomByte Jan 8, 2026
a26e414
refactor(server): Remove obsolete code from serveResources middleware
matz3 Jan 8, 2026
287d25d
refactor(project): Add env variable to skip cache update
RandomByte Jan 9, 2026
69b287f
refactor(project): Fix hash tree updates
RandomByte Jan 9, 2026
b055127
refactor(project): Remove unused 'cacheDir' param
matz3 Jan 9, 2026
e76341e
fix(project): Prevent projects from being always invalidated
matz3 Jan 9, 2026
6d273fc
fix(project): Prevent exception when not building in watch mode
matz3 Jan 12, 2026
10c95b6
refactor(project): Only store new or modified cache entries
RandomByte Jan 9, 2026
579f22b
refactor(project): Refactor project cache validation
RandomByte Jan 11, 2026
5c5ea29
refactor(project): Extract project build into own method
matz3 Jan 13, 2026
ba85505
fix(project): Clear cleanup task queue
matz3 Jan 13, 2026
8d6a82d
test(project): Add ProjectBuilder integration test
matz3 Jan 13, 2026
9aefc2a
test(project): Add failing ProjectBuilder test case
matz3 Jan 13, 2026
0e55017
test(project): Enhance ProjectBuilder test assertions
matz3 Jan 13, 2026
6832290
test(project): Add library test case for ProjectBuilder
matz3 Jan 13, 2026
74e46f7
test(project): Build dependencies in application test of ProjectBuilder
matz3 Jan 13, 2026
323f21e
test(project): Refactor ProjectBuilder test code
matz3 Jan 14, 2026
21788d2
refactor(project): Refactor task resource request tracking
RandomByte Jan 14, 2026
eb2c873
test(project): Add theme-library test and update assertions for fixed…
matz3 Jan 14, 2026
454f598
test(project): Use graph.build for ProjectBuilder test
matz3 Jan 15, 2026
65ed720
test(project): Add custom task to ProjectBuilder test
matz3 Jan 15, 2026
6e7b449
fix(project): Fix custom task execution
matz3 Jan 15, 2026
f8497a7
fix(project): Prevent writing cache when project build was skipped
matz3 Jan 16, 2026
b9ee0b3
refactor(project): Create dedicated SharedHashTree class
RandomByte Jan 15, 2026
2d8611a
refactor(project): Re-implement differential task build
RandomByte Jan 15, 2026
5f4b563
refactor(project): Fix HashTree tests
RandomByte Jan 16, 2026
636a8dc
refactor(project): Fix handling cache handling of removed resources
RandomByte Jan 16, 2026
e469b86
test(project): Add cases for theme.library.e with seperate less files
maxreichmann Jan 20, 2026
6397c36
refactor(project): Update graph traversal
RandomByte Jan 20, 2026
e33191a
refactor(project): Add BuildServer and BuildReader
RandomByte Jan 16, 2026
f0c85f7
refactor(project): Refactor project result cache
RandomByte Jan 20, 2026
deff519
refactor(server): Integrate BuildServer
RandomByte Jan 20, 2026
a6212d0
refactor(project): Small build task cache restructuring, cleanup
RandomByte Jan 20, 2026
750b5af
refactor(project): JSDoc cleanup
RandomByte Jan 20, 2026
084a694
refactor(project): ProjectBuilder cleanup
RandomByte Jan 20, 2026
b03ca09
refactor(builder): Small stringReplacer cleanup
RandomByte Jan 20, 2026
6fdf297
revert(fs): Add Switch reader
RandomByte Jan 20, 2026
ae606ca
refactor(project): Add perf logging, cleanups
RandomByte Jan 20, 2026
90eace8
refactor(project): Add cache write perf logging
RandomByte Jan 20, 2026
4b80389
refactor(project): Improve stage change handling
RandomByte Jan 21, 2026
daddda6
refactor(project): Implement queue system in BuildServer
matz3 Jan 21, 2026
16bd3a5
refactor(server): Add error callback and handle in CLI
RandomByte Jan 21, 2026
209dad9
refactor(project): ProjectBuilder to provide callback on project built
RandomByte Jan 21, 2026
1ec45eb
refactor(project): Do not always include root project in build
RandomByte Jan 21, 2026
d0c8d70
refactor(project): Refactor BuildServer init, add tests
RandomByte Jan 21, 2026
134d3f9
refactor(project): Minor ProjectBuildCache and ProjectBuildContext re…
RandomByte Jan 23, 2026
c5500db
refactor(project): Handle abort signal in ProjectBuilder et al.
RandomByte Jan 23, 2026
8a00ea7
refactor(project): Refactor BuildServer queue
RandomByte Jan 23, 2026
30a4fb9
refactor(project): Fix cache invalidation tracking
RandomByte Jan 23, 2026
e794fa0
refactor(project): Fix stage restore
RandomByte Jan 26, 2026
4845c2b
refactor(project): Add cache support for custom tasks
RandomByte Jan 26, 2026
e4f909a
test(project): Add file deletion case for theme.library.e
maxreichmann Jan 26, 2026
3aa2824
fix(builder): Filter out non-JS resources in minify task
matz3 Jan 26, 2026
b0f627c
test(project): Add test case for minify task fix
matz3 Jan 26, 2026
b57ec07
test(project): Add ResourceRequestManager tests
RandomByte Jan 26, 2026
899ffbc
refactor(project): Fix derived trees unexpected upsert in parents
RandomByte Jan 26, 2026
de983ef
test(project): Adjust test cases for .library changes
matz3 Jan 26, 2026
a33ca53
fix: Ensure dot-file matching with micromatch
matz3 Jan 26, 2026
10f7133
test(project): Add test case for ui5.yaml changes
matz3 Jan 26, 2026
cad8d5f
fix(project): Handle BuildServer race condition when changing files
matz3 Jan 26, 2026
19b9520
test(project): Remove test.serial.only
matz3 Jan 26, 2026
e596a6e
deps: Fix depcheck issues
matz3 Jan 26, 2026
002367c
test(project): Update ProjectBuildCache and TaskBuildCache tests
RandomByte Jan 26, 2026
371bdb2
test(project): Update ProjectBuilder tests and JSDoc
RandomByte Jan 26, 2026
85eac90
test(project): Update TaskRunner tests
RandomByte Jan 26, 2026
e4a526d
test(project): Update various tests
RandomByte Jan 26, 2026
66daff1
test(project): Add missing comma
matz3 Jan 27, 2026
8ad4888
refactor(project): Improve abort signal handling
RandomByte Jan 27, 2026
24254bf
refactor(project): Fix additional tests
RandomByte Jan 27, 2026
06c9df0
refactor(project): Move dependency indice init into PBC
RandomByte Jan 27, 2026
dfa9a6b
fix(project): Improve BuildServer stability on resource changes
matz3 Jan 27, 2026
d6f6fba
test(project): Add case for BuildServer which requests application an…
maxreichmann Jan 27, 2026
421b5ad
test(project): Add cases
maxreichmann Jan 28, 2026
5bddb1c
test(project): Add cases for project type "module" (ProjectBuilder)
maxreichmann Jan 29, 2026
6118277
refactor(project): ProjectBuildCache state handling
RandomByte Jan 28, 2026
806ab4d
test(project): Update node_modules deps to be aligned with actual fix…
maxreichmann Feb 4, 2026
433f7ee
test(project): Add "library" dependencies to "module" fixture
maxreichmann Feb 5, 2026
cf43f0c
test(project): Update ProjectBuildContext tests
matz3 Feb 9, 2026
f2061e7
Revert "test(project): Update node_modules deps to be aligned with ac…
maxreichmann Feb 10, 2026
56e6dd0
refactor(project): Rename task param 'supportsDifferentialUpdates' =>…
RandomByte Feb 10, 2026
590612e
test(project): Extend FixtureTester (ProjectBuilder) to work with non…
maxreichmann Feb 10, 2026
549d577
test(project): Add cases for ui5.yaml path mapping (Modules)
maxreichmann Feb 10, 2026
f1d4bff
test(project): Add race condition test
RandomByte Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,272 changes: 2,723 additions & 6,549 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/builder/lib/processors/nonAsciiEscaper.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ async function nonAsciiEscaper({resources, options: {encoding}}) {
// only modify the resource's string if it was changed
if (escaped.modified) {
resource.setString(escaped.string);
return resource;
}
return resource;
}

return Promise.all(resources.map(processResource));
Expand Down
3 changes: 2 additions & 1 deletion packages/builder/lib/processors/stringReplacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ export default function({resources, options: {pattern, replacement}}) {
return Promise.all(resources.map(async (resource) => {
const content = await resource.getString();
const newContent = content.replaceAll(pattern, replacement);
// only modify the resource's string if it was changed
if (content !== newContent) {
resource.setString(newContent);
return resource;
}
return resource;
}));
}
2 changes: 1 addition & 1 deletion packages/builder/lib/tasks/buildThemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default async function({
}

let processedResources;
const useWorkers = !!taskUtil;
const useWorkers = !process.env.UI5_CLI_NO_WORKERS && !!taskUtil;
if (useWorkers) {
const threadMessageHandler = new FsMainThreadInterface(fsInterface(combo));

Expand Down
13 changes: 10 additions & 3 deletions packages/builder/lib/tasks/escapeNonAsciiCharacters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@ import nonAsciiEscaper from "../processors/nonAsciiEscaper.js";
*
* @param {object} parameters Parameters
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {string[]} [parameters.changedProjectResourcePaths] Set of changed resource paths within the project.
* This is only set if a cache is used and changes have been detected.
* @param {object} parameters.options Options
* @param {string} parameters.options.pattern Glob pattern to locate the files to be processed
* @param {string} parameters.options.encoding source file encoding either "UTF-8" or "ISO-8859-1"
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
export default async function({workspace, options: {pattern, encoding}}) {
export default async function({workspace, changedProjectResourcePaths, options: {pattern, encoding}}) {
if (!encoding) {
throw new Error("[escapeNonAsciiCharacters] Mandatory option 'encoding' not provided");
}

const allResources = await workspace.byGlob(pattern);
let allResources;
if (changedProjectResourcePaths) {
allResources = await Promise.all(changedProjectResourcePaths.map((resource) => workspace.byPath(resource)));
} else {
allResources = await workspace.byGlob(pattern);
}

const processedResources = await nonAsciiEscaper({
resources: allResources,
Expand All @@ -33,5 +40,5 @@ export default async function({workspace, options: {pattern, encoding}}) {
}
});

await Promise.all(processedResources.map((resource) => workspace.write(resource)));
await Promise.all(processedResources.map((resource) => resource && workspace.write(resource)));
}
25 changes: 21 additions & 4 deletions packages/builder/lib/tasks/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import fsInterface from "@ui5/fs/fsInterface";
* @param {object} parameters Parameters
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {@ui5/project/build/helpers/TaskUtil|object} [parameters.taskUtil] TaskUtil
* @param {string[]} [parameters.changedProjectResourcePaths] Set of changed resource paths within the project.
* This is only set if a cache is used and changes have been detected.
* @param {object} parameters.options Options
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
* @param {boolean} [parameters.options.omitSourceMapResources=false] Whether source map resources shall
Expand All @@ -26,17 +28,32 @@ import fsInterface from "@ui5/fs/fsInterface";
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
export default async function({
workspace, taskUtil, options: {pattern, omitSourceMapResources = false, useInputSourceMaps = true
}}) {
const resources = await workspace.byGlob(pattern);
workspace, taskUtil, changedProjectResourcePaths,
options: {pattern, omitSourceMapResources = false, useInputSourceMaps = true}
}) {
let resources;
if (changedProjectResourcePaths) {
resources = await Promise.all(
changedProjectResourcePaths
// Filtering out non-JS resources such as .map files
// FIXME: The changed resources should rather be matched against the provided pattern
.filter((resourcePath) => resourcePath.endsWith(".js"))
.map((resource) => workspace.byPath(resource))
);
} else {
resources = await workspace.byGlob(pattern);
}
if (resources.length === 0) {
return;
}
const processedResources = await minifier({
resources,
fs: fsInterface(workspace),
taskUtil,
options: {
addSourceMappingUrl: !omitSourceMapResources,
readSourceMappingUrl: !!useInputSourceMaps,
useWorkers: !!taskUtil,
useWorkers: !process.env.UI5_CLI_NO_WORKERS && !!taskUtil,
}
});

Expand Down
38 changes: 21 additions & 17 deletions packages/builder/lib/tasks/replaceBuildtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,30 @@ function getTimestamp() {
*
* @param {object} parameters Parameters
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {string[]} [parameters.changedProjectResourcePaths] Set of changed resource paths within the project.
* This is only set if a cache is used and changes have been detected.
* @param {object} parameters.options Options
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
export default function({workspace, options: {pattern}}) {
export default async function({workspace, changedProjectResourcePaths, options: {pattern}}) {
let resources;
if (changedProjectResourcePaths) {
resources = await Promise.all(changedProjectResourcePaths.map((resource) => workspace.byPath(resource)));
} else {
resources = await workspace.byGlob(pattern);
}
const timestamp = getTimestamp();

return workspace.byGlob(pattern)
.then((processedResources) => {
return stringReplacer({
resources: processedResources,
options: {
pattern: "${buildtime}",
replacement: timestamp
}
});
})
.then((processedResources) => {
return Promise.all(processedResources.map((resource) => {
return workspace.write(resource);
}));
});
const processedResources = await stringReplacer({
resources,
options: {
pattern: "${buildtime}",
replacement: timestamp
}
});
return Promise.all(processedResources.map((resource) => {
if (resource) {
return workspace.write(resource);
}
}));
}
40 changes: 23 additions & 17 deletions packages/builder/lib/tasks/replaceCopyright.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,38 @@ import stringReplacer from "../processors/stringReplacer.js";
*
* @param {object} parameters Parameters
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {string[]} [parameters.changedProjectResourcePaths] Set of changed resource paths within the project.
* This is only set if a cache is used and changes have been detected.
* @param {object} parameters.options Options
* @param {string} parameters.options.copyright Replacement copyright
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
export default function({workspace, options: {copyright, pattern}}) {
export default async function({workspace, changedProjectResourcePaths, options: {copyright, pattern}}) {
if (!copyright) {
return Promise.resolve();
return;
}

// Replace optional placeholder ${currentYear} with the current year
copyright = copyright.replace(/(?:\$\{currentYear\})/, new Date().getFullYear());

return workspace.byGlob(pattern)
.then((processedResources) => {
return stringReplacer({
resources: processedResources,
options: {
pattern: /(?:\$\{copyright\}|@copyright@)/g,
replacement: copyright
}
});
})
.then((processedResources) => {
return Promise.all(processedResources.map((resource) => {
return workspace.write(resource);
}));
});
let resources;
if (changedProjectResourcePaths) {
resources = await Promise.all(changedProjectResourcePaths.map((resource) => workspace.byPath(resource)));
} else {
resources = await workspace.byGlob(pattern);
}

const processedResources = await stringReplacer({
resources,
options: {
pattern: /(?:\$\{copyright\}|@copyright@)/g,
replacement: copyright
}
});
return Promise.all(processedResources.map((resource) => {
if (resource) {
return workspace.write(resource);
}
}));
}
37 changes: 21 additions & 16 deletions packages/builder/lib/tasks/replaceVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,30 @@ import stringReplacer from "../processors/stringReplacer.js";
*
* @param {object} parameters Parameters
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {string[]} [parameters.changedProjectResourcePaths] Set of changed resource paths within the project.
* This is only set if a cache is used and changes have been detected.
* @param {object} parameters.options Options
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
* @param {string} parameters.options.version Replacement version
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
export default function({workspace, options: {pattern, version}}) {
return workspace.byGlob(pattern)
.then((allResources) => {
return stringReplacer({
resources: allResources,
options: {
pattern: /\$\{(?:project\.)?version\}/g,
replacement: version
}
});
})
.then((processedResources) => {
return Promise.all(processedResources.map((resource) => {
return workspace.write(resource);
}));
});
export default async function({workspace, changedProjectResourcePaths, options: {pattern, version}}) {
let resources;
if (changedProjectResourcePaths) {
resources = await Promise.all(changedProjectResourcePaths.map((resource) => workspace.byPath(resource)));
} else {
resources = await workspace.byGlob(pattern);
}
const processedResources = await stringReplacer({
resources,
options: {
pattern: /\$\{(?:project\.)?version\}/g,
replacement: version
}
});
await Promise.all(processedResources.map((resource) => {
if (resource) {
return workspace.write(resource);
}
}));
}
4 changes: 2 additions & 2 deletions packages/builder/test/utils/fshelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export async function readFileContent(filePath) {
}

export async function directoryDeepEqual(t, destPath, expectedPath) {
const dest = await readdir(destPath, {recursive: true});
const expected = await readdir(expectedPath, {recursive: true});
const dest = (await readdir(destPath, {recursive: true})).sort();
const expected = (await readdir(expectedPath, {recursive: true})).sort();
t.deepEqual(dest, expected);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/cli/lib/cli/commands/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import baseMiddleware from "../middlewares/base.js";
import path from "node:path";

const build = {
command: "build",
Expand Down Expand Up @@ -173,6 +174,7 @@ async function handleBuild(argv) {
const buildSettings = graph.getRoot().getBuilderSettings() || {};
await graph.build({
graph,
cacheDir: path.join(graph.getRoot().getRootPath(), ".ui5-cache"),
destPath: argv.dest,
cleanDest: argv["clean-dest"],
createBuildManifest: argv["create-build-manifest"],
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/lib/cli/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ serve.handler = async function(argv) {
serverConfig.cert = cert;
}

const {h2, port: actualPort} = await serverServe(graph, serverConfig);
const {promise: pOnError, reject} = Promise.withResolvers();
const {h2, port: actualPort} = await serverServe(graph, serverConfig, function(err) {
reject(err);
});

const protocol = h2 ? "https" : "http";
let browserUrl = protocol + "://localhost:" + actualPort;
Expand Down Expand Up @@ -183,6 +186,7 @@ serve.handler = async function(argv) {
const {default: open} = await import("open");
open(browserUrl);
}
await pOnError; // Await errors that should bubble into the yargs handler
};

export default serve;
49 changes: 49 additions & 0 deletions packages/fs/lib/MonitoredReader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import AbstractReader from "./AbstractReader.js";

export default class MonitoredReader extends AbstractReader {
#reader;
#sealed = false;
#paths = [];
#patterns = [];

constructor(reader) {
super(reader.getName());
this.#reader = reader;
}

getResourceRequests() {
this.#sealed = true;
return {
paths: this.#paths,
patterns: this.#patterns,
};
}

async _byGlob(virPattern, options, trace) {
if (this.#sealed) {
throw new Error(`Unexpected read operation after reader has been sealed`);
}
if (this.#reader.resolvePattern) {
const resolvedPattern = this.#reader.resolvePattern(virPattern);
this.#patterns.push(resolvedPattern);
} else {
this.#patterns.push(virPattern);
}
return await this.#reader._byGlob(virPattern, options, trace);
}

async _byPath(virPath, options, trace) {
if (this.#sealed) {
throw new Error(`Unexpected read operation after reader has been sealed`);
}
if (this.#reader.resolvePath) {
const resolvedPath = this.#reader.resolvePath(virPath);
if (resolvedPath) {
this.#paths.push(resolvedPath);
}
} else {
this.#paths.push(virPath);
}
return await this.#reader._byPath(virPath, options, trace);
}
}
Loading
Loading