pluginVersion() named package.json relative to its own module. A bundler takes such a file for an asset: a Turbopack build of a site copied the plugin's whole package.json (dependency lists, scripts, the registry and repository addresses; no secret) to /_next/static/media/package.<hash>.json, served to anyone. Webpack kept it on the server side. The version now comes from src/version.ts (scripts/write-version.mjs, run by the `version` script; a test fails when it differs from package.json). A smoke test of the built site: nothing under .next/static is a package manifest. Co-Authored-By: Claude Fable 5.2 <[email protected]>
11 lines
615 B
TypeScript
11 lines
615 B
TypeScript
/**
|
|
* The plugin's own version, as a constant in the code.
|
|
*
|
|
* Not read from package.json at run time: naming that file relative to the module (a URL built
|
|
* from the module's own address) in server code makes a bundler treat the file as an ASSET — Turbopack copied the plugin's whole
|
|
* package.json (dependency lists, scripts, the registry address) into the site's public
|
|
* `/_next/static/media/`. Written by `node scripts/write-version.mjs` (the `version` script of
|
|
* package.json runs it on `pnpm version …`); test/version.test.ts fails when the two differ.
|
|
*/
|
|
export const PLUGIN_VERSION = '1.16.7'
|