Skip to content

chore: migrate to cwm-build-tools v0.5.x#6

Merged
bcordis merged 1 commit into
mainfrom
feat/migrate-to-cwm-build-tools-0.5
May 11, 2026
Merged

chore: migrate to cwm-build-tools v0.5.x#6
bcordis merged 1 commit into
mainfrom
feat/migrate-to-cwm-build-tools-0.5

Conversation

@bcordis

@bcordis bcordis commented May 9, 2026

Copy link
Copy Markdown
Member

Summary

Drops the project-side build/build-package.php in favor of the generic cwm-build binary introduced in cwm-build-tools v0.5.0-alpha (issue Joomla-Bible-Study/cwm-build-tools#5). Bumps to v0.5.1-alpha for the ensure-minified gate fix surfaced during this migration.

Behavior parity — verified end-to-end

Legacy cwm-build
File count 89 89
Size 215 KB 215 KB
File list (89 paths) identical
File contents (89 files) identical (diff -rq shows zero differences)

The unzipped trees are byte-equivalent.

Changes

composer.json

-  "cwm/build-tools": "^0.4@alpha",
+  "cwm/build-tools": "^0.5@alpha",
-  "build:package":         "php build/build-package.php",
-  "build:package:verbose": "php build/build-package.php --verbose",
+  "build:package":         "cwm-build",
+  "build:package:verbose": "cwm-build -v",
   "release":               "cwm-release",
   "bump-version":          "cwm-bump",
-  "package":               "cwm-package",
   ...

The package script is removed because lib_cwmscripture is a single-extension library, not a multi-extension package wrapper — on v0.5+ cwm-package requires a package: block in the config and would fail without one.

cwm-build.config.json

build.command kept as "npm run build && cwm-build" so the release pipeline keeps auto-running npm run build exactly as before. New build: schema fields added per the v0.5.0-alpha migration guide:

  • outputDir, outputName ({version} substituted)
  • manifest, scriptFile
  • sources[]src / sql / language / media/lib_cwmscripture with the same per-source zip prefixes the legacy script used
  • excludes[].git, .DS_Store, .idea, node_modules, .php-cs-fixer.cache (contains-mode, same as legacy)
  • preBuildensure-minified mode pointing at media/lib_cwmscripture/{js,css}, same gate semantics as legacy

build/build-package.php

Deleted (190 lines).

composer.lock

cwm/build-tools v0.4.0-alpha → v0.5.1-alpha.

Why no manifest changes

Schema paths in the new build: block are source-tree paths that match the legacy script's behavior 1:1. The package's <media> element keeps controlling install-time destination as before — adopting cwm-build is a behavior-preserving migration.

Test plan

  • composer build:package — produces identical zip (89 files / 215 KB; full byte-equivalent diff)
  • composer build:package:verbose — works (added -v flag)
  • After rm build/build-package.php — build still works (now driven entirely by cwm-build reading the config)
  • composer release -- 1.1.4 end-to-end run on next release (release pipeline reads build.command which is unchanged in shape)

Related

🤖 Generated with Claude Code

Drops the project-side build/build-package.php in favor of the generic
cwm-build binary introduced in cwm-build-tools v0.5.0-alpha (issue
Joomla-Bible-Study/cwm-build-tools#5). Bumps to v0.5.1-alpha for the
ensure-minified gate fix surfaced during this migration.

Behavior parity verified end-to-end:

  Legacy: 89 files, 215 KB
  cwm-build: 89 files, 215 KB
  diff -r between unzipped contents: identical (file list AND every
  file's bytes)

Changes:

  composer.json
    - cwm/build-tools: ^0.4@alpha -> ^0.5@alpha
    - "build:package": "php build/build-package.php" -> "cwm-build"
    - "build:package:verbose": "php build/build-package.php --verbose"
                              -> "cwm-build -v"
    - dropped "package": "cwm-package" — single-extension lib doesn't
      need a multi-extension package wrapper, and on v0.5+ that script
      would fail without a `package:` block

  cwm-build.config.json
    - build.command kept as "npm run build && cwm-build" so the release
      pipeline keeps auto-running npm build, exactly as before
    - new build.* fields:
        outputDir, outputName ({version} substituted),
        manifest, scriptFile,
        sources[] (src/sql/language/media — same prefixes as legacy),
        excludes[] (.git/.DS_Store/.idea/node_modules/.php-cs-fixer.cache
                    — same list, contains-mode default),
        preBuild (mode: ensure-minified, dirs: media/.../js + css —
                  same gate semantics as legacy)

  build/build-package.php
    - deleted (190 lines)

  composer.lock
    - cwm/build-tools v0.4.0-alpha -> v0.5.1-alpha

The release pipeline is unchanged for downstream callers — cwm-release
keeps reading build.command. Direct `composer build:package` users get
identical zips. No manifest changes required.

Refs Joomla-Bible-Study/cwm-build-tools#5 (per-consumer migration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bcordis bcordis merged commit e5fa6e1 into main May 11, 2026
1 check passed
@bcordis bcordis deleted the feat/migrate-to-cwm-build-tools-0.5 branch May 11, 2026 15:11
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.

1 participant