From 12dd8250747826a065caac9e527a2c7e299e7433 Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 16:47:13 +0100 Subject: [PATCH 1/8] create common config files folder --- configs/jest.config.base.json | 14 ++++++++++++++ tsconfig.base.json => configs/tsconfig.base.json | 0 tsconfig.json | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 configs/jest.config.base.json rename tsconfig.base.json => configs/tsconfig.base.json (100%) diff --git a/configs/jest.config.base.json b/configs/jest.config.base.json new file mode 100644 index 00000000..1063d8e8 --- /dev/null +++ b/configs/jest.config.base.json @@ -0,0 +1,14 @@ +module.exports = { + globals: { + FEATURE_FLAGS: '' + }, + setupFilesAfterEnv: ['./rtl.setup.js'], + verbose: true, + moduleDirectories: ['node_modules'], + transform: { + '^.+\\.(js|tsx?)$': 'babel-jest' + }, + collectCoverage: true, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], + transformIgnorePatterns: ['node_modules/(?!(proton-shared)/)'] +}; diff --git a/tsconfig.base.json b/configs/tsconfig.base.json similarity index 100% rename from tsconfig.base.json rename to configs/tsconfig.base.json diff --git a/tsconfig.json b/tsconfig.json index 3ee7a6c6..7356b152 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./tsconfig.base.json" + "extends": "./configs/tsconfig.base.json" } From f5f8356740d89dc2e8dc23f6a14db8a3c2d5130f Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 17:16:20 +0100 Subject: [PATCH 2/8] move babel.config to configs --- babel.config.js | 7 +++---- configs/babel.config.js | 4 ++++ configs/{jest.config.base.json => jest.config.base.js} | 0 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 configs/babel.config.js rename configs/{jest.config.base.json => jest.config.base.js} (100%) diff --git a/babel.config.js b/babel.config.js index f9abc014..0923c1e8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,3 @@ -module.exports = { - presets: ['@babel/preset-env'], - plugins: ['@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime'] -}; +import baseConfig from './configs/babel.config'; + +module.exports = baseConfig; diff --git a/configs/babel.config.js b/configs/babel.config.js new file mode 100644 index 00000000..f9abc014 --- /dev/null +++ b/configs/babel.config.js @@ -0,0 +1,4 @@ +module.exports = { + presets: ['@babel/preset-env'], + plugins: ['@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime'] +}; diff --git a/configs/jest.config.base.json b/configs/jest.config.base.js similarity index 100% rename from configs/jest.config.base.json rename to configs/jest.config.base.js From 82ce9499ab81c508515a9f635801e614e4a5fbd3 Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 17:23:24 +0100 Subject: [PATCH 3/8] add .base to babel.config --- babel.config.js | 2 +- configs/{babel.config.js => babel.config.base.js} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename configs/{babel.config.js => babel.config.base.js} (100%) diff --git a/babel.config.js b/babel.config.js index 0923c1e8..87f1f1cc 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ -import baseConfig from './configs/babel.config'; +import baseConfig from './configs/babel.config.base'; module.exports = baseConfig; diff --git a/configs/babel.config.js b/configs/babel.config.base.js similarity index 100% rename from configs/babel.config.js rename to configs/babel.config.base.js From 26dcac6804e92de12b5c14dbb948321631c50f6e Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 17:41:00 +0100 Subject: [PATCH 4/8] add more presets and plugins to babel.config.base --- configs/babel.config.base.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configs/babel.config.base.js b/configs/babel.config.base.js index f9abc014..1fa10050 100644 --- a/configs/babel.config.base.js +++ b/configs/babel.config.base.js @@ -1,4 +1,8 @@ module.exports = { - presets: ['@babel/preset-env'], - plugins: ['@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime'] + presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'], + plugins: [ + '@babel/plugin-proposal-object-rest-spread', + '@babel/plugin-transform-runtime', + 'transform-require-context' + ] }; From ca1f5f8c81dfa29005123f00b4c000b9a934a9bf Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 17:42:28 +0100 Subject: [PATCH 5/8] use require instead of import --- babel.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 87f1f1cc..c4c636b0 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,4 @@ -import baseConfig from './configs/babel.config.base'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const baseConfig = require('./configs/babel.config.base'); module.exports = baseConfig; From e30cd2055acf8368ee7e970481d5f0bd3082a746 Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 18:01:10 +0100 Subject: [PATCH 6/8] add babel-plugin-transform-require-context as dev dependency --- package.json | 1 + po/template.pot | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 po/template.pot diff --git a/package.json b/package.json index bb158a56..476bc0d6 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "@babel/plugin-transform-runtime": "^7.6.2", "@typescript-eslint/eslint-plugin": "^1.13.0", "@typescript-eslint/parser": "^1.13.0", + "babel-plugin-transform-require-context": "^0.1.1", "eslint": "^6.7.2", "eslint-config-airbnb-base": "^14.0.0", "eslint-plugin-import": "^2.18.2", diff --git a/po/template.pot b/po/template.pot new file mode 100644 index 00000000..7dc895b3 --- /dev/null +++ b/po/template.pot @@ -0,0 +1,156 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=utf-8\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: lib/helpers/humanSize.js:13 +msgctxt "file size format" +msgid "KB" +msgstr "" + +#: lib/helpers/humanSize.js:14 +msgctxt "file size format" +msgid "MB" +msgstr "" + +#: lib/helpers/humanSize.js:15 +msgctxt "file size format" +msgid "GB" +msgstr "" + +#: lib/filters/factory.js:11 +msgctxt "Filter modal type" +msgid "Select ..." +msgstr "" + +#: lib/filters/factory.js:12 +msgctxt "Filter modal type" +msgid "If the subject" +msgstr "" + +#: lib/filters/factory.js:13 +msgctxt "Filter modal type" +msgid "If the sender" +msgstr "" + +#: lib/filters/factory.js:14 +msgctxt "Filter modal type" +msgid "If the recipient" +msgstr "" + +#: lib/filters/factory.js:15 +msgctxt "Filter modal type" +msgid "If the attachments" +msgstr "" + +#: lib/filters/factory.js:18 +msgctxt "Condition for custom filter" +msgid "contains" +msgstr "" + +#: lib/filters/factory.js:19 +msgctxt "Condition for custom filter" +msgid "is exactly" +msgstr "" + +#: lib/filters/factory.js:20 +msgctxt "Condition for custom filter" +msgid "begins with" +msgstr "" + +#: lib/filters/factory.js:21 +msgctxt "Condition for custom filter" +msgid "ends with" +msgstr "" + +#: lib/filters/factory.js:22 +msgctxt "Condition for custom filter" +msgid "matches" +msgstr "" + +#: lib/filters/factory.js:24 +msgctxt "Condition for custom filter" +msgid "does not contain" +msgstr "" + +#: lib/filters/factory.js:27 +msgctxt "Condition for custom filter" +msgid "is not" +msgstr "" + +#: lib/filters/factory.js:29 +msgctxt "Condition for custom filter" +msgid "does not begin with" +msgstr "" + +#: lib/filters/factory.js:33 +msgctxt "Condition for custom filter" +msgid "does not end with" +msgstr "" + +#: lib/filters/factory.js:37 +msgctxt "Condition for custom filter" +msgid "does not match" +msgstr "" + +#: lib/filters/factory.js:42 +msgctxt "Filter modal operators" +msgid "All conditions must be fulfilled (AND)" +msgstr "" + +#: lib/filters/factory.js:43 +msgctxt "Filter modal operators" +msgid "One condition must be fulfilled (OR)" +msgstr "" + +#: lib/keys/calendarKeys.js:98 +#: lib/keys/keys.js:102 +msgctxt "Error" +msgid "Signature verification failed" +msgstr "" + +#: lib/keys/keys.js:122 +msgctxt "Error" +msgid "Incorrect decryption password" +msgstr "" + +#: lib/keys/calendarKeys.js:230 +#, javascript-format +msgctxt "Error" +msgid "Could not find address ${ email }." +msgstr "" + +#: lib/calendar/integration/createOrUpdateEvent.js:14 +msgctxt "Error" +msgid "Primary address key not found" +msgstr "" + +#: lib/calendar/integration/createOrUpdateEvent.js:21 +msgctxt "Error" +msgid "Primary calendar key is not decrypted" +msgstr "" + +#: lib/themes/themes.js:13 +msgctxt "Theme" +msgid "Default theme" +msgstr "" + +#: lib/themes/themes.js:23 +msgctxt "Theme" +msgid "Custom theme" +msgstr "" + +#: lib/themes/themes.js:33 +msgctxt "Theme" +msgid "Light" +msgstr "" + +#: lib/themes/themes.js:42 +msgctxt "Theme" +msgid "Blue" +msgstr "" + +#: lib/themes/themes.js:51 +msgctxt "Theme" +msgid "Dark theme" +msgstr "" \ No newline at end of file From 26724e4b1dd737cce62edd681d499c1d629517a3 Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 18:02:24 +0100 Subject: [PATCH 7/8] add comment in babel.config.base --- configs/babel.config.base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/babel.config.base.js b/configs/babel.config.base.js index 1fa10050..e3558a95 100644 --- a/configs/babel.config.base.js +++ b/configs/babel.config.base.js @@ -3,6 +3,6 @@ module.exports = { plugins: [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime', - 'transform-require-context' + 'transform-require-context' // this plugin is here only to make Jest tests run ] }; From b3dc6b03db39d2ab333ee393d56c335383e290bb Mon Sep 17 00:00:00 2001 From: econdepe Date: Thu, 19 Dec 2019 18:08:47 +0100 Subject: [PATCH 8/8] gitignore translation files --- .gitignore | 3 +- po/template.pot | 156 ------------------------------------------------ 2 files changed, 2 insertions(+), 157 deletions(-) delete mode 100644 po/template.pot diff --git a/.gitignore b/.gitignore index 7e6cc155..72b23e92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -node_modules +node_modules/ +po/ .idea .DS_Store .eslintcache diff --git a/po/template.pot b/po/template.pot deleted file mode 100644 index 7dc895b3..00000000 --- a/po/template.pot +++ /dev/null @@ -1,156 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=utf-8\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n" - -#: lib/helpers/humanSize.js:13 -msgctxt "file size format" -msgid "KB" -msgstr "" - -#: lib/helpers/humanSize.js:14 -msgctxt "file size format" -msgid "MB" -msgstr "" - -#: lib/helpers/humanSize.js:15 -msgctxt "file size format" -msgid "GB" -msgstr "" - -#: lib/filters/factory.js:11 -msgctxt "Filter modal type" -msgid "Select ..." -msgstr "" - -#: lib/filters/factory.js:12 -msgctxt "Filter modal type" -msgid "If the subject" -msgstr "" - -#: lib/filters/factory.js:13 -msgctxt "Filter modal type" -msgid "If the sender" -msgstr "" - -#: lib/filters/factory.js:14 -msgctxt "Filter modal type" -msgid "If the recipient" -msgstr "" - -#: lib/filters/factory.js:15 -msgctxt "Filter modal type" -msgid "If the attachments" -msgstr "" - -#: lib/filters/factory.js:18 -msgctxt "Condition for custom filter" -msgid "contains" -msgstr "" - -#: lib/filters/factory.js:19 -msgctxt "Condition for custom filter" -msgid "is exactly" -msgstr "" - -#: lib/filters/factory.js:20 -msgctxt "Condition for custom filter" -msgid "begins with" -msgstr "" - -#: lib/filters/factory.js:21 -msgctxt "Condition for custom filter" -msgid "ends with" -msgstr "" - -#: lib/filters/factory.js:22 -msgctxt "Condition for custom filter" -msgid "matches" -msgstr "" - -#: lib/filters/factory.js:24 -msgctxt "Condition for custom filter" -msgid "does not contain" -msgstr "" - -#: lib/filters/factory.js:27 -msgctxt "Condition for custom filter" -msgid "is not" -msgstr "" - -#: lib/filters/factory.js:29 -msgctxt "Condition for custom filter" -msgid "does not begin with" -msgstr "" - -#: lib/filters/factory.js:33 -msgctxt "Condition for custom filter" -msgid "does not end with" -msgstr "" - -#: lib/filters/factory.js:37 -msgctxt "Condition for custom filter" -msgid "does not match" -msgstr "" - -#: lib/filters/factory.js:42 -msgctxt "Filter modal operators" -msgid "All conditions must be fulfilled (AND)" -msgstr "" - -#: lib/filters/factory.js:43 -msgctxt "Filter modal operators" -msgid "One condition must be fulfilled (OR)" -msgstr "" - -#: lib/keys/calendarKeys.js:98 -#: lib/keys/keys.js:102 -msgctxt "Error" -msgid "Signature verification failed" -msgstr "" - -#: lib/keys/keys.js:122 -msgctxt "Error" -msgid "Incorrect decryption password" -msgstr "" - -#: lib/keys/calendarKeys.js:230 -#, javascript-format -msgctxt "Error" -msgid "Could not find address ${ email }." -msgstr "" - -#: lib/calendar/integration/createOrUpdateEvent.js:14 -msgctxt "Error" -msgid "Primary address key not found" -msgstr "" - -#: lib/calendar/integration/createOrUpdateEvent.js:21 -msgctxt "Error" -msgid "Primary calendar key is not decrypted" -msgstr "" - -#: lib/themes/themes.js:13 -msgctxt "Theme" -msgid "Default theme" -msgstr "" - -#: lib/themes/themes.js:23 -msgctxt "Theme" -msgid "Custom theme" -msgstr "" - -#: lib/themes/themes.js:33 -msgctxt "Theme" -msgid "Light" -msgstr "" - -#: lib/themes/themes.js:42 -msgctxt "Theme" -msgid "Blue" -msgstr "" - -#: lib/themes/themes.js:51 -msgctxt "Theme" -msgid "Dark theme" -msgstr "" \ No newline at end of file