This package has been published with a number of dist-tags meant for different purposes:
stable
: Client Production environment,beta
: Client Sandbox environment,rc
: Developer environment for testing hotfixes preparing forbeta
or, worst comes to worst,stable
,canary
: For developers to test on core components
Storybook allows custom block developers to see how components act individually and together. This will ensure that components work as expected and in an accessible implementation. Addons you'll see in the tray below the icon will determine its accessibility practices as well and provide suggestions for use.
The component explorer will also show the effect of different props on components. For component-driven development, this will hopefully make frontend developer lives easier.
npm i
npm run storybook
If you don't go to the page automatically on successful compilation, go to http://localhost:6006/.
When you push to the branch and make a pull request, you will see the built storybook in the pull request checks.
If you need to update an existing Engine SDK component, contact the Pagebuilder team. If you want to create a new component follow these instructions:
-
Pull the latest
canary
branch-
git checkout canary
-
git fetch -a
-
-
Branch off the
canary
branchgit checkout -b PEN-[jira ticket num]-[brief description of feature]
-
Create a new folder
YourComponentName
undersrc/components
. -
Implement your component in a
index.tsx
file. Remember to add aninterface
with your component's props and addproptypes
for type checking. -
Implement unit tests for your component in a
index.test.tsx
file. Remember to use your component locally to test the changes. -
Document your component by creating a new story
YourComponentName.stories.mdx
understories/
.- Run
npm run storybook
to verify your story was created
- Run
-
When committing your changes, Chromatic will run visual regression tests and will generate a link to review any changes
-
When your component is ready make a PR against
canary
, get approval for your PR, then follow the publishing steps.
- Merge into
canary
branch. You can watch the github publish action here.
- Force-push into the
rc
branch fromcanary
like so:
- update the base branch
git checkout canary && git remote update --prune origin && git reset --hard origin/canary
- Force push base branch into target:
git push origin canary:rc -f
- You can watch the github publish action here.
- Changes published to beta should be tested in either
rc
branch orcanary
first.beta
is a client environment that is not for themes developers to test in. - Merge into
beta
branch. You can watch the github publish action here.
-
After design qa and qa approval, make a pull request from the
rc
branch to themaster
branch. -
Version and publish as above. Make sure you're using
stable
notlatest
.
npm version
git push origin rc
npm publish --tag stable
- Your changes should be reflected in the blocks using
engine-theme-sdk
blocks/card-list-block/package.json
{
"name": "@wpmedia/card-list-block",
"dependencies": {
"@wpmedia/engine-theme-sdk": "stable"
}
}
- Go to new theme feature pack's
blocks.json
. Change your engine block to the@beta
release in the blocks list (eg, "@wpmedia/header-nav" -> "@wpmedia/header-nav@beta"). Make a pr against the news theme repo making that change to themaster
branch. Then publish that change using deployment strategy to the canary environment (corecomponents prod is a canary env). Alert quality assurance stakeholder that the change has been published.
blocks.json
{
"engineSDK": "@wpmedia/engine-theme-sdk@stable"
}
Read more about dist tags via npm.
Engine SDK components are written in React and Typescript, and its stories are written in MDX Format. It requires Storybook version 6.0.0-beta.26 and up.
Add Engine SDK to your project.
npm install --save @wpmedia/engine-theme-sdk
Add to your blocks.json
.
@wpmedia/engine-theme-sdk@version
You can test Engine SDK components locally by updating the .env
file of the feature pack to include the absolute path to the engine theme sdk directory. Please see step-by-step for full details.
While most SDK components are public facing, the ArcLogo
is meant for internal use and is generally used for the navigation header block, footer block or anywhere that requires a fallback logo for branding.
Since the documentation for this cannot be available in ALC as it is meant to be a user-facing documentation source, there is internal documentation in this repo for it's use which can be found at /stories/internal/ArcLogo.stories.mdx
Engine Theme SDK automatically deploys to ALC. Engine SDK documentation is available here. To update the documentation on Arc Learning Center you have to upload it to S3 by following these steps:
- Run
npm run build-storybook
onengine-theme-sdk
. This will generate a static storybook build in/storybook-static
. - Open the WP-ARC AWS Console (you might need to authenticate with OKTA first).
- Go to
storybooks
, thenengine-theme-sdk
and click onUpload
. - Upload your files to replace the contents of
engine-theme-sdk
with your new build. Make sure to include thesb_dll
folder generated in the build. - Click on
Next
and go through the uploading process with the default settings. - After a minute your changes will be live on ALC.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.