Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow JS files and Folders within the public folder #2221

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

andrechism
Copy link
Contributor

@andrechism andrechism commented Feb 2, 2024

What's the purpose of this pull request?

This PR adds JS files to the public folder allowed file types.
It also enables the possibility to create folders within the public folder.

How it works?

In the starter's public folder,
Add a folder and a file inside it
It should be copied to the public folder inside .faststore
image image

How to test it?

Try to access the file within the preview.

Starters Deploy Preview

https://sfj-f81fa73--marinbrasil.preview.vtex.app/XMLData/tramontina.xml
https://sfj-f81fa73--marinbrasil.preview.vtex.app/sitemap/department-0.xml
https://sfj-f81fa73--marinbrasil.preview.vtex.app/files/service-worker.js

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 3:25pm

Copy link

codesandbox-ci bot commented Feb 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 26cecd6:

Sandbox Source
Store UI Typescript Configuration

@andrechism andrechism marked this pull request as ready for review February 2, 2024 19:20
@andrechism andrechism requested a review from a team as a code owner February 2, 2024 19:20
@andrechism andrechism requested review from hellofanny and ArthurTriis1 and removed request for a team February 2, 2024 19:20
@andrechism andrechism changed the title feat: js files on public folder feat: allow JS files and Folders within the public folder Feb 2, 2024
Copy link
Contributor

@Gmantiqueira Gmantiqueira left a comment

Choose a reason for hiding this comment

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

Hey, thank you for your contribution! 🚀

Can you explain further about the motivation of this PR? Currently, we're avoiding enabling JS or any executable files because of security reasons.

@andrechism
Copy link
Contributor Author

Hey, thank you for your contribution! 🚀

Can you explain further about the motivation of this PR? Currently, we're avoiding enabling JS or any executable files because of security reasons.

Hi @Gmantiqueira!!

About allowing JS files:
Our client uses a third-party app (Pushnews) that requires a service worker file in the same domain to work properly.

About the creation of folders inside the public folder:
More folder structure flexibility and maintaining the same behavior observed in VTEX IO, like the sitemap and XMLData files.

andrechism added a commit to andrechism/faststore that referenced this pull request Feb 8, 2024
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.

None yet

3 participants