diff --git a/.gitignore b/.gitignore index 5ae34ec..1eaf42e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ dist/ node_modules/ thumbs.db + +# generated translation files +/translations +/locale diff --git a/package-lock.json b/package-lock.json index 18da0a9..ee07a35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -900,6 +900,15 @@ "@babel/plugin-transform-react-jsx-source": "7.0.0" } }, + "@babel/runtime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", + "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", + "dev": true, + "requires": { + "regenerator-runtime": "0.12.1" + } + }, "@babel/template": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.0.tgz", @@ -1704,6 +1713,17 @@ } } }, + "babel-plugin-react-intl": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-3.0.1.tgz", + "integrity": "sha512-FqnEO+Tq7kJVUPKsSG3s5jaHi3pAC4RUR11IrscvjsfkOApLP2DtzNo6dtQ+tX+OzEzJx7cUms8aCw5BFyW5xg==", + "dev": true, + "requires": { + "@babel/runtime": "7.0.0", + "intl-messageformat-parser": "1.4.0", + "mkdirp": "0.5.1" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -3709,6 +3729,12 @@ "ms": "2.0.0" } }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3740,6 +3766,12 @@ "ms": "2.0.0" } }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -6936,6 +6968,14 @@ "dev": true, "requires": { "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "jsonfile": { @@ -7306,6 +7346,14 @@ "read-pkg-up": "1.0.1", "redent": "1.0.0", "trim-newlines": "1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "merge-descriptors": { @@ -7411,9 +7459,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mississippi": { @@ -7510,14 +7558,6 @@ "dev": true, "requires": { "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } } }, "move-concurrently": { @@ -7796,6 +7836,12 @@ "ms": "2.0.0" } }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -10677,6 +10723,14 @@ "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "react": { @@ -10921,6 +10975,12 @@ "regenerate": "1.4.0" } }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + }, "regenerator-transform": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz", diff --git a/package.json b/package.json index 35b5458..651ee8e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/preset-react": "^7.0.0", "babel-eslint": "^10.0.0", + "babel-plugin-react-intl": "^3.0.1", "electron": "2.0.7", "electron-builder": "^20.28.1", "electron-webpack": "^2.1.2", diff --git a/webpack.renderer.additions.js b/webpack.renderer.additions.js index 47886fa..18f8145 100644 --- a/webpack.renderer.additions.js +++ b/webpack.renderer.additions.js @@ -6,22 +6,28 @@ module.exports = { { test: /\.jsx?$/, loader: 'babel-loader', - // include: [path.resolve(__dirname, 'src', 'renderer'), /node_modules[\\/]scratch-[^\\/]+[\\/]src/], + resolve: { + symlinks: false + }, + include: [ + path.resolve(__dirname, 'src', 'renderer'), + /node_modules[\\/]scratch-[^\\/]+[\\/]src/ + ], options: { // Explicitly disable babelrc so we don't catch various config // in much lower dependencies. babelrc: false, + cacheDirectory: true, plugins: [ - '@babel/proposal-object-rest-spread' + '@babel/proposal-object-rest-spread', // 'syntax-dynamic-import', // 'transform-async-to-generator', - // 'transform-object-rest-spread', - // ['react-intl', { - // messagesDir: './translations/messages/' - // }] + ['react-intl', { + messagesDir: './translations/messages/' + }] ], presets: [ - // ['env', {targets: {electron: '2.0.7'}}], + ['@babel/env', {targets: {electron: '2.0.7'}}], '@babel/react' ] }