Skip to content

Commit b5f6205

Browse files
adamrayavcua-mobifyvmartahajinsuha1yunakim714
authored
[App Extensibility ⚙️] Deploy -extensibility-preview.04 (@W-17910075@) (#2402)
* @W-17589798@ Bump develop to v3.10.0-dev (#2278) * Update changelog files * Bump to the preview versions * Bump up preview versions * @W-17589798@ Release preview version 3.9.0-preview.2 (#2264) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * @W-17589798@ Release preview version 3.9.0-preview.3 (#2268) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> * @W-17589798@ Release preview version 3.9.0-preview.4 (#2272) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md * Fix import error template retail react app (#2270) * revert babel.config.js workaround * move everything out of utils into ssr.js or default.js * update default.js templates * update ssr.js templates * rerun ci jobs * rerun ci jobs * Bump versions --------- Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Update CHANGELOG.md --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * @W-17589798@ Release preview version 3.9.0-preview.5 (#2274) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md * Fix import error template retail react app (#2270) * revert babel.config.js workaround * move everything out of utils into ssr.js or default.js * update default.js templates * update ssr.js templates * rerun ci jobs * rerun ci jobs * Bump versions --------- Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Update CHANGELOG.md * Add missing `_app-config` template changes (#2273) * @W-17589798@ Release preview version 3.9.0-preview.4 (#2272) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md * Fix import error template retail react app (#2270) * revert babel.config.js workaround * move everything out of utils into ssr.js or default.js * update default.js templates * update ssr.js templates * rerun ci jobs * rerun ci jobs * Bump versions --------- Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Update CHANGELOG.md --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * add missing app config template changes * update both app config templates --------- Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Bump version to 3.9.0-preview.5 * Update CHANGELOG.md --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> * @W-17589798@ PWA Kit v3.9.0, commerce-sdk-react 3.2.0, retail-react-app 6.0.0 Release (#2277) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md * Fix import error template retail react app (#2270) * revert babel.config.js workaround * move everything out of utils into ssr.js or default.js * update default.js templates * update ssr.js templates * rerun ci jobs * rerun ci jobs * Bump versions --------- Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Update CHANGELOG.md * Add missing `_app-config` template changes (#2273) * @W-17589798@ Release preview version 3.9.0-preview.4 (#2272) * Update default.js.hbs and ssr.js.hbs templates to support new login flows (#2263) * update bootstrap default.js.hbs to include login options * update ssr.js templates * Revert/page meta data tags 3.9.x (#2259) * Revert page-meta-data changes * Update CHANGELOG.md * Fix changelog --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Bump to version 3.9.0-preview.2 * Fix lint errors in default.js templates (#2265) * fix lint errors * rerun ci jobs * Update app config templates (#2267) * lint default.js in templates folder (#2266) Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Bump to version 3.9.0-preview.3 * Update CHANGELOG.md * Fix import error template retail react app (#2270) * revert babel.config.js workaround * move everything out of utils into ssr.js or default.js * update default.js templates * update ssr.js templates * rerun ci jobs * rerun ci jobs * Bump versions --------- Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Update CHANGELOG.md --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * add missing app config template changes * update both app config templates --------- Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Bump version to 3.9.0-preview.5 * Update CHANGELOG.md * Bump versions * Update changelogs * Update CHANGELOG.md * Update peer dep in package-lock --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> * Bump version to 3.10.0-dev --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> * Undo change not sure whats going on this this new line issue. * Clean up storefront extension dependencies * Added missing commerce-react dep * Re-order package.json * More dependency cleanup * Revert changes to storefront package.json * More dep clean up * Remove some unused deps * Re lock projects * @W-17643479@ Add page meta data to search results and product pages (#2282) * Add page meta data to search results and product pages * Changelog * Apply suggestions --------- Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * Don't use dependencies in extensions * [App Extensibility ⚙️] Fix Issues with Pushing Bundles to MRT (@W-17779391@) (#2281) * Remove core-polyfill * Fix commerce-sdk-react peerDependency version * Update package-lock.json * Update bump-version script * PR Feedback * Add more docs * Revert "Add more docs" This reverts commit 59715d2. * Revert "PR Feedback" This reverts commit 42b10d6. * Revert "Update bump-version script" This reverts commit 7387793. * Move deps to peer deps * Fix merge conflicts and re-lock packages * Forgot to commit lock files * @W-17286066 Remove forced garbage collection per invocation (#2285) * Remove forced garbage collection on each invocation. * Allow FORCE_GC env-var to enable old behavior. * Added /memtest endpoint to mrt reference app. * updated CHANGELOG.md with link to PR. * Update TUTORIAL.md Signed-off-by: Kevin He <kevin.he@salesforce.com> * Fix tests Recent changes to "@testing-library/user-event" broke our tests. * Make same change for template * Enable Social & Passwordless Login in Demo Storefront (#2284) * Increas max size for vendor * Use `^` in starter extension * [App Extensibility ⚙️] Fix Slow Dev Server start on Windows (@W-17792667@) (#2289) * Use thread-loader * Replace event-emitter with EventTarget * Clean up * Fix test * Add evt.detail to tests * Update thread-loader config * Remove extensions from typescript-minimal & Update changelogs * Solve merge conflicts * Increase build/main.js maxSize * Revert social and passwordless login in develop (#2292) * use . for server timing delimiter * add changelog * update react query performance delimiter * update getProps performance header delimiter * Update TUTORIAL.md Signed-off-by: Kevin He <kevin.he@salesforce.com> * @W-17760517@ Automatically update bug bounty instance on new release (#2291) * Add new preset * New workflow for bug bounty deploy * Fix indent * Add runs-on * Install deps * temp remove step conditions * set credentials file to default * Test version check * Trigger on Github release * Test * Test2 * test 3 * test 4 * test5 * test6 * test7 * test8 * test9 * test10 * test11 * test12 * test13 * test 14 * test 15 * test16 * test17 * test18 * test19 * test20 * test21 * test22 * test23 * test24 * test25 * test26 * Restore actual changes * Test by reversing condition * Revert conditional to what we want * apply suggestions + refactor * flip condition for testing * Fix file structure * Add checkout * Specify shell * Set token as input * Checkout before node setup * Use correct condition * Allow custom bundle message on deploy * Add quotes * Set tag name * Remove bracket * Update condition * [App Extensibility ⚙️] Polish Project Generator (@W-17910008@) (#2293) * Remove Do you want to use Extensibility question & Fix outputDir * Remove debug logs * Remove Choose a project preset to get started question * Clean up extensionName redundancy * Update TUTORIAL.md * lint * Bump core to 3.9.1 and point versions for independent packages * Cherry pick PR2285 * Update readmes * Update package-lock.json * Bad merge * Fix bad merge again * Lint fix * update cloudwatch sender maxRetries to 0 * add comment * add changelog * bump version to v3.9.2 * empty commit * @W-17900760@ Deploy Demo Storefront with SLAS Private Client (#2297) * WIP * Use zzrf-001 stg * Set output * test * test * test * test * test * test * test * test * test * test * test * test * Add logging * fix conditional * Add brackets * fix * fix * adjust * test * test * test * flip condition for testing * Update handlebars for RefArchGlobal locales * Add US locale + currency to RefArchGlobal and set as default * Add site alias * Enable passwordless and social login * Adjust comment since handlebars don't add a newline * Apply aliases * Adjust newline * Comment * Add siteid and locale to demo path * Enable site setting * Re-add handlebar helper * showDefaults: true * Use translatable title for demo store * Fix lint * Deploy to production demo site * Re-enable bug bounty deploy * Use Salesforce Cloud as default logo for extensible projects * Change condition so we run a deploy * Restore latest release condition * Revert "Use Salesforce Cloud as default logo for extensible projects" This reverts commit 6ec6c7b. * Use a non-extensible template for demo site * Deploy demo site * Revert deployment condition * Apply suggestions * Fallback name if no release tag name * test * test * New step for bundle name * fix else * Use new step with everything else * redeploy demo site * Fix conditions after release * Test matrix * Handle secrets outside of matrix * test * Fix api key name * Set flags and don't fail-fast * Reapply on release condition * fix server timing header delimiter * skip changelog * add tests * remove comment * lint * resolve conflict * @W-17405592 - DataCloud Events in PWA (#2229) (#2318) Send analytics events from the PWA Kit to Data Cloud --------- Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> Co-authored-by: Carson Campbell <170666418+carson-campbell@users.noreply.github.com> * [App Extensibility ⚙️] Add script to display all files in an extension that can be overridden (@W-17555422@) (#2299) * Init list-overridables script * Support loadable overridables import * Look for overridable imports in the configured extensions * Split command into two * Reuse helpers getConfiguredExtensions * lint * Fix tests * Clean up * Fix check-overrides using findOverrideFiles * Fix duplicate imports * Reuse resolver getPackageName * clean up * lint * Fix tests * Update hasCorrespondingOverridableImport path matching * Include the file list that match overridable imports * Simplify hasCorrespondingOverridableImport * lint * Extract utils from webpack overrride-resolver loader * Add js docs * Add tests * Fix Windows tests * Use path.sep to normalize paths * Clean up use webpack plugin alternative approach * OverrideStatsPlugin Webpack plugin * Fix list-overrides on Windows * Update pwa-kit-extension-sdk lock files * Add sourceExtension to override stats * PR Feedback * Add OverrideStatsPlugin tests * Add types to OverrideStatsPlugin tests * Add more types * PR Feedback * Update test to use virtual filesystem * lint * Add docs * Add more tests to overrides-resolver-loader * PR Feedback docs * Bypass test on Windows * Update lock files * Lint Fixes * Fix chakra imports * Lint * Use Act in test, and port network mocks * Add global mock for cc-datacloud-typescript lib Because this was a module we couldn't use jest without having to either use an experimental flag on jest. * Bump bundle max sizes * Enable ssh to test workflow failures * Undo e2e * Add action to display content of .bin for debugging * Fix workflow * Update test.yml * Relock packages in an attempt to fix ci errors * Remove debugging * more debugging * Update test.yml * Add debugging logs * more debugging * more debugging * more logging * Fix for node 22 Node 22 doesn't like using npm pack without a version, might be a bug with verdaccio * Remove debug logs and add latest when using npm pack * Remove more debug logs * Move move storefront to storefront-old * Move retail template to extension folder * '/app' becomes '/src' * Move the README * Copy setup files * Fix location of setup files * These files aren't required in an extension * Remove old config and replace with new config * Move types * Move meta data file * Migrate router to extension with changes. * Update jest-setup * Migrate jest.config. * Migrate package.json * Remove special components and add their replacements * Migrate changes to useAddressFields component * Migrate changes for header component * Migrate associated tests * Migrate tests for link component * Migrate changes for product-tile component * Migrate search component * Migrate search partial component * Migrate seo component * Migrate constants file * Migrate hooks index * Migrate use-active-data hook and tests * Migrate various hook changes and test fixes * Migrate mock data Note: Unsure about whether mockedRegisteredCustomerWithNoNumber should have been re-added * Migrate account pages. * Migrade checkout page changes * Migrate checkout partial changes * Migrate product-list components * Migrate theme colors * Migrate utils * migrate project files/configs * Remove unused files in extension projects * Move static folder * Update eslint ignore * Remove some more unused scripts/folders * Fix lint warnings * Fix import paths for hooks * Migrate theme index * Replace `@salesforce/template-retail-react-app` imports with relative ones * Linting * Migrate page-designer assets * Migrate page-designer layouts * Migrate page-designer misc * Migrate utils * Migrate theme base and project folders * Migrate theme foundations * Update imports for account pages * Update cart page imports * Migrate home page * Migrate login page * Migrate login-redirect page * Migrate page-not-found page * Migrate the product-details page * Migrate product-list page * Migrate registration page * Migrate reset password * Migrate checkout page * Migrate cart pages * Migrate account pages * Lint * Chane aliased imports to relative imports for new code * Remove `template-retail-react-app` from generator * Migrate mocks folder * Migrate search component partials folder * Migrate svg assets * Migrate contexts file * Delete chakra storefront old project * Re-generate lock files across mono repo * Add data cloud types and update code to work with as an extension * Fix login page * Lint * W-17908517 - Fix basket loading after logging out (#2323) * fix basket loading after logging out * Fix some tests, rework others Re-worked the data cloud tests, still a work in progress. * Fix some failing tests Skip header tests Skip datacloud tests * Remove references to old template Remove ci bundle analyzer action * Remove smoke and lighthouse tests for defunct retail template * Remove other instance of smoke test script runner * Update test.yml * Remove code that was added back via a merge * Remove code that was added as a result of a bad merge * Update peer deps for storefront extension * Remove mobify object from extensions package.json files (#2336) * [App Extensibility] replace `extendRoutes` with `getRoutes` and `getRoutesAsync` @W-17916765@ (#2308) * Convert extendRoutes to an async method * Add todos * Temporarily modify the typescript-minimal project * Minor refactoring * Call every extension's route function in parallel For a simpler implementation, replaced extendRoutes with getRoutes. Probably safer too, since we think there's no need to have access to the existing/previous routes. * Pass in the request path * Explore passing in locals and how to manage access token * Remove extendRoutes from the API * Allow configuring of the auth property name in locals * Rename the property in locals * Create a new extension for a better example * Add some console logs * Experiment with having partial route Partial route in the getRoutes, and then completing it during beforeRouteMatch. * Experiment with correct way to get app origin * Add todo * Some cleanup * Fix the partial route with correct path * Remove no longer necessary code * Combine params into a single object * Remove some console logs * Add comment to clarify * Implement getRoutes and getRoutesAsync Co-Authored-By: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-Authored-By: Ben Chypak <bchypak@salesforce.com> * Add comment * Add comment * Add type to allow for `componentName` property * Remove params for `getRoutes` Only `getRoutesAsync` who needs the params. * Remove params for getRoutes * Revert "Remove params for `getRoutes`" This reverts commit 38e352f. * Revert "Remove params for getRoutes" This reverts commit 4119cda. * Update comments * Update tests * Update tests * Revert changes to typescript-minimal * Update package-lock.json * Update changelog files * Update readme files * Add jsdoc to some types * Rename test to make it clearer * Empty commit --------- Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com> * Initial refactor of ssr into setup-server * Refactor some of the utils and create middleware * Remove wishlist from configurate list of pages for now * Fix some lint errors * [App Extensibility ⚙️] Pin Specific Versions for Extensions in Generated Project (@W-17779226@) (#2339) * Use npm view to get the latest version * Update available-app-extensions.json * lint * Prepend caret (^) to the version number * [Snyk] Dependency updates (#2338) * Update nanoid dependency * Override path-to-regexp version * Update CHANGELOG.md * Apply snyk version bumps * Update changelogs * Update CHANGELOG.md * Update changelogs * Fix jwks path and replace constants with configurable values * Empty commit * Fix regression and fix some tests config * Fix mock config * Don't send undefined redirect urls * Use extension config not app config in checkout * Fix idps destructure * Fix test and pr feedback * Initial commit * Remove debugging logs * Removed unused error handler middleware * Adding flex value as this component is used in display flex * Better fix, still not great * Fix issue with null pointer * Lint * Update with-layout.tsx * Lint * [App Extensibility] make sure DNT feature still works as expected (@W-18128633@) (#2345) * Show DNT banner * Make default DNT state configurable * Add `build:watch` script, like what other packages have (#2346) * [App Extensibility] Bring back and fix the recently-skipped tests (@W-18120857@) (#2349) * Bring back the data-cloud tests For some reason, jest cannot mock js-cookie. It crashed with out-of-memory error. So I decided to avoid mocking it. Calling `Cookie.get` would return either a string or undefined (if not found). So I adjusted our mocks to allow for undefined value as well. * Fix header tests My Account icon actually gets rendered with 'My account' label (note that it's a small-case "a"). * Revert "Bring back the data-cloud tests" This reverts commit 16978e1. * Mock js-cookie in a different way Such that we won't run into the out-of-memory error. * Route serialization to support Shopper SEO URL mapping integration (#2300) * update Switch component to load routes from RoutesProvider and RoutesContext * Server: update react-rendering.js to serialize extensions that have getRoutesAsync implemented and save it under window.__EXTENSIONS__ global variable * update ApplicationExtension to cache results from getRoutesAsync to _cachedRoutes property * update ApplicationExtension to deserialize routes from window.__EXTENSIONS__ when on the client and save it under _cachedRoutes * [App Extensibility] Bring back recently-commented-out Github actions (@W-18219092@) (#2351) * Actions: bundle size and npm scripts * Tweak condition * Lighthouse test * Fix test workflow * Try different way to set env variable * Aargh, forgot to close the quote * Comment out lighthouse test for now * Move to separate job those that don't test code correctness * Refactor the MRT's node version * Try fixing error * Try fixing error * Experiment with `bundlesize` * Check bundle sizes * Simplify code with github.action_path * Debugging * Workaround for bug with bundlesize bundlesize cannot handle absolute path to the config file. See siddharthkp/bundlesize#326 * Lighthouse test now accepts config filename to be more reusable * Experiment with passing in json config * Experiment with passing in json config * For the other jobs, run the npm-scripts test * Add comment to clarify * Remove duplicate test It's already run in the generated and generated-windows jobs. * Revert "Remove duplicate test" This reverts commit 74116b7. * Smoke testing npm scripts now run in all nodes and OSes * Delete no-longer-needed code * Test running an invalid command * Test running an invalid command * Move more things to setup_ubuntu and setup_windows * Move more things to setup_ubuntu and setup_windows * Move more things to setup_ubuntu and setup_windows * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * New step to verify Node and NPM versions * Debugging windows * Some refactoring * Prints clearer message * Clean up code * A bit of reordering * Add comments * Add comments * Add error handling for jq * Extract the app generation into its own action * Fix the error handling * Fix action * The timeout-minutes cannot be used inside an action * Remove console log * Sync with latest develop branch * Initial implementation * Update package lock files * @W-13747172 Fix a11y (#2375) * fix a11y * @W-17830285@ Add custom parameters to SLAS authorize calls (#2358) * Allow custom parameters to SLAS authorize calls * Update CHANGELOG.md * Move extractCustomParameters to utils * Use options and body instead of parameters for consistency * Ensure only custom parameters are set from register to login * Don't send custom params to shopperCustomer register * Allow custom params to be set via login.mutateAsync * Update tests using ShopperCustomers * Apply feedback * Add comments * Lint * Pin to previous version of cc-datacloud-typescript Their latest 1.1.0 release that's out today was causing an error with building our pwa-kit project. * Revert "Pin to previous version of cc-datacloud-typescript" This reverts commit e558f52. * Make constants file, clean up, remove logs * Update CHANGELOG.md * Add tests for utilities. * Committing temp version bump * Revert "Committing temp version bump" This reverts commit 398cfce. * Fix failing tests * Update package lock files * Try replacing `sh.cat` with native file reading See if such replacement works well on a Windows machine. * Debug: see what gets generated * Fix regression in getAsseturl * Debugging * Refactor file copying logic * Clean up * Revert "Try replacing `sh.cat` with native file reading" This reverts commit dc26b6e. * Remove debug code * Add changelog for the chakra-storefront * Update CHANGELOG.md * [App Extensibility ⚙️] Remove `extension-` prefix requirement (@W-18131976@) (#2390) * Remove extension prefix * Clean changes in template-typescript-minimal * Optimize detecting extensions logic * WIP Fix tests * Fix tests * Fix tests * Move import constant * Refactor packagePath ternary * Condensed fullPackagePath into one line * Update package namespace and name extract logic * Use validate-npm-package-name in generator * lint * Adjust generator copy * Update packages/pwa-kit-create-app/scripts/create-mobify-app.js Co-authored-by: Kevin He <kevin.he@salesforce.com> Signed-off-by: Adam Raya <adamraya@users.noreply.github.com> * PR Feedback detectExtensions args --------- Signed-off-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> * Update packages/pwa-kit-react-sdk/src/ssr/universal/utils.ts Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> Signed-off-by: Ben Chypak <bchypak@mobify.com> * PR feedback round 1 * Remove test configuration * Remove sample override for testing * Fix lint error * Revert override * Regenerate lock files --------- Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Signed-off-by: Kevin He <kevin.he@salesforce.com> Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> Signed-off-by: Adam Raya <adamraya@users.noreply.github.com> Signed-off-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com> Co-authored-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: mitesh-patel-crm <85328777+mitesh-patel-crm@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: mitesh.patel <mitesh.patel@salesforce.com> Co-authored-by: Carson Campbell <170666418+carson-campbell@users.noreply.github.com> Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Jainam Sheth <j.sheth@salesforce.com>
1 parent 904de01 commit b5f6205

File tree

781 files changed

+53425
-159812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

781 files changed

+53425
-159812
lines changed

.eslintrc.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,5 @@ module.exports = {
3232
]
3333
}
3434
]
35-
},
36-
// For an import in a file to be replaced via template extensibility, the import must use the
37-
// full package name, rather than relative imports, i.e. all retail react app imports must use
38-
// "@salesforce/retail-react-app/" rather than relative imports.
39-
overrides: [
40-
{
41-
files: ['packages/template-retail-react-app/**'],
42-
plugins: ['no-relative-import-paths'],
43-
rules: {
44-
// https://github.com/MelvinVermeer/eslint-plugin-no-relative-import-paths
45-
'no-relative-import-paths/no-relative-import-paths': [
46-
'error',
47-
{
48-
allowSameFolder: false,
49-
rootDir: 'packages/template-retail-react-app',
50-
prefix: '@salesforce/retail-react-app'
51-
}
52-
]
53-
}
54-
}
55-
]
35+
}
5636
}
Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
name: bundlesize
1+
name: bundle_size_test
2+
inputs:
3+
cwd:
4+
required: true
5+
config:
6+
required: true
27
runs:
38
using: composite
49
steps:
5-
- name: Check bundle size
10+
- name: Analyze build
11+
working-directory: ${{ inputs.cwd }}
612
run: |-
7-
npm run test:max-file-size
13+
npm run analyze-build
14+
shell: bash
15+
16+
- name: Check bundle sizes
17+
working-directory: ${{ inputs.cwd }}
18+
# NOTE: A bug prevented us from running bundlesize with a config file:
19+
# npx bundlesize --scope ${{ github.action_path }}/bundlesize.config.json
20+
# For more details, see https://github.com/siddharthkp/bundlesize/issues/326
21+
run: |-
22+
json_string='${{ inputs.config }}'
23+
24+
if ! echo "$json_string" | jq '.' > /dev/null 2>&1; then
25+
echo "::error::Invalid JSON input provided: $json_string"
26+
exit 1
27+
fi
28+
29+
# Parse the given json string and build the command to run
30+
echo "$json_string" | jq -r 'to_entries[] | "npx bundlesize -f \"" + .key + "\" -s " + .value' | while IFS= read -r command; do
31+
echo "Executing: $command"
32+
eval "$command"
33+
done
34+
shell: bash
35+
36+
- name: Report bundle sizes
37+
run: |-
38+
node ./scripts/report-bundle-size.js ${{ inputs.cwd }}/build
839
shell: bash

.github/actions/changelog-check/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
using: 'composite'
1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0 # Fetch full history to access all commits
1515

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: check_if_latest_release
2+
inputs:
3+
token:
4+
description: "Github API token"
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Check if latest release
9+
run: |-
10+
RELEASE_JSON=$(curl -s -H "Authorization: token ${{ inputs.token }}" \
11+
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
12+
13+
LATEST_TAG_NAME=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
14+
RELEASE_EVENT_TAG_NAME=$(echo ${{ github.event.release.tag_name }})
15+
16+
echo "Latest tag: $LATEST_TAG_NAME"
17+
echo "Release event tag: $RELEASE_EVENT_TAG_NAME"
18+
19+
if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then
20+
echo "We are releasing the latest tag."
21+
echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV
22+
else
23+
echo "We are not releasing the latest tag."
24+
echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV
25+
fi
26+
shell: bash

.github/actions/datadog/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ runs:
99
steps:
1010
- name: Send metrics to Datadog
1111
run : |
12+
# TODO: move it back to setup_ubuntu action
1213
# For the datadog cli, it must be installed via python
1314
# to install python packages on CI environment, we must activate the virtual env
1415
# or otherwise it throws error: externally-managed-environment
1516
python3 -m venv venv
1617
source venv/bin/activate
1718
pip install datadog
1819
20+
# TODO: move it back to setup_ubuntu action
1921
# Add a dogrc so we can submit metrics to datadog
2022
printf "[Connection]\napikey = ${{inputs.datadog_api_key}}\nappkey =\n" > ~/.dogrc
2123
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: generate_app_with_preset
2+
inputs:
3+
preset:
4+
required: true
5+
output_dir:
6+
required: false
7+
default: generated_pwa
8+
runs:
9+
using: composite
10+
steps:
11+
- run: |-
12+
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir ${{ inputs.output_dir }}
13+
shell: bash
14+
env:
15+
GENERATOR_PRESET: ${{ inputs.preset }}
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
name: lighthouse_ci
2+
inputs:
3+
project_dir:
4+
required: true
5+
config_filename:
6+
required: true
27
runs:
38
using: composite
49
steps:
5-
- name: Run Lighthouse CI on the PWA
6-
# This test is flaky, so let's try it three times!
7-
run: npm run test:lighthouse --prefix packages/template-retail-react-app || npm run test:lighthouse --prefix packages/template-retail-react-app || npm run test:lighthouse --prefix packages/template-retail-react-app
10+
- name: Run Lighthouse CI
11+
working-directory: ${{ inputs.project_dir }}
12+
run: |-
13+
lighthouse_test="npx @lhci/cli autorun --config=${{ github.action_path }}/${{ inputs.config_filename }}"
14+
# This test is flaky, so let's try it three times!
15+
$lighthouse_test || $lighthouse_test || $lighthouse_test
816
shell: bash
17+
env:
18+
NODE_ENV: production

packages/template-retail-react-app/tests/lighthouserc.js renamed to .github/actions/lighthouse_ci/lighthouserc.retail-react-app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7+
78
module.exports = {
89
// The different Lighthouse CI configuration options:
910
// https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/configuration.md
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: smoke_tests
1+
name: npm_scripts
22
inputs:
3-
dir:
4-
required: false
5-
# The path to a project to test
6-
default: "./packages/template-retail-react-app"
3+
cwd:
4+
required: true
75
runs:
86
using: composite
97
steps:
10-
- name: Smoke test scripts
8+
- name: Smoke test the npm scripts
119
run: |-
1210
# Basic smoke-tests for uncommonly run scripts in a project
13-
node ./scripts/smoke-test-npm-scripts.js --dir "${{ inputs.dir }}"
11+
node ./scripts/smoke-test-npm-scripts.js --dir "${{ inputs.cwd }}"
1412
shell: bash

.github/actions/push_to_mrt/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ inputs:
44
description: Project directory
55
default: ${{ github.workspace }}
66
TARGET:
7-
description: MRT target
7+
description: MRT target environment
88
FLAGS:
99
description: Push flags
10+
PROJECT:
11+
description: MRT target project
12+
default: "scaffold-pwa"
13+
MESSAGE:
14+
description: Bundle message / name
15+
default: "build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
1016
runs:
1117
using: composite
1218
steps:
1319
- name: Push Bundle to MRT
1420
run: |-
1521
cd ${{ inputs.CWD }}
16-
project="scaffold-pwa"
17-
build="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
1822
if [[ ${{ inputs.TARGET }} ]]; then
19-
npm run push -- -s $project --message "$build" --target ${{ inputs.TARGET }} ${{ inputs.FLAGS }}
23+
npm run push -- -s ${{ inputs.PROJECT }} --message "${{ inputs.MESSAGE }}" --target ${{ inputs.TARGET }} ${{ inputs.FLAGS }}
2024
fi
2125
shell: bash

0 commit comments

Comments
 (0)