mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
feat: add beta version notice
This commit is contained in:
@@ -10,6 +10,9 @@ const APP_VERSION = version.replaceAll(".", "");
|
|||||||
console.log("App version:", APP_VERSION);
|
console.log("App version:", APP_VERSION);
|
||||||
console.log("Ip address:", ip.address());
|
console.log("Ip address:", ip.address());
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
beta: {
|
||||||
|
REACT_APP_BETA: true,
|
||||||
|
},
|
||||||
test: {
|
test: {
|
||||||
TEST_ALL: true,
|
TEST_ALL: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "notesnook",
|
"name": "notesnook",
|
||||||
"description": "Your private note taking space",
|
"description": "Your private note taking space",
|
||||||
"version": "1.8.10",
|
"version": "2.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "./src/App.js",
|
"main": "./src/App.js",
|
||||||
"homepage": "https://notesnook.com/",
|
"homepage": "https://notesnook.com/",
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
"start": "env-cmd -e all,dev,web react-scripts start",
|
"start": "env-cmd -e all,dev,web react-scripts start",
|
||||||
"start:desktop": "env-cmd -e all,desktop react-scripts start",
|
"start:desktop": "env-cmd -e all,desktop react-scripts start",
|
||||||
"build": "env-cmd -e all,web react-scripts build",
|
"build": "env-cmd -e all,web react-scripts build",
|
||||||
|
"build:beta": "env-cmd -e all,web,beta react-scripts build",
|
||||||
"build:profile": "env-cmd -e all,web react-scripts build --profile",
|
"build:profile": "env-cmd -e all,web react-scripts build --profile",
|
||||||
"build:desktop": "env-cmd -e all,desktop react-scripts build",
|
"build:desktop": "env-cmd -e all,desktop react-scripts build",
|
||||||
"deploy": "./scripts/deploy.sh",
|
"deploy": "./scripts/deploy.sh",
|
||||||
|
|||||||
3
apps/web/scripts/deploy-beta.sh
Executable file
3
apps/web/scripts/deploy-beta.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
yarn build:beta
|
||||||
|
|
||||||
|
rsync -aPzz --exclude "*.map" --exclude "*.txt" ./build/* thecodrr@94.237.75.100:/home/thecodrr/beta.notesnook.com/public_html $1
|
||||||
@@ -37,9 +37,40 @@ const features: Record<FeatureKeys, Feature> = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
highlights: {
|
highlights: {
|
||||||
title: "✨ Highlights ✨",
|
title: appVersion.isBeta
|
||||||
subtitle: `Welcome to v${appVersion.clean}`,
|
? "Welcome to Notesnook Beta!"
|
||||||
subFeatures: [],
|
: "✨ Highlights ✨",
|
||||||
|
subtitle: appVersion.isBeta
|
||||||
|
? `v${appVersion.clean}-beta`
|
||||||
|
: `Welcome to v${appVersion.clean}`,
|
||||||
|
subFeatures: appVersion.isBeta
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
icon: Icon.Warn,
|
||||||
|
title: "Notice",
|
||||||
|
subtitle: (
|
||||||
|
<>
|
||||||
|
This is the beta version and as such will contain bugs. Things
|
||||||
|
are expected to break but should be generally stable. Please use
|
||||||
|
the <Code text="Report an issue" /> button to report all bugs.
|
||||||
|
Thank you!
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: Icon.Warn,
|
||||||
|
title: "Notice 2",
|
||||||
|
subtitle: (
|
||||||
|
<>
|
||||||
|
Switching between beta & stable versions can cause weird
|
||||||
|
issues including data loss. It is recommended that you do not
|
||||||
|
use both simultaneously. You can switch once the beta version
|
||||||
|
enters stable.
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [],
|
||||||
cta: {
|
cta: {
|
||||||
title: "Got it",
|
title: "Got it",
|
||||||
icon: Icon.Checkmark,
|
icon: Icon.Checkmark,
|
||||||
@@ -52,7 +83,8 @@ const features: Record<FeatureKeys, Feature> = {
|
|||||||
|
|
||||||
const key = `${appVersion.numerical}:highlights`;
|
const key = `${appVersion.numerical}:highlights`;
|
||||||
const hasShownBefore = Config.get(key, false) as boolean;
|
const hasShownBefore = Config.get(key, false) as boolean;
|
||||||
const hasShownAny = Config.has((k) => k.endsWith(":highlights"));
|
const hasShownAny =
|
||||||
|
appVersion.isBeta || Config.has((k) => k.endsWith(":highlights"));
|
||||||
if (!hasShownAny) Config.set(key, true);
|
if (!hasShownAny) Config.set(key, true);
|
||||||
|
|
||||||
return hasShownAny && !isTesting() && !hasShownBefore;
|
return hasShownAny && !isTesting() && !hasShownBefore;
|
||||||
|
|||||||
@@ -4,14 +4,21 @@ export const appVersion = {
|
|||||||
formatted: format(
|
formatted: format(
|
||||||
process.env.REACT_APP_VERSION,
|
process.env.REACT_APP_VERSION,
|
||||||
process.env.REACT_APP_GIT_HASH,
|
process.env.REACT_APP_GIT_HASH,
|
||||||
process.env.REACT_APP_PLATFORM as Platforms
|
process.env.REACT_APP_PLATFORM as Platforms,
|
||||||
|
process.env.REACT_APP_BETA === "true"
|
||||||
),
|
),
|
||||||
clean: formatVersion(process.env.REACT_APP_VERSION),
|
clean: formatVersion(process.env.REACT_APP_VERSION),
|
||||||
numerical: parseInt(process.env.REACT_APP_VERSION || "0"),
|
numerical: parseInt(process.env.REACT_APP_VERSION || "0"),
|
||||||
|
isBeta: process.env.REACT_APP_BETA === "true",
|
||||||
};
|
};
|
||||||
|
|
||||||
function format(version?: string, hash?: string, type?: "web" | "desktop") {
|
function format(
|
||||||
return `${formatVersion(version)}-${hash}-${type}`;
|
version?: string,
|
||||||
|
hash?: string,
|
||||||
|
type?: "web" | "desktop",
|
||||||
|
beta?: boolean
|
||||||
|
) {
|
||||||
|
return `${formatVersion(version)}-${hash}-${type}${beta ? "-beta" : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatVersion(version?: string) {
|
function formatVersion(version?: string) {
|
||||||
@@ -38,6 +45,7 @@ export function getServiceWorkerVersion(
|
|||||||
formatted: formatVersion(version),
|
formatted: formatVersion(version),
|
||||||
numerical: parseInt(version),
|
numerical: parseInt(version),
|
||||||
clean: formatVersion(version),
|
clean: formatVersion(version),
|
||||||
|
isBeta: appVersion.isBeta,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
serviceWorker.postMessage({ type: "GET_VERSION" });
|
serviceWorker.postMessage({ type: "GET_VERSION" });
|
||||||
|
|||||||
Reference in New Issue
Block a user