-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from mollie/release/v1.2.0
[1.2.0] Custom application
- Loading branch information
Showing
117 changed files
with
147,951 additions
and
655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ENABLE_NEW_JSX_TRANSFORM="true" | ||
FAST_REFRESH="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ENABLE_NEW_JSX_TRANSFORM="true" | ||
FAST_REFRESH="true" | ||
|
||
ENTRY_POINT_URI_PATH="mollie" | ||
PROJECT_KEY="your-project-key" | ||
CLOUD_IDENTIFIER="gcp-eu" | ||
CUSTOM_APPLICATION_ID="app-id" | ||
APPLICATION_URL="http://localhost:3001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
process.env.ENABLE_NEW_JSX_TRANSFORM = 'true'; | ||
|
||
/** | ||
* @type {import("eslint").Linter.Config} | ||
*/ | ||
module.exports = { | ||
extends: ['@commercetools-frontend/eslint-config-mc-app'], | ||
plugins: ['graphql', 'cypress'], | ||
overrides: [ | ||
{ | ||
files: ['**/*.ctp.graphql'], | ||
rules: { | ||
'graphql/template-strings': [ | ||
'error', | ||
{ | ||
env: 'literal', | ||
schemaJson: require('./schemas/ctp.json'), | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
public | ||
dist | ||
!.env | ||
|
||
# Cypress | ||
cypress/.env | ||
cypress/screenshots/** | ||
cypress/videos/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
i18n/data/*.json | ||
public | ||
.cache | ||
.yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"parser": "typescript", | ||
"overrides": [ | ||
{ | ||
"files": "*.json", | ||
"options": { | ||
"parser": "json" | ||
} | ||
}, | ||
{ | ||
"files": "*.graphql", | ||
"options": { | ||
"parser": "graphql" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* THIS IS A GENERATED FILE */ | ||
/* eslint-disable import/no-duplicates */ | ||
|
||
declare module '*/fetch-channel-details.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const FetchChannelDetails: DocumentNode; | ||
|
||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/fetch-channels.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const FetchChannels: DocumentNode; | ||
|
||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/update-channel-details.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const UpdateChannelDetails: DocumentNode; | ||
|
||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/fetch-custom-objects.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const FetchCustomObjects: DocumentNode; | ||
|
||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/fetch-custom-object-details.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const UpdateCustomObjects: DocumentNode; | ||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/update-custom-object-details.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const UpdateCustomObjectDetails: DocumentNode; | ||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/remove-custom-object-details.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const RemoveCustomObjectDetails: DocumentNode; | ||
export default defaultDocument; | ||
} | ||
|
||
declare module '*/fetch-extension-destination.ctp.graphql' { | ||
import { DocumentNode } from 'graphql'; | ||
const defaultDocument: DocumentNode; | ||
export const FetchExtensionDestination: DocumentNode; | ||
export default defaultDocument; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
declare module '@commercetools/sync-actions' { | ||
export type SyncAction = { action: string; [x: string]: unknown }; | ||
function buildActions<NextDraft, OriginalDraft>( | ||
nextDraft: NextDraft, | ||
originalDraft: OriginalDraft | ||
): SyncAction[]; | ||
export type Syncer = { | ||
buildActions: typeof buildActions; | ||
}; | ||
export function createSyncChannels(): Syncer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<p align="center"> | ||
<a href="https://commercetools.com/"> | ||
<img alt="commercetools logo" src="https://unpkg.com/@commercetools-frontend/assets/logos/commercetools_primary-logo_horizontal_RGB.png"> | ||
</a> | ||
<b>Custom Application starter template in TypeScript</b> | ||
</p> | ||
|
||
This is the [TypeScript](https://www.typescriptlang.org/) version of the starter template to [develop Custom Applications](https://docs.commercetools.com/merchant-center-customizations/custom-applications) for the Merchant Center. | ||
|
||
# Installing the template | ||
|
||
Read the [Getting started](https://docs.commercetools.com/merchant-center-customizations/custom-applications) documentation for more information. | ||
|
||
# Developing the Custom Application | ||
|
||
Learn more about [developing a Custom Application](https://docs.commercetools.com/merchant-center-customizations/development) and [how to use the CLI](https://docs.commercetools.com/merchant-center-customizations/api-reference/cli). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
PERMISSIONS, | ||
entryPointUriPath, | ||
CLOUD_IDENTIFIER, | ||
CUSTOM_APPLICATION_ID, | ||
APPLICATION_URL, | ||
} from './src/constants'; | ||
|
||
/** | ||
* @type {import('@commercetools-frontend/application-config').ConfigOptionsForCustomApplication} | ||
*/ | ||
const config = { | ||
name: 'Mollie', | ||
entryPointUriPath, | ||
cloudIdentifier: CLOUD_IDENTIFIER, | ||
env: { | ||
development: { | ||
initialProjectKey: 'shopm-adv-windev', | ||
}, | ||
production: { | ||
applicationId: CUSTOM_APPLICATION_ID, | ||
url: APPLICATION_URL, | ||
}, | ||
}, | ||
oAuthScopes: { | ||
view: ['view_key_value_documents'], | ||
manage: ['manage_key_value_documents', 'manage_extensions'], | ||
}, | ||
icon: '${path:./assets/mollie.svg}', | ||
mainMenuLink: { | ||
defaultLabel: 'Mollie', | ||
labelAllLocales: [], | ||
permissions: [PERMISSIONS.Manage], | ||
}, | ||
headers: { | ||
csp: { | ||
'connect-src': ['*.euope-west1.gcp.commercetoolsr.app'], | ||
}, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import path from 'path'; | ||
import { defineConfig } from 'cypress'; | ||
import { customApplicationConfig } from '@commercetools-frontend/cypress/task'; | ||
|
||
export default defineConfig({ | ||
retries: 1, | ||
video: false, | ||
viewportHeight: 1080, | ||
viewportWidth: 1920, | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
async setupNodeEvents(on, cypressConfig) { | ||
// Load the config | ||
if (!process.env.CI) { | ||
const envPath = path.join(__dirname, 'cypress/.env'); | ||
console.log('Loading environment variables from', envPath); | ||
const dotenv = await import('dotenv'); | ||
dotenv.config({ path: envPath }); | ||
} | ||
|
||
on('task', { customApplicationConfig }); | ||
return { | ||
...cypressConfig, | ||
env: { | ||
...cypressConfig.env, | ||
LOGIN_USER: process.env.CYPRESS_LOGIN_USER, | ||
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_PASSWORD, | ||
PROJECT_KEY: process.env.CYPRESS_PROJECT_KEY, | ||
PACKAGE_NAME: process.env.CYPRESS_PACKAGE_NAME, | ||
LOCALE: process.env.CYPRESS_LOCALE || 'en-GB', | ||
}, | ||
}; | ||
}, | ||
baseUrl: process.env.CYPRESS_BASE_URL || 'http://localhost:3001', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CYPRESS_LOGIN_USER=<your-user> | ||
CYPRESS_LOGIN_PASSWORD=<your-password> | ||
CYPRESS_PROJECT_KEY=<your-project-key> | ||
CYPRESS_PACKAGE_NAME="application" | ||
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/" | ||
CYPRESS_LOCALE="en-GB" |
Oops, something went wrong.