Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsx-email,create-jsx-email): dangling width on button in generator #232

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.moon/cache
.eslintcache
.rendered
.test
node_modules
dist
.DS_Store
Expand Down
1 change: 0 additions & 1 deletion assets/templates/email.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const Template = ({ email, name }{{ propsType }}) => (
<Button
style={button}
href="https://example.com"
width={'100%'}
align={'center'}
backgroundColor={'#777'}
borderRadius={5}
Expand Down
3 changes: 2 additions & 1 deletion packages/create-jsx-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
"funding": {
"type": "github",
"url": "https://github.com/sponsors/shellscape"
}
},
"generatorsBump": "0"
}
1 change: 1 addition & 0 deletions packages/jsx-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"type": "github",
"url": "https://github.com/sponsors/shellscape"
},
"generatorsBump": "0",
"sideEffects": false,
"tshy": {
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions test/cli/.snapshots/create.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`cli > esbuild plugins 1`] = `Promise {}`;
28 changes: 28 additions & 0 deletions test/cli/create.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';

import { execa } from 'execa';
import { describe, expect, test } from 'vitest';
import strip from 'strip-ansi';

process.chdir(__dirname);

describe('cli', async () => {
test('esbuild plugins', async () => {
const { stdout } = await execa({
cwd: __dirname,
shell: true
// Note: For some reason `pnpm exec` is fucking with our CWD, and resets it to
// packages/jsx-email, which causes the config not to be found. so we use npx instead
})`email create BatmanEmail --out ./.test/emails `;
const plain = strip(stdout);

console.log(plain);

expect(plain).toContain('Creating a new template at ');
expect(plain).toContain('Template BatmanEmail.tsx created');

const contents = readFile(join(__dirname, '.test/emails/BatmanEmail.tsx'), 'utf8');
expect(contents).toMatchSnapshot();
});
});
Loading