mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Set in-tree extensions package.json version on build (#2946)
* set extensions package.json version on build Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * set extensions package.json version on build Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
683a520186
commit
e7947021e9
5 files changed
+16
-4
No files matched your search
@@ -22,6 +22,7 @@ import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import appInfo from "../package.json";
|
||||
import semver from "semver";
|
||||
import fastGlob from "fast-glob";
|
||||
|
||||
const packagePath = path.join(__dirname, "../package.json");
|
||||
const versionInfo = semver.parse(appInfo.version);
|
||||
@@ -41,3 +42,14 @@ if (versionInfo.prerelease) {
|
||||
|
||||
|
||||
fs.writeFileSync(packagePath, `${JSON.stringify(appInfo, null, 2)}\n`);
|
||||
|
||||
const extensionManifests = fastGlob.sync(["extensions/*/package.json"]);
|
||||
|
||||
for (const manifestPath of extensionManifests) {
|
||||
const packagePath = path.join(__dirname, "..", manifestPath);
|
||||
|
||||
import(packagePath).then((packageInfo) => {
|
||||
packageInfo.default.version = `${versionInfo.raw}.${Date.now()}`;
|
||||
fs.writeFileSync(packagePath, `${JSON.stringify(packageInfo.default, null, 2)}\n`);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user