Merge branch 'develop' of github.com:ONLYOFFICE/AppServer into release/1.0.0
This commit is contained in:
commit
e703927239
@ -92,6 +92,12 @@ server {
|
||||
root $public_root;
|
||||
try_files /images/$basename /index.html =404;
|
||||
}
|
||||
|
||||
location ~* /static/fonts/ {
|
||||
expires 365d;
|
||||
root $public_root;
|
||||
try_files /fonts/$basename /index.html =404;
|
||||
}
|
||||
|
||||
location ~* /static/offline/ {
|
||||
root $public_root;
|
||||
|
@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
globDirectory: 'build/deploy/',
|
||||
globPatterns: [
|
||||
'**/*.{ico,woff2,svg,html,json,js,txt,png}'
|
||||
'**/*.{ico,woff2,svg,html,json,js,png}'
|
||||
],
|
||||
ignoreURLParametersMatching: [
|
||||
/^utm_/,
|
||||
|
17
package.json
17
package.json
@ -18,6 +18,19 @@
|
||||
"scripts": {
|
||||
"wipe": "rimraf node_modules yarn.lock web/**/node_modules products/**/node_modules",
|
||||
"build": "concurrently \"wsrun --parallel build\"",
|
||||
"sw-build": "workbox injectManifest config/workbox-config.js && yarn sw-modify && yarn sw-minimize",
|
||||
"sw-calendar-replace": "replace-in-files --string='products/ASC.Calendar/client/' --replacement='products/calendar/' build/deploy/public/sw.js",
|
||||
"sw-crm-replace": "replace-in-files --string='products/ASC.CRM/client/' --replacement='products/crm/' build/deploy/public/sw.js",
|
||||
"sw-files-replace": "replace-in-files --string='products/ASC.Files/client/' --replacement='products/files/' build/deploy/public/sw.js",
|
||||
"sw-files-editor-replace": "replace-in-files --string='products/ASC.Files/editor/' --replacement='products/files/doceditor/' build/deploy/public/sw.js",
|
||||
"sw-mail-replace": "replace-in-files --string='products/ASC.Mail/client/' --replacement='products/mail/' build/deploy/public/sw.js",
|
||||
"sw-people-replace": "replace-in-files --string='products/ASC.People/client/' --replacement='products/people/' build/deploy/public/sw.js",
|
||||
"sw-projects-replace": "replace-in-files --string='products/ASC.Projects/client/' --replacement='products/projects/' build/deploy/public/sw.js",
|
||||
"sw-studio-replace": "replace-in-files --string='studio/client/' --replacement='/' build/deploy/public/sw.js",
|
||||
"sw-studio-login-replace": "replace-in-files --string='studio/login/' --replacement='login/' build/deploy/public/sw.js",
|
||||
"sw-public-replace": "replace-in-files --string='public/' --replacement='static/' build/deploy/public/sw.js",
|
||||
"sw-modify": "yarn sw-calendar-replace && yarn sw-crm-replace && yarn sw-crm-replace && yarn sw-files-replace && yarn sw-files-editor-replace && yarn sw-mail-replace && yarn sw-people-replace && yarn sw-projects-replace && yarn sw-studio-replace && yarn sw-studio-login-replace && yarn sw-public-replace",
|
||||
"sw-minimize": "yarn terser --compress --mangle -- build/deploy/public/sw.js --output build/deploy/public/sw.js",
|
||||
"start": "concurrently \"wsrun --parallel start\"",
|
||||
"start-prod": "concurrently \"wsrun --parallel start-prod\"",
|
||||
"serve": "concurrently \"wsrun --parallel serve\"",
|
||||
@ -26,12 +39,14 @@
|
||||
"storybook": "yarn workspace @appserver/components storybook",
|
||||
"storybook-build": "yarn workspace @appserver/components run storybook-build",
|
||||
"bump": "lerna version --no-push --no-git-tag-version",
|
||||
"deploy": "rimraf build/deploy && concurrently \"wsrun --parallel deploy\" && cp -r public build/deploy && workbox injectManifest config/workbox-config.js"
|
||||
"deploy": "rimraf build/deploy && concurrently \"wsrun --parallel deploy\" && cp -r public build/deploy && yarn sw-build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^5.3.0",
|
||||
"lerna": "^3.22.1",
|
||||
"replace-in-files-cli": "^1.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"terser": "^5.7.1",
|
||||
"workbox-cli": "^6.1.5",
|
||||
"wsrun": "^5.2.4"
|
||||
}
|
||||
|
@ -5,76 +5,70 @@ $font-family-base: "Open Sans", sans-serif;
|
||||
font-family: "Open Sans";
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
src: url("../../public/fonts/light/open-sans-light.woff2") format("woff2");
|
||||
src: url("/static/fonts/open-sans-light.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
src: url("../../public/fonts/light-italic/open-sans-light-italic.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-light-italic.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url("../../public/fonts/regular/open-sans-regular.woff2") format("woff2");
|
||||
src: url("/static/fonts/open-sans-regular.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
src: url("../../public/fonts/italic/open-sans-italic.woff2") format("woff2");
|
||||
src: url("/static/fonts/open-sans-italic.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
src: url("../../public/fonts/semibold/open-sans-semibold.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-semibold.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
src: url("../../public/fonts/semibold-italic/open-sans-semibold-italic.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-semibold-italic.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
src: url("../../public/fonts/bold/open-sans-bold.woff2") format("woff2");
|
||||
src: url("/static/fonts/open-sans-bold.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
src: url("../../public/fonts/bold-italic/open-sans-bold-italic.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-bold-italic.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: 800;
|
||||
font-style: normal;
|
||||
src: url("../../public/fonts/extra-bold/open-sans-extra-bold.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-extra-bold.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-weight: 800;
|
||||
font-style: italic;
|
||||
src: url("../../public/fonts/extra-bold-italic/open-sans-extra-bold-italic.woff2")
|
||||
format("woff2");
|
||||
src: url("/static/fonts/open-sans-extra-bold-italic.woff2") format("woff2");
|
||||
}
|
||||
|
||||
html,
|
||||
|
@ -18,6 +18,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"global": "^4.4.0",
|
||||
"react-selecto": "^1.12.0"
|
||||
"react-selecto": "^1.12.0",
|
||||
"workbox-window": "^6.1.5"
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +1,36 @@
|
||||
import {
|
||||
precacheAndRoute,
|
||||
cleanupOutdatedCaches,
|
||||
//createHandlerBoundToURL,
|
||||
} from "workbox-precaching";
|
||||
import { setCacheNameDetails } from "workbox-core";
|
||||
import { clientsClaim } from "workbox-core";
|
||||
import { /*NavigationRoute,*/ registerRoute } from "workbox-routing";
|
||||
import { googleFontsCache, imageCache, offlineFallback } from "workbox-recipes";
|
||||
import {
|
||||
//CacheFirst,
|
||||
//NetworkFirst,
|
||||
StaleWhileRevalidate,
|
||||
} from "workbox-strategies";
|
||||
//import { ExpirationPlugin } from "workbox-expiration";
|
||||
//import { BroadcastUpdatePlugin } from "workbox-broadcast-update";
|
||||
importScripts(
|
||||
"https://storage.googleapis.com/workbox-cdn/releases/6.1.5/workbox-sw.js"
|
||||
);
|
||||
|
||||
workbox.setConfig({
|
||||
debug: true,
|
||||
});
|
||||
|
||||
// This will trigger the importScripts() for workbox.strategies and its dependencies:
|
||||
const { precacheAndRoute, cleanupOutdatedCaches } = workbox.precaching;
|
||||
const { setCacheNameDetails, clientsClaim } = workbox.core;
|
||||
const { registerRoute } = workbox.routing;
|
||||
const { googleFontsCache, imageCache, offlineFallback } = workbox.recipes;
|
||||
const { StaleWhileRevalidate } = workbox.strategies;
|
||||
|
||||
// SETTINGS
|
||||
|
||||
// Claiming control to start runtime caching asap
|
||||
clientsClaim();
|
||||
|
||||
// Use to update the app after user triggered refresh (without prompt)
|
||||
//self.skipWaiting();
|
||||
|
||||
// PRECACHING
|
||||
|
||||
// Setting custom cache name
|
||||
setCacheNameDetails({ precache: "wb6-precache", runtime: "wb6-runtime" });
|
||||
|
||||
// We inject manifest here using "workbox-build" in workbox-inject.js
|
||||
precacheAndRoute(self.__WB_MANIFEST);
|
||||
const precachRoutes = self.__WB_MANIFEST;
|
||||
|
||||
precacheAndRoute(precachRoutes);
|
||||
|
||||
// Remove cache from the previous WB versions
|
||||
cleanupOutdatedCaches();
|
||||
|
||||
// NAVIGATION ROUTING
|
||||
|
||||
// This assumes /index.html has been precached.
|
||||
// const navHandler = createHandlerBoundToURL("/index.html");
|
||||
// const navigationRoute = new NavigationRoute(navHandler, {
|
||||
// denylist: [new RegExp("/out-of-spa/")], // Also might be specified explicitly via allowlist
|
||||
// });
|
||||
// registerRoute(navigationRoute);
|
||||
|
||||
// STATIC RESOURCES
|
||||
|
||||
googleFontsCache({ cachePrefix: "wb6-gfonts" });
|
||||
@ -77,24 +65,3 @@ offlineFallback({
|
||||
imageFallback: "/static/offline/offline.svg",
|
||||
fontFallback: false,
|
||||
});
|
||||
|
||||
// ALL OTHER EVENTS
|
||||
|
||||
// Receive push and show a notification
|
||||
// self.addEventListener("push", function (event) {
|
||||
// console.log("[Service Worker]: Received push event", event);
|
||||
|
||||
// var notificationData = {};
|
||||
|
||||
// if (event.data.json()) {
|
||||
// notificationData = event.data.json();
|
||||
// } else {
|
||||
// notificationData = {
|
||||
// title: "Something Has Happened",
|
||||
// message: "Something you might want to check out",
|
||||
// icon: "/assets/img/pwa-logo.png",
|
||||
// };
|
||||
// }
|
||||
|
||||
// self.registration.showNotification(notificationData.title, notificationData);
|
||||
// });
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -90,17 +90,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -88,17 +88,6 @@ const config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -92,17 +92,6 @@ const config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
@ -92,17 +92,6 @@ var config = {
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
{
|
||||
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "fonts/[hash].[ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ["style-loader", "css-loader"],
|
||||
|
Loading…
Reference in New Issue
Block a user