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

Files within folders of templates are URL encoded #229

Closed
nerdyman opened this issue Sep 8, 2024 · 7 comments · Fixed by #236
Closed

Files within folders of templates are URL encoded #229

nerdyman opened this issue Sep 8, 2024 · 7 comments · Fixed by #236

Comments

@nerdyman
Copy link

nerdyman commented Sep 8, 2024

Hi, I've recently set up the GitHub bot in one of my repos. The package publishing is working but nested files in the folder I'm using for the --template arg are being URL encoded, causing the file structure to be flatened.

Here's a link to the bot comment and the Stackblitz project it created.

Flattened file structure

The / in the file paths has been escaped so the files don't resolve.


P.S. really loving the simplicity of this plugin! It's way nicer than publishing pre-releases to npm.

@Aslemammad
Copy link
Member

Thank you for the kind words!

Oh, that's bad! Let me think and find a solution with the team!

@Aslemammad
Copy link
Member

Hey @nerdyman

Can you try this command in your workflow and see if now it solves your issue?

API_URL=https://pkg.pr.new pnpx pkg-pr-new@https://be6db5b4.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/pkg-pr-new@236 publish './lib' # and all the options you want...

@alex-kozlov-dev
Copy link

alex-kozlov-dev commented Sep 12, 2024

Hey @Aslemammad

I have same issue. I tried to use command above, but it doesn't seem to resolve the issue 😞

Stackblitz
image

Full command:

API_URL=https://pkg.pr.new npx pkg-pr-new@https://be6db5b4.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/pkg-pr-new@236 publish $(ls -d ./packages/*) --template './examples/*'

Edit: I've also tried to use old version npx [email protected] ..., but the issue persists 😞

@nerdyman
Copy link
Author

nerdyman commented Sep 12, 2024

@Aslemammad That didn't work for me either unfortunately, the file paths are still escaped.

I used

API_URL=https://pkg.pr.new/ pnpx pkg-pr-new@https://be6db5b4.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/pkg-pr-new@236 publish './lib' --template='./docs/example'

https://github.com/nerdyman/react-compare-slider/actions/runs/10836757398/job/30071202990?pr=143#step:7:1

I'm not sure if #236 would resolve the issue completely though. It looks like it will escape [ and ] but frameworks like Next.js use square brackets in file names so files like [...nextauth].ts would still be escaped.

Edit: Does the existing StackBlitz project need to be deleted for the fix to apply?

@Aslemammad
Copy link
Member

I see, I guess that's because it uses the old backend and not the updated one! Can you folks give me the repo you're trying pkg.pr.new on, so I fork it and try it?

And [] has to be escaped because otherwise it'd fail, but I guess it'd work, let's see what happens with the repros.

@Aslemammad
Copy link
Member

I'm testing it on the PR, let's see how it goes!

@Aslemammad
Copy link
Member

Ok, as you can see in the PR (example-2), it is working. Sorry for the confusion.

Will ship it soon.

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 a pull request may close this issue.

3 participants