Skip to content

Support non node environment validation#24

Merged
brenthosie merged 7 commits into
masterfrom
support-non-node-environment-validation
Mar 19, 2026
Merged

Support non node environment validation#24
brenthosie merged 7 commits into
masterfrom
support-non-node-environment-validation

Conversation

@brenthosie

Copy link
Copy Markdown
Member

Description

Changes to allow validator to still be the "source of truth for validation" but can be used in a web context.

Related Issue

https://jira.corp.adobe.com/browse/PDCL-14485

Motivation and Context

This was a node-only project and wouldn't work due to it's inherent step of gathering files from the file system.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Brent Hosie added 5 commits March 5, 2026 16:21
Split validation into schema, file checks, and Node-only file gathering.
The default export is unchanged for Node consumers.

Add a ./validatesubpath that takes (descriptor, fileList) so browser consumers can run
full validation without Node APIs.

- @adobe/reactor-validator/schema (schema validation only)
- @adobe/reactor-validator/files (file validation with caller-provided file list).
…onsumers, be a little more restrictive with the viewBasePath.
@brenthosie brenthosie requested a review from markhicken March 6, 2026 17:36

@markhicken markhicken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just the windows path change thing and maybe the mobile validation. Everything else is probably optional. Let me know if you want to chat about anything.

Nice update!

Comment thread lib/validateFiles.js
Comment thread lib/validateFiles.js
return result;
};

module.exports = gatherFilesInNodeEnvironment;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

web-manifest.test.js and edge-manifest.test.js do cover this code, but there are no direct tests verifying:

  • Recursive directory traversal
  • Handling of symlinks, empty directories, or special characters in filenames
  • Path separator output on different OS

Maybe consider if we need unit tests for these cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the changes as-is don't necessitate testing these today given they weren't tested explicitly before these changes.

Comment thread lib/validateSchema.js
var schemas = {
web: require('@adobe/reactor-turbine-schemas/schemas/extension-package-web.json'),
edge: require('@adobe/reactor-turbine-schemas/schemas/extension-package-edge.json'),
mobile: require('@adobe/reactor-turbine-schemas/schemas/extension-package-mobile.json')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Web and edge have test fixtures and tests, but I don't think mobile is used, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wouldn't say mobile isn't used, there's a mobile schema to validate against.

Comment thread package.json
@brenthosie brenthosie requested a review from markhicken March 18, 2026 20:59

@markhicken markhicken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested this out in the Lens PR. Seems to work!

@brenthosie brenthosie merged commit 53676ec into master Mar 19, 2026
3 checks passed
@brenthosie brenthosie deleted the support-non-node-environment-validation branch March 19, 2026 21:33
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.

2 participants