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

feat(config/migration): migrate package.json config #33633

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RahulGautamSingh
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh commented Jan 15, 2025

Changes

  • Migrate renovate config inside a package.json file by deleting the config from the package.json file and creating a new renovate.json file with the migrated config.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

lib/workers/repository/config-migration/branch/create.ts Outdated Show resolved Hide resolved
lib/workers/repository/config-migration/branch/create.ts Outdated Show resolved Hide resolved
];

if (pJsonMigration) {
const pJson = JSON.parse((await readLocalFile('package.json', 'utf8'))!);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use our json utils

const pJsonContent = await applyPrettierFormatting(
'package.json',
JSON.stringify(pJson, undefined, migratedConfigData.indent.indent),
upath.extname('package.json').replace('.', '') as PrettierParser,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
upath.extname('package.json').replace('.', '') as PrettierParser,
'json',

simplify?

Copy link
Collaborator

@secustor secustor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM outside of existing comments

const pJson = parseJson(
await readLocalFile('package.json', 'utf8'),
'package.json',
) as any;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
) as any;
) as unknown;

Don't use any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Renovate Config PR should migrate contents from package.json>renovate to renovate.json
3 participants