mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-30 12:09:15 +00:00
refactor(backend): collapse entitlement provider abstraction back to LicenseService (#889)
Removes backend/src/entitlements/ (registry, loadProvider, CommunityEntitlementProvider, types, headers, normalize) and the two abstraction-only tests. Relocates headers/normalize/types to services/license-*.ts. Swaps 22 consumer call sites from getEntitlementProvider() to LicenseService.getInstance(). Drops the Dockerfile install step plus PRO_PACKAGE_VERSION build-arg and github_token BuildKit secret in docker-publish.yml. Removes the now stale no-restricted-imports rule in backend/eslint.config.mjs. Net: 37 files changed, ~700 lines removed, no behavior change. Local dev no longer requires GitHub Packages auth to start the backend. Rationale and revisit conditions in docs/internal/adrs/2026-05-02-collapse-entitlement-provider.md.
This commit is contained in:
@@ -25,26 +25,6 @@ export default tseslint.config(
|
||||
// New in ESLint 10 recommended - existing patterns, suppress until addressed
|
||||
'no-useless-assignment': 'warn',
|
||||
'preserve-caught-error': 'warn',
|
||||
// The private @studio-saelix/sencho-pro package is loaded at
|
||||
// runtime via dynamic import in entitlements/loadProvider.ts.
|
||||
// A static import would (a) bundle the package into the public
|
||||
// BSL build via TypeScript's module resolution, defeating the
|
||||
// privacy split, and (b) break in Community-only environments
|
||||
// where the package is not installed. Use loadEntitlementProvider()
|
||||
// and the registry instead.
|
||||
// no-restricted-imports flags ES `import` statements only by
|
||||
// default; dynamic `import()` expressions are not flagged unless
|
||||
// we set `allowDynamicImports: false`. The loader uses
|
||||
// `await import('@studio-saelix/sencho-pro')` and is therefore
|
||||
// not affected without an extra opt-in.
|
||||
'no-restricted-imports': ['error', {
|
||||
patterns: [
|
||||
{
|
||||
group: ['@studio-saelix/sencho-pro', '@studio-saelix/sencho-pro/*'],
|
||||
message: 'Do not statically import the private package. Use loadEntitlementProvider() and getEntitlementProvider() from src/entitlements/.',
|
||||
},
|
||||
],
|
||||
}],
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user