@prakash.gurung/commerce-newsletter 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +21 -0
- package/.changeset/config.json +11 -0
- package/.elsie.js +33 -0
- package/.env +1 -0
- package/.eslintrc.js +3 -0
- package/.github/.metadata.json +8 -0
- package/.github/CODEOWNERS +2 -0
- package/.github/workflows/pr-build-windows.yaml +26 -0
- package/.github/workflows/pr-build.yaml +26 -0
- package/.github/workflows/pr-check-changeset.yaml +26 -0
- package/.github/workflows/pr-graphql-validation.yaml +72 -0
- package/.github/workflows/release.yaml +80 -0
- package/.gitignore +7 -0
- package/.storybook/main.js +21 -0
- package/.storybook/preview.js +81 -0
- package/.storybook/public/favicon.svg +14 -0
- package/CHANGELOG.md +33 -0
- package/LICENSE.md +188 -0
- package/README.md +196 -0
- package/coverage/clover.xml +174 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/api/fetch-graphql/fetch-graphql.ts.html +115 -0
- package/coverage/lcov-report/api/fetch-graphql/index.html +131 -0
- package/coverage/lcov-report/api/fetch-graphql/index.ts.html +88 -0
- package/coverage/lcov-report/api/index.html +116 -0
- package/coverage/lcov-report/api/index.ts.html +94 -0
- package/coverage/lcov-report/api/initialize/index.html +131 -0
- package/coverage/lcov-report/api/initialize/index.ts.html +88 -0
- package/coverage/lcov-report/api/initialize/initialize.ts.html +154 -0
- package/coverage/lcov-report/api/newsletter/index.html +131 -0
- package/coverage/lcov-report/api/newsletter/index.ts.html +115 -0
- package/coverage/lcov-report/api/newsletter/newsletter.ts.html +247 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/NewsletterForm/NewsletterForm.tsx.html +427 -0
- package/coverage/lcov-report/components/NewsletterForm/index.html +131 -0
- package/coverage/lcov-report/components/NewsletterForm/index.ts.html +118 -0
- package/coverage/lcov-report/components/index.html +116 -0
- package/coverage/lcov-report/components/index.ts.html +88 -0
- package/coverage/lcov-report/containers/NewsletterContainer/NewsletterContainer.tsx.html +454 -0
- package/coverage/lcov-report/containers/NewsletterContainer/index.html +131 -0
- package/coverage/lcov-report/containers/NewsletterContainer/index.ts.html +118 -0
- package/coverage/lcov-report/containers/index.html +116 -0
- package/coverage/lcov-report/containers/index.ts.html +88 -0
- package/coverage/lcov-report/data/models/index.html +116 -0
- package/coverage/lcov-report/data/models/index.ts.html +85 -0
- package/coverage/lcov-report/data/transforms/index.html +116 -0
- package/coverage/lcov-report/data/transforms/index.ts.html +85 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +281 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/render/Provider.tsx.html +229 -0
- package/coverage/lcov-report/render/index.html +146 -0
- package/coverage/lcov-report/render/index.ts.html +88 -0
- package/coverage/lcov-report/render/render.tsx.html +97 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/types/events.d.ts.html +115 -0
- package/coverage/lcov-report/types/index.html +116 -0
- package/coverage/lcov.info +306 -0
- package/dist/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/dist/api/fetch-graphql/index.d.ts +2 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/initialize/index.d.ts +2 -0
- package/dist/api/initialize/initialize.d.ts +10 -0
- package/dist/api/newsletter/index.d.ts +10 -0
- package/dist/api/newsletter/newsletter.d.ts +14 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +4 -0
- package/dist/api.js.map +1 -0
- package/dist/chunks/initialize.js +4 -0
- package/dist/chunks/initialize.js.map +1 -0
- package/dist/chunks/newsletter.js +10 -0
- package/dist/chunks/newsletter.js.map +1 -0
- package/dist/components/NewsletterForm/NewsletterForm.d.ts +17 -0
- package/dist/components/NewsletterForm/index.d.ts +11 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/containers/NewsletterContainer/NewsletterContainer.d.ts +10 -0
- package/dist/containers/NewsletterContainer/index.d.ts +11 -0
- package/dist/containers/NewsletterContainer.d.ts +3 -0
- package/dist/containers/NewsletterContainer.js +4 -0
- package/dist/containers/NewsletterContainer.js.map +1 -0
- package/dist/containers/index.d.ts +2 -0
- package/dist/data/models/index.d.ts +2 -0
- package/dist/data/transforms/index.d.ts +2 -0
- package/dist/i18n/en_US.json.d.ts +17 -0
- package/dist/reload +1 -0
- package/dist/render/Provider.d.ts +8 -0
- package/dist/render/index.d.ts +2 -0
- package/dist/render/render.d.ts +4 -0
- package/dist/render.d.ts +1 -0
- package/dist/render.js +5 -0
- package/dist/render.js.map +1 -0
- package/examples/html-host/example.css +130 -0
- package/examples/html-host/favicon.ico +0 -0
- package/examples/html-host/index.html +114 -0
- package/examples/html-host/styles.css +64 -0
- package/jest.config.js +19 -0
- package/package.json +42 -0
- package/prettier.config.js +3 -0
- package/src/api/fetch-graphql/fetch-graphql.test.ts +19 -0
- package/src/api/fetch-graphql/fetch-graphql.ts +10 -0
- package/src/api/fetch-graphql/index.ts +1 -0
- package/src/api/index.ts +3 -0
- package/src/api/initialize/index.ts +1 -0
- package/src/api/initialize/initialize.test.ts +23 -0
- package/src/api/initialize/initialize.ts +23 -0
- package/src/api/newsletter/index.ts +10 -0
- package/src/api/newsletter/newsletter.mdx +26 -0
- package/src/api/newsletter/newsletter.test.ts +76 -0
- package/src/api/newsletter/newsletter.ts +54 -0
- package/src/components/NewsletterForm/NewsletterForm.css +96 -0
- package/src/components/NewsletterForm/NewsletterForm.stories.tsx +71 -0
- package/src/components/NewsletterForm/NewsletterForm.test.tsx +109 -0
- package/src/components/NewsletterForm/NewsletterForm.tsx +114 -0
- package/src/components/NewsletterForm/index.ts +11 -0
- package/src/components/index.ts +1 -0
- package/src/containers/NewsletterContainer/NewsletterContainer.stories.tsx +35 -0
- package/src/containers/NewsletterContainer/NewsletterContainer.test.tsx +174 -0
- package/src/containers/NewsletterContainer/NewsletterContainer.tsx +123 -0
- package/src/containers/NewsletterContainer/index.ts +11 -0
- package/src/containers/index.ts +1 -0
- package/src/data/models/index.ts +0 -0
- package/src/data/transforms/index.ts +0 -0
- package/src/docs/intro.mdx +5 -0
- package/src/i18n/en_US.json +14 -0
- package/src/render/Provider.test.tsx +40 -0
- package/src/render/Provider.tsx +48 -0
- package/src/render/index.ts +1 -0
- package/src/render/render.test.tsx +16 -0
- package/src/render/render.tsx +4 -0
- package/src/types/events.d.ts +10 -0
- package/storybook-stories.js +13 -0
- package/tests/__mocks__/browserMocks.ts +26 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
This folder stores release intent files for `dropin-template`.
|
|
4
|
+
|
|
5
|
+
## Create a changeset
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run changeset
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Check pending release status
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run changeset:status
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Apply version/changelog updates locally
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run changeset:version
|
|
21
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "restricted",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
package/.elsie.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
name: 'Newsletter',
|
|
12
|
+
api: {
|
|
13
|
+
root: './src/api',
|
|
14
|
+
importAliasRoot: '@/newsletter/api',
|
|
15
|
+
},
|
|
16
|
+
components: [
|
|
17
|
+
{
|
|
18
|
+
id: 'Components',
|
|
19
|
+
root: './src/components',
|
|
20
|
+
importAliasRoot: '@/newsletter/components',
|
|
21
|
+
cssPrefix: 'newsletter',
|
|
22
|
+
default: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
containers: {
|
|
26
|
+
root: './src/containers',
|
|
27
|
+
importAliasRoot: '@/newsletter/containers',
|
|
28
|
+
},
|
|
29
|
+
schema: {
|
|
30
|
+
endpoint: process.env.ENDPOINT,
|
|
31
|
+
headers: {}
|
|
32
|
+
}
|
|
33
|
+
};
|
package/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ENDPOINT="https://na1-sandbox.api.commerce.adobe.com/4XR4RKXgJjQXaxUCMC6TN3/graphql"
|
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: 'Run Build Windows'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
run-build-windows:
|
|
9
|
+
runs-on: windows-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 22
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: npm install
|
|
21
|
+
|
|
22
|
+
- name: Generate config
|
|
23
|
+
run: npx elsie generate config --name TestDropin
|
|
24
|
+
|
|
25
|
+
- name: Run build
|
|
26
|
+
run: npm run build
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: 'Run Build'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
run-build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 22
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: npm install
|
|
21
|
+
|
|
22
|
+
- name: Generate config
|
|
23
|
+
run: npx elsie generate config --name TestDropin
|
|
24
|
+
|
|
25
|
+
- name: Run build
|
|
26
|
+
run: npm run build
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Check Changeset
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, ready_for_review, reopened, synchronize, labeled, unlabeled]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
check-changeset:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
if: |
|
|
11
|
+
!github.event.pull_request.draft &&
|
|
12
|
+
!contains(github.event.pull_request.labels.*.name, 'skip-changeset')
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: 22
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm install
|
|
24
|
+
|
|
25
|
+
- name: Check for changeset
|
|
26
|
+
run: npx changeset status --since=origin/main
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: 'GraphQL Validation'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
validate-graphql:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
DEFAULT_ENDPOINTS: >-
|
|
13
|
+
https://mcstaging.aemshop.net/graphql,
|
|
14
|
+
https://na1-sandbox.api.commerce.adobe.com/LwndYQs37CvkUQk9WEmNkz/graphql
|
|
15
|
+
SOURCE_PATHS: ./src
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 20
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: yarn install
|
|
28
|
+
|
|
29
|
+
- name: Extract GraphQL endpoints from PR description
|
|
30
|
+
id: endpoints
|
|
31
|
+
uses: actions/github-script@v7
|
|
32
|
+
with:
|
|
33
|
+
script: |
|
|
34
|
+
const pr = await github.rest.pulls.get({
|
|
35
|
+
owner: context.repo.owner,
|
|
36
|
+
repo: context.repo.repo,
|
|
37
|
+
pull_number: context.payload.pull_request.number,
|
|
38
|
+
});
|
|
39
|
+
const body = pr.data.body || '';
|
|
40
|
+
const matches = [...body.matchAll(/GraphQL Endpoint:\s*(https?:\/\/[^ ]+\/graphql)/gi)];
|
|
41
|
+
const endpoints = matches.map(m => m[1]).join(',');
|
|
42
|
+
if (endpoints) {
|
|
43
|
+
core.info(`Found endpoints in PR: ${endpoints}`);
|
|
44
|
+
core.setOutput('endpoints', endpoints);
|
|
45
|
+
} else {
|
|
46
|
+
core.info('No endpoints found in PR – will use default or env.');
|
|
47
|
+
core.setOutput('endpoints', '');
|
|
48
|
+
}
|
|
49
|
+
- name: Determine final endpoints list
|
|
50
|
+
id: final-endpoints
|
|
51
|
+
run: |
|
|
52
|
+
ENDPOINTS_INPUT="${{ steps.endpoints.outputs.endpoints }}"
|
|
53
|
+
if [ -n "$ENDPOINTS_INPUT" ]; then
|
|
54
|
+
echo "Using endpoints from PR description."
|
|
55
|
+
echo "endpoints=$ENDPOINTS_INPUT" >> "$GITHUB_OUTPUT"
|
|
56
|
+
elif [ -n "$GRAPHQL_ENDPOINTS" ]; then
|
|
57
|
+
echo "Using endpoints from GRAPHQL_ENDPOINTS env."
|
|
58
|
+
echo "endpoints=$GRAPHQL_ENDPOINTS" >> "$GITHUB_OUTPUT"
|
|
59
|
+
else
|
|
60
|
+
echo "Using default endpoints."
|
|
61
|
+
echo "endpoints=${DEFAULT_ENDPOINTS}" >> "$GITHUB_OUTPUT"
|
|
62
|
+
fi
|
|
63
|
+
- name: Run GraphQL validation
|
|
64
|
+
run: |
|
|
65
|
+
IFS=',' read -ra ENDPOINT_ARRAY <<< "${{ steps.final-endpoints.outputs.endpoints }}"
|
|
66
|
+
ENDPOINT_FLAGS=""
|
|
67
|
+
for url in "${ENDPOINT_ARRAY[@]}"; do
|
|
68
|
+
CLEANED_URL=$(echo "$url" | xargs)
|
|
69
|
+
ENDPOINT_FLAGS="$ENDPOINT_FLAGS -e=$CLEANED_URL"
|
|
70
|
+
done
|
|
71
|
+
echo "Running: npx elsie gql validate -s=${{ env.SOURCE_PATHS }} $ENDPOINT_FLAGS"
|
|
72
|
+
npx elsie gql validate -s=${{ env.SOURCE_PATHS }} $ENDPOINT_FLAGS
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
name: Release
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 22
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm install
|
|
28
|
+
|
|
29
|
+
- name: Configure git
|
|
30
|
+
run: |
|
|
31
|
+
git config user.name "github-actions[bot]"
|
|
32
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
33
|
+
|
|
34
|
+
- name: Check for changesets
|
|
35
|
+
id: check
|
|
36
|
+
run: |
|
|
37
|
+
count=$(find .changeset -name "*.md" ! -name "README.md" | wc -l)
|
|
38
|
+
if [ "$count" -gt 0 ]; then
|
|
39
|
+
echo "has_changes=true" >> "$GITHUB_OUTPUT"
|
|
40
|
+
else
|
|
41
|
+
echo "has_changes=false" >> "$GITHUB_OUTPUT"
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
- name: Run version command
|
|
45
|
+
if: steps.check.outputs.has_changes == 'true'
|
|
46
|
+
run: npx changeset version
|
|
47
|
+
|
|
48
|
+
- name: Update lockfile
|
|
49
|
+
if: steps.check.outputs.has_changes == 'true'
|
|
50
|
+
run: npm install --package-lock-only
|
|
51
|
+
|
|
52
|
+
- name: Create or update release PR
|
|
53
|
+
if: steps.check.outputs.has_changes == 'true'
|
|
54
|
+
env:
|
|
55
|
+
GH_TOKEN: ${{ github.token }}
|
|
56
|
+
run: |
|
|
57
|
+
BRANCH="changeset-release/main"
|
|
58
|
+
git checkout -b "$BRANCH"
|
|
59
|
+
git add -A
|
|
60
|
+
git commit -m "chore: bump version"
|
|
61
|
+
git push origin "$BRANCH" --force
|
|
62
|
+
gh pr create \
|
|
63
|
+
--title "chore: bump version" \
|
|
64
|
+
--body "Version bump from pending changesets." \
|
|
65
|
+
--base main \
|
|
66
|
+
--head "$BRANCH" \
|
|
67
|
+
--label "skip-changeset" \
|
|
68
|
+
|| gh pr edit "$BRANCH" --title "chore: bump version" --add-label "skip-changeset"
|
|
69
|
+
|
|
70
|
+
- name: Tag release
|
|
71
|
+
if: steps.check.outputs.has_changes == 'false'
|
|
72
|
+
run: |
|
|
73
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
74
|
+
if git tag | grep -q "^v$VERSION$"; then
|
|
75
|
+
echo "Tag v$VERSION already exists, skipping."
|
|
76
|
+
else
|
|
77
|
+
NOTES=$(awk "/^## $VERSION/{found=1; next} found && /^## /{exit} found{print}" CHANGELOG.md)
|
|
78
|
+
git tag -a "v$VERSION" -m "$NOTES"
|
|
79
|
+
git push --tags
|
|
80
|
+
fi
|
package/.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { name } from '../.elsie';
|
|
2
|
+
|
|
3
|
+
export const stories = [
|
|
4
|
+
{
|
|
5
|
+
directory: '../src',
|
|
6
|
+
titlePrefix: name,
|
|
7
|
+
},
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export const framework = '@storybook/preact-webpack5';
|
|
11
|
+
|
|
12
|
+
export const addons = [
|
|
13
|
+
'@storybook/addon-essentials',
|
|
14
|
+
'@storybook/addon-a11y',
|
|
15
|
+
'@storybook/addon-interactions',
|
|
16
|
+
'@storybook/addon-coverage',
|
|
17
|
+
'@adobe-commerce/elsie/config/storybook/addon',
|
|
18
|
+
'@adobe-commerce/elsie/storybook-stories', // core stories
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const staticDirs = ['./public'];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DocsPage, DocsContainer } from '@storybook/addon-docs';
|
|
2
|
+
import { initializers } from '@adobe-commerce/elsie/lib';
|
|
3
|
+
import { events } from '@adobe-commerce/event-bus';
|
|
4
|
+
import { Provider } from '../src/render/Provider';
|
|
5
|
+
import { initialize as pkg, setEndpoint } from '../src/api';
|
|
6
|
+
|
|
7
|
+
// Initialize GraphQl Client
|
|
8
|
+
setEndpoint(process.env.ENDPOINT);
|
|
9
|
+
|
|
10
|
+
// Enable events logger
|
|
11
|
+
events.enableLogger(true);
|
|
12
|
+
|
|
13
|
+
// Initialize
|
|
14
|
+
initializers.register(pkg);
|
|
15
|
+
|
|
16
|
+
window.addEventListener('load', initializers.mount);
|
|
17
|
+
|
|
18
|
+
export const decorators = [
|
|
19
|
+
(Story) => {
|
|
20
|
+
return (
|
|
21
|
+
<Provider>
|
|
22
|
+
<Story />
|
|
23
|
+
</Provider>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export const parameters = {
|
|
29
|
+
docs: {
|
|
30
|
+
container: (props) => {
|
|
31
|
+
return (
|
|
32
|
+
<Provider>
|
|
33
|
+
<DocsContainer {...props} />
|
|
34
|
+
</Provider>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
page: DocsPage,
|
|
38
|
+
},
|
|
39
|
+
options: {
|
|
40
|
+
storySort: {
|
|
41
|
+
order: [
|
|
42
|
+
'*',
|
|
43
|
+
['Getting Started', 'API', 'Containers', 'Components', '*'],
|
|
44
|
+
'Base',
|
|
45
|
+
[
|
|
46
|
+
'Welcome',
|
|
47
|
+
'Quick start',
|
|
48
|
+
'CLI usage',
|
|
49
|
+
'Foundations',
|
|
50
|
+
[
|
|
51
|
+
'Design tokens',
|
|
52
|
+
[
|
|
53
|
+
'Overview',
|
|
54
|
+
'Colors',
|
|
55
|
+
'Typography',
|
|
56
|
+
'Spacing',
|
|
57
|
+
'Shape styles',
|
|
58
|
+
'*',
|
|
59
|
+
],
|
|
60
|
+
'*',
|
|
61
|
+
],
|
|
62
|
+
'Components',
|
|
63
|
+
['Overview', '*'],
|
|
64
|
+
'API',
|
|
65
|
+
['Initializer', 'Render', 'Event Bus', '*'],
|
|
66
|
+
'Host examples',
|
|
67
|
+
['Html host', 'React host', 'Vue host', '*'],
|
|
68
|
+
'Utilities',
|
|
69
|
+
[
|
|
70
|
+
'classList',
|
|
71
|
+
'debounce',
|
|
72
|
+
'deepmerge',
|
|
73
|
+
'getFormValues',
|
|
74
|
+
'getFormErrors',
|
|
75
|
+
'*',
|
|
76
|
+
],
|
|
77
|
+
],
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg version="1.2" baseProfile="tiny-ps" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 432" width="488" height="432">
|
|
2
|
+
<title>Adobe_Corporate_logo-svg</title>
|
|
3
|
+
<style>
|
|
4
|
+
tspan { white-space:pre }
|
|
5
|
+
.shp0 { fill: #fa0c00 }
|
|
6
|
+
</style>
|
|
7
|
+
<g id="Layer">
|
|
8
|
+
<path id="Layer" class="shp0" d="M180.43 0L0 0L0 431.15L180.43 0Z" />
|
|
9
|
+
<path id="Layer" class="shp0" d="M307.37 0L487.57 0L487.57 431.15L307.37 0Z" />
|
|
10
|
+
<path id="Layer" class="shp0" d="M243.9 158.91L358.74 431.15L283.4 431.15L249.07 344.47L165.03 344.47L243.9 158.91Z" />
|
|
11
|
+
</g>
|
|
12
|
+
<g id="Layer">
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# dropin-template
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5a636b1: Fixes the Provider to merge user-provided langDefinitions with the drop-in's default definitions, enabling label/placeholder overrides via the initializer API.
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 26a336c: ## Initial stable release (1.0.0)
|
|
14
|
+
|
|
15
|
+
This release marks the first stable version of the dropin template, incorporating all foundational work since the initial scaffold.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **Environment variable support**: `elsie.js` and Storybook's `preview.js` now dynamically pick up environment variables at runtime
|
|
20
|
+
- **Codebase cleanup**: Removed unnecessary sandbox code to keep the template lean and focused
|
|
21
|
+
- **GraphQL schema validation**: Added a CI workflow that validates GraphQL operations on every pull request, including improved parsing of HTML fragments in PR descriptions and more specific PR description endpoint link format detection
|
|
22
|
+
|
|
23
|
+
### Improvements
|
|
24
|
+
|
|
25
|
+
- Updated Node.js engine requirement to `^20.0.0 || ^22.0.0`
|
|
26
|
+
- Fixed and cleaned up `tsconfig.json` (removed `sourceMap` option)
|
|
27
|
+
- Upgraded all core SDK dependencies (`@adobe-commerce/elsie`, `@adobe-commerce/event-bus`, `@adobe-commerce/fetch-graphql`, `@adobe-commerce/storefront-design`, `@dropins/build-tools`) to their latest stable releases
|
|
28
|
+
- Updated README with comprehensive dropin documentation and prerequisites
|
|
29
|
+
|
|
30
|
+
### CI/CD
|
|
31
|
+
|
|
32
|
+
- Added PR build workflows on Ubuntu and Windows (`pr-build.yaml`, `pr-build-windows.yaml`)
|
|
33
|
+
- Integrated Changesets for automated changelog generation and version management
|