Merge branch '004' into crypto-refactor
# Conflicts: # package.json
This commit is contained in:
8
.babelrc
8
.babelrc
@@ -1,15 +1,9 @@
|
|||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
"@babel/typescript",
|
"@babel/typescript",
|
||||||
[
|
"@babel/preset-env"
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": "> 0.25%, not dead"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-transform-runtime",
|
|
||||||
"@babel/plugin-proposal-class-properties",
|
"@babel/plugin-proposal-class-properties",
|
||||||
"angularjs-annotate"
|
"angularjs-annotate"
|
||||||
]
|
]
|
||||||
|
|||||||
6
.browserslistrc
Normal file
6
.browserslistrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
chrome 80 # electron 8.2
|
||||||
|
last 2 Firefox versions
|
||||||
|
last 2 Edge versions
|
||||||
|
last 2 Safari versions
|
||||||
|
last 2 Opera versions
|
||||||
|
Firefox ESR
|
||||||
@@ -49,6 +49,7 @@ import {
|
|||||||
} from './directives/views';
|
} from './directives/views';
|
||||||
|
|
||||||
import { trusted } from './filters';
|
import { trusted } from './filters';
|
||||||
|
import { isDev } from './utils';
|
||||||
|
|
||||||
angular.module('app', ['ngSanitize']);
|
angular.module('app', ['ngSanitize']);
|
||||||
|
|
||||||
@@ -109,3 +110,14 @@ angular
|
|||||||
|
|
||||||
// Services
|
// Services
|
||||||
angular.module('app').service('mainApplicationGroup', ApplicationGroup);
|
angular.module('app').service('mainApplicationGroup', ApplicationGroup);
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if (isDev) {
|
||||||
|
Object.defineProperties(window, {
|
||||||
|
application: {
|
||||||
|
get: () =>
|
||||||
|
(angular.element(document).injector().get('mainApplicationGroup') as any)
|
||||||
|
.application,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ export class Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public clearNoteChangeListener() {
|
||||||
|
this._onNoteChange = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register to be notified when the editor's note's values change
|
* Register to be notified when the editor's note's values change
|
||||||
* (and thus a new object reference is created)
|
* (and thus a new object reference is created)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
export function getParameterByName(name: string, url: string) {
|
export function getParameterByName(name: string, url: string) {
|
||||||
name = name.replace(/[[\]]/g, '\\$&');
|
name = name.replace(/[[\]]/g, '\\$&');
|
||||||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
|
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ export class PureViewCtrl {
|
|||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor($timeout: ng.ITimeoutService) {
|
constructor($timeout: ng.ITimeoutService) {
|
||||||
this.$timeout = $timeout;
|
this.$timeout = $timeout;
|
||||||
/* Allow caller constructor to finish setting instance variables */
|
|
||||||
setImmediate(() => {
|
|
||||||
this.state = this.getInitialState();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
|
this.state = {
|
||||||
|
...this.getInitialState(),
|
||||||
|
...this.state,
|
||||||
|
}
|
||||||
this.addAppEventObserver();
|
this.addAppEventObserver();
|
||||||
this.addAppStateObserver();
|
this.addAppStateObserver();
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,6 @@ export class PureViewCtrl {
|
|||||||
this.unsubState();
|
this.unsubState();
|
||||||
this.unsubApp = undefined;
|
this.unsubApp = undefined;
|
||||||
this.unsubState = undefined;
|
this.unsubState = undefined;
|
||||||
(this.application as any) = undefined;
|
|
||||||
if (this.stateTimeout) {
|
if (this.stateTimeout) {
|
||||||
this.$timeout.cancel(this.stateTimeout);
|
this.$timeout.cancel(this.stateTimeout);
|
||||||
}
|
}
|
||||||
@@ -141,4 +140,4 @@ export class PureViewCtrl {
|
|||||||
/** Optional override */
|
/** Optional override */
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
|
this.editor.clearNoteChangeListener();
|
||||||
this.removeTagsObserver();
|
this.removeTagsObserver();
|
||||||
this.removeComponentsObserver();
|
this.removeComponentsObserver();
|
||||||
(this.removeTagsObserver as any) = undefined;
|
(this.removeTagsObserver as any) = undefined;
|
||||||
|
|||||||
21
package-lock.json
generated
21
package-lock.json
generated
@@ -1285,18 +1285,6 @@
|
|||||||
"@babel/helper-plugin-utils": "^7.8.3"
|
"@babel/helper-plugin-utils": "^7.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-transform-runtime": {
|
|
||||||
"version": "7.8.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.8.3.tgz",
|
|
||||||
"integrity": "sha512-/vqUt5Yh+cgPZXXjmaG9NT8aVfThKk7G4OqkVhrXqwsC5soMn/qTCxs36rZ2QFhpfTJcjw4SNDIZ4RUb8OL4jQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/helper-module-imports": "^7.8.3",
|
|
||||||
"@babel/helper-plugin-utils": "^7.8.3",
|
|
||||||
"resolve": "^1.8.1",
|
|
||||||
"semver": "^5.5.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/plugin-transform-shorthand-properties": {
|
"@babel/plugin-transform-shorthand-properties": {
|
||||||
"version": "7.8.3",
|
"version": "7.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz",
|
||||||
@@ -11415,6 +11403,15 @@
|
|||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"webpack-merge": {
|
||||||
|
"version": "4.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz",
|
||||||
|
"integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4.17.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
"webpack-sources": {
|
"webpack-sources": {
|
||||||
"version": "1.4.3",
|
"version": "1.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -7,12 +7,11 @@
|
|||||||
"url": "https://github.com/standardnotes/web"
|
"url": "https://github.com/standardnotes/web"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack-dev-server --progress",
|
"start": "webpack-dev-server --progress --config webpack.dev.js",
|
||||||
"watch": "webpack --mode development -w",
|
"watch": "webpack -w --config webpack.dev.js",
|
||||||
"bundle": "webpack --mode production",
|
"bundle": "webpack --config webpack.prod.js",
|
||||||
"build": "bundle install && npm install && npm run bundle",
|
"build": "bundle install && npm install && npm run bundle",
|
||||||
"submodules": "git submodule update --init --force --remote",
|
"submodules": "git submodule update --init --force --remote",
|
||||||
"test": "karma start karma.conf.js --single-run",
|
|
||||||
"lint": "eslint --fix app/assets/javascripts/**/*.js",
|
"lint": "eslint --fix app/assets/javascripts/**/*.js",
|
||||||
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"
|
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"
|
||||||
},
|
},
|
||||||
@@ -20,10 +19,8 @@
|
|||||||
"@babel/cli": "^7.8.4",
|
"@babel/cli": "^7.8.4",
|
||||||
"@babel/core": "^7.8.7",
|
"@babel/core": "^7.8.7",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
"@babel/plugin-transform-runtime": "^7.8.3",
|
|
||||||
"@babel/preset-env": "^7.8.7",
|
"@babel/preset-env": "^7.8.7",
|
||||||
"@babel/preset-typescript": "^7.8.3",
|
"@babel/preset-typescript": "^7.8.3",
|
||||||
"@babel/runtime": "^7.8.7",
|
|
||||||
"@types/angular": "^1.7.0",
|
"@types/angular": "^1.7.0",
|
||||||
"@types/chai": "^4.2.11",
|
"@types/chai": "^4.2.11",
|
||||||
"@types/lodash": "^4.14.149",
|
"@types/lodash": "^4.14.149",
|
||||||
@@ -50,6 +47,7 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-standard": "^4.0.1",
|
"eslint-plugin-standard": "^4.0.1",
|
||||||
"file-loader": "^5.1.0",
|
"file-loader": "^5.1.0",
|
||||||
|
"lodash": "^4.17.15",
|
||||||
"mini-css-extract-plugin": "^0.9.0",
|
"mini-css-extract-plugin": "^0.9.0",
|
||||||
"mocha": "^7.1.0",
|
"mocha": "^7.1.0",
|
||||||
"ng-cache-loader": "0.0.26",
|
"ng-cache-loader": "0.0.26",
|
||||||
@@ -58,15 +56,15 @@
|
|||||||
"pug-loader": "^2.4.0",
|
"pug-loader": "^2.4.0",
|
||||||
"sass-loader": "^8.0.2",
|
"sass-loader": "^8.0.2",
|
||||||
"serve-static": "^1.14.1",
|
"serve-static": "^1.14.1",
|
||||||
"snjs": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
|
|
||||||
"sn-stylekit": "2.0.22",
|
"sn-stylekit": "2.0.22",
|
||||||
|
"snjs": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
|
||||||
"ts-loader": "^6.2.2",
|
"ts-loader": "^6.2.2",
|
||||||
"typescript": "^3.8.3",
|
"typescript": "^3.8.3",
|
||||||
"typescript-eslint": "0.0.1-alpha.0",
|
"typescript-eslint": "0.0.1-alpha.0",
|
||||||
"webpack": "^4.42.0",
|
"webpack": "^4.42.0",
|
||||||
"webpack-cli": "^3.3.11",
|
"webpack-cli": "^3.3.11",
|
||||||
"webpack-dev-server": "^3.10.3",
|
"webpack-dev-server": "^3.10.3",
|
||||||
"lodash": "^4.17.15"
|
"webpack-merge": "^4.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sncrypto": "github:standardnotes/sncrypto#7e76ab9977f85039d9399b935aecfe495a951edb"
|
"sncrypto": "github:standardnotes/sncrypto#7e76ab9977f85039d9399b935aecfe495a951edb"
|
||||||
|
|||||||
@@ -2,20 +2,12 @@ const path = require('path');
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const CopyPlugin = require('copy-webpack-plugin');
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './app/assets/javascripts/index.ts',
|
entry: './app/assets/javascripts/index.ts',
|
||||||
output: {
|
output: {
|
||||||
filename: './javascripts/app.js'
|
filename: './javascripts/app.js'
|
||||||
},
|
},
|
||||||
devServer: {
|
|
||||||
proxy: {
|
|
||||||
'/extensions': {
|
|
||||||
target: 'http://localhost:3001',
|
|
||||||
pathRewrite: { '^/extensions': '/public/extensions' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
port: 3001
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__VERSION__: JSON.stringify(require('./package.json').version)
|
__VERSION__: JSON.stringify(require('./package.json').version)
|
||||||
@@ -27,10 +19,9 @@ module.exports = {
|
|||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
// Options similar to the same options in webpackOptions.output
|
// Options similar to the same options in webpackOptions.output
|
||||||
filename: './stylesheets/app.css',
|
filename: './stylesheets/app.css',
|
||||||
ignoreOrder: false // Enable to remove warnings about conflicting order
|
ignoreOrder: true // Enable to remove warnings about conflicting order
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
devtool: 'source-map',
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.js'],
|
extensions: ['.ts', '.js'],
|
||||||
alias: {
|
alias: {
|
||||||
@@ -46,7 +37,7 @@ module.exports = {
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.(js|ts)$/,
|
test: /\.(js|ts)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /(node_modules|snjs)/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'babel-loader'
|
loader: 'babel-loader'
|
||||||
}
|
}
|
||||||
|
|||||||
19
webpack.dev.js
Normal file
19
webpack.dev.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
const merge = require('webpack-merge');
|
||||||
|
const config = require('./webpack.config.js');
|
||||||
|
|
||||||
|
module.exports = (_env, argv) => {
|
||||||
|
const port = argv.port || 3001;
|
||||||
|
return merge(config, {
|
||||||
|
mode: 'development',
|
||||||
|
devServer: {
|
||||||
|
publicPath: '/dist/',
|
||||||
|
proxy: {
|
||||||
|
'/extensions': {
|
||||||
|
target: `http://localhost:${port}`,
|
||||||
|
pathRewrite: { '^/extensions': '/public/extensions' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
port,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
7
webpack.prod.js
Normal file
7
webpack.prod.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const merge = require('webpack-merge');
|
||||||
|
const config = require('./webpack.config.js');
|
||||||
|
|
||||||
|
module.exports = merge(config, {
|
||||||
|
mode: 'production',
|
||||||
|
devtool: 'source-map',
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user