Skip to content

Commit

Permalink
Showing 6 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/logger/index.ts
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ export const logSummary = (header = 'SUMMARY') => {
let str = printBoxStart(`${ICN_ROCKET} ${header} ${timeString}`, getCurrentCommand());

str += printIntoBox(`ReNative Version: ${_highlightColor(ctx.rnvVersion)}`);
if (ctx.files?.project?.package) {
if (ctx.files?.project?.package?.name && ctx.files?.project?.package?.version) {
str += printIntoBox(`Project Name ($package.name): ${_highlightColor(ctx.files.project.package.name)}`);
str += printIntoBox(
`Project Version ($package.version): ${_highlightColor(ctx.files.project.package.version)}`
4 changes: 2 additions & 2 deletions packages/core/src/projects/package.ts
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ export const checkAndCreateProjectPackage = async (c: RnvContext) => {
logInfo(`Your ${c.paths.project.package} is missing. CREATING...DONE`);

const packageName = c.files.project.config?.projectName || c.paths.project.dir.split('/').pop();
// const version = c.files.project.config?.defaults?.package?.version || '0.1.0';
const packageVersion = c.files.project.config?.projectVersion || '0.1.0';
const templateName = c.files.project.config?.currentTemplate;
if (!templateName) {
logWarning('You are missing currentTemplate in your renative.json');
@@ -42,7 +42,7 @@ export const checkAndCreateProjectPackage = async (c: RnvContext) => {

const pkgJson = templateObj?.templateConfig?.packageTemplate || {};
pkgJson.name = packageName;
// pkgJson.version = version;
pkgJson.version = packageVersion;
pkgJson.dependencies = pkgJson.dependencies || {};
// No longer good option to assume same version
// pkgJson.dependencies.renative = rnvVersion;
1 change: 1 addition & 0 deletions packages/core/src/schema/configFiles/project.ts
Original file line number Diff line number Diff line change
@@ -220,6 +220,7 @@ const Paths = z

const RootProjectBaseFragment = {
workspaceID: WorkspaceID,
projectVersion: z.string(),
projectName: ProjectName,
isMonorepo: z.optional(IsMonoRepo),
isTemplate: z.boolean().optional(),
1 change: 1 addition & 0 deletions packages/core/src/schema/configFiles/template.ts
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@ export const RootTemplateSchema = z.object({
peerDependencies: z.optional(NpmDep),
optionalDependencies: z.optional(NpmDep),
name: z.string().optional(),
version: z.string().optional(),
})
),
})
1 change: 1 addition & 0 deletions packages/engine-core/src/__tests__/tasks.test.ts
Original file line number Diff line number Diff line change
@@ -160,6 +160,7 @@ test('Execute task.rnv.new', async () => {
isNew: true,
platforms: {},
projectName: 'test',
projectVersion: '1.0.0',
templates: {
'@rnv/template-starter': {
version: '1.0.0-canary.7',
2 changes: 2 additions & 0 deletions packages/engine-core/src/tasks/task.rnv.new.ts
Original file line number Diff line number Diff line change
@@ -664,6 +664,7 @@ export const taskRnvNew = async (c: RnvContext) => {
...renativeTemplateConfig,
...renativeTemplateConfigExt,
projectName: data.projectName || 'my-project',
projectVersion: data.inputVersion || '0.1.0',
workspaceID: data.optionWorkspaces.selectedOption || 'project description',
// paths: {
// appConfigsDir: './appConfigs',
@@ -716,6 +717,7 @@ export const taskRnvNew = async (c: RnvContext) => {
config.platforms = platforms;
config.engines = engines;
config.defaults = defaults;

writeFileSync(c.paths.project.config, config);

if (data.gitEnabled) {

0 comments on commit 2cc6ef2

Please sign in to comment.