Skip to content

Commit

Permalink
Merge pull request #81 from Adyen/release/1.0.0-beta.3
Browse files Browse the repository at this point in the history
Release/1.0.0-beta.3
  • Loading branch information
shanikantsingh authored Dec 13, 2023
2 parents 281b8e9 + 1f1b76c commit c32b81a
Show file tree
Hide file tree
Showing 23 changed files with 4,846 additions and 17,726 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
with:
node-version: 18.15
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm install
# Copy LICENSE to adyen-salesforce-pwa package
- run: cp LICENSE packages/adyen-salesforce-pwa/
# Copy env example file to adyen-salesforce-pwa package
- run: cp packages/adyen-retail-react-app/.env.example packages/adyen-salesforce-pwa/
# Install the node modules
- run: cd packages/adyen-salesforce-pwa/ && npm ci
- run: cd packages/adyen-salesforce-pwa/ && npm install
# Build
- run: cd packages/adyen-salesforce-pwa/ && npm run build-prod
# Publish the npm package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Vagrantfile
.env
/build/
dist
coverage
45 changes: 43 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adyen-salesforce-pwa",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"license": "See license in LICENSE",
"engines": {
"node": "^16.0.0 || ^18.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/adyen-retail-react-app/build/loadable-stats.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"hash": "cd9e739667a258abddb4",
"hash": "84e140465b7193b7b54a",
"publicPath": "/mobify/bundle/development/",
"outputPath": "/Users/aleksandarm/Repositories/adyen-salesforce-headless-commerce-pwa/packages/adyen-retail-react-app/build",
"assetsByChunkName": {
Expand Down Expand Up @@ -54,7 +54,7 @@
{
"type": "asset",
"name": "vendor.js",
"size": 8675975,
"size": 8676138,
"emitted": false,
"comparedForEmit": false,
"cached": true,
Expand Down
7 changes: 4 additions & 3 deletions packages/adyen-retail-react-app/overrides/app/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ import {
DEFAULT_LIMIT_VALUES,
DEFAULT_SEARCH_PARAMS
} from '@salesforce/retail-react-app/app/constants'
/* -----------------Adyen Begin ------------------------ */
import {countryList} from '@adyen/adyen-salesforce-pwa'

export const SHIPPING_COUNTRY_CODES = countryList
/* -----------------Adyen End ------------------------ */

// original value is 25
DEFAULT_LIMIT_VALUES[0] = 3
DEFAULT_SEARCH_PARAMS.limit = 3

export const CUSTOM_HOME_TITLE = '🎉 Hello Extensible React Template!'

export {DEFAULT_LIMIT_VALUES, DEFAULT_SEARCH_PARAMS}

export const SHIPPING_COUNTRY_CODES = countryList

export * from '@salesforce/retail-react-app/app/constants'
20 changes: 13 additions & 7 deletions packages/adyen-retail-react-app/overrides/app/ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import {isRemote} from '@salesforce/pwa-kit-runtime/utils/ssr-server'
import {getConfig} from '@salesforce/pwa-kit-runtime/utils/ssr-config'
import helmet from 'helmet'
import bodyParser from 'body-parser'
/* -----------------Adyen Begin ------------------------ */
import {registerAdyenEndpoints} from '@adyen/adyen-salesforce-pwa/dist/ssr/index.js'

/* -----------------Adyen End ------------------------ */
const options = {
// The build directory (an absolute path)
buildDir: path.resolve(process.cwd(), 'build'),
Expand All @@ -35,7 +36,7 @@ const runtime = getRuntime()

const {handler} = runtime.createHandler(options, (app) => {
app.use(bodyParser.json())

/* -----------------Adyen Begin ------------------------ */
// Set HTTP security headers
app.use(
helmet({
Expand All @@ -50,7 +51,9 @@ const {handler} = runtime.createHandler(options, (app) => {
'*.paypal.com',
'*.media-amazon.com',
'*.payments-amazon.com',
'https://www.paypalobjects.com/js-sdk-logos/2.2.7/paypal-blue.svg'
'https://www.paypalobjects.com/js-sdk-logos/2.2.7/paypal-blue.svg',
'https://*.cash.app',
'https://*.gstatic.com'
],
'script-src': [
"'self'",
Expand All @@ -62,7 +65,10 @@ const {handler} = runtime.createHandler(options, (app) => {
'https://static-eu.payments-amazon.com/checkout.js',
'https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js',
'https://sandbox-assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visa-sdk.js?v2',
'https://pay.google.com/gp/p/js/pay.js'
'https://pay.google.com/gp/p/js/pay.js',
'https://*.cash.app',
'https://*.checkout.visa.com',
'https://*.mastercard.com'
],
'connect-src': [
"'self'",
Expand All @@ -72,7 +78,7 @@ const {handler} = runtime.createHandler(options, (app) => {
'https://www.sandbox.paypal.com/xoplatform/logger/api/logger?disableSetCookie=true'
],
'frame-src': ["'self'", '*.adyen.com', '*.paypal.com'],

/* -----------------Adyen End ------------------------ */
// Do not upgrade insecure requests for local development
'upgrade-insecure-requests': isRemote() ? [] : null
}
Expand All @@ -90,7 +96,7 @@ const {handler} = runtime.createHandler(options, (app) => {
app.get('/favicon.ico', runtime.serveStaticFile('static/ico/favicon.ico'))

app.get('/worker.js(.map)?', runtime.serveServiceWorker)

/* -----------------Adyen Begin ------------------------ */
/**
* Adyen API Endpoints
* - Environment
Expand All @@ -116,7 +122,7 @@ const {handler} = runtime.createHandler(options, (app) => {
* }
*/
registerAdyenEndpoints(app, runtime)

/* -----------------Adyen End ------------------------ */
app.get('*', runtime.render)
})
// SSR requires that we export a single handler function called 'get', that
Expand Down
Loading

0 comments on commit c32b81a

Please sign in to comment.