Skip to content

Commit fb0a2d7

Browse files
committed
fix: strong dependency config loading, analyze early return, and combobox focus loss
- vite-plugin: copy strongDependencies from inline options and only short-circuit config loading when all three config-derived values (renderers, strong, strongDependencies) are provided inline - cli analyze: include requireDependencies in the no-targets early return guard so barrel-only projects with require: true do not exit 0 without checking dependency violations - PlaygroundVersionCombobox: add onMouseDown preventDefault on the listbox so clicks on list padding, scrollbar, loading text, or empty text do not blur the input and dismiss the popup
1 parent cd920a4 commit fb0a2d7

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎packages/cli/src/commands/analyze/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export default defineCommand({
375375
);
376376
}
377377

378-
if (targets.length === 0 && !measureCoverage && !reportDependencies) {
378+
if (targets.length === 0 && !measureCoverage && !reportDependencies && !requireDependencies) {
379379
ctx.ui.intro('octane analyze');
380380
ctx.ui.outro('No Octane modules found.');
381381
return { json: { ok: true, analyzed: 0, findings: [] } };

‎packages/vite-plugin-octane/src/index.js‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,9 @@ export function octane(inlineOptions = {}) {
15011501
compilerOptions.requireDirective = inlineOptions.requireDirective;
15021502
}
15031503
if (inlineOptions.renderers !== undefined) compilerOptions.renderers = inlineOptions.renderers;
1504+
if (inlineOptions.strongDependencies !== undefined) {
1505+
compilerOptions.strongDependencies = inlineOptions.strongDependencies;
1506+
}
15041507
if (inlineOptions.cssModuleConstants !== undefined) {
15051508
compilerOptions.cssModuleConstants = inlineOptions.cssModuleConstants;
15061509
}
@@ -1509,9 +1512,13 @@ export function octane(inlineOptions = {}) {
15091512
if (typeof compilerConfigHook === 'function') {
15101513
compilerPlugin.config = function compilerConfigWithAppOptions(userConfig, env) {
15111514
const projectRoot = userConfig.root ? path.resolve(userConfig.root) : process.cwd();
1512-
// Both inline compiler options override app config independently. Preserve
1513-
// the synchronous path when neither needs to read octane.config.ts.
1514-
if (inlineOptions.renderers !== undefined && inlineOptions.strong !== undefined) {
1515+
// All inline compiler options override app config independently. Preserve
1516+
// the synchronous path when none needs to read octane.config.ts.
1517+
if (
1518+
inlineOptions.renderers !== undefined &&
1519+
inlineOptions.strong !== undefined &&
1520+
inlineOptions.strongDependencies !== undefined
1521+
) {
15151522
compilerConfigWatchFiles.clear();
15161523
return compilerConfigHook.call(this, userConfig, env);
15171524
}
@@ -1520,7 +1527,8 @@ export function octane(inlineOptions = {}) {
15201527
if (!octaneConfigExists(projectRoot)) {
15211528
if (inlineOptions.renderers === undefined) delete compilerOptions.renderers;
15221529
if (inlineOptions.strong === undefined) delete compilerOptions.strong;
1523-
delete compilerOptions.strongDependencies;
1530+
if (inlineOptions.strongDependencies === undefined)
1531+
delete compilerOptions.strongDependencies;
15241532
compilerConfigWatchFiles.clear();
15251533
// A new app config can introduce Strong mode or renderer rules.
15261534
compilerConfigWatchFiles.add(path.resolve(configPath));
@@ -1535,7 +1543,9 @@ export function octane(inlineOptions = {}) {
15351543
if (inlineOptions.strong === undefined) {
15361544
compilerOptions.strong = config.config.compiler.strong;
15371545
}
1538-
compilerOptions.strongDependencies = config.config.compiler.strongDependencies;
1546+
if (inlineOptions.strongDependencies === undefined) {
1547+
compilerOptions.strongDependencies = config.config.compiler.strongDependencies;
1548+
}
15391549
compilerConfigWatchFiles.clear();
15401550
for (const file of [...config.dependencies, ...config.missingDependencies]) {
15411551
compilerConfigWatchFiles.add(path.resolve(file));

‎website/src/pages/playground/PlaygroundVersionCombobox.tsrx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ export function PlaygroundVersionCombobox(props: PlaygroundVersionComboboxProps)
269269
role="listbox"
270270
aria-label="Octane versions"
271271
hidden={!open}
272+
onMouseDown={(event: MouseEvent) => event.preventDefault()}
272273
>
273274
@for (const item of options; key item) {
274275
<li

0 commit comments

Comments
 (0)