Skip to content

fix(headers): correct email + add SPDX + @spec example#19

Open
rubenvdlinde wants to merge 19 commits into
developmentfrom
fix/header-consistency-info-email
Open

fix(headers): correct email + add SPDX + @spec example#19
rubenvdlinde wants to merge 19 commits into
developmentfrom
fix/header-consistency-info-email

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

  • Fix @author email typo: dev@conductio.nlinfo@conduction.nl across 9 template PHP files
  • Add SPDX-FileCopyrightText + SPDX-License-Identifier after the main docblock, consistent placement across all files (previously some had // SPDX-License-Identifier before the docblock, most had nothing)
  • Bump @copyright year: 2024 → 2026
  • Add file-level @spec openspec/changes/{change-name}/tasks.md#task-N example in Application.php with explanation comment — ADR-003 mandates this for every class and public method, and having the example in the template is what propagates the convention to new app scaffolds

Why this matters

This template is copied into every Conduction app at scaffold time, which means the dev@conductio.nl typo has propagated into 988 occurrences across 927 files org-wide. Fixing it here is the root-cause fix; the downstream sweep follows.

Similarly, @spec coverage is currently near-zero outside decidesk because the template never shows builders what the tag looks like.

Test plan

  • composer install + ./vendor/bin/phpcs clean on template
  • Scaffold a new app from this template and verify generated headers are correct

WilcoLouwerse and others added 17 commits April 2, 2026 14:47
…uctors

Issues caught by every code review on apps built from this template:
- <licence>agpl</licence> → <licence>eupl</licence>
- OC.requestToken → getRequestToken() from @nextcloud/auth
- Added SPDX-License-Identifier: EUPL-1.2 to all PHP/JS/Vue files
- Constructor properties: private → private readonly
The app store only recognises agpl/apache/mit — not eupl.
Source files use SPDX EUPL-1.2 headers (the actual licence).
info.xml uses agpl for store compatibility only.
- Extend base webpack config instead of replacing resolve/module
- Add NodePolyfillPlugin for process polyfill compatibility
- Add CnObjectSidebar + objectSidebarState for proper sidebar positioning
- Update deps: @nextcloud/l10n ^3.1.0, @nextcloud/dialogs ^5.3.7
- Add sass/sass-loader for SCSS support
…plitChunks

Two issues found when testing builder-generated apps (decidesk):

1. main.js: loadTranslations() wraps Vue mount in a callback that never
   fires when l10n/en_US.json returns 404 (new apps don't have translations).
   Fix: mount Vue synchronously, import t/n directly.

2. webpack.config.js: Nextcloud serves chunk files from /apps/<id>/js/ but
   custom_apps files live at /custom_apps/<id>/js/. Any webpack code-split
   chunk (from lazy imports or vendor splitting) fails with ChunkLoadError.
   Fix: disable splitChunks entirely. Use static imports in router.
Gives the Hydra builder a working reference for the full CRUD lifecycle:

- ItemList.vue: CnIndexPage + useListView composable (zero-boilerplate list)
- ItemDetail.vue: CnDetailPage with sidebar, save/delete, CnObjectDataWidget
- object.js: replaced hand-rolled store with createObjectStore from library
- store.js: registerObjectType pattern with settings-driven schema binding
- MainMenu.vue: added Items nav entry between Dashboard and Documentation
- router: static imports with props factory for :id params
- package.json: fix @nextcloud/dialogs ^3.2.0 (Vue 2), add apexcharts/codemirror

These patterns prevent the recurring builder mistakes: lazy imports (ChunkLoadError),
custom stores (should use createObjectStore), missing list/detail views, and wrong
dependency versions.
Settings link should be inside NcAppNavigationSettings (the gear icon
widget), not a bare NcAppNavigationItem — follows Nextcloud convention
for admin-only controls and matches the procest pattern.
The correct Nextcloud pattern:
- Admin settings: /settings/admin/{appid} (via AdminSettings.php + settings.js)
- In-app settings: NcAppSettingsDialog modal opened from gear menu
- NO /settings route in the Vue router

The gear foldout (NcAppNavigationSettings) can hold additional admin
nav items. The Settings item emits @open-settings which App.vue
handles by opening the UserSettings modal.

Matches the OpenCatalogi pattern.
- Fix ReferenceError: use this.t() instead of bare t() in ItemDetail.vue
- Wrap hardcoded app name in AdminRoot.vue
- Add 14 missing keys to en.json and nl.json (30→44 keys)
Standardize on #actions across all components per the updated
slot naming convention in @conduction/nextcloud-vue.
Update all translation keys to use sentence case (only first letter capitalized)
instead of title case. Keys changed:
- "Add Groups" → "Add groups"
- "Active Collections" → "Active collections"
- "API Key" → "API key"
- And 400+ similar keys across all apps

Sentence case for keys improves consistency and readability while preserving
proper English grammar in translated values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- @author email: dev@conductio.nl → info@conduction.nl (the .nl
  typo had propagated into every Conduction app since this template
  is the source — 988 occurrences across 927 files org-wide).
- @copyright year: 2024 → 2026.
- SPDX: unified placement to // SPDX-FileCopyrightText + // SPDX-License-Identifier
  after the main docblock, before declare(strict_types=1). Removes the
  pre-docblock // SPDX line variant that had crept into some files.
- @SPEC example: added a file-level @SPEC tag in Application.php
  as a reference for future specs (ADR-003 requires every class and
  public method to carry an @SPEC tag linking back to the OpenSpec
  change that created or last modified the file).

Template files are the golden pattern builder containers copy when
scaffolding a new app, so fixing them here prevents the typo and
missing SPDX from recurring on every future build.
Moved SPDX-FileCopyrightText + SPDX-License-Identifier from // line
comments to inside the main docblock, placed between the description
and the @category tag.

Reason: the standard template convention (and what reuse lint expects)
is for SPDX metadata to live colocated with @author/@copyright/@license
inside the file docblock, not as standalone // comments before declare.
The previous commit's // SPDX-... pattern was a transitional style and
should never have been promoted to the template.
@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

ADR audit follow-up — PR #20

Did a full audit of this template against every MUST/SHALL/REQUIRED rule in the 17 org-wide ADRs. Findings + minimal fixes are in #20 (stacked on top of this branch).

Snapshot of the gaps found:

Gap ADR Status
No seed data in app_template_register.json ADR-001 fixed — 3 @self objects added
MetricsController missing (route declared, 500 on call) ADR-006 fixed — new controller with {app}_health_status + {app}_info
HealthController missing (route declared, 500 on call) ADR-006 fixed — new public JSON controller
No CORS OPTIONS on public endpoints ADR-002 fixed on /api/health
SettingsService::loadConfiguration returns $e->getMessage() to client ADR-005 fixed — static generic message, real error logged
SettingsController never try/catches ADR-005 fixed
Raw fetch() in settings store ADR-004 fixed — @nextcloud/axios
5 Vue files import directly from @nextcloud/vue ADR-004 fixed — all via @conduction/nextcloud-vue
window.confirm() in ItemDetail.vue ADR-004 fixed — NcDialog
Deep link URL uses hash format ADR-004 fixed — path format
@spec only on Application.php ADR-003 fixed — file + method level on every class in lib/
No error-path unit test ADR-008 fixed — testIndexReturnsGenericErrorOnServiceException

Full table (56 rules, 13 fixed, 5 partial with documented exceptions, 6 N/A): docs/adr-audit.md in #20.

Follow-ups flagged but not fixed (to keep this diff scoped): @license@licence sweep (ADR-014 says UK spelling but PHPCS defaults to US), private readonly on DI constructors, SettingsServiceTest (≥3 methods per ADR-008), first domain-mutation endpoint with per-object auth check (ADR-005), pagination example with _page/_limit/total response shape (ADR-002).

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 9933e0d

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-20 06:32 UTC

Download the full PDF report from the workflow artifacts.

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.

2 participants