From 7f96c44f44bf8e77469a60215118463a960f7b5c Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Thu, 19 Nov 2026 17:59:03 +0800 Subject: [PATCH] fix(init): default compat to console 0.8+ and core-api 2.x The scaffold defaulted to console >=0.7.0 <0.8.0 and core-api ^1.6, so a fresh extension was incompatible with every Laravel 12 instance (console 0.8.x, core-api 2.x) that registry v2 serves. --- src/commands/init.ts | 3 ++- test/e2e/run.sh | 2 +- test/unit/init.test.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/init.ts b/src/commands/init.ts index 4b595bf..015989c 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -17,7 +17,8 @@ import { CliError, slugify, splitList, studly } from '../util.js'; export const STARTER_TEMPLATE = 'https://github.com/fleetbase/starter-extension.git'; /** console 0.7.x and core-api 1.6+ are what the starter targets today */ -export const DEFAULT_COMPAT = { console: '>=0.7.0 <0.8.0', api: '^1.6' }; +// Registry v2 instances run console 0.8.x (Laravel 12) or later and core-api 2.x. +export const DEFAULT_COMPAT = { console: '>=0.8.0 <0.10.0', api: '^2.0' }; export const INITIAL_VERSION = '0.1.0'; const SKIP = new Set(['.git', 'node_modules', 'server_vendor', 'vendor', 'dist', 'tmp', '.php-cs-fixer.cache']); diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 0f03a6c..373822a 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -86,7 +86,7 @@ run init --name "E2E Insights" --template "$TEMPLATE" --yes --author "E2E Develo cd "$WORK/e2e-insights" grep -q "\"name\": \"@${USERNAME}/e2e-insights-engine\"" package.json || fail "package name" grep -q "\"name\": \"${USERNAME}/e2e-insights-api\"" composer.json || fail "composer name" -grep -q '"console": ">=0.7.0 <0.8.0"' extension.json || fail "compat.console" +grep -q '"console": ">=0.8.0 <0.10.0"' extension.json || fail "compat.console" run build [ -f .fleetbase/release.json ] || fail "no release.json" # list to files first: under pipefail, grep -q closing the pipe early makes GNU tar fail diff --git a/test/unit/init.test.ts b/test/unit/init.test.ts index b162cc7..e1b017f 100644 --- a/test/unit/init.test.ts +++ b/test/unit/init.test.ts @@ -31,7 +31,7 @@ describe('init', () => { expect(await flb('init', dir, '--name', 'Fleet Insights', '--organization', 'acme', '--template', STARTER, '--yes', '--no-git', '--author', 'Acme Ltd ', '--keywords', 'fleet,analytics', '--console', '>=0.7.60 <0.8.0')).toBe(0); const manifest = JSON.parse(read(dir, 'extension.json')); - expect(manifest).toMatchObject({ name: 'Fleet Insights', version: '0.1.0', engine: 'package.json', api: 'composer.json', compat: { console: '>=0.7.60 <0.8.0', api: '^1.6' }, keywords: ['fleet', 'analytics'] }); + expect(manifest).toMatchObject({ name: 'Fleet Insights', version: '0.1.0', engine: 'package.json', api: 'composer.json', compat: { console: '>=0.7.60 <0.8.0', api: '^2.0' }, keywords: ['fleet', 'analytics'] }); const pkg = JSON.parse(read(dir, 'package.json')); expect(pkg).toMatchObject({ name: '@acme/fleet-insights-engine', version: '0.1.0', fleetbase: { route: 'fleet-insights' }, author: 'Acme Ltd ' });