Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(demo): add magento and venia environments #2866

Merged
Merged
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
34 changes: 27 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@
}
},
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/apps/demo",
"index": "apps/demo/src/index.html",
"main": "apps/demo/src/main.ts",
"polyfills": "apps/demo/src/polyfills.ts",
"browser": "apps/demo/src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "apps/demo/tsconfig.app.json",
"assets": [
"apps/demo/src/assets",
Expand All @@ -127,9 +129,7 @@
},
"scripts": [],
"aot": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
Expand All @@ -148,14 +148,28 @@
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "apps/demo/src/environments/environment.ts",
"with": "apps/demo/src/environments/environment.prod.ts"
}
]
},
"magento": {
"fileReplacements": [
{
"replace": "apps/demo/src/environments/environment.ts",
"with": "apps/demo/src/environments/environment.magento.ts"
}
]
},
"venia": {
"fileReplacements": [
{
"replace": "apps/demo/src/environments/environment.ts",
"with": "apps/demo/src/environments/environment.venia.ts"
}
]
}
},
"defaultConfiguration": ""
Expand All @@ -171,6 +185,12 @@
"configurations": {
"production": {
"buildTarget": "demo:build:production"
},
"magento": {
"buildTarget": "demo:build:magento"
},
"venia": {
"buildTarget": "demo:build:venia"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions apps/demo/src/environments/environment.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// `ng build --configuration production` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

import { DaffAuthorizeNetConfig } from '@daffodil/authorizenet/driver';

export const DemoDriverVariantEnum = {
IN_MEMORY: 0,
MAGENTO: 1,
Expand All @@ -15,6 +17,7 @@ export interface InMemoryEnviromentDriverConfiguration {
export interface MagentoEnvironmentDriverConfiguration {
variant: typeof DemoDriverVariantEnum.MAGENTO;
domain: string;
anetConfig: DaffAuthorizeNetConfig;
}

export interface ShopifyEnviromentDriverConfiguration {
Expand Down
5 changes: 5 additions & 0 deletions apps/demo/src/environments/environment.magento.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ export const environment: EnvironmentConfiguration = {
driver: {
variant: DemoDriverVariantEnum.MAGENTO,
domain: 'https://magento2.test',
anetConfig: {
// TODO: add these
clientKey: '',
apiLoginID: '',
},
},
};
15 changes: 15 additions & 0 deletions apps/demo/src/environments/environment.venia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
EnvironmentConfiguration,
DemoDriverVariantEnum,
} from './environment.interface';

/**
* The environment configuration of the magento environment
*/
export const environment: EnvironmentConfiguration = {
production: true,
driver: {
variant: DemoDriverVariantEnum.MAGENTO,
domain: 'https://venia.magento.com',
},
};
Loading