feat(web): remove web-server and change web to a static website deployment (#1360)
* feat(web): add deploying static app * fix(web): linter ignore patterns * fix(web): cloudfront invalidation and favicons placement * feat(web-server): remove web-server package in favour of web * fix(web): remove linter parallel jobs due to oom issue * fix(mobile): eslintignore paths * fix(web): copy of components * fix(web): include building components in building all process * fix(web): copying of components
11
packages/web/.eslintignore
Normal file
@@ -0,0 +1,11 @@
|
||||
node_modules
|
||||
dist
|
||||
.eslintrc
|
||||
*.webpack.*.js
|
||||
web.webpack-defaults.js
|
||||
*.config.js
|
||||
__mocks__
|
||||
|
||||
src/components
|
||||
src/favicon
|
||||
src/vendor
|
||||
@@ -9,7 +9,6 @@
|
||||
"../../node_modules/@standardnotes/config/src/.eslintrc"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "react", "react-hooks"],
|
||||
"ignorePatterns": [".eslintrc.js", "*.webpack.*.js", "webpack-defaults.js", "jest.config.js", "__mocks__"],
|
||||
"rules": {
|
||||
"standard/no-callback-literal": 0, // Disable this as we have too many callbacks relying on literals
|
||||
"no-throw-literal": 0,
|
||||
|
||||
1
packages/web/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
src/components
|
||||
@@ -9,16 +9,18 @@
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "webpack --config web.webpack.prod.js && yarn tsc",
|
||||
"clean": "rm -fr dist",
|
||||
"build": "yarn clean && yarn copy:components && webpack --config web.webpack.prod.js && yarn tsc",
|
||||
"clean": "rm -fr dist && rm -rf src/components",
|
||||
"format": "prettier --write src/javascripts",
|
||||
"lint": "eslint src/javascripts",
|
||||
"prebuild": "yarn clean",
|
||||
"start": "webpack-dev-server --config web.webpack.dev.js",
|
||||
"test": "jest --config jest.config.js --coverage",
|
||||
"tsc": "tsc --project tsconfig.json",
|
||||
"upgrade:snjs": "ncu -u '@standardnotes/*'",
|
||||
"watch": "webpack -w --config web.webpack.dev.js"
|
||||
"watch": "webpack -w --config web.webpack.dev.js",
|
||||
"copy:components": "yarn copy:components-assets && yarn copy:components-zips",
|
||||
"copy:components-assets": "mkdir -p src/components/assets && cp -r ../../node_modules/@standardnotes/components-meta/dist/assets/. src/components/assets",
|
||||
"copy:components-zips": "mkdir -p src/components/zips && cp -r ../../node_modules/@standardnotes/components-meta/dist/zips/. ./src/components/zips"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "*",
|
||||
@@ -33,6 +35,7 @@
|
||||
"autoprefixer": "^10.4.7",
|
||||
"babel-loader": "^8.2.5",
|
||||
"circular-dependency-plugin": "^5.2.2",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"css-loader": "*",
|
||||
"dotenv": "^16.0.0",
|
||||
"eslint": "*",
|
||||
@@ -71,6 +74,7 @@
|
||||
"@reach/listbox": "^0.16.2",
|
||||
"@reach/tooltip": "^0.16.2",
|
||||
"@reach/visually-hidden": "^0.16.0",
|
||||
"@standardnotes/components-meta": "workspace:*",
|
||||
"@standardnotes/filepicker": "workspace:*",
|
||||
"@standardnotes/files": "workspace:*",
|
||||
"@standardnotes/icons": "workspace:*",
|
||||
|
||||
67
packages/web/src/404.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The page you were looking for doesn't exist (404)</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<style>
|
||||
body {
|
||||
background-color: #EFEFEF;
|
||||
color: #2E2F30;
|
||||
text-align: center;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.dialog {
|
||||
width: 95%;
|
||||
max-width: 33em;
|
||||
margin: 4em auto 0;
|
||||
}
|
||||
|
||||
div.dialog > div {
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #BBB;
|
||||
border-top: #B00100 solid 4px;
|
||||
border-top-left-radius: 9px;
|
||||
border-top-right-radius: 9px;
|
||||
background-color: white;
|
||||
padding: 7px 12% 0;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 100%;
|
||||
color: #730E15;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
div.dialog > p {
|
||||
margin: 0 0 1em;
|
||||
padding: 1em;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #999;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-color: #DADADA;
|
||||
color: #666;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- This file lives in public/404.html -->
|
||||
<div class="dialog">
|
||||
<div>
|
||||
<h1>The page you were looking for doesn't exist.</h1>
|
||||
<p>You may have mistyped the address or the page may have moved.</p>
|
||||
</div>
|
||||
<p>If you are the application owner check the logs for more information.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
67
packages/web/src/422.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The change you wanted was rejected (422)</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<style>
|
||||
body {
|
||||
background-color: #EFEFEF;
|
||||
color: #2E2F30;
|
||||
text-align: center;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.dialog {
|
||||
width: 95%;
|
||||
max-width: 33em;
|
||||
margin: 4em auto 0;
|
||||
}
|
||||
|
||||
div.dialog > div {
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #BBB;
|
||||
border-top: #B00100 solid 4px;
|
||||
border-top-left-radius: 9px;
|
||||
border-top-right-radius: 9px;
|
||||
background-color: white;
|
||||
padding: 7px 12% 0;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 100%;
|
||||
color: #730E15;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
div.dialog > p {
|
||||
margin: 0 0 1em;
|
||||
padding: 1em;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #999;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-color: #DADADA;
|
||||
color: #666;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- This file lives in public/422.html -->
|
||||
<div class="dialog">
|
||||
<div>
|
||||
<h1>The change you wanted was rejected.</h1>
|
||||
<p>Maybe you tried to change something you didn't have access to.</p>
|
||||
</div>
|
||||
<p>If you are the application owner check the logs for more information.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
66
packages/web/src/500.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>We're sorry, but something went wrong (500)</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<style>
|
||||
body {
|
||||
background-color: #EFEFEF;
|
||||
color: #2E2F30;
|
||||
text-align: center;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.dialog {
|
||||
width: 95%;
|
||||
max-width: 33em;
|
||||
margin: 4em auto 0;
|
||||
}
|
||||
|
||||
div.dialog > div {
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #BBB;
|
||||
border-top: #B00100 solid 4px;
|
||||
border-top-left-radius: 9px;
|
||||
border-top-right-radius: 9px;
|
||||
background-color: white;
|
||||
padding: 7px 12% 0;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 100%;
|
||||
color: #730E15;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
div.dialog > p {
|
||||
margin: 0 0 1em;
|
||||
padding: 1em;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #999;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-color: #DADADA;
|
||||
color: #666;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- This file lives in public/500.html -->
|
||||
<div class="dialog">
|
||||
<div>
|
||||
<h1>We're sorry, but something went wrong.</h1>
|
||||
</div>
|
||||
<p>If you are the application owner check the logs for more information.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
packages/web/src/favicon/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
packages/web/src/favicon/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
packages/web/src/favicon/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
9
packages/web/src/favicon/browserconfig.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="favicon/mstile-150x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
BIN
packages/web/src/favicon/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 557 B |
BIN
packages/web/src/favicon/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 595 B |
BIN
packages/web/src/favicon/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
packages/web/src/favicon/mstile-150x150.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
19
packages/web/src/favicon/site.webmanifest
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "",
|
||||
"short_name": "",
|
||||
"icons": [
|
||||
{
|
||||
"src": "android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
||||
48
packages/web/src/index.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
|
||||
<link rel="canonical" href="https://app-static.standardnotes.com" />
|
||||
|
||||
<link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
|
||||
<link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
|
||||
<link href="favicon/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"></link>
|
||||
<link href="manifest.webmanifest" rel="manifest"></link>
|
||||
|
||||
<link color="#5bbad5" href="favicon/safari-pinned-tab.svg" rel="mask-icon"></link>
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<meta content="Standard Notes" name="apple-mobile-web-app-title"/>
|
||||
<meta content="Standard Notes" name="application-name"/>
|
||||
<base href="/"></base>
|
||||
|
||||
<title>Notes · Standard Notes</title>
|
||||
<meta name="description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
|
||||
|
||||
<meta name="twitter:title" content="Standard Notes, an end-to-end encrypted notes app."/>
|
||||
<meta name="twitter:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
|
||||
<meta name="twitter:site" content="@standardnotes"/>
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
|
||||
<meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
|
||||
<meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
|
||||
|
||||
<script>
|
||||
window.defaultSyncServer = "https://api.standardnotes.com";
|
||||
window.defaultFilesHost = "https://files.standardnotes.com";
|
||||
window.enabledUnfinishedFeatures = false;
|
||||
window.websocketUrl = "wss://sockets.standardnotes.com";
|
||||
window.purchaseUrl = "https://standardnotes.com/purchase";
|
||||
window.plansUrl = "https://standardnotes.com/plans";
|
||||
window.dashboardUrl = "https://standardnotes.com/dashboard";
|
||||
</script>
|
||||
|
||||
<script src="./app.js" debug="false"></script>
|
||||
<link rel="stylesheet" media="all" href="./app.css" debug="false" />
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
39
packages/web/src/manifest.webmanifest
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"app": {
|
||||
"launch": {
|
||||
"urls": [
|
||||
"https://app.standardnotes.com/"
|
||||
],
|
||||
"web_url": "https://app.standardnotes.com",
|
||||
"container": "tab"
|
||||
}
|
||||
},
|
||||
"offline_enabled": true,
|
||||
"permissions": [],
|
||||
"requirements": {
|
||||
"3D": {
|
||||
"features": []
|
||||
}
|
||||
},
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "favicon/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "any maskable",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"name": "Standard Notes",
|
||||
"description": "A Simple And Private Notes App",
|
||||
"version": "1.0",
|
||||
"manifest_version": 2,
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone",
|
||||
"start_url": ".."
|
||||
}
|
||||
5
packages/web/src/robots.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
||||
#
|
||||
# To ban all spiders from the entire site uncomment the next two lines:
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
85
packages/web/src/vendor/libsodium.bundle.js
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
(window["webpackJsonpSNCrypto"] = window["webpackJsonpSNCrypto"] || []).push([["libsodium"],{
|
||||
|
||||
/***/ "./lib/libsodium.js":
|
||||
/*!**************************!*\
|
||||
!*** ./lib/libsodium.js ***!
|
||||
\**************************/
|
||||
/*! exports provided: ready, crypto_pwhash, crypto_pwhash_ALG_DEFAULT, crypto_aead_xchacha20poly1305_ietf_encrypt, crypto_aead_xchacha20poly1305_ietf_decrypt */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! libsodium-wrappers */ "./node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js");
|
||||
/* harmony import */ var libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ready", function() { return libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__["ready"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "crypto_pwhash", function() { return libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__["crypto_pwhash"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "crypto_pwhash_ALG_DEFAULT", function() { return libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__["crypto_pwhash_ALG_DEFAULT"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "crypto_aead_xchacha20poly1305_ietf_encrypt", function() { return libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__["crypto_aead_xchacha20poly1305_ietf_encrypt"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "crypto_aead_xchacha20poly1305_ietf_decrypt", function() { return libsodium_wrappers__WEBPACK_IMPORTED_MODULE_0__["crypto_aead_xchacha20poly1305_ietf_decrypt"]; });
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 0:
|
||||
/*!********************!*\
|
||||
!*** fs (ignored) ***!
|
||||
\********************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/*!**********************!*\
|
||||
!*** util (ignored) ***!
|
||||
\**********************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/*!**********************!*\
|
||||
!*** util (ignored) ***!
|
||||
\**********************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/*!************************!*\
|
||||
!*** buffer (ignored) ***!
|
||||
\************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/*!************************!*\
|
||||
!*** crypto (ignored) ***!
|
||||
\************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
//# sourceMappingURL=libsodium.bundle.js.map
|
||||
30596
packages/web/src/vendor/vendors~libsodium.bundle.js
vendored
Normal file
@@ -2,6 +2,7 @@ const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CircularDependencyPlugin = require('circular-dependency-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const mergeWithEnvDefaults = require('./web.webpack-defaults')
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -36,6 +37,19 @@ module.exports = (env) => {
|
||||
filename: './app.css',
|
||||
ignoreOrder: true, // Enable to remove warnings about conflicting order
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: 'src/favicon', to: 'favicon' },
|
||||
{ from: 'src/vendor', to: 'dist' },
|
||||
{ from: 'src/components', to: 'components' },
|
||||
{ from: 'src/404.html' },
|
||||
{ from: 'src/422.html' },
|
||||
{ from: 'src/500.html' },
|
||||
{ from: 'src/index.html' },
|
||||
{ from: 'src/manifest.webmanifest' },
|
||||
{ from: 'src/robots.txt' }
|
||||
]
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js'],
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = (env, argv) => {
|
||||
],
|
||||
devServer: {
|
||||
hot: true,
|
||||
static: '../web-server/public',
|
||||
static: './dist',
|
||||
port,
|
||||
devMiddleware: {
|
||||
writeToDisk: argv.writeToDisk,
|
||||
|
||||