Skip to main content

Part 4: Ship it

  • You need: Part 3 finished.
  • You get: your theme checked, built, uploaded and applied to your advisor's draft in Experience Designer, and the loop for every later change.

Everything so far ran on your machine. In this part you check the theme, build the zip and put it on your advisor.

Step 18: Check and build (10 min)​

Goal: see a gate catch a mistake, then four green gates and one zip.

Skill: run the gates before every build.

The gates are the project's four checks: styles, code, types and tests. yarn build doesn't run them, so you do.

First, see a gate catch a mistake. Open src/components/results-page/results-page.component.vue. In the .results-page__subheadline rule, replace the colour variable with a raw value:

src/components/results-page/results-page.component.vue
.results-page__subheadline {
font-family: var(--zv-font-body);
font-size: var(--zv-font-size-md);
line-height: var(--zv-line-height-loose);
color: #1f4d3a;
text-align: center;
}

Run the first gate:

yarn lint:css

Among other lines, it names the file, the line and the rule:

src/components/results-page/results-page.component.vue (1)

163:10 [hex-color] Hex color '#1f4d3a' in 'color'

✘ FAIL 1 violation(s) across 1 file(s).

Put var(--zv-text-secondary) back and run yarn lint:css again. It passes.

Now run all four:

Run:

yarn lint:css && yarn lint && yarn typecheck && yarn test

The command stops at the first gate that fails. Fix what it reports and run it again.

You should now see the first gate end with:

✔ OK — CSS token lint passed.

yarn lint and yarn typecheck print no findings, and the run ends with:

 Test Files  13 passed (13)
Tests 110 passed (110)

With an AI assistant the numbers can be higher. What matters is that none failed.

Build the zip:

yarn build

You should now see the run end with:

✅ Build complete. Output in ./build/

Look at what it made:

ls build
solstice-theme.remote-component.v0-0.config.json
solstice-theme.remote-component.v0-0.manifest.json
solstice-theme.remote-component.v0-0.min.css
solstice-theme.remote-component.v0-0.min.js
solstice-theme.remote-component.v0.0.1.zip

The .zip is the file you upload. It holds the other four. Its name comes from two values you already know: name in zoovu.manifest.js, which you set in Step 3, and version in package.json.

There is nothing to commit: git ignores the build folder.

Step 19: Upload and apply (10 min)​

Goal: Solstice on your advisor in Experience Designer.

Skill: upload a theme and put it on an advisor.

Open Experience Designer as in Step 3.

Upload the zip​

Experience Designer calls your theme a component.

  1. In the right panel, open the Config tab and expand ADVANCED OPTIONS.
  2. Click Upload component.
  3. In the dialog, click browse or Upload file and pick build/solstice-theme.remote-component.v0.0.1.zip.

The Upload component button under ADVANCED OPTIONS in the Config tab

The upload starts as soon as you pick the file. Then the page reloads.

Experience Designer accepts each version of a theme once. Upload v0.0.1 one time only. In Step 21 you learn how to upload a change.

Choose a theme​

Here a theme is Experience Designer's saved design for your advisor, not your code. Your Solstice component goes into it in the next section. You do this once per advisor.

  1. In the dialog "Choose a theme", pick Base Application Theme under APPLICATION THEMES and click Open theme.
  2. In the dialog "Save your theme", give the theme a name, such as Solstice, and click Save theme.

The Choose a theme dialog with Base Application Theme under APPLICATION THEMES

Put Solstice on the advisor​

  1. In the bar under the preview, under Local, click Solstice theme. That is the label you set in Step 3.
  2. If the dialog "Change component?" appears, click Confirm.
  3. In the Config tab, look at Component. It shows the name Solstice theme and the version 0.0.1.

You should now see your advisor in the Solstice look in the preview in the middle of the page.

The Solstice theme tile under Local, and the Solstice look in the preview

  1. Click Save and Apply. In the dialog "Add notes", click Save and apply. The first time, the dialog has the checkbox Update runner to the latest available version, already checked. Leave it checked.

You should now see the message "Theme applied. The theme has been applied to the assistant's draft."

The message Theme applied in Experience Designer

  1. Go to the preview tab you opened in Step 3 and reload it. If you closed it, click Preview in the top bar.

You should now see the first question in the Solstice look, with blank buttons. Step 20 adds their texts.

The preview in the Solstice look, with buttons that have no labels yet

Step 20: Add the texts and change your sentence (10 min)​

Goal: labels on every button, and your own sentence under the results headline.

Skill: add a language and change a text on the Translation page of Experience Designer.

Add the texts​

The buttons in the preview tab are blank because the theme has no texts in your advisor's language yet. Add the language once:

  1. In the left menu of Experience Designer, click Translation.
  2. Click Add language. Select the country and the language of your advisor and click Save. They are the locale at the end of your preview link: en-IE is English in Ireland.
  3. Click the translate icon next to the new language, at the top of its column.

You should now see the message "Auto translation completed", and the new column filled with the texts of your theme.

The translate icon at the top of the new language column on the Translation page

Change your sentence​

This is the text from Step 12. You change it here, without opening your editor.

  1. In the same table, search for Picked. The row Subheadline Text has Picked for your next trip. in the Label column.
  2. Double-click its cell in your language's column, replace the text with your own sentence, such as Gear that goes the distance., and press Enter.

The Subheadline Text row in the Translation table, with the cell of the language column to edit

  1. In the left menu, click Design. If the page says "This advisor uses an Application Theme", click Switch to the Application Design page.
  2. Click Save and Apply, then Save and apply.
  3. Reload the preview tab and answer the questions until you reach the results page. Wait for the product cards.

You should now see every button with its label, and your own sentence under the results headline.

The results page in the preview, with the new sentence under the headline

The sentence went from a preset in your code to the Translation page of Experience Designer. The template's other texts have rows there too, such as Add To Cart Toast Text.

Step 21: Ship a new version (5 min)​

Goal: learn the loop for every later change: change, raise the version, build, upload.

Skill: change, raise the version, build, upload.

Make one change you can spot at a glance. In src/css/tokens.css, raise --zv-radius-2 on line 133:

src/css/tokens.css
  --zv-radius-0: 6px;
--zv-radius-1: 10px;
--zv-radius-2: 24px;
--zv-radius-3: 50%;
--zv-radius-4: 9999px;

If yarn start is running, the answer cards and the product cards get rounder corners at once.

Run the gates:

yarn lint:css && yarn lint && yarn typecheck && yarn test

Raise the version, so Experience Designer takes the new zip:

yarn bump-version

You should now see:

Version bumped: 0.0.1 → 0.0.2

Build again:

yarn build
ls build/*.zip

The build empties the build folder first, so it now holds one zip, the new one:

build/solstice-theme.remote-component.v0.0.2.zip

Commit the change together with its version:

git commit -am "Round the cards more, version 0.0.2"

Now upload it. Go back to the Experience Designer tab. If you closed it, open it as in Step 3: the Design page then says "This advisor uses an Application Theme", and Switch to the Application Design page takes you to your theme.

  1. In the Config tab, expand ADVANCED OPTIONS, click Upload component and pick build/solstice-theme.remote-component.v0.0.2.zip. The page reloads.
  2. The preview is empty now, and no theme is selected in the bar under it. Under Local, click Solstice theme again.
  3. In the Config tab, check that Component shows the version 0.0.2.
  4. Click Save and Apply, then Save and apply.
  5. Reload the preview tab.

The empty preview after an upload, before the theme is clicked again

You should now see rounder answer cards, and your sentence from Step 20 still under the results headline. There is one Solstice theme tile, and it always holds the newest version.

Version 0.0.2 in the Config tab, and answer cards with rounder corners

That is the whole loop. For every later change: change, gates, yarn bump-version, yarn build, upload, click your theme, Save and Apply.

What next​

Four things to do next with this project:

  • Connect the real cart. Replace the body of addToShopCart in src/helpers/add-to-shop-cart.ts with your shop's cart call. Until then, every click counts as added, so replace the stand-in before you publish.
  • Go live. Your theme is on the draft. Publish the advisor when it is ready: see Preview, save, publish.
  • Add a second language. Repeat Add language in Translation and review what the translate icon filled in.
  • Start your own theme. Run the npx command from Step 2 with your own folder name, and take your brand's values through Parts 2 to 4.

The reference pages cover what the workshop skipped:

Checkpoint. Your theme is on your advisor's draft, an editor can change its texts, and you know the loop for the next version. That is the workshop. git log --oneline shows 14 lines, or 15 if you removed the launcher. With an AI assistant, two fewer.

If something is off​

  • After the upload: "Unable to publish component. Component with this version already exists." This version was uploaded before. Run yarn bump-version, then yarn build, and upload the new zip.
  • After an upload the preview in Experience Designer is empty and the Config tab has no Component. An upload doesn't select the new version. Under Local, click Solstice theme, then Save and Apply.
  • The buttons in the preview tab have no labels. The theme has no texts in the advisor's language. Follow Add the texts in Step 20.
  • A text you added in a later version is empty in the preview tab. The language was translated before that text existed. In Translation, click the translate icon next to the language again, then Save and Apply.

For anything else, see Troubleshooting.