Skip to content

Commit

Permalink
feat: adjust plop to new preview folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrejkarz committed May 24, 2024
1 parent d00c427 commit bfb2348
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/webapp/plop/email/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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'),
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/webapp/plop/email/templates/preview.hbs
Original file line number Diff line number Diff line change
@@ -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: '[email protected]',
Expand Down

0 comments on commit bfb2348

Please sign in to comment.