From bfb23484d9dc54fffd6156fdcf387734daef0573 Mon Sep 17 00:00:00 2001 From: Sebastian Drejkarz Date: Fri, 24 May 2024 13:54:07 +0200 Subject: [PATCH] feat: adjust plop to new preview folder --- packages/webapp/plop/email/index.js | 5 ++--- packages/webapp/plop/email/templates/preview.hbs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/webapp/plop/email/index.js b/packages/webapp/plop/email/index.js index c10eadd65..b45b9f9ce 100644 --- a/packages/webapp/plop/email/index.js +++ b/packages/webapp/plop/email/index.js @@ -3,8 +3,7 @@ const path = require('path'); const templatesPath = path.join(__dirname, 'templates'); module.exports = (plop) => { - const rootEmailsNamespace = '../webapp-libs/webapp-emails' - const emailsNamespace = `${rootEmailsNamespace}/src`; + const emailsNamespace = `../webapp-libs/webapp-emails/src`; const templates = path.join(emailsNamespace, 'templates', '{{ camelCase name }}'); plop.setGenerator('email', { @@ -19,7 +18,7 @@ module.exports = (plop) => { actions: [ { type: 'add', - path: `${rootEmailsNamespace}/emails/{{ camelCase name }}.tsx`, + path: `${emailsNamespace}/preview/{{ camelCase name }}.tsx`, templateFile: path.join(templatesPath, 'preview.hbs'), }, { diff --git a/packages/webapp/plop/email/templates/preview.hbs b/packages/webapp/plop/email/templates/preview.hbs index 277c6c4c9..586d17bf6 100644 --- a/packages/webapp/plop/email/templates/preview.hbs +++ b/packages/webapp/plop/email/templates/preview.hbs @@ -1,6 +1,6 @@ -import { buildEmail } from '../src/email'; -import { {{ pascalCase name }}Props } from '../src/templates/{{ camelCase name }}'; -import { EmailTemplateType } from '../src/types'; +import { buildEmail } from '../email'; +import { {{ pascalCase name }}Props } from '../templates/{{ camelCase name }}'; +import { EmailTemplateType } from '../types'; const data: {{ pascalCase name }}Props = { to: 'user@example.com',