diff --git a/rollup.config.js b/rollup.config.js index 54591f0a..e11559ae 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -15,7 +15,6 @@ if (pkg.module !== ES_FILENAME || pkg.main !== CJS_FILENAME) { } const outro = ` -__info__.version = '${pkg.version}'; __info__.date = '${new Date().toISOString()}'; __info__.hash = '${git.short()}'; __info__.url = 'https://github.com/odoo/owl'; diff --git a/src/runtime/app.ts b/src/runtime/app.ts index aecfbc4e..1b4b1946 100644 --- a/src/runtime/app.ts +++ b/src/runtime/app.ts @@ -1,3 +1,4 @@ +import { version } from "../version"; import { Component, ComponentConstructor, Props } from "./component"; import { ComponentNode } from "./component_node"; import { nodeErrorHandlers, OwlError, handleError } from "./error_handling"; @@ -54,6 +55,7 @@ export class App< E = any > extends TemplateSet { static validateTarget = validateTarget; + static version = version; name: string; Root: ComponentConstructor
; diff --git a/src/runtime/index.ts b/src/runtime/index.ts index a01a3574..a1013eae 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,3 +1,4 @@ +import { App } from "./app"; import { config, createBlock, @@ -56,4 +57,6 @@ export { export { validate } from "./validation"; export { OwlError } from "./error_handling"; -export const __info__ = {}; +export const __info__ = { + version: App.version, +}; diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 00000000..bec7bf6c --- /dev/null +++ b/src/version.ts @@ -0,0 +1,2 @@ +// do not modify manually. This value is updated by the release script. +export const version = "2.0.7"; diff --git a/tools/release.js b/tools/release.js index 4becd5e2..9584334c 100644 --- a/tools/release.js +++ b/tools/release.js @@ -86,6 +86,7 @@ async function startRelease() { // --------------------------------------------------------------------------- log(`Step 3/${STEPS}: updating package.json...`); await replaceInFile("./package.json", current, next); + await replaceInFile("./src/version.ts", current, next); // --------------------------------------------------------------------------- log(`Step 4/${STEPS}: creating git commit...`);