Skip to content

Commit

Permalink
Prepare for v3 preview release - @W-13481576@ (#1233)
Browse files Browse the repository at this point in the history
* 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

* Namespace all public packages with '@salesforce'

* Point to @salesforce/commerce-sdk-react

* Point to @salesforce/pwa-kit-dev

* Point to @salesforce/pwa-kit-react-sdk

* Point to @salesforce/pwa-kit-runtime

* Point to @salesforce/pwa-kit-create-app

* Update package locks

* Linting fix

* commerce-sdk-react@1.0.0-dev

* retail-react-app@1.0.0-dev

* Update `bin` field

* Update action.yml

* Fix source for templates on npm

* Comment out the check-dependencies.js for now

* Update "extendable" value

* Lint

* Fix jest module mapper

* Fix retail test app using wrong source and id

* Handle salesforce namespace in package name

* Add '@salesforce' to the prefix

---------

Co-authored-by: yunakim714 <yunakim@salesforce.com>
Co-authored-by: Brian Feister <bfeister@salesforce.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
10 people authored May 30, 2023
1 parent 3b574fc commit 9baf1c8
Show file tree
Hide file tree
Showing 339 changed files with 1,323 additions and 1,113 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup_ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ runs:
node ./scripts/gtime.js monorepo_install npm ci
# Build the PWA
npm run lerna -- run analyze-build --scope "retail-react-app"
npm run lerna -- run analyze-build --scope "@salesforce/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
# node ./scripts/check-dependencies.js
# Install Snyk CLI
# TODO: Ticket W-12425059. Revisit Snyk CLI integration to monitor manifest files on generated projects.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<h1>The Progressive Web App (PWA) Kit</h1>

[![npm](https://img.shields.io/npm/v/pwa-kit-react-sdk.svg)](https://www.npmjs.com/package/pwa-kit-react-sdk)
[![npm](https://img.shields.io/npm/v/@salesforce/pwa-kit-react-sdk.svg)](https://www.npmjs.com/package/@salesforce/pwa-kit-react-sdk)
[![License](https://img.shields.io/github/license/SalesforceCommerceCloud/pwa-kit.svg)](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/master/LICENSE)
[![Checks](https://img.shields.io/github/checks-status/SalesforceCommerceCloud/pwa-kit/develop.svg)](https://github.com/SalesforceCommerceCloud/pwa-kit)
[![npm](https://img.shields.io/npm/dm/pwa-kit-react-sdk.svg)](https://www.npmjs.com/package/pwa-kit-react-sdk)
[![npm](https://img.shields.io/npm/dm/@salesforce/pwa-kit-react-sdk.svg)](https://www.npmjs.com/package/@salesforce/pwa-kit-react-sdk)

</div>

Expand Down Expand Up @@ -34,7 +34,7 @@ The PWA Kit is a storefront technology for headless commerce using Salesforce Co
### Create Your First Project

```bash
npx pwa-kit-create-app
npx @salesforce/pwa-kit-create-app
```

Enter your [sandbox configuration](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/getting-started.html#new-project).
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "3.0.0-dev",
"scripts": {
"bump-version": "node ./scripts/bump-version/index.js",
"bump-version:retail-react-app": "node ./scripts/bump-version/index.js --package=retail-react-app",
"bump-version:commerce-sdk-react": "node ./scripts/bump-version/index.js --package=commerce-sdk-react-preview",
"bump-version:retail-react-app": "node ./scripts/bump-version/index.js --package=@salesforce/retail-react-app",
"bump-version:commerce-sdk-react": "node ./scripts/bump-version/index.js --package=@salesforce/commerce-sdk-react",
"publish-to-npm": "node ./scripts/publish-to-npm.js",
"format": "lerna run --stream format",
"preinstall": "node ./scripts/check-version.js",
Expand All @@ -27,4 +27,4 @@
"node": "^16.11.0 || ^18.0.0",
"npm": "^8.0.0 || ^9.0.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/commerce-sdk-react/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/

module.exports = {
extends: [require.resolve('pwa-kit-dev/configs/eslint')]
extends: [require.resolve('@salesforce/pwa-kit-dev/configs/eslint')]
}
1 change: 1 addition & 0 deletions packages/commerce-sdk-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## v1.0.0-dev (May 29, 2023)
## v3.0.0-dev (May 12, 2023)

- Add missing cache invalidation for contexts/customers/login/order [#1073](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1073)
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 @@ -26,7 +26,7 @@ To integrate this library with your PWA Kit application you can use the `Commerc
// app/components/_app-config/index.jsx

import {CommerceApiProvider} from '@salesforce/commerce-sdk-react'
import {withReactQuery} from 'pwa-kit-react-sdk/ssr/universal/components/with-react-query'
import {withReactQuery} from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/with-react-query'

const AppConfig = ({children}) => {
return (
Expand Down
8 changes: 4 additions & 4 deletions packages/commerce-sdk-react/package-lock.json

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

6 changes: 3 additions & 3 deletions packages/commerce-sdk-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commerce-sdk-react-preview",
"version": "3.0.0-dev",
"name": "@salesforce/commerce-sdk-react",
"version": "1.0.0-dev",
"description": "A library that provides react hooks for fetching data from Commerce Cloud",
"homepage": "https://github.com/SalesforceCommerceCloud/pwa-kit/tree/develop/packages/ecom-react-hooks#readme",
"bugs": {
Expand Down Expand Up @@ -60,7 +60,7 @@
"jsonwebtoken": "^8.5.1",
"nock": "^13.3.0",
"nodemon": "^2.0.22",
"pwa-kit-dev": "3.0.0-dev",
"@salesforce/pwa-kit-dev": "3.0.0-dev",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/internal-lib-build/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/

module.exports = {
extends: [require.resolve('pwa-kit-dev/configs/eslint/no-react')]
extends: [require.resolve('@salesforce/pwa-kit-dev/configs/eslint/no-react')]
}
2 changes: 1 addition & 1 deletion packages/internal-lib-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"devDependencies": {
"npm-packlist": "^4.0.0",
"pwa-kit-dev": "3.0.0-dev",
"@salesforce/pwa-kit-dev": "3.0.0-dev",
"typescript": "4.8.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/pwa-kit-create-app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/

module.exports = {
extends: [require.resolve('pwa-kit-dev/configs/eslint/no-react')]
extends: [require.resolve('@salesforce/pwa-kit-dev/configs/eslint/no-react')]
}
6 changes: 3 additions & 3 deletions packages/pwa-kit-create-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ A tool for generating PWA Kit projects based on project templates, such as the [
To get started, open a terminal and run the following:

```bash
npx pwa-kit-create-app
npx @salesforce/pwa-kit-create-app
```

For help, run:

```bash
npx pwa-kit-create-app --help
npx @salesforce/pwa-kit-create-app --help
```

## Documentation
Expand All @@ -41,4 +41,4 @@ The full documentation for PWA Kit and Managed Runtime is hosted on the [Salesfo


## Support Policy
Security patches are provided for 24 months after the general availability of each major version of the SDK (1.0, 2.0, and so on).
Security patches are provided for 24 months after the general availability of each major version of the SDK (1.0, 2.0, and so on).
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/

module.exports = {
extends: [require.resolve('pwa-kit-dev/configs/eslint')]
extends: [require.resolve('@salesforce/pwa-kit-dev/configs/eslint')]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = require('pwa-kit-dev/configs/babel/babel-config')
module.exports = require('@salesforce/pwa-kit-dev/configs/babel/babel-config')
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import {start, registerServiceWorker} from 'pwa-kit-react-sdk/ssr/browser/main'
import {start, registerServiceWorker} from '@salesforce/pwa-kit-react-sdk/ssr/browser/main'

const main = () => {
// The path to your service worker should match what is set up in ssr.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// it processes requests in whatever way your project requires.

// Uncomment the following line for the example code to work.
import {QueryParameters} from 'pwa-kit-runtime/utils/ssr-request-processing'
import {QueryParameters} from '@salesforce/pwa-kit-runtime/utils/ssr-request-processing'

/**
* The processRequest function is called for *every* non-proxy, non-bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {routes} from '{{preset.templateSource.id}}/app/routes'
{{!-- TODO: The configure routes should be an optional opt-in provided from the SDK. --}}
import {configureRoutes} from '{{preset.templateSource.id}}/app/utils/routes-utils'
import {getConfig} from 'pwa-kit-runtime/utils/ssr-config'
import {getConfig} from '@salesforce/pwa-kit-runtime/utils/ssr-config'

{{!-- export default routes --}}
export default () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
'use strict'

const path = require('path')
const {getRuntime} = require('pwa-kit-runtime/ssr/server/express')
const {isRemote} = require('pwa-kit-runtime/utils/ssr-server')
const {getConfig} = require('pwa-kit-runtime/utils/ssr-config')
const {getRuntime} = require('@salesforce/pwa-kit-runtime/ssr/server/express')
const {isRemote} = require('@salesforce/pwa-kit-runtime/utils/ssr-server')
const {getConfig} = require('@salesforce/pwa-kit-runtime/utils/ssr-config')
const helmet = require('helmet')

const options = {
Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-create-app/package-lock.json

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

6 changes: 3 additions & 3 deletions packages/pwa-kit-create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pwa-kit-create-app",
"name": "@salesforce/pwa-kit-create-app",
"version": "3.0.0-dev",
"description": "Salesforce's project generator tool",
"homepage": "https://github.com/SalesforceCommerceCloud/pwa-kit/tree/develop/packages/pwa-kit-create-app#readme",
Expand All @@ -12,7 +12,7 @@
},
"license": "See license in LICENSE",
"author": "cc-pwa-kit@salesforce.com",
"bin": "scripts/create-mobify-app.js",
"bin": {"pwa-kit-create-app": "scripts/create-mobify-app.js"},
"files": [
"assets",
"templates"
Expand All @@ -37,7 +37,7 @@
},
"devDependencies": {
"internal-lib-build": "3.0.0-dev",
"pwa-kit-dev": "3.0.0-dev",
"@salesforce/pwa-kit-dev": "3.0.0-dev",
"verdaccio": "^5.22.1"
},
"engines": {
Expand Down
13 changes: 8 additions & 5 deletions packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* script but does setup/teardown of a local NPM repository that lets us test some
* important edge-cases. Those are:
*
* 1. Testing `npx pwa-kit-create-app` without publishing to the public NPM repo.
* 1. Testing `npx @salesforce/pwa-kit-create-app` without publishing to the public NPM repo.
* 2. Realistically testing generated projects as though they were installed from
* the public NPM repo.
*
Expand All @@ -22,7 +22,7 @@
*
* ## Detailed Explanations
*
* ### Testing `npx pwa-kit-create-app`
* ### Testing `npx @salesforce/pwa-kit-create-app`
*
* It is simply not possible to test the behaviour of the `npx` command without
* first publishing the package under test. We don't want to publish to the public
Expand Down Expand Up @@ -128,9 +128,12 @@ const runGenerator = () => {
const foundNpm = cp.spawnSync(npm, ['-v']).stdout.toString().trim()
const flags = semver.satisfies(foundNpm, '>=7') ? '-y' : ''

cp.execSync(`npx ${flags} pwa-kit-create-app@latest ${process.argv.slice(2).join(' ')}`, {
stdio: 'inherit'
})
cp.execSync(
`npx ${flags} @salesforce/pwa-kit-create-app@latest ${process.argv.slice(2).join(' ')}`,
{
stdio: 'inherit'
}
)
}

const main = () => {
Expand Down
10 changes: 5 additions & 5 deletions packages/pwa-kit-create-app/scripts/create-mobify-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* ## Basic usage
*
* We expect end-users to generate projects by running `npx pwa-kit-create-app` on
* We expect end-users to generate projects by running `npx @salesforce/pwa-kit-create-app` on
* the CLI and following the prompts. Users must be able to run that command without
* installing any dependencies first.
*
Expand Down Expand Up @@ -197,7 +197,7 @@ const PRESETS = [
shortDescription: 'The Retail app using your own Commerce Cloud instance',
templateSource: {
type: TEMPLATE_SOURCE_NPM,
id: 'retail-react-app'
id: '@salesforce/retail-react-app'
},
questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS],
assets: ['translations'],
Expand All @@ -215,7 +215,7 @@ const PRESETS = [
shortDescription: 'The Retail app with demo Commerce Cloud instance',
templateSource: {
type: TEMPLATE_SOURCE_NPM,
id: 'retail-react-app'
id: '@salesforce/retail-react-app'
},
questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS],
answers: {
Expand All @@ -237,8 +237,8 @@ const PRESETS = [
name: 'Retail React App Test Project',
description: '',
templateSource: {
type: TEMPLATE_SOURCE_BUNDLE,
id: 'retail-react-app'
type: TEMPLATE_SOURCE_NPM,
id: '@salesforce/retail-react-app'
},
questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS],
answers: {
Expand Down
Loading

0 comments on commit 9baf1c8

Please sign in to comment.