Skip to content

Commit 0c3aaa3

Browse files
authored
fix(create-email): Name & version (#2097)
1 parent 50a5587 commit 0c3aaa3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.changeset/stupid-lights-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-email": patch
3+
---
4+
5+
Show package.json's version on --version for create-email

packages/create-email/src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ import logSymbols from 'log-symbols';
88
import ora from 'ora';
99
import { tree } from './tree.js';
1010

11+
const packageJson = JSON.parse(
12+
fse.readFileSync(
13+
path.resolve(import.meta.dirname, '../package.json'),
14+
'utf8',
15+
),
16+
);
17+
1118
const getLatestVersionOfTag = async (packageName, tag) => {
1219
const response = await fetch(
1320
`https://registry.npmjs.org/${packageName}/${tag}`,
@@ -90,8 +97,8 @@ const init = async (name, { tag }) => {
9097
};
9198

9299
new Command()
93-
.name('create-email')
94-
.version('0.0.30-canary.0')
100+
.name(packageJson.name)
101+
.version(packageJson.version)
95102
.description('The easiest way to get started with React Email')
96103
.arguments('[dir]', 'Path to initialize the project')
97104
.option('-t, --tag <tag>', 'Tag of React Email versions to use', 'latest')

0 commit comments

Comments
 (0)