Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Versioning the retail react app (#1209)
* more fixes for out of sync package / lockfiles * add missing pwa-kit packages * Fix regex matching patterns (#1057) * resolve package lock errors * clean console logs and code * more cleanup, remove duplicate items in overrideregex * upgrade minimatch version, match all file extensions, match with no file extension * fix dependency dupes * Remove all console logs / cleanup / unnecessary code * fix some problems with final cleanup * merge * remove stress test files post-merge * added pdp page override with small customization * add constants file to spike project and tweak overrides values * Fix bug where `<path>/dir/index.(js|jsx|etc)` was being picked up by template extensibility, but `<path>/dir/non-index-name.(js|jsx|etc)` was not * fix package.json scripts * fix falsy value defaulting causing errors in `path.join` fix broken `npm run push` * delete `build/loadable-stat.json` from git, gitignore should work from there * fix some file pathing issues in how SDK looks up default / universal / project components * Perf enhancements, don't use regex all (.*) for module replacement, reduce conditional logic execution * minor code style tweak * cleanup * initial work on moving code to use resolver * fix getoverridepath and break on ^ imports * add todos and comments * rewrite requestcontext.request for path with caret * perform overrideshashmap lookup for relative import * progress * fix conflicts * fix package lockfiles that were out of sync * Revert "fix package lockfiles that were out of sync" This reverts commit 7f3c364. * progress * fix out of sync lockfiles * merge conflict * resolve merge conflict * update spike project's engines / regen v3 lockfiles * regenerate lock files * add missing node engines * add missing useToast (bad merge) * updates from underlying template-retail-react-app * drop unnecessary pages/product-detail override * fix dupe useToast * progress on making `charles-solution` work * initial pass at migration to `resolver.getHook('resolve').tapAsync` working, TODO next... cleanup * restore icons file and add extensible text to home * add some comments and construct hashmap in new plugin * working glob sync lookup?? * resolve lookup when there is no extension * add component slot for testing * fix some lookup errors * migrate to new directory * remove unnecessary directory nesting, remove unnecessary files for "minimum file project" * add example of extending routes non-destructively, add example of quickly toggling some base constant values (e.g. categories shown on home page) * Update example route * add some demo examples of overrides * cleanup * commit package name change * rewrite requests coming from underlying template * cleanup * rename plugin file * remove unnecessary build files * rename to overrides * fix lookup errors * fix some broken upstream changes, eslint fixes * fix bad merge conflict * Bring back the deleted package.json * Install new eslint plugin * No more relative imports in retail-react-app * Create .prettierrc.yaml * restore other deleted package lockfiles * fix some eslint issues * remove `^` imports and begin migrating logic away from previous API. TODO: get webpack to resolve `retail-react-app` base import path from within `template-retail-react-app` * bring back deleted package lockfiles * short circuit plugin temporarily, get webpack `alias` working for template to resolve self-referencing `retail-react-app` imports * fix unreachable condition * wow... freaking works 🚀 * cleanup, get `template-retail-react-app` working again * cleanup * Create .eslintrc.js * fix routes.jsx which no longer pulled relative template * make routes.jsx more concise * update lockfiles * add jsconfig.json for IDEs to have magic `retail-react-app` be discoverable * more cleanup * change package.json key from `mobify` => `ccExtensibility` * cleanup * Final cleanup, remove console.logs, make `extendable` dynamic for internal file resolution in `template-retail-react-app` (and future projects), remove some non-required files, * fix straggler non-dynamic filepath * cleanup * remove code that shouldn't be in v3+ * bump-version script ignores the retail-react-app * See if this `--pre-dist-tag` works as expected * Clean up code * Add todo * sync package.json deps in extended example project * cleanup / pr feedback * Update npm scripts * Disable `npm install` step * List the packages' versions for easy review * Fix bug with versioning the root package file * A bit of refactoring * Some clean up * pr feedback, great catch @kevinxh * fix problem with bad copy from underlying template file * pr feedback / cleanup * cleanup Co-authored-by: Kevin He <kevin.he@salesforce.com> * Update package-lock.json * WIP * drop unneeded complexity * lockfiles * moving toward an array of `alias`es * Generator: try downloading retail-react-app@latest from npm * Some refactoring * Refactor template extensibility functionality to use `resolve.alias` + greatly reduce code footprint + make leading slash optional in `ccExtensibility.overridesDir` * Tweak the versioning logic * These are optional options * Use a new npm tag for testing purpose * add brand-logo with no clash for server side viewBox * add `request-processor.js` (required for worker.js to load) and fix bad extensibility path loading in `build-dev-server.js` * Add some comments * Install shelljs * retail-react-app: version updates scoped to this directory only * Update versioning logic in the root * retail-react-app: simplify the versioning logic * fake sdk release v3 * fake release of retail-react-app v1 * lint fix * fix failing pwa-kit-react-sdk tests * cleanup * regen package lockfiles * lint:fix * Explore publishing certain packages only * Revert "fake release of retail-react-app v1" This reverts commit f8dcaa0. * Revert "fake sdk release v3" This reverts commit 3aad2da. * fix failing tests in CI re: `TextDecoder is not defined` * take 2 attempting to fix TextDecoder global in jest * fix jest module mapper * fix jest moduleMapper config * REALLY fix jest moduleNameMapper config for new pathing + fix node `util` global TextDecoder is not defined in jest * add brand-logo * remove previously added `AbovePDP` Template Hook component * replay #1128 from bad merge * eslint:fix for `retail-react-app` base paths * de-duplicate deps in bundle * fix path defaulting, don't pass nullish value to path.resolve * improve pathing for overridesDir in pwa-kit-dev webapack config + add missing worker/main.js * fix pathing * fix pathing issue that was mysteriously UNFIXED * fix `worker.js` path * Now also increment the pre-release version of the templates * Now allows for publishing one package only to npm * fix app/static pathing in non-extensible builds * Make sure Lerna uses the exact versions (without carrot) * Update package.json * What I expect to see from Ben's work * Some refactoring * Scale to multiple independent packages * Make sure version updates are synced throughout * Some refactoring * Remove commented lines * No need to do version-pinning ourselves Because we now call `lerna version --exact`. * Add eslint and prettier * Move script to allow reuse by future templates * [Extensibility] Remove Einstein proxy and send Einstein events directly from app (#1202) * Remove Einstein proxy and send Einstein events directly from app * Update ssrParameters * Replace ExtendsCircularImportsPlugin with OverridesResolverPlugin (#1211) * Replace ExtendsCircularImportsPlugin with OverridesResolverPlugin * fix filepath problem --------- Co-authored-by: Brian Feister <bfeister@salesforce.com> * Move `npm install` to the publishing step * Update console log * Prep for fixing a bug * Updating a package version checks deps in other packages * remove irrelevant bundlesize check to pass CI * Extract shared util functions * Consistency: add newline to EOF * Get the name of the current package * Fix `vendor.js` inclusion of `retail-react-app` files (#1198) * fix duplicate lilbs in bundle * fix app/static pathing for non-extensible builds * oof, fix extensible app/static filepaths * Resolve conflicting npm deps via `resolve.alias` * add missing worker/main.js * cleanup unused imports * WIP, add list of original overridable deps * prevent template extensibility vendor.js from treating baseline route files as deps in vendor.js * fix irrelevant bundlesize declaration to pass CI * drop test:max-file-size test from my-extended-retail-app * replace relative with absolute path fetchTranslations (#1215) Co-authored-by: Brian Feister <47546998+bfeister@users.noreply.github.com> * For now, make this package private It's going to be deleted anyways in the near-future. * Iterate over the other packages only * Exclude these npm scripts from the smoke test * Handle scenario of an SDK package with independent version * Refactor for unit testing, fix pathing issue from old version of file parsing algoritihim * Add a 'sync' version of the script * Tweak conditions * Some refactoring * Some refactoring * Script to run a local npm registry * Add todos for bug fixes * Verify where the npm registry is * Ignore this linting error * Update regex * Add comments * Checks for clean working tree * Handle uncommitted changes * Make sure to update the package lock files * If error, make sure to still clean up * Install from the root * Some refactoring * No longer needing this install step Now that we've run install in earlier steps. * For safety * If not on CI, make sure to publish to local npm In order to avoid accidental publishing to remote npm registry. * Only exit if there's an error * remove demo extensible app in light of soon-to-be-merged PR from @bendvc * lockfiles from reaact18 / chakra2 * Feature/template extensibility (#1162) * initial work on moving code to use resolver * fix getoverridepath and break on ^ imports * add todos and comments * rewrite requestcontext.request for path with caret * perform overrideshashmap lookup for relative import * progress * progress * regenerate lock files * fix dupe useToast * progress on making `charles-solution` work * initial pass at migration to `resolver.getHook('resolve').tapAsync` working, TODO next... cleanup * restore icons file and add extensible text to home * add some comments and construct hashmap in new plugin * working glob sync lookup?? * resolve lookup when there is no extension * add component slot for testing * fix some lookup errors * cleanup * rewrite requests coming from underlying template * cleanup * rename plugin file * remove unnecessary build files * rename to overrides * fix lookup errors * fix some broken upstream changes, eslint fixes * Bring back the deleted package.json * Install new eslint plugin * No more relative imports in retail-react-app * Create .prettierrc.yaml * restore other deleted package lockfiles * fix some eslint issues * remove `^` imports and begin migrating logic away from previous API. TODO: get webpack to resolve `retail-react-app` base import path from within `template-retail-react-app` * short circuit plugin temporarily, get webpack `alias` working for template to resolve self-referencing `retail-react-app` imports * fix unreachable condition * wow... freaking works 🚀 * cleanup, get `template-retail-react-app` working again * cleanup * Create .eslintrc.js * fix routes.jsx which no longer pulled relative template * make routes.jsx more concise * update lockfiles * add jsconfig.json for IDEs to have magic `retail-react-app` be discoverable * more cleanup * change package.json key from `mobify` => `ccExtensibility` * cleanup * Final cleanup, remove console.logs, make `extendable` dynamic for internal file resolution in `template-retail-react-app` (and future projects), remove some non-required files, * fix straggler non-dynamic filepath * cleanup * remove code that shouldn't be in v3+ * sync package.json deps in extended example project * cleanup / pr feedback * pr feedback, great catch @kevinxh * fix problem with bad copy from underlying template file * pr feedback / cleanup * cleanup Co-authored-by: Kevin He <kevin.he@salesforce.com> * Update package-lock.json * WIP * drop unneeded complexity * lockfiles * moving toward an array of `alias`es * Refactor template extensibility functionality to use `resolve.alias` + greatly reduce code footprint + make leading slash optional in `ccExtensibility.overridesDir` * add brand-logo with no clash for server side viewBox * add `request-processor.js` (required for worker.js to load) and fix bad extensibility path loading in `build-dev-server.js` * lint fix * fix failing pwa-kit-react-sdk tests * cleanup * lint:fix * fix failing tests in CI re: `TextDecoder is not defined` * take 2 attempting to fix TextDecoder global in jest * fix jest module mapper * fix jest moduleMapper config * REALLY fix jest moduleNameMapper config for new pathing + fix node `util` global TextDecoder is not defined in jest * add brand-logo * remove previously added `AbovePDP` Template Hook component * replay #1128 from bad merge * eslint:fix for `retail-react-app` base paths * de-duplicate deps in bundle * fix path defaulting, don't pass nullish value to path.resolve * improve pathing for overridesDir in pwa-kit-dev webapack config + add missing worker/main.js * fix pathing * fix pathing issue that was mysteriously UNFIXED * fix `worker.js` path * fix app/static pathing in non-extensible builds * [Extensibility] Remove Einstein proxy and send Einstein events directly from app (#1202) * Remove Einstein proxy and send Einstein events directly from app * Update ssrParameters * Replace ExtendsCircularImportsPlugin with OverridesResolverPlugin (#1211) * Replace ExtendsCircularImportsPlugin with OverridesResolverPlugin * fix filepath problem --------- Co-authored-by: Brian Feister <bfeister@salesforce.com> * remove irrelevant bundlesize check to pass CI * Fix `vendor.js` inclusion of `retail-react-app` files (#1198) * fix duplicate lilbs in bundle * fix app/static pathing for non-extensible builds * oof, fix extensible app/static filepaths * Resolve conflicting npm deps via `resolve.alias` * add missing worker/main.js * cleanup unused imports * WIP, add list of original overridable deps * prevent template extensibility vendor.js from treating baseline route files as deps in vendor.js * fix irrelevant bundlesize declaration to pass CI * drop test:max-file-size test from my-extended-retail-app * replace relative with absolute path fetchTranslations (#1215) Co-authored-by: Brian Feister <47546998+bfeister@users.noreply.github.com> * Refactor for unit testing, fix pathing issue from old version of file parsing algoritihim * fix merge conflict resolution * remove template extensible demo in prep for @bendvc's pr for generator work * regen lockfiles for react 18 changes * fix linting --------- Co-authored-by: yunakim714 <yunakim@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> * support windows file paths * Remove package * Make sure versions are all 3.0.0-dev * Update package lock files * Follow up to recent merge conflicts * Revert these changes to the generator * Fix issue with failed tests because of react query dev tools * Let the output of `npm version` pass through * Revert "Let the output of `npm version` pass through" This reverts commit 33b3058. * Make sure to `npm install` after updating dependencies * Prepare to consolidate all of the versioning scripts And move them to the root of monorepo. * Move the rest of scripts into the monorepo root * commerce-sdk-react now has its own version * Use correct package name * Add todos * Reconsider where to do `npm install` * Clean up * Remove todo * Remove unused dependency * Some code cleanup * Move the versioning scripts into their own folder * Delete run-local-npm.js --------- Co-authored-by: Brian Feister <bfeister@salesforce.com> Co-authored-by: yunakim714 <yunakim@salesforce.com> Co-authored-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com> Co-authored-by: Brian Feister <47546998+bfeister@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com>
- Loading branch information