Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ ignores:
# Include an explanation why the package is ignored
- '@babel/*' # Used in babel.config.js and babel.config.jest.js
- '@types/react-dom' # Used in src/index.jsx
- anypoint-cli-exchange-plugin # CLI tool executed via execSync in scripts, not imported
- anypoint-cli-v4 # CLI tool executed via execSync in scripts, not imported
- jest-environment-jsdom-sixteen # Used by test:react script in package.json
- lib # Used in App.jsx, references local directory
- node-fetch # False positive - clientConfig.ts imports the type from @types/node-fetch
Expand Down
20 changes: 20 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ $ yarn test

### Merging to `preview`

### Updating APIs
Update the version file in `api-versions.txt` to the version you want to test or add a new API. Use the API version from your API release or branch build.

Alternatively, you can run `yarn updateApiVersion` to update the `api-versions.txt` file with the latest API version snapshots for the APIs listed in the file.

To add a new API:

1. Edit `api-versions.txt` and add a new line following the existing format:
- `<api-asset-id-with-version-suffix>=<semantic-version>`
- Example:

```
shopper-newfeature-oas-v1=1.0.0
```

2. Run:
- `yarn updateApis` to download the API OAS into `apis/` directory

#### Update and Check SDK before merging:

Before merging any changes into `preview`, SDK generation must pass locally:

```
Expand Down
14 changes: 14 additions & 0 deletions api-versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
shopper-baskets-oas-v1=1.9.0
shopper-baskets-oas-v2=2.1.0
shopper-consents-oas-v1=1.1.0
shopper-context-oas-v1=1.1.1
shopper-customers-oas-v1=1.1.1
shopper-experience-oas-v1=1.0.7
shopper-gift-certificates-oas-v1=1.0.26
shopper-login-oas-v1=1.39.41
shopper-orders-oas-v1=1.5.0
shopper-products-oas-v1=1.0.37
shopper-promotions-oas-v1=1.0.36
shopper-search-oas-v1=1.3.0
shopper-seo-oas-v1=1.0.13
shopper-stores-oas-v1=1.0.17
9 changes: 0 additions & 9 deletions apis/shopper-baskets-oas-1.9.0/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-baskets-oas-2.1.0/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-consents-oas-1.1.0/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-context-oas-1.1.1/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-customers-oas-1.1.1/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-experience-oas-1.0.7/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-gift-certificates-oas-1.0.26/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-login-oas-1.39.41/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-orders-oas-1.5.0/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-products-oas-1.0.37/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-promotions-oas-1.0.36/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-search-oas-1.3.0/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-seo-oas-1.0.13/.metadata.json

This file was deleted.

17 changes: 0 additions & 17 deletions apis/shopper-stores-oas-1.0.17/.metadata.json

This file was deleted.

1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'scripts/**/*.{js,jsx,ts,tsx}',
'!scripts/generate.ts',
'!scripts/updateApis.ts',
'!scripts/utils.ts',
'!scripts/generateVersionTable.ts',
'!<rootDir>/node_modules/',
],
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"test": "yarn run check:types && yarn run test:unit && CI=true yarn run test:react",
"test:react": "react-scripts test --env=jest-environment-jsdom-sixteen src/environment",
"test:unit": "jest --coverage --testPathIgnorePatterns node_modules src/environment --silent",
"updateApis": "ts-node --compiler-options '{\"module\": \"commonjs\", \"target\": \"ES6\" }' ./scripts/updateApis.ts && yarn diffApis"
"updateApiVersions": "ts-node --compiler-options '{\"module\": \"commonjs\", \"target\": \"ES6\" }' scripts/updateApiVersions.ts",
"updateApis": "ts-node --compiler-options '{\"module\": \"commonjs\", \"target\": \"ES6\" }' scripts/updateApis.ts && yarn diffApis"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -93,7 +94,6 @@
"resolutions": {
"**/@npmcli/fs": "<1.1.0",
"**/@oclif/command": "<=1.8.3",
"**/@oclif/core": "<=0.5.9",
"**/isbot": "<=3.0.27",
"**/yargs": "<17",
"depcheck/@babel/parser": "7.16.4"
Expand All @@ -117,12 +117,16 @@
"@rollup/plugin-node-resolve": "8.4.0",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "10.4.9",
"@types/adm-zip": "^0.5.0",
"@types/fs-extra": "^9.0.13",
"@types/node-fetch": "^2.6.2",
"@types/react-dom": "^16.9.16",
"@types/seedrandom": "^3.0.8",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"adm-zip": "^0.5.10",
"anypoint-cli-exchange-plugin": "^1.0.0",
"anypoint-cli-v4": "1.6.12",
"autoprefixer": "9.8.8",
"bundlesize2": "^0.0.31",
"depcheck": "^1.4.3",
Expand Down Expand Up @@ -183,7 +187,7 @@
},
{
"path": "commerce-sdk-isomorphic-with-deps.tgz",
"maxSize": "2.5 MB"
"maxSize": "2.65 MB"
}
],
"proxy": "https://SHORTCODE.api.commercecloud.salesforce.com"
Expand Down
Loading
Loading