Prepare app for production
This commit is contained in:
parent
846ad44d89
commit
4bd75271aa
6 changed files with 56 additions and 27 deletions
9
.changeset/thirty-poets-collect.md
Normal file
9
.changeset/thirty-poets-collect.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
"saleor-app-data-importer": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Enable origins check for installation via env variables
|
||||||
|
|
||||||
|
Update app-sdk
|
||||||
|
|
||||||
|
Set Nuvo development mode based on env variables
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -38,4 +38,5 @@ yarn-error.log*
|
||||||
.saleor-app-auth.json
|
.saleor-app-auth.json
|
||||||
test-invoice.pdf
|
test-invoice.pdf
|
||||||
coverage/
|
coverage/
|
||||||
apps/**/generated
|
apps/**/generated
|
||||||
|
.eslintcache
|
|
@ -19,7 +19,7 @@
|
||||||
"@material-ui/core": "^4.12.4",
|
"@material-ui/core": "^4.12.4",
|
||||||
"@material-ui/icons": "^4.11.3",
|
"@material-ui/icons": "^4.11.3",
|
||||||
"@material-ui/lab": "4.0.0-alpha.61",
|
"@material-ui/lab": "4.0.0-alpha.61",
|
||||||
"@saleor/app-sdk": "0.26.1",
|
"@saleor/app-sdk": "0.28.0",
|
||||||
"@saleor/macaw-ui": "^0.7.2",
|
"@saleor/macaw-ui": "^0.7.2",
|
||||||
"@urql/exchange-auth": "^1.0.0",
|
"@urql/exchange-auth": "^1.0.0",
|
||||||
"@vitejs/plugin-react": "^3.1.0",
|
"@vitejs/plugin-react": "^3.1.0",
|
||||||
|
|
|
@ -36,7 +36,7 @@ const columns = getCustomersModelColumns();
|
||||||
|
|
||||||
const nuvoSettings: SettingsAPI = {
|
const nuvoSettings: SettingsAPI = {
|
||||||
columns,
|
columns,
|
||||||
developerMode: true, //todo
|
developerMode: process.env.NODE_ENV !== "production",
|
||||||
identifier: "customers",
|
identifier: "customers",
|
||||||
modal: false,
|
modal: false,
|
||||||
style: {
|
style: {
|
||||||
|
|
|
@ -2,8 +2,27 @@ import { createAppRegisterHandler } from "@saleor/app-sdk/handlers/next";
|
||||||
|
|
||||||
import { saleorApp } from "../../../saleor-app";
|
import { saleorApp } from "../../../saleor-app";
|
||||||
|
|
||||||
|
const allowedUrlsPattern = process.env.ALLOWED_DOMAIN_PATTERN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Required endpoint, called by Saleor to install app.
|
* Required endpoint, called by Saleor to install app.
|
||||||
* It will exchange tokens with app, so saleorApp.apl will contain token
|
* It will exchange tokens with app, so saleorApp.apl will contain token
|
||||||
*/
|
*/
|
||||||
export default createAppRegisterHandler(saleorApp);
|
export default createAppRegisterHandler({
|
||||||
|
apl: saleorApp.apl,
|
||||||
|
/**
|
||||||
|
* Prohibit installation from Saleors other than specified by the regex.
|
||||||
|
* Regex source is ENV so if ENV is not set, all installations will be allowed.
|
||||||
|
*/
|
||||||
|
allowedSaleorUrls: [
|
||||||
|
(url) => {
|
||||||
|
if (allowedUrlsPattern) {
|
||||||
|
const regex = new RegExp(allowedUrlsPattern);
|
||||||
|
|
||||||
|
return regex.test(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
|
@ -31,7 +31,7 @@ importers:
|
||||||
'@material-ui/core': ^4.12.4
|
'@material-ui/core': ^4.12.4
|
||||||
'@material-ui/icons': ^4.11.3
|
'@material-ui/icons': ^4.11.3
|
||||||
'@material-ui/lab': 4.0.0-alpha.61
|
'@material-ui/lab': 4.0.0-alpha.61
|
||||||
'@saleor/app-sdk': 0.26.1
|
'@saleor/app-sdk': 0.28.0
|
||||||
'@saleor/apps-shared': workspace:*
|
'@saleor/apps-shared': workspace:*
|
||||||
'@saleor/macaw-ui': ^0.7.2
|
'@saleor/macaw-ui': ^0.7.2
|
||||||
'@testing-library/react': ^13.4.0
|
'@testing-library/react': ^13.4.0
|
||||||
|
@ -65,7 +65,7 @@ importers:
|
||||||
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
|
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
|
||||||
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
|
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
|
||||||
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
|
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
|
||||||
'@saleor/app-sdk': 0.26.1_3vryta7zmbcsw4rrqf4axjqggm
|
'@saleor/app-sdk': 0.28.0_3vryta7zmbcsw4rrqf4axjqggm
|
||||||
'@saleor/apps-shared': link:../../packages/shared
|
'@saleor/apps-shared': link:../../packages/shared
|
||||||
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
|
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
|
||||||
'@urql/exchange-auth': 1.0.0_graphql@16.6.0
|
'@urql/exchange-auth': 1.0.0_graphql@16.6.0
|
||||||
|
@ -3784,27 +3784,6 @@ packages:
|
||||||
/@rushstack/eslint-patch/1.2.0:
|
/@rushstack/eslint-patch/1.2.0:
|
||||||
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
||||||
|
|
||||||
/@saleor/app-sdk/0.26.1_3vryta7zmbcsw4rrqf4axjqggm:
|
|
||||||
resolution: {integrity: sha512-gkNQusr8XrfLR7EcB5OKt2MV7og7g1TmdeGBTsdJwkRK18lhYz4fpTGqzoQ+3UrNq98TNuoM3dznr7oPi1QFUA==}
|
|
||||||
peerDependencies:
|
|
||||||
next: '>=12'
|
|
||||||
react: '>=17'
|
|
||||||
react-dom: '>=17'
|
|
||||||
dependencies:
|
|
||||||
debug: 4.3.4
|
|
||||||
fast-glob: 3.2.12
|
|
||||||
graphql: 16.6.0
|
|
||||||
jose: 4.11.4
|
|
||||||
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
|
|
||||||
raw-body: 2.5.1
|
|
||||||
react: 18.2.0
|
|
||||||
react-dom: 18.2.0_react@18.2.0
|
|
||||||
retes: 0.33.0
|
|
||||||
uuid: 8.3.2
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@saleor/app-sdk/0.26.1_biqbaboplfbrettd7655fr4n2y:
|
/@saleor/app-sdk/0.26.1_biqbaboplfbrettd7655fr4n2y:
|
||||||
resolution: {integrity: sha512-gkNQusr8XrfLR7EcB5OKt2MV7og7g1TmdeGBTsdJwkRK18lhYz4fpTGqzoQ+3UrNq98TNuoM3dznr7oPi1QFUA==}
|
resolution: {integrity: sha512-gkNQusr8XrfLR7EcB5OKt2MV7og7g1TmdeGBTsdJwkRK18lhYz4fpTGqzoQ+3UrNq98TNuoM3dznr7oPi1QFUA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -3888,6 +3867,27 @@ packages:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@saleor/app-sdk/0.28.0_3vryta7zmbcsw4rrqf4axjqggm:
|
||||||
|
resolution: {integrity: sha512-miH54G0/q+VPeWEnnyOdHac7/4DUB789O+eV0VmuYqsp9C3S7KWQXqmJ4Wb4V7M2NBHnLIVy8vnMQwCa5PTESw==}
|
||||||
|
peerDependencies:
|
||||||
|
next: '>=12'
|
||||||
|
react: '>=17'
|
||||||
|
react-dom: '>=17'
|
||||||
|
dependencies:
|
||||||
|
debug: 4.3.4
|
||||||
|
fast-glob: 3.2.12
|
||||||
|
graphql: 16.6.0
|
||||||
|
jose: 4.11.4
|
||||||
|
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
|
||||||
|
raw-body: 2.5.1
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0_react@18.2.0
|
||||||
|
retes: 0.33.0
|
||||||
|
uuid: 8.3.2
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@saleor/macaw-ui/0.7.2_2dwar4pp5qoelfawvjffoi6dne:
|
/@saleor/macaw-ui/0.7.2_2dwar4pp5qoelfawvjffoi6dne:
|
||||||
resolution: {integrity: sha512-Fli7fhTWuHu7q2CzxwTUpB4x9HYaxHSAzCLZLA23VY1ieIWbCxbsXadMiMGWp/nuYitswMr6JXMm+1SDe9K8LQ==}
|
resolution: {integrity: sha512-Fli7fhTWuHu7q2CzxwTUpB4x9HYaxHSAzCLZLA23VY1ieIWbCxbsXadMiMGWp/nuYitswMr6JXMm+1SDe9K8LQ==}
|
||||||
engines: {node: '>=16 <19'}
|
engines: {node: '>=16 <19'}
|
||||||
|
|
Loading…
Reference in a new issue