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: STRF-12941 Add channelUrl parameter to stencil start #1254

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

jairo-bc
Copy link
Contributor

@jairo-bc jairo-bc commented Jan 16, 2025

What?

Some users have a proxy or dns settings on the custom domain that block requests from stencil cli. By using --channelUrl you can directly set up bigcommerce domain to bypass custom domain protections

Tickets / Documentation

Screenshots (if appropriate)

Screenshot 2025-01-16 at 16 51 21

cc @bigcommerce/storefront-team

@jairo-bc jairo-bc requested a review from a team January 16, 2025 17:13
@jairo-bc
Copy link
Contributor Author

I think we can ignore snyk as it complains on the "hardcoded token" in tests

@jairo-bc jairo-bc marked this pull request as ready for review January 16, 2025 17:13
Copy link
Contributor

@bc-max bc-max left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@huntario huntario left a comment

Choose a reason for hiding this comment

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

🍏
To test this out I took a domain that is applied to my store and pointed to the DNS to Google's IP to simulate a non-bc-compatible proxy.
Screenshot 2025-01-17 at 7 34 07 AM

Screenshot 2025-01-17 at 7 34 27 AM

On master:
➜ cornerstone git:(master) ✗ stencil start
Error: The BigCommerce Store you are pointing to either does not exist or is not available at this time.
Error details:
Request failed with status code 404
at Object.checkCliVersion (file:///Users/hunter.leachman/.nvm/versions/node/v20.16.0/lib/node_modules/@bigcommerce/stencil-cli/lib/theme-api-client.js:43:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async StencilStart.run (file:///Users/hunter.leachman/.nvm/versions/node/v20.16.0/lib/node_modules/@bigcommerce/stencil-cli/lib/stencil-start.js:62:34)

not ok -- Error: The BigCommerce Store you are pointing to either does not exist or is not available at this time.
Error details:
Request failed with status code 404

Please visit the troubleshooting page https://developer.bigcommerce.com/stencil-docs/deploying-a-theme/troubleshooting-theme-uploads.
If this error persists, please visit https://github.com/bigcommerce/stencil-cli/issues and submit an issue.

After:

➜ cornerstone git:(master) ✗ node ../../stencil-cli/bin/stencil.js init --url https://store-upsk9v87r9.mybigcommerce.com --token afsdfsdfsdfsdfsdfsdf
? What port would you like to run the server on? 3000
? What is your favourite Package Manager? npm
Set API host to: https://api.bigcommerce.com
✔ Dependencies installed successfully
You are now ready to go! To start developing, run $ stencil start
➜ cornerstone git:(master) ✗ node ../../stencil-cli/bin/stencil.js start --channelUrl https://store-upsk9v87r9.mybigcommerce.com

                                 `+h
                               `+ddd
                             .oddddd
                           .oddddddd
                         -sddddddddd
                      `-sddddddddddd
                     -shdddddddddddd
                     ...-:+ydddddddd
                `......`   `+ddddddd
                -ddddddh-    ddddddd
            `   .yyyyyyo.  `+ddddddd
          .o/    `````    :ydddddddd
        -ohd+   `//////:` `.sddddddd
      -sdddd+   -ddddddds   `hdddddd
    :sdddddd+   .sssssso-   `ddddddd
  :ydddddddd+              -yddddddd
/yddddddddddy+++++++++++oshddddddddd

`/hdddddddddddddddddddddddddddddddddddd
/hdddddddddddddddddddddddddddddddddddddd


BigCommerce Stencil


-----------------Startup Information-------------

config.stencil.json location: /Users/hunter.leachman/Desktop/projects/themes/cornerstone/config.stencil.json
secrets.stencil.json location: /Users/hunter.leachman/Desktop/projects/themes/cornerstone/secrets.stencil.json
config.json location: /Users/hunter.leachman/Desktop/projects/themes/cornerstone/config.json
Store URL: http://shirt.fyi
SSL Store URL: https://store-upsk9v87r9.mybigcommerce.com
Node Version: v20.16.0


[Browsersync] Proxying: http://localhost:3001
[Browsersync] Access URLs:

   Local: http://localhost:3000
External: http://192.168.1.185:3000

      UI: http://localhost:3002

UI External: http://localhost:3002

[Browsersync] Watching files...
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
isModuleDeclaration has been deprecated, please migrate to isImportOrExportDeclaration
at isModuleDeclaration (/Users/hunter.leachman/Desktop/projects/themes/cornerstone/node_modules/@babel/types/lib/validators/generated/index.js:2748:35)
at PluginPass.Program (/Users/hunter.leachman/Desktop/projects/themes/cornerstone/node_modules/babel-plugin-lodash/lib/index.js:102:44)
Webpack Bundle Analyzer saved report to /Users/hunter.leachman/Desktop/projects/themes/cornerstone/assets/dist/report.html
[Browsersync] Reloading Browsers...

@jairo-bc jairo-bc merged commit 988c787 into master Jan 17, 2025
9 of 10 checks passed
@jairo-bc
Copy link
Contributor Author

cc @bigcommerce/dev-docs

@bc-traciporter
Copy link

Hi @jairo-bc Do I need to update the stencil start section in our devdocs?

@jairo-bc
Copy link
Contributor Author

@bc-traciporter yes

@bc-traciporter
Copy link

@jairo-bc Can you review PR 763? I am not sure if the description is correct?
Screenshot 2025-01-21 at 9 06 43 AM

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.

5 participants