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 forbetaor, 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
canarybranch-
git checkout canary -
git fetch -a
-
-
Branch off the
canarybranchgit checkout -b PEN-[jira ticket num]-[brief description of feature]
-
Create a new folder
YourComponentNameundersrc/components. -
Implement your component in a
index.tsxfile. Remember to add aninterfacewith your component's props and addproptypesfor type checking. -
Implement unit tests for your component in a
index.test.tsxfile. Remember to use your component locally to test the changes. -
Document your component by creating a new story
YourComponentName.stories.mdxunderstories/.- Run
npm run storybookto 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
canarybranch. You can watch the github publish action here.
- Force-push into the
rcbranch fromcanarylike 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
rcbranch orcanaryfirst.betais a client environment that is not for themes developers to test in. - Merge into
betabranch. You can watch the github publish action here.
-
After design qa and qa approval, make a pull request from the
rcbranch to themasterbranch. -
Version and publish as above. Make sure you're using
stablenotlatest.
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@betarelease in the blocks list (eg, "@wpmedia/header-nav" -> "@wpmedia/header-nav@beta"). Make a pr against the news theme repo making that change to themasterbranch. 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-storybookonengine-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-sdkand click onUpload. - Upload your files to replace the contents of
engine-theme-sdkwith your new build. Make sure to include thesb_dllfolder generated in the build. - Click on
Nextand 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.
