Skip to content

Commit

Permalink
Merge branch 'develop' into spike/upgradeability
Browse files Browse the repository at this point in the history
* develop: (52 commits)
  fix localstorage key by add siteId prefix (#988)
  [Shopper Experience] `ImageTile` component (#967)
  Skip Snyk CLI (#983)
  fix(retail-react-app): recent searches (#969)
  [Feature] Shopper Experience / Page Designer Components (#963)
  fix(template-retail-react-app): improved handling of blocked einstein requests (#970)
  remove getResetPasswordToken from not implemented list (#973)
  Apply changes from commerce react sdk in feature branch (#964)
  Add Shopper Experience hooks (#958)
  chore: update pwa-kit-dev eslint config (#950)
  Serialize category data once only (#953)
  Fix layout shift for mega menu (#952)
  Update customer baskets cache when there is a basket mutation (#945)
  Remove the PersistentCache functionality (#949)
  Replace isomorphic jest mocks with msw handlers (#944)
  fix: handle special characters in `boldString` util (#942)
  Fix broken CI – confusing path to package.json in the 'dist' directory! (#946)
  @W-11920099 Re-write 'npm push' in Typescript, warn if Node deprecated (#763)
  Allow support for multiple sites concurrently w/ `commerce-sdk-react` (#911)
  Update `develop` with v2.6.0 (#939)
  ...

# Conflicts:
#	lerna.json
#	package-lock.json
#	package.json
#	packages/commerce-sdk-react/CHANGELOG.md
#	packages/commerce-sdk-react/package-lock.json
#	packages/commerce-sdk-react/package.json
#	packages/internal-lib-build/package-lock.json
#	packages/internal-lib-build/package.json
#	packages/pwa-kit-create-app/package-lock.json
#	packages/pwa-kit-create-app/package.json
#	packages/pwa-kit-dev/CHANGELOG.md
#	packages/pwa-kit-dev/bin/pwa-kit-dev.js
#	packages/pwa-kit-dev/package-lock.json
#	packages/pwa-kit-dev/package.json
#	packages/pwa-kit-react-sdk/CHANGELOG.md
#	packages/pwa-kit-react-sdk/package-lock.json
#	packages/pwa-kit-react-sdk/package.json
#	packages/pwa-kit-react-sdk/src/ssr/browser/main.jsx
#	packages/pwa-kit-runtime/CHANGELOG.md
#	packages/pwa-kit-runtime/package-lock.json
#	packages/pwa-kit-runtime/package.json
#	packages/template-express-minimal/package-lock.json
#	packages/template-express-minimal/package.json
#	packages/template-retail-react-app/app/commerce-api/mock-data.js
#	packages/template-retail-react-app/package-lock.json
#	packages/template-retail-react-app/package.json
#	packages/template-typescript-minimal/package-lock.json
#	packages/template-typescript-minimal/package.json
#	packages/test-commerce-sdk-react/package-lock.json
#	packages/test-commerce-sdk-react/package.json
  • Loading branch information
bfeister committed Feb 16, 2023
2 parents e787d68 + 9a0900e commit 4db08c6
Show file tree
Hide file tree
Showing 258 changed files with 9,870 additions and 7,883 deletions.
470 changes: 0 additions & 470 deletions .circleci/config.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'',
{
pattern: '^ \\* Copyright \\(c\\) \\d{4}, (salesforce.com, inc|Salesforce, Inc)\\.$',
template: ' * Copyright (c) 2022, Salesforce, Inc.'
template: ` * Copyright (c) ${new Date().getFullYear()}, Salesforce, Inc.`
},
' * All rights reserved.',
' * SPDX-License-Identifier: BSD-3-Clause',
Expand All @@ -17,4 +17,4 @@ module.exports = {
]
]
}
}
}
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/package-lock.json binary linguist-generated=true
* text=auto
* text=auto eol=lf
12 changes: 12 additions & 0 deletions .github/actions/check_clean/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: check_clean
runs:
using: composite
steps:
- name: Check Repository Clean
run: |-
# Print status for debugging on CircleCI.
git status
# Fail the build if any step leaves uncommitted changes in the repo
# that would prevent Lerna from publishing (Lerna gets this right).
git diff --exit-code
shell: bash
18 changes: 18 additions & 0 deletions .github/actions/count_deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: count_deps
runs:
using: composite
steps:
- name: Count Generated Project Dependencies
# TODO: Can TOTAL_PACKAGES be exported in a cleaner way?
run: |-
MAX_PACKAGES="2260"
total=$(./scripts/count-dependencies.js generated-${{ matrix.template }})
echo "TOTAL_PACKAGES=${total}" >> $GITHUB_ENV
if [ "$total" -gt "$MAX_PACKAGES" ]; then
echo "Error: Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
exit 1;
else
echo "Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
fi
shell: bash
14 changes: 14 additions & 0 deletions .github/actions/create_mrt/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: create_mrt
inputs:
mobify_user:
description: "Mobify user email"
mobify_api_key:
description: "Mobify user API key"
runs:
using: composite
steps:
- name: Create MRT credentials file
run: |-
# Add credentials file at ~/.mobify so we can upload to Mobify Cloud
npm run save-credentials --prefix packages/template-retail-react-app -- --user "${{inputs.mobify_user}}" --key "${{inputs.mobify_api_key}}"
shell: bash
16 changes: 16 additions & 0 deletions .github/actions/datadog/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: datadog
inputs:
datadog_api_key:
description: "Datadog API key"
TOTAL_PACKAGES:
description: "Total # of packages"
runs:
using: composite
steps:
- name: Send metrics to Datadog
run : |
# Add a dogrc so we can submit metrics to datadog
printf "[Connection]\napikey = ${{inputs.datadog_api_key}}\nappkey =\n" > ~/.dogrc
dog metric post mobify_platform_sdks.generated_project_total_packages ${{ inputs.TOTAL_PACKAGES }}
shell: bash
7 changes: 7 additions & 0 deletions .github/actions/lighthouse_ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: lighthouse_ci
runs:
using: composite
steps:
- name: Run Lighthouse CI on the PWA
run: npm run test:lighthouse --prefix packages/template-retail-react-app
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/publish_to_npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish_to_npm
inputs:
NODE_AUTH_TOKEN:
description: "Node auth token"
runs:
using: composite
steps:
# TODO: Figure out a way to specify whether to publish to "latest" or "next" tag
- name: Publish to NPM
run: |-
# Add NPM token to allow publishing
echo "//registry.npmjs.org/:_authToken=${{ inputs.NODE_AUTH_TOKEN }}" > ~/.npmrc
# Publish all changed packages. The "from-package" arg means "look
# at the version numbers in each package.json file and if that doesn't
# exist on NPM, publish"
npm run lerna -- publish from-package --yes --no-verify-access
# Cleanup
rm ~/.npmrc
shell: bash
18 changes: 18 additions & 0 deletions .github/actions/push_to_mrt/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: push_to_mrt
inputs:
CWD:
description: Project directory
TARGET:
description: MRT target
runs:
using: composite
steps:
- name: Push Bundle to MRT
run: |-
cd ${{ inputs.CWD }}
project="scaffold-pwa"
build="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
if [[ ${{ inputs.TARGET }} ]]; then
npm run push -- -s $project --message "$build" --target ${{ inputs.TARGET }}
fi
shell: bash
37 changes: 37 additions & 0 deletions .github/actions/setup_ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: setup_ubuntu
inputs:
cwd:
required: false
default: "${PWD}"
description: "Setup Ubuntu Machine"
runs:
using: composite
steps:
- name: Install Dependencies
run: |-
# Install system dependencies
sudo apt-get update -yq
sudo apt-get install python2 python3-pip time -yq
sudo pip install -U pip setuptools
sudo pip install awscli==1.18.85 datadog==0.40.1
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci
# Build the PWA
npm run lerna -- run analyze-build --scope "retail-react-app"
# Report bundle sizes
node ./scripts/report-bundle-size.js
# Check that packages are all using the same versions of compilers, etc.
node ./scripts/check-dependencies.js
# Install Snyk CLI
# TODO: Ticket W-12425059. Revisit Snyk CLI integration to monitor manifest files on generated projects.
# TODO: Latest Snyk CLI version is currently failing on npm i. We use the alternative Snyk GitHub integration.
# sudo npm install -g snyk
# Install Lighthouse CI CLI
sudo npm install -g @lhci/cli
shell: bash
14 changes: 14 additions & 0 deletions .github/actions/setup_windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: setup_windows
inputs:
cwd:
required: false
default: "${PWD}"
description: "Setup Windows Machine"
runs:
using: composite
steps:
- name: Install Dependencies
run: |-
# Install node dependencies
npm ci
shell: bash
14 changes: 14 additions & 0 deletions .github/actions/smoke_tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: smoke_tests
inputs:
dir:
required: false
# The path to a project to test
default: "./packages/template-retail-react-app"
runs:
using: composite
steps:
- name: Smoke test scripts
run: |-
# Basic smoke-tests for uncommonly run scripts in a project
node ./scripts/smoke-test-npm-scripts.js --dir ${{ inputs.dir }}
shell: bash
15 changes: 15 additions & 0 deletions .github/actions/snyk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: snyk
inputs:
snyk_token:
description: "Snyk token"
DEVELOP:
description: "Is this the 'develop' branch?"
runs:
using: composite
steps:
- name: Audit Generated Project
run: |-
# Run snyk auth - authenticate snyk using environment variables to add the token
snyk auth ${{ inputs.snyk_token }}
snyk monitor --ignore-policy --remote-repo-url='https://github.com/SalesforceCommerceCloud/pwa-kit.git' --project-name='generated-scaffold-pwa'
shell: bash
27 changes: 27 additions & 0 deletions .github/actions/unit_tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: unit_tests
inputs:
cwd:
required: false
default: "${PWD}"
description: "Run tests action description"
runs:
using: composite
steps:
- name: Run tests step
# TODO: The pilefile policy is a legacy of CircleCI. Is it still needed?
run: |-
# Explicitly set pipefile policy. This is the default for non-windows, but seems
# that is needs to be set on windows to fail immediately.
set -eo pipefail
cd ${{ inputs.cwd }}
# Note: Each of these test commands need to be exposed on the monorepo
# root and *also* on the PWA package. This section is run on both.
# Ensure bundlesize is in check
npm run test:max-file-size
# Always run fast unit tests
npm run test
shell: bash

0 comments on commit 4db08c6

Please sign in to comment.