Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/changelog-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ runs:
fi
echo "Changed files: $CHANGED_FILES"

PUBLIC_PACKAGES=("commerce-sdk-react" "pwa-kit-create-app" "pwa-kit-dev" "pwa-kit-react-sdk" "pwa-kit-runtime" "template-retail-react-app")
PUBLIC_PACKAGES=("commerce-sdk-react" "pwa-kit-create-app" "pwa-kit-dev" "pwa-kit-react-sdk" "pwa-kit-runtime")

for PACKAGE in "${PUBLIC_PACKAGES[@]}"; do
if echo "$CHANGED_FILES" | grep -iq "^packages/$PACKAGE/"; then
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:

- name: Get Template Version
run: |-
version=`jq -r ".version" packages/template-retail-react-app/package.json`
version=`jq -r ".version" packages/template-chakra-storefront/package.json`
echo "retail_app_template_version=$version" >> "$GITHUB_ENV"

- name: Generate Retail App Without Extensibility
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:

- name: Get Template Version
run: |-
version=`jq -r ".version" packages/template-retail-react-app/package.json`
version=`jq -r ".version" packages/template-chakra-storefront/package.json`
echo "retail_app_template_version=$version" >> "$GITHUB_ENV"

- name: Generate Retail App With Extensibility
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:

- name: Get Template Version
run: |-
version=`jq -r ".version" packages/template-retail-react-app/package.json`
version=`jq -r ".version" packages/template-chakra-storefront/package.json`
echo "retail_app_template_version=$version" >> "$GITHUB_ENV"

- name: Generate Retail App Private Client
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Get retail-react-app version
run: |-
version=`jq -r ".version" packages/template-retail-react-app/package.json | cut -d "-" -f 1`
version=`jq -r ".version" packages/template-chakra-storefront/package.json | cut -d "-" -f 1`
echo "retail_app_version_base=$version" >> "$GITHUB_ENV"

- name: Get commerce-sdk-react version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:

jobs:
setup-template-retail-react-app:
setup-template-chakra-storefront:
runs-on: ubuntu-latest
steps:
- name: Initialize
Expand Down Expand Up @@ -45,6 +45,6 @@ jobs:
with:
project_id: ${{ env.PROJECT_ID }}
target_id: ${{ env.MRT_TARGET_ID }}
project_dir: "./packages/template-retail-react-app"
project_dir: "./packages/template-chakra-storefront"
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
CWD: "./packages/template-chakra-storefront"
TARGET: staging

- name: Push Bundle to MRT (Commerce SDK React)
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ build
docs
coverage
scripts/generator/assets
app/static
static
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) that inc
- `pwa-kit-runtime`: A package that contains runtime environments for applications to run on Managed Runtime
- `template-express-minimal`: A project template that can be used as a starting point for a generic Express application (does not include React)
- `template-mrt-reference-app`: A project template that is used by the Managed Runtime team to test platform features
- `template-retail-react-app`: A project template that can be used as a starting point for a full retail storefront
- `template-chakra-storefront`: A project template that can be used as a starting point for a full retail storefront
- `template-typescript-minimal`: A project template with TypeScript support that can be used as a starting point for React projects
- `test-commerce-sdk-react`: A project that is used to test `commerce-sdk-react` and demonstrate usage of the library

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<br /><br />
The PWA Kit is a storefront technology for headless commerce using Salesforce Commerce APIs and React. It provides front-end developers with a more flexible and agile approach to build and maintain modern shopping experiences.
<br/><br/>
<img alt="pwa-kit banner" src="https://raw.githubusercontent.com/SalesforceCommerceCloud/pwa-kit/develop/packages/template-retail-react-app/app/static/img/hero.png" style="width: 700px; height:auto;">
<img alt="pwa-kit banner" src="https://raw.githubusercontent.com/SalesforceCommerceCloud/pwa-kit/develop/packages/template-chakra-storefront/static/img/hero.png" style="width: 700px; height:auto;">

</div>

Expand Down Expand Up @@ -55,7 +55,7 @@ npm run push -- -m "Message to help you recognize this bundle"

## 🌍 Localization

See the [Localization README.md](./packages/template-retail-react-app/translations/README.md) for important setup instructions for localization.
See the [Localization README.md](./packages/template-chakra-storefront/static/translations/README.md) for important setup instructions for localization.

## ⚠️ License Information

Expand Down
2 changes: 1 addition & 1 deletion packages/commerce-sdk-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ npm install @salesforce/commerce-sdk-react @tanstack/react-query
To integrate this library with your PWA Kit application you can use the `CommerceApiProvider` directly assuming that you use the `withReactQuery` higher order component to wrap your `AppConfig` component. Below is a snippet of how this is accomplished.

```jsx
// app/components/_app-config/index.jsx
// src/components/_app-config/index.jsx

import {CommerceApiProvider} from '@salesforce/commerce-sdk-react'
import {withReactQuery} from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/with-react-query'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This version of the application uses [Template Extensibility](https://developer.

## 🌍 Localization

See the [Localization README.md](./packages/template-retail-react-app/translations/README.md) for important setup instructions for localization.
See the [Localization README.md](./packages/template-chakra-storefront/static/translations/README.md) for important setup instructions for localization.

## 📖 Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/pwa-kit-dev/bin/pwa-kit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const getProjectName = async () => {
}

const getAppEntrypoint = () => {
return p.join(process.cwd(), 'app', 'ssr.js')
return p.join(process.cwd(), 'src', 'ssr.js')
}

const main = async () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/pwa-kit-dev/src/configs/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ const entryPointExists = (segments) => {
return false
}

const getAppEntryPoint = () => './app/main'
const getAppEntryPoint = () => './src/main'

const getServerEntryPoint = () => './app/ssr.js'
const getServerEntryPoint = () => './src/ssr.js'

const getPublicPathEntryPoint = () => {
return resolve(
Expand Down Expand Up @@ -356,7 +356,7 @@ const enableReactRefresh = (config) => {
}

const client =
entryPointExists(['app', 'main']) &&
entryPointExists(['src', 'main']) &&
baseConfig('web')
.extend(withChunking)
.extend((config) => {
Expand All @@ -377,7 +377,7 @@ const client =
new LoadablePlugin({writeToDisk: true}),
analyzeBundle && getBundleAnalyzerPlugin(CLIENT)
].filter(Boolean),
// Hide the performance hints, since we already have a similar `bundlesize` check in `template-retail-react-app` package
// Hide the performance hints, since we already have a similar `bundlesize` check in `template-chakra-storefront` package
performance: {
hints: false
}
Expand All @@ -396,7 +396,7 @@ const clientOptional = baseConfig('web')
...config,
name: CLIENT_OPTIONAL,
entry: {
...optional('loader', resolve(projectDir, 'app', 'loader.js')),
...optional('loader', resolve(projectDir, 'src', 'loader.js')),
...optional('worker', resolve(projectDir, 'worker', 'main.js')),
...optional('fetch-polyfill', resolve(projectDir, 'node_modules', 'whatwg-fetch'))
},
Expand Down Expand Up @@ -482,13 +482,13 @@ const ssr = (() => {
})()

const requestProcessor =
entryPointExists(['app', 'request-processor']) &&
entryPointExists(['src', 'request-processor']) &&
baseConfig('node')
.extend((config) => {
return {
...config,
name: REQUEST_PROCESSOR,
entry: './app/request-processor.js',
entry: './src/request-processor.js',
output: {
path: buildDir,
filename: 'request-processor.js',
Expand Down
12 changes: 6 additions & 6 deletions packages/pwa-kit-dev/src/configs/webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const getOverridePath = (relativePath) => {
'pwa-kit-react-sdk',
'ssr',
'universal',
...relativePath.filter((item) => item !== 'app')
...relativePath.filter((item) => item !== 'src')
)
}

Expand All @@ -41,23 +41,23 @@ export const sdkReplacementPlugin = () => {
const overridables = [
{
path: makeRegExp('pwa-kit-react-sdk(/dist)?/ssr/universal/components/_app-config$'),
newPath: getOverridePath(['app', 'components', '_app-config', 'index'])
newPath: getOverridePath(['src', 'components', '_app-config', 'index'])
},
{
path: makeRegExp('pwa-kit-react-sdk(/dist)?/ssr/universal/components/_document$'),
newPath: getOverridePath(['app', 'components', '_document', 'index'])
newPath: getOverridePath(['src', 'components', '_document', 'index'])
},
{
path: makeRegExp('pwa-kit-react-sdk(/dist)?/ssr/universal/components/_app$'),
newPath: getOverridePath(['app', 'components', '_app', 'index'])
newPath: getOverridePath(['src', 'components', '_app', 'index'])
},
{
path: makeRegExp('pwa-kit-react-sdk(/dist)?/ssr/universal/components/_error$'),
newPath: getOverridePath(['app', 'components', '_error', 'index'])
newPath: getOverridePath(['src', 'components', '_error', 'index'])
},
{
path: makeRegExp('pwa-kit-react-sdk(/dist)?/ssr/universal/routes$'),
newPath: getOverridePath(['app', 'routes'])
newPath: getOverridePath(['src', 'routes'])
}
]

Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-dev/src/ssr/server/build-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const DevServerMixin = {
// Warning: Ugly part of the Bundle spec that we need to maintain.
//
// This function assumes that an SDK build step will copy all
// non-webpacked assets from the 'app' dir to the 'build' dir.
// non-webpacked assets from the 'src' dir to the 'build' dir.
//
// If you look carefully through the history, this has never
// been true though – assets get copied from app/static to
Expand All @@ -270,7 +270,7 @@ export const DevServerMixin = {
// https://salesforce-internal.slack.com/archives/C8YDDMKFZ/p1677793769255659?thread_ts=1677791840.174309&cid=C8YDDMKFZ

return (req, res) => {
const baseDir = path.resolve(req.app.options.projectDir, 'app')
const baseDir = path.resolve(req.app.options.projectDir, 'src')
return this._serveStaticFile(req, res, baseDir, filePath, opts)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ describe('DevServer persistent caching support', () => {
res.status(status)
res.setHeader('content-type', 'application/javascript')
res.setHeader('content-encoding', 'gzip')
res.send(zlib.gzipSync(fse.readFileSync(path.join(testFixtures, 'app', 'main.js'))))
res.send(zlib.gzipSync(fse.readFileSync(path.join(testFixtures, 'src', 'main.js'))))
break

case 'compressed-responses-test':
Expand Down
2 changes: 1 addition & 1 deletion packages/pwa-kit-dev/src/utils/script-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ interface DependencyTree {
* @returns A DependencyTree with the versions of all dependencies
*/
export const getProjectDependencyTree = async (): Promise<DependencyTree | null> => {
// When executing this inside template-retail-react-app, the output of `npm ls` exceeds the
// When executing this inside template-chakra-storefont, the output of `npm ls` exceeds the
// max buffer size that child_process can handle, so we can't use that directly. The max string
// size is much larger, so writing/reading a temp file is a functional workaround.
const tmpDir = await mkdtemp(path.join(os.tmpdir(), 'pwa-kit-dev-'))
Expand Down
1 change: 1 addition & 0 deletions packages/template-chakra-storefront/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@salesforce/chakra-storefront",
"version": "0.1.0-extensibility-preview.5",
"private": true,
"bugs": {
"url": "https://github.com/SalesforceCommerceCloud/pwa-kit/issues"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const App = (props) => {

// Fetch the translation message data using the target locale.
const {data: messages} = useQuery({
queryKey: ['app', 'translations', 'messages', targetLocale],
queryKey: ['static', 'translations', 'messages', targetLocale],
queryFn: () => {
if (is404ForMissingTranslationFile) {
// Return early to prevent an infinite loop
Expand Down Expand Up @@ -305,7 +305,7 @@ const App = (props) => {
locale={targetLocale}
messages={messages}
// For react-intl, the _default locale_ refers to the locale that the inline `defaultMessage`s are written for.
// NOTE: if you update this value, please also update the following npm scripts in `template-retail-react-app/package.json`:
// NOTE: if you update this value, please also update the following npm scripts in `template-chakra-storefront/package.json`:
// - "extract-default-translations"
// - "compile-translations:pseudo"
defaultLocale={appConfig.defaultAppLocale}
Expand Down
Loading