Skip to content

Comments

feat(create-cli): support config file format selection#1250

Open
hanna-skryl wants to merge 1 commit intomainfrom
config-file-format-selection
Open

feat(create-cli): support config file format selection#1250
hanna-skryl wants to merge 1 commit intomainfrom
config-file-format-selection

Conversation

@hanna-skryl
Copy link
Collaborator

Closes #1243

Config file format selection is added to the setup wizard. The wizard now prompts users to choose between TypeScript and JavaScript, with the default auto-detected from the filesystem based on tsconfig presence. A --config-format CLI option allows skipping the prompt.

@nx-cloud
Copy link

nx-cloud bot commented Feb 24, 2026

View your CI Pipeline Execution ↗ for commit f4b3065

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 32s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 13m 15s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 1m 59s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-24 21:51:14 UTC

@nx-cloud
Copy link

nx-cloud bot commented Feb 24, 2026

View your CI Pipeline Execution ↗ for commit f4b3065

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 32s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 13m 15s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 1m 59s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-24 21:51:45 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1250

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1250

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1250

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1250

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1250

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1250

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1250

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1250

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1250

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1250

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1250

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1250

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1250

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1250

commit: f4b3065

@github-actions
Copy link
Contributor

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit b8dec18 with previous commit d27a23a.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Security 🔴 0 🔴 9 ↑ +9.3
Performance 🔴 47 🔴 38 ↓ −8.4
Code coverage 🟢 93 🟢 93 ↑ +0.1
Documentation 🟡 51 🟡 51 ↑ +0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Updates 🟡 73 🟡 73
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Accessibility 🟢 92 🟢 92
Best Practices 🟢 97 🟢 97
SEO 🟢 92 🟢 92
👍 3 groups improved, 👎 1 group regressed, 👍 6 audits improved, 👎 9 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JS packages npm audit 🔴 0 🔴 9 ↑ +9.3
Lighthouse Performance 🔴 47 🔴 38 ↓ −8.4
Code coverage Code coverage metrics 🟢 93 🟢 93 ↑ +0.1
JSDocs coverage Documentation coverage 🟡 51 🟡 51 ↑ +0.1

30 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟩 Root document took 530 ms 🟥 Root document took 630 ms ↑ +19 %
Lighthouse Reduce unused JavaScript 🟨 Potential savings of 256 KiB 🟥 Potential savings of 233 KiB ↑ +∞ %
Lighthouse Remove duplicate modules in JavaScript bundles 🟨 Potential savings of 80 KiB 🟥 Potential savings of 78 KiB ↑ +∞ %
Lighthouse Largest Contentful Paint 🟥 4.4 s 🟥 8.1 s ↑ +82.1 %
JS packages Vulnerabilities for npm prod dependencies. 🟥 22 vulnerabilities (13 high, 3 moderate, 6 low) 🟥 16 vulnerabilities (6 high, 3 moderate, 7 low) ↓ −27.3 %
Lighthouse First Contentful Paint 🟨 3.0 s 🟥 3.2 s ↑ +7.6 %
Lighthouse Speed Index 🟥 6.2 s 🟥 6.7 s ↑ +8.4 %
Lighthouse Total Blocking Time 🟥 1,820 ms 🟥 1,380 ms ↓ −24.4 %
Lighthouse Time to Interactive 🟥 13.5 s 🟥 14.1 s ↑ +4.5 %
JSDocs coverage Functions coverage 🟥 590 undocumented functions 🟥 596 undocumented functions ↑ +1 %
JSDocs coverage Types coverage 🟥 275 undocumented types 🟥 277 undocumented types ↑ +0.7 %
Code coverage Branch coverage 🟨 89.2 % 🟨 89.3 % ↑ +0.1 %
JSDocs coverage Variables coverage 🟥 271 undocumented variables 🟥 272 undocumented variables ↑ +0.4 %
Code coverage Function coverage 🟩 94.5 % 🟩 94.5 % ↑ +0.1 %
Code coverage Line coverage 🟩 92.7 % 🟩 92.7 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,138 KiB 🟩 Total size was 2,129 KiB ↓ −0.4 %
Lighthouse Minimizes main-thread work 🟥 10.5 s 🟥 8.3 s ↓ −20.8 %
Lighthouse JavaScript execution time 🟥 3.6 s 🟥 2.8 s ↓ −21.3 %
Lighthouse Server Backend Latencies 🟩 1,270 ms 🟩 550 ms ↓ −57 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +4.5 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↓ −0.1 %
Lighthouse Max Potential First Input Delay 🟥 1,110 ms 🟥 850 ms ↓ −23.6 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 79 KiB 🟥 Potential savings of 110 KiB ↑ +40.6 %
Lighthouse Network Round Trip Times 🟩 40 ms 🟩 70 ms ↑ +92 %
JS packages Vulnerabilities for npm dev dependencies. 🟥 81 vulnerabilities (3 critical, 65 high, 10 moderate, 3 low) 🟥 51 vulnerabilities (3 critical, 33 high, 11 moderate, 4 low) ↓ −37 %
Lighthouse Avoids an excessive DOM size 🟥 2,363 elements 🟥 2,368 elements ↑ +0.2 %
Axe ARIA hidden element must not be focusable or contain focusable elements 🟩 202 elements 🟩 203 elements ↑ +0.5 %

651 other audits are unchanged.

@github-actions
Copy link
Contributor

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit b8dec18 with previous commit d27a23a.

💼 Project create-cli

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🔴 19 🔴 22 ↑ +2.6
Code coverage 🟢 98 🟢 98 ↑ +0.4

4 other categories are unchanged.

👍 2 groups improved, 👍 3 audits improved, 👎 1 audit regressed, 1 audit changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🔴 19 🔴 22 ↑ +2.6
Code coverage Code coverage metrics 🟢 98 🟢 98 ↑ +0.4

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Functions coverage 🟥 11 undocumented functions 🟥 17 undocumented functions ↑ +54.5 %
Code coverage Branch coverage 🟩 92.9 % 🟩 94.1 % ↑ +1.3 %
JSDocs coverage Types coverage 🟥 12 undocumented types 🟥 14 undocumented types ↑ +16.7 %
Code coverage Line coverage 🟩 98.5 % 🟩 98.9 % ↑ +0.5 %
JSDocs coverage Variables coverage 🟥 3 undocumented variables 🟥 4 undocumented variables ↑ +33.3 %

438 other audits are unchanged.

💼 Project utils

🥳 Code PushUp report has improved.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🟡 60 🟡 60 ↑ +0.1

5 other categories are unchanged.

👍 1 group improved

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🟡 60 🟡 60 ↑ +0.1

14 other groups are unchanged.

🛡️ Audits

All of 444 audits are unchanged.

💼 Project plugin-lighthouse

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

All of 6 categories are unchanged.

1 audit changed without impacting score

🗃️ Groups

All of 15 groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Branch coverage 🟩 98.8 % 🟩 98.8 % ↓ −0.1 %

443 other audits are unchanged.


11 other projects are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review February 24, 2026 22:49
function isConfigFileFormat(
value: string | undefined,
): value is ConfigFileFormat {
return value === 'ts' || value === 'js' || value === 'mjs';
Copy link
Collaborator

Choose a reason for hiding this comment

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

When you need a union with runtime validation, it's usually better to have a runtime constant as the source of truth. That allows you to derive both the type and the runtime validation from the same set of values. Otherwise, you have to keep them in sync without any help from TypeScript.

  • source of truth:

    export const CONFIG_FILE_FORMATS = ['ts', 'js', 'mjs'] as const;
  • derived type:

    export type ConfigFileFormat = (typeof CONFIG_FILE_FORMATS)[number];
  • derived runtime validation:

    Suggested change
    return value === 'ts' || value === 'js' || value === 'mjs';
    const validValues: readonly string[] = CONFIG_FILE_FORMATS;
    return value != null && validValues.includes(value);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate config file in setup wizard

2 participants