mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
chore: bump version to 1.6.12
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
const { execSync } = require("child_process");
|
||||
const { cpus } = require("os");
|
||||
const { version } = require("./package.json");
|
||||
|
||||
const NUM_CPUS = cpus().length;
|
||||
const IS_CI = process.env.CI;
|
||||
const gitHash = execSync("git rev-parse --short HEAD").toString().trim();
|
||||
const APP_VERSION = version.replaceAll(".", "");
|
||||
console.log("App version:", APP_VERSION);
|
||||
module.exports = {
|
||||
test: {
|
||||
TEST_ALL: true,
|
||||
@@ -14,6 +17,7 @@ module.exports = {
|
||||
INLINE_RUNTIME_CHUNK: false,
|
||||
DISABLE_ESLINT_PLUGIN: true,
|
||||
REACT_APP_GIT_HASH: gitHash,
|
||||
REACT_APP_VERSION: APP_VERSION,
|
||||
},
|
||||
dev: {
|
||||
REACT_APP_CI: "true",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@notesnook/desktop",
|
||||
"productName": "Notesnook",
|
||||
"description": "Your private note taking space",
|
||||
"version": "1.6.11",
|
||||
"version": "1.6.12",
|
||||
"private": true,
|
||||
"main": "./build/electron.js",
|
||||
"homepage": "https://notesnook.com/",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "notesnook",
|
||||
"description": "Your private note taking space",
|
||||
"version": "1.6.11",
|
||||
"version": "1.6.12",
|
||||
"private": true,
|
||||
"main": "./src/App.js",
|
||||
"homepage": "https://notesnook.com/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Flex, Text } from "rebass";
|
||||
import { getAppVersion } from "../../utils/useVersion";
|
||||
import { appVersion } from "../../utils/version";
|
||||
import Field from "../field";
|
||||
import Dialog from "./dialog";
|
||||
import platform from "platform";
|
||||
@@ -23,7 +23,7 @@ This is all optional, of course.`,
|
||||
};
|
||||
|
||||
function getDeviceInfo() {
|
||||
const appVersion = getAppVersion().formatted;
|
||||
const appVersion = appVersion.formatted;
|
||||
const os = platform.os;
|
||||
const browser = `${platform.name} ${platform.version}`;
|
||||
|
||||
|
||||
@@ -71,3 +71,5 @@ self.addEventListener("message", (event) => {
|
||||
});
|
||||
|
||||
// Any other custom service worker logic can go here.
|
||||
const VERSION = process.env.REACT_APP_VERSION;
|
||||
console.log("App version:", VERSION);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Config from "./config";
|
||||
import { getPlatform } from "./platform";
|
||||
import { getAppVersion } from "./useVersion";
|
||||
import { appVersion } from "./version";
|
||||
|
||||
export function loadTrackerScript() {
|
||||
if (Config.get("telemetry") === "false") return;
|
||||
@@ -68,7 +68,7 @@ export function trackVisit() {
|
||||
window.umami.trackView("/");
|
||||
trackEvent(
|
||||
ANALYTICS_EVENTS.version,
|
||||
`${getAppVersion().formatted}-${getPlatform().toLowerCase()}`
|
||||
`${appVersion.formatted}-${getPlatform().toLowerCase()}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SUBSCRIPTION_STATUS } from "../common";
|
||||
import { db } from "../common/db";
|
||||
import Config from "./config";
|
||||
import { isUserPremium } from "../hooks/use-is-user-premium";
|
||||
import { getAppVersion } from "./useVersion";
|
||||
import { appVersion } from "./version";
|
||||
|
||||
var CACHED_ANNOUNCEMENTS = [];
|
||||
var cancelled = false;
|
||||
@@ -65,7 +65,7 @@ async function shouldShowAnnouncement(announcement) {
|
||||
|
||||
show =
|
||||
!announcement.appVersion ||
|
||||
announcement.appVersion === getAppVersion().numerical;
|
||||
announcement.appVersion === appVersion.numerical;
|
||||
|
||||
if (!show) return false;
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
// import { useEffect, useState } from "react";
|
||||
// import { db } from "../common/db";
|
||||
// import config from "./config";
|
||||
|
||||
var APP_VERSION = {
|
||||
formatted: format(
|
||||
1611,
|
||||
process.env.REACT_APP_GIT_HASH,
|
||||
process.env.REACT_APP_PLATFORM
|
||||
),
|
||||
numerical: 1611,
|
||||
appUpdated: false,
|
||||
appUpdateable: false,
|
||||
changelog: undefined,
|
||||
fetched: false,
|
||||
};
|
||||
|
||||
var CACHED_VERSION = undefined;
|
||||
function useVersion() {
|
||||
// const [version, setVersion] = useState(APP_VERSION);
|
||||
|
||||
// useEffect(() => {
|
||||
// (async function () {
|
||||
// const version = await getVersion();
|
||||
// setVersion(version);
|
||||
// })();
|
||||
// }, []);
|
||||
|
||||
return [APP_VERSION, APP_VERSION];
|
||||
}
|
||||
export default useVersion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} version
|
||||
* @param {string} hash
|
||||
* @param {"web"|"desktop"} type
|
||||
*/
|
||||
function format(version, hash, type) {
|
||||
const [major, minor, bugfix0, bugfix1] = version.toString().split("");
|
||||
return `${major}.${minor}.${bugfix0}${bugfix1 || ""}-${hash}-${type}`;
|
||||
}
|
||||
|
||||
export function getAppVersion() {
|
||||
return APP_VERSION;
|
||||
}
|
||||
|
||||
export function getCachedVersion() {
|
||||
return CACHED_VERSION;
|
||||
}
|
||||
|
||||
// export async function getVersion() {
|
||||
// try {
|
||||
// var app_version = config.get("app_version");
|
||||
// if (!app_version) {
|
||||
// app_version = APP_VERSION;
|
||||
// config.set("app_version", APP_VERSION);
|
||||
// }
|
||||
// if (APP_VERSION.fetched) return CACHED_VERSION;
|
||||
|
||||
// const version = await db.version();
|
||||
// if (!version) return APP_VERSION;
|
||||
|
||||
// const changelog = version.web_changelog || version.changelog;
|
||||
// CACHED_VERSION = {
|
||||
// formatted: format(version.web),
|
||||
// numerical: version.web,
|
||||
// appUpdated:
|
||||
// version.web > app_version.numerical &&
|
||||
// APP_VERSION.numerical === version.web,
|
||||
// appUpdateable: version.web > APP_VERSION.numerical,
|
||||
// updateSeverity: version.severity,
|
||||
// changelog: !changelog ? undefined : changelog,
|
||||
// fetched: true,
|
||||
// };
|
||||
// if (CACHED_VERSION.appUpdated) {
|
||||
// config.set("app_version", CACHED_VERSION);
|
||||
// }
|
||||
// return CACHED_VERSION;
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// }
|
||||
// return APP_VERSION;
|
||||
// }
|
||||
19
apps/web/src/utils/version.js
Normal file
19
apps/web/src/utils/version.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export const appVersion = {
|
||||
formatted: format(
|
||||
process.env.REACT_APP_VERSION,
|
||||
process.env.REACT_APP_GIT_HASH,
|
||||
process.env.REACT_APP_PLATFORM
|
||||
),
|
||||
numerical: parseInt(process.env.REACT_APP_VERSION),
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} version
|
||||
* @param {string} hash
|
||||
* @param {"web"|"desktop"} type
|
||||
*/
|
||||
function format(version, hash, type) {
|
||||
const [major, minor, bugfix0, bugfix1] = version.toString().split("");
|
||||
return `${major}.${minor}.${bugfix0}${bugfix1 || ""}-${hash}-${type}`;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ import { showLoadingDialog } from "../common/dialog-controller";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { showPasswordDialog } from "../common/dialog-controller";
|
||||
import { hardNavigate, hashNavigate } from "../navigation";
|
||||
import useVersion from "../utils/useVersion";
|
||||
import { appVersion } from "../utils/version";
|
||||
import { CHECK_IDS } from "notes-core/common";
|
||||
import { openPaddleDialog } from "../common/checkout";
|
||||
import Tip from "../components/tip";
|
||||
@@ -139,7 +139,6 @@ function Settings(props) {
|
||||
const toggleNightMode = useThemeStore((store) => store.toggleNightMode);
|
||||
const followSystemTheme = useThemeStore((store) => store.followSystemTheme);
|
||||
const [zoomFactor, setZoomFactor] = useZoomFactor();
|
||||
const [, version] = useVersion();
|
||||
|
||||
const toggleFollowSystemTheme = useThemeStore(
|
||||
(store) => store.toggleFollowSystemTheme
|
||||
@@ -631,7 +630,7 @@ function Settings(props) {
|
||||
<Tip
|
||||
sx={{ mt: 2 }}
|
||||
text="About"
|
||||
tip={`version ${version.formatted}`}
|
||||
tip={`version ${appVersion.formatted}`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user