Skip to content

Fix template pitfalls found in the LUP upgrade - #638

Merged
luistinygod merged 10 commits into
mainfrom
fix/template-pitfalls-from-lup-upgrade
Nov 4, 2026
Merged

luistinygod merged 10 commits into
mainfrom
fix/template-pitfalls-from-lup-upgrade

Conversation

@luistinygod

@luistinygod luistinygod commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Short Introduction

Fixes nine small problems in the template that came up while upgrading innovativeanskaffelser (LUP) to PHP 8.4 and WordPress 7.1 on top of Project Base. Each fix is its own commit; the last commit revises the security-deps.yml fix.

Description

Commit Problem Fix
.wp-env.json afterStart runs rm ./wp-content/object-cache.php, but lifecycle scripts run on the host, where the Composer script installs the drop-in at public/content/object-cache.php. The & also lets the setup race the removal. rm -f ./public/content/object-cache.php && npm run wp-env …
lint-staged prettier --write . ignores the file list lint-staged passes and rewrites the whole repository on every commit. prettier --write
packageManager npm@10.7.0 while engines.npm requires >=11.16.0. npm@11.16.0
turbo.json Each package's webpack.config.js and postcss.config.js re-export the root ones, which Turborepo does not hash, so changing a root config can restore a stale build/. PostCSS also reads the T2 custom media file that Composer installs. globalDependencies: webpack.config.js, postcss.config.js, composer.lock
Deploy filter Lists the old ESLint files but not eslint.config.js, jsconfig.json, psalm.xml, turbo.json, browsersync.config.js, .npmrc, .wp-env.json or .copilotignore. Added. The old entries stay, for projects that still have those files.
setup-main-site.sh wp theme enable --network prints an error on a single-site install. Only runs when wp core is-installed --network succeeds.
INSTALLATION.md Mentions Codeship and a config folder that no longer exist, and lists WP_SITEURL as a setting although wp-config.php derives it from WP_HOME. Updated.
security-deps.yml The schedule guard checks repository_owner == 'Emilia-Capital', so the cron run never happens in a Dekode repository. Skip the cron only on forks: github.event.repository.fork == false. No hardcoded owner, so repositories created from the template elsewhere still run it.
anonymize.config.json No pattern for the Patchstack event log table. .*_patchstack_event_log$ with purge. Projects without Patchstack have no such table, so it matches nothing.

Steps to Test/Replicate

Checked:

  • package.json, turbo.json, .wp-env.json and anonymize.config.json parse as JSON, security-deps.yml parses as YAML, and setup-main-site.sh passes bash -n.
  • wp core is-installed --network exits 1 on a single-site install, so the guard skips the command there.
  • The same changes are in use in LUP: turbo run build --dry=json lists the three new global inputs, and lint-staged runs on staged files only.

Not checked:

  • The security-deps.yml fork condition on GitHub: only the YAML parsing and Prettier were checked.
  • The multisite branch of setup-main-site.sh.
  • wp-env itself (no Docker available): the new rm path follows from where the Composer script writes the file.
  • The deploy filter against a real deployment. I don't know if the shared deploy workflow adds a catch-all, so I only extended the exclusions.

Screenshots

Not applicable.

Checklist

  • I have written unit tests where applicable (not applicable)
  • My code follows the Dekode coding standards
  • I've tested my changes with keyboard and screen readers (not applicable)
  • My code follows the accessibility standards (not applicable)
  • My code is properly documented
  • I've declared any PII (Personally Identifiable Information) for anonymization

The lifecycle script runs on the host, where the Composer script installs the drop-in at public/content/object-cache.php. The old path did not exist, and a single & let the setup race the removal.
prettier --write . ignores the file list lint-staged passes and rewrites the whole repository on every commit.
engines.npm requires >=11.16.0 but packageManager pinned npm@10.7.0.
Each package's webpack and postcss config re-exports the root one, which Turborepo did not hash, so a change to either could restore a stale build/. PostCSS also reads the T2 custom media definitions installed by Composer.
The filter still listed the old ESLint files and missed eslint.config.js, jsconfig.json, psalm.xml, turbo.json, browsersync.config.js, .npmrc, .wp-env.json and .copilotignore, so they were deployed.
wp theme enable --network prints an error on a single-site install. Guard it so a single-site setup runs without errors.
There is no config folder, deployments run on GitHub Actions rather than Codeship, and WP_SITEURL is derived from WP_HOME in wp-config.php.
The cron job was guarded by repository_owner == 'Emilia-Capital', so it never ran in any Dekode repository.
The table is a log, not content. Projects that do not use Patchstack have no such table, so the pattern matches nothing there.
Compare against the fork flag instead of a hardcoded repository owner, so repositories created from the template outside DekodeInteraktiv still run the cron job.

@stian-overasen stian-overasen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! 👍

@luistinygod
luistinygod merged commit d90ca8c into main Nov 4, 2026
4 checks passed
@luistinygod
luistinygod deleted the fix/template-pitfalls-from-lup-upgrade branch November 4, 2026 14:34
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