Skip to content

Commit

Permalink
Merge branch 'main' into typescript-snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jun 29, 2022
2 parents 53c801b + 1cc471e commit deef024
Show file tree
Hide file tree
Showing 202 changed files with 18,067 additions and 20,520 deletions.
31 changes: 31 additions & 0 deletions .changeset/angry-days-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@commercetools-frontend/application-shell-connectors': patch
---

There is a new React hook which you can use to access the Project Images rewrite configuration [see documentation](https://docs.commercetools.com/custom-applications/api-reference/commercetools-frontend-application-shell-connectors#project-image-settings).

You would use it like this:

```js
function MyComponent() {
const { isLoading, imageRegex } = useProjectExtensionImageRegex();

if (isLoading) return <LoadingSpinner />;

return (
<div>
<h1>Project images regex: {imageRegex}</h1>
</div>
);
}

function MyApp() {
return (
<ProjectExtensionProviderForImageRegex>
<MyComponent />
</ProjectExtensionProviderForImageRegex>
);
}
```

Both `GetProjectExtensionImageRegex` component and `withProjectExtensionImageRegex` still exists for backwards compatibility but have been marked as deprecated.
28 changes: 28 additions & 0 deletions .changeset/bright-plants-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@commercetools-backend/eslint-config-node': patch
'@commercetools-backend/express': patch
'@commercetools-backend/loggers': patch
'@commercetools-frontend/actions-global': patch
'@commercetools-frontend/application-config': patch
'@commercetools-frontend/application-shell': patch
'@commercetools-frontend/application-shell-connectors': patch
'@commercetools-frontend/assets': patch
'@commercetools-frontend/babel-preset-mc-app': patch
'@commercetools-frontend/browser-history': patch
'@commercetools-frontend/constants': patch
'@commercetools-frontend/create-mc-app': patch
'@commercetools-frontend/eslint-config-mc-app': patch
'@commercetools-frontend/i18n': patch
'@commercetools-frontend/jest-preset-mc-app': patch
'@commercetools-frontend/l10n': patch
'@commercetools-frontend/mc-html-template': patch
'@commercetools-frontend/mc-scripts': patch
'@commercetools-frontend/notifications': patch
'@commercetools-frontend/permissions': patch
'@commercetools-frontend/react-notifications': patch
'@commercetools-frontend/sdk': patch
'@commercetools-frontend/sentry': patch
'@commercetools-frontend/url-utils': patch
---

Drop the copyright year from the license files
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
],
"commit": false,
"linked": [
"fixed": [
[
"@commercetools-backend/*",
"@commercetools-frontend/*",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/dirty-ravens-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/l10n': minor
---

The localized data has been updated. In particular, the time zones data has been updated and restructured to be more usable and readable.
5 changes: 5 additions & 0 deletions .changeset/dry-planes-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-components': patch
---

Accessibility improvements of the `TabHeader` component.
28 changes: 28 additions & 0 deletions .changeset/little-wasps-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@commercetools-frontend/mc-scripts': minor
---

Migrate CLI to TypeScript.

Internally, the CLI now uses [cac](https://github.com/cacjs/cac) to handle CLI commands and options.

# Deprecated entry points

Importing the function `createPostcssConfig` from the main entry point `@commercetools-frontend/mc-scripts` is now deprecated. Use the entry point `@commercetools-frontend/mc-scripts/postcss` instead.

```diff
const {
createPostcssConfig,
-} = require('@commercetools-frontend/mc-scripts');
+} = require('@commercetools-frontend/mc-scripts/postcss');
```

Importing the functions `createWebpackConfigForDevelopment` and `createWebpackConfigForProduction` from the main entry point `@commercetools-frontend/mc-scripts` is now deprecated. Use the entry point `@commercetools-frontend/mc-scripts/webpack` instead.

```diff
const {
createWebpackConfigForDevelopment,
createWebpackConfigForProduction,
-} = require('@commercetools-frontend/mc-scripts');
+} = require('@commercetools-frontend/mc-scripts/webpack');
```
9 changes: 9 additions & 0 deletions .changeset/quick-plums-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@commercetools-frontend/application-shell': patch
---

Fixed aria role names.

We were using invalid role names in some of the component's elements.

Special mention to the element wrapping the notifications as it now uses the aria-live [attribute](https://www.w3.org/TR/wai-aria/#aria-live) (with **polite** value).
5 changes: 5 additions & 0 deletions .changeset/quick-rocks-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/assets': patch
---

Convert entry point to typescript
5 changes: 5 additions & 0 deletions .changeset/red-trainers-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@commercetools-frontend/application-shell": patch
---

Fix `ApplicationShell` header selectors a11y issues
5 changes: 5 additions & 0 deletions .changeset/silver-cobras-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell-connectors': patch
---

Export `TImageRegexContext` type
5 changes: 5 additions & 0 deletions .changeset/slimy-apples-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-html-template': patch
---

Removed _user-scalable=no_ property from `viewport` meta tag as it is a problem from the [accessibility point of view](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#viewport_basics).
5 changes: 5 additions & 0 deletions .changeset/wicked-foxes-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell': patch
---

Fix `ApplicationShell` header a11y issues in user menu dropdown
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ module.exports = {
],
},
},
{
files: ['**/*.core.graphql'],
rules: {
'graphql/template-strings': [
'error',
{
env: 'literal',
schemaJson: require('./schemas/core.json'),
},
],
},
},
{
files: ['**/*.settings.graphql'],
rules: {
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ labels:
assignees: ''
---

<!---
Before you submit, please search open/closed github issues and discussions since someone might have asked something similar before.
-->

**Describe the issue**

<!-- A clear and concise description of what's not working. -->
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
- name: commercetools Platform Support
- name: commercetools Support
url: https://jira.commercetools.com/servicedesk/customer/portal/1
about: Have an issue or question that contains sensitive or customer information? Ask our support team!
36 changes: 36 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

description: Shared action with basic setup for each job

runs:
using: composite

steps:
- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
shell: bash

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
- name: Install dependencies
run: yarn install --immutable
env:
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L14-L18
# https://github.com/marketplace/actions/cypress-io#custom-install
CYPRESS_INSTALL_BINARY: "0"
shell: bash

- name: Building packages
run: yarn build
shell: bash
34 changes: 34 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deployment

on:
push:
branches:
- main

jobs:
deploy_playground:
runs-on: ubuntu-latest

timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies and build packages
uses: ./.github/actions/ci

- name: Building Playground application
run: yarn playground:build
env:
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}

- name: Deploying Playground application to Vercel (production)
run: |
yarn workspace playground run deploy --prod --token="${{ secrets.VERCEL_TOKEN_PLAYGROUND }}"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_PLAYGROUND }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_PLAYGROUND }}
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build_and_deploy_docs:
runs-on: ubuntu-latest

timeout-minutes: 20
timeout-minutes: 10

# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L8-L11
env:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Deploy to Vercel (Production)
if: ${{ env.DEPLOY_DOCS_ENV == 'Production' }}
id: deploy-docs-to-vercel-production
uses: amondnet/vercel-action@v20
uses: amondnet/vercel-action@v25
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
scope: commercetools
Expand All @@ -87,7 +87,7 @@ jobs:
- name: Deploy to Vercel (Preview)
if: ${{ env.DEPLOY_DOCS_ENV == 'Preview' }}
id: deploy-docs-to-vercel-preview
uses: amondnet/vercel-action@v20
uses: amondnet/vercel-action@v25
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
scope: commercetools
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

runs-on: ubuntu-latest

timeout-minutes: 5
timeout-minutes: 10

steps:
- name: Checkout
Expand Down
Loading

0 comments on commit deef024

Please sign in to comment.