feat(email): upload email-renderer lib's storybook to GCP

Because:

* email-renderer lib's storybook is not uploaded to GCP

This commit:

* make it upload to GCP by adjusting output dir

Closes FXA-12630
This commit is contained in:
MagentaManifold
2025-12-09 13:03:16 -05:00
parent c56c2fb172
commit 0ab7e7dc4f
5 changed files with 43 additions and 25 deletions

View File

@@ -881,7 +881,7 @@ jobs:
- run:
name: Publish Storybooks
command: |
STORYBOOKS_USE_YARN_WORKSPACES=false STORYBOOKS_SKIP_BUILD=true LOG_LEVEL=TRACE npx github:mozilla-fxa/storybook-gcp-publisher
STORYBOOKS_PACKAGES_ROOT="." STORYBOOKS_PACKAGES_DEPTH=4 STORYBOOKS_USE_YARN_WORKSPACES=false STORYBOOKS_SKIP_BUILD=true LOG_LEVEL=TRACE npx github:mozilla-fxa/storybook-gcp-publisher
update-yarn-cache:
executor: default-executor

View File

@@ -10,7 +10,8 @@ export default {
options: {},
},
stories: ['../src/**/*.stories.ts'],
staticDirs: process.env.STORYBOOK_BUILD !== 'true' ? ['..'] : undefined,
staticDirs:
process.env.STORYBOOK_BUILD !== 'true' ? ['../public'] : undefined,
addons: [
'@storybook/addon-webpack5-compiler-babel',
'@storybook/addon-docs',

View File

@@ -56,12 +56,42 @@
}
},
"build-storybook": {
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"executor": "nx:run-commands",
"outputs": ["{projectRoot}/storybook-static"],
"dependsOn": ["build-css", "build-ts"],
"options": {
"outputDir": "dist/storybook/accounts/email-renderer",
"configDir": "libs/accounts/email-renderer/.storybook"
"commands": [
"nx run accounts-email-renderer:build-storybook-only",
"nx run accounts-email-renderer:build-storybook-copy-locales",
"nx run accounts-email-renderer:build-storybook-copy-templates"
],
"parallel": false
}
},
"build-storybook-only": {
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"options": {
"outputDir": "{projectRoot}/storybook-static",
"configDir": "{projectRoot}/.storybook"
}
},
"build-storybook-copy-locales": {
"executor": "nx:run-commands",
"options": {
"commands": [
"mkdir -p {projectRoot}/storybook-static/public/locales && cp -R {projectRoot}/public/locales {projectRoot}/storybook-static/public"
],
"cwd": "."
}
},
"build-storybook-copy-templates": {
"executor": "nx:run-commands",
"options": {
"commands": [
"mkdir -p {projectRoot}/storybook-static/templates && cp -R {projectRoot}/src {projectRoot}/storybook-static"
],
"cwd": "."
}
},
"storybook": {
@@ -84,13 +114,8 @@
"command": "npx grunt --gruntfile libs/accounts/email-renderer/gruntfile.js l10n-watch",
"cwd": "."
},
"inputs": [
"{projectRoot}/gruntfile.js",
"{projectRoot}/src/**/en.ftl"
],
"outputs": [
"{projectRoot}/public/en/auth.ftl"
]
"inputs": ["{projectRoot}/gruntfile.js", "{projectRoot}/src/**/en.ftl"],
"outputs": ["{projectRoot}/public/en/auth.ftl"]
},
"l10n-merge": {
"executor": "nx:run-commands",
@@ -98,13 +123,8 @@
"command": "yarn grunt --gruntfile libs/accounts/email-renderer/gruntfile.js l10n-merge",
"cwd": "."
},
"inputs": [
"{projectRoot}/gruntfile.js",
"{projectRoot}/src/**/en.ftl"
],
"outputs": [
"{projectRoot}/public/en/auth.ftl"
]
"inputs": ["{projectRoot}/gruntfile.js", "{projectRoot}/src/**/en.ftl"],
"outputs": ["{projectRoot}/public/en/auth.ftl"]
},
"l10n-copy": {
"executor": "nx:run-commands",

View File

@@ -26,7 +26,7 @@ ejs.fileLoader = function (filePath: string) {
const request = new XMLHttpRequest();
// `false` makes the request synchronous
request.open('GET', './src/' + filePath, false);
request.open('GET', './src' + filePath, false);
request.send(null);
if (request.status === 200) {

View File

@@ -15,9 +15,6 @@
"build-copy-assets": "./scripts/copy-assets.sh",
"build-css": "nx emails-scss",
"build-ts": "tsc --build && tsc-alias",
"build-storybook": "NODE_OPTIONS=--openssl-legacy-provider STORYBOOK_BUILD=true storybook build && yarn build-storybook-copy-locales && yarn build-storybook-copy-templates",
"build-storybook-copy-locales": "mkdir -p ./storybook-static/public/locales && cp -R ./public/locales ./storybook-static/public",
"build-storybook-copy-templates": "mkdir -p ./storybook-static/lib/senders/emails/templates && cp -R ./lib/senders/emails ./storybook-static/lib/senders",
"bump-template-versions": "node scripts/template-version-bump",
"clean": "rimraf dist",
"clean-up-old-ci-stripe-customers": "node -r esbuild-register ./scripts/clean-up-old-ci-stripe-customers.js --limit 1000",
@@ -30,7 +27,7 @@
"l10n-merge": "yarn grunt merge-ftl",
"l10n-merge-test": "yarn grunt merge-ftl:test",
"l10n-watch": "yarn grunt watch-ftl",
"lint": "yarn glean-lint && eslint . .storybook --ext .js,.ts",
"lint": "yarn glean-lint && eslint . --ext .js,.ts",
"install-ejs": "./scripts/install-ejs.sh",
"gen-keys": "node -r esbuild-register ./scripts/gen_keys.js; node -r esbuild-register ./scripts/oauth_gen_keys.js; node -r esbuild-register ./scripts/gen_vapid_keys.js",
"emails-scss": "node -r esbuild-register ./lib/senders/emails/sass-compile-files.ts",