Shopify / koa-shopify-auth

DEPRECATED Middleware to authenticate a Koa application with Shopify
MIT License
80 stars 64 forks source link

Include app bridge JS file in package #150

Closed paulomarg closed 2 years ago

paulomarg commented 2 years ago

WHY are these changes introduced?

We included the app bridge file in this package to avoid using a CDN for it, but it wasn't being bundled in the package.

WHAT is this pull request doing?

Bundle the App Bridge package with this one. I also had to fix a handful of typescript issues that didn't show up before.

Type of change

Checklist

lukejagodzinski commented 2 years ago

It doesn't really solve the issue. Even though you included app-bridge in the bundle it's still not accessible after running app. In this file node_modules/@shopify/koa-shopify-auth/dist/src/auth/redirection-page.js:6 the path to app-bridge file is hardcoded. We use the esbuild bundler and it produces one file. Because of that the path tries to find the app-bridge file in the root directory of the project and not in the node_modules. You shouldn't expect that someone is not using bundler. Also I think the path should be configurable and if someone want to use CDN they should have option to do so.