Skip to content

Warn when a module has not set a license - #671

Merged
cb1kenobi merged 2 commits into
v7from
chris/warn-on-unfilled-module-license
Sep 2, 2026
Merged

Warn when a module has not set a license#671
cb1kenobi merged 2 commits into
v7from
chris/warn-on-unfilled-module-license

Conversation

@cb1kenobi

@cb1kenobi cb1kenobi commented Sep 1, 2026

Copy link
Copy Markdown
Member

The SDK's module templates seed the manifest with a placeholder licence:

iphone/templates/module/default/template/ios/manifest.ejs
android/templates/module/default/template/android/manifest.ejs
→ license: Specify your license

Nothing prompts anyone to replace it, so it ships. A code search across tidev finds three modules that have released with it still in place — titanium-identity, titanium-onboarding and ti.previewinteraction — and it surfaces anywhere the manifest does, including the module listing on titaniumsdk.com.

readManifest() now warns when it sees one:

Module ti.previewinteraction has not set a license (/path/to/ios/manifest):
choose an SPDX license such as "Apache-2.0".

The message names the fix rather than the origin of the string — where the value came from is not the reader's problem. Suggesting SPDX specifically is the point: across the sixteen modules in the Titanium registry, Apache 2.0 is currently spelled six different ways (Apache 2.0, Apache License Version 2.0, Apache License, Version 2.0, Apache, Apache 2, Apache Public License v2), which is what made this worth warning about at all.

Why a warning and not an error

readManifest() already throws for a missing moduleid, platform or version, so throwing here would be consistent — but those are structural, and this is not. The placeholder belongs to a dependency. Failing an app build because somebody else's metadata is unfilled punishes the person who cannot fix it, and would break builds that work today for three real modules.

The predicate is exported instead:

export function isPlaceholderLicense(license: string | undefined): boolean

so a packaging or release step — which is talking to the author who can fix it — can reject what this only warns about. That is the layer where the check actually belongs.

Matching ignores case and surrounding whitespace, since the templates emit a trailing newline and manifests are hand-edited. A missing licence is treated as not a placeholder: absent is a different problem from unfilled, and not this check's.

Checks

4 new tests; full suite 287 passed, 1 skipped, across 29 files. pnpm check (type-check, lint, format) clean.

Context: this came out of TI-66 on the titaniumsdk.com rewrite, which found the placeholder plus the six spellings. The spelling normalisation went out as separate PRs to the module repos and is now merged in eight of them.

🤖 Generated with Claude Code

The SDK's module templates seed `license: Specify your license`, and nothing
prompts anyone to replace it. Three modules under tidev have shipped releases
with it still in place — titanium-identity, titanium-onboarding and
ti.previewinteraction — and it surfaces anywhere the manifest does.

`readManifest()` now warns when it sees one. It deliberately does not throw:
the placeholder belongs to a dependency, and failing an app build because
somebody else's metadata is unfilled punishes the wrong person. The predicate
is exported so a packaging or release step, which is talking to the author who
can actually fix it, can reject what this only warns about.
The warning called the value a "scaffolding placeholder", which describes where
the string came from rather than what the reader should do about it. It now
names the fix:

  Module ti.foo has not set a license (ios/manifest): choose an SPDX license
  such as "Apache-2.0".

Suggesting SPDX rather than any free-form string is the point: sixteen modules
currently spell Apache 2.0 six different ways, which is what made this worth
warning about at all.
@cb1kenobi cb1kenobi changed the title Warn when a module manifest carries the scaffolding licence Warn when a module has not set a license Sep 2, 2026
@cb1kenobi
cb1kenobi merged commit 8b59682 into v7 Sep 2, 2026
15 of 16 checks passed
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