Skip to content

Commit

Permalink
feat(demo): add magento and venia environments (#2866)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jun 14, 2024
1 parent 546fbe3 commit 3876145
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
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',
},
};

0 comments on commit 3876145

Please sign in to comment.