Skip to content

Conversation

@Shinoni
Copy link
Contributor

@Shinoni Shinoni commented Feb 11, 2026

What does this PR do?

Removed the requirement that webapplication.json must exist. If it exists, we check that the files it references are present. If it's missing or force-ignored, we require a non-empty dist/index.html instead. This supports apps without a JSON config and allows force-ignoring the descriptor.

What issues does this PR fix or reference?

N/A

#, @@

Functionality Before

webapplication.json was required, and at least one content file (besides the metadata XML) was required.

Functionality After

webapplication.json is optional; if present, we validate its fields and check that referenced files exist; if missing or force-ignored, we require a non-empty dist/index.html instead.

@Shinoni Shinoni requested a review from a team as a code owner February 11, 2026 22:02
@Shinoni Shinoni force-pushed the lt/web-app-descriptor-validation branch from b1382cc to c11198b Compare February 11, 2026 22:16
}

if (!config.outputDir || typeof config.outputDir !== 'string') {
this.expectedSourceError(descriptorPath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these output the props that are missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Pushed the fix that will output all missing props.

Copy link

@k-j-kim k-j-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than a more specific error message for missing props, lgtm!

}
if (this.tree.readFileSync(indexPath).length === 0) {
this.expectedSourceError(indexPath);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The errors messages (below) for validating the webapplication.json contents are really clear. These errors here too feel vague. How about something like: If a webapplication.json file does not exist, you are require to include a 'dist/index.tml' file. This will be the entry point for your webapplication

} catch (e) {
const detail = e instanceof Error ? e.message : String(e);
throw new SfError(`Invalid JSON in webapplication.json: ${detail}`, 'InvalidJsonError');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question for the webapplication.json file and its contents: Do you have any public docs you could link to for the correct structure of this config file? This could help users validate all potential errors in a single pass rather than fixing one, getting an error, fixing one, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. We’re still working on finalizing its structure, but for now we’ve defined the required properties.

);
}

const fallbackPath = join(outputDirPath, config.routing.fallback.replace(/^\//, ''));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this replace use path.sep instead?


const fallbackPath = join(outputDirPath, config.routing.fallback.replace(/^\//, ''));
if (!this.tree.exists(fallbackPath)) {
this.expectedSourceError(fallbackPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also feels too vague. "The filepath defined in the webapplication.json -> routing.fallback was not found. Ensure this file exists at the location defined."

if (Array.isArray(config.routing.rewrites)) {
for (const { rewrite } of config.routing.rewrites) {
if (rewrite) {
const rewritePath = join(outputDirPath, rewrite.replace(/^\//, ''));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path.sep instead of ^\/?

- webapplication.json optional: when absent or force-ignored, require non-empty dist/index.html
- Validate required fields (outputDir, routing, trailingSlash, fallback) with clear error messages
- Validate fallback and rewrite targets exist on disk
- Precise error messages for dist fallback (missing folder, missing file, empty file)
- Use path.sep for cross-platform path handling

Co-authored-by: Cursor <cursoragent@cursor.com>
@Shinoni Shinoni force-pushed the lt/web-app-descriptor-validation branch from 2b12667 to 68a8f79 Compare February 12, 2026 20:25
…JSON test

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants