diff --git a/examples/hacker-news/config.cloud.js b/examples/hacker-news/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/hacker-news/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/hacker-news/package.json b/examples/hacker-news/package.json index e82564a3b6..3bfa94dcb2 100644 --- a/examples/hacker-news/package.json +++ b/examples/hacker-news/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "start": "babel-node ./run.js start", "dev": "babel-node ./run.js dev", "import": "babel-node ./import", @@ -40,8 +41,12 @@ "resolve-es": "0.17.4", "resolve-redux": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", "resolve-storage-lite": "0.17.4", "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "resolve-module-comments": "0.17.4", "resolve-module-auth": "0.17.4", "sanitizer": "0.1.3", diff --git a/examples/hacker-news/run.js b/examples/hacker-news/run.js index dad0404b44..1c4d25c451 100644 --- a/examples/hacker-news/run.js +++ b/examples/hacker-news/run.js @@ -10,6 +10,7 @@ import resolveModuleComments from 'resolve-module-comments' import resolveModuleAuth from 'resolve-module-auth' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test-functional' @@ -70,6 +71,19 @@ void (async () => { break } + case 'cloud': { + await build( + merge( + defaultResolveConfig, + appConfig, + cloudConfig, + moduleComments, + moduleAuth + ) + ) + break + } + case 'start': { await start( merge( diff --git a/examples/hello-world/config.cloud.js b/examples/hello-world/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/hello-world/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 38b4163acb..ff6d8f77ce 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "dev": "babel-node ./run.js dev", "start": "babel-node ./run.js start", "test": "jest --testMatch=**/test/unit/*.test.js --verbose", @@ -18,9 +19,15 @@ "react-dom": "16.6.0", "react-helmet": "5.2.0", "redux": "4.0.0", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", - "resolve-readmodel-memory": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "redux-devtools-extension": "2.13.5" }, "devDependencies": { diff --git a/examples/hello-world/run.js b/examples/hello-world/run.js index 0c0ff4eebc..28b5230edf 100644 --- a/examples/hello-world/run.js +++ b/examples/hello-world/run.js @@ -8,6 +8,7 @@ import { } from 'resolve-scripts' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' @@ -26,6 +27,11 @@ void (async () => { break } + case 'cloud': { + await build(merge(defaultResolveConfig, appConfig, cloudConfig)) + break + } + case 'start': { await start(merge(defaultResolveConfig, appConfig, prodConfig)) break diff --git a/examples/shopping-list-advanced/config.cloud.js b/examples/shopping-list-advanced/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/shopping-list-advanced/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/shopping-list-advanced/package.json b/examples/shopping-list-advanced/package.json index f44d13611d..b998e0a526 100644 --- a/examples/shopping-list-advanced/package.json +++ b/examples/shopping-list-advanced/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "babel-node ./run.js build", "dev": "babel-node ./run.js dev", + "cloud": "babel-node ./run.js cloud", "start": "babel-node ./run.js start", "start:native": "cd native && npm run start", "test": "npm run test:domain && npm run test:web && npm run test:native", @@ -19,11 +20,16 @@ "deepmerge": "2.2.1", "redux": "4.0.0", "react": "16.6.0", - "resolve-module-auth": "0.17.4", - "resolve-readmodel-memory": "0.17.4", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", "resolve-scripts": "0.17.4", - "resolve-subscribe-socket.io": "0.17.4" + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", + "resolve-module-auth": "0.17.4" }, "devDependencies": { "@babel/core": "7.0.0", diff --git a/examples/shopping-list-advanced/run.js b/examples/shopping-list-advanced/run.js index be4da52e8c..6233012ad6 100644 --- a/examples/shopping-list-advanced/run.js +++ b/examples/shopping-list-advanced/run.js @@ -9,6 +9,7 @@ import { import createAuthModule from 'resolve-module-auth' import devConfig from './config.dev' +import cloudConfig from './config.cloud' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' import adjustWebpackConfigs from './config.adjust_webpack' @@ -58,6 +59,14 @@ void (async () => { break } + case 'cloud': { + await build( + merge(defaultResolveConfig, appConfig, cloudConfig, authModule), + adjustWebpackConfigs.bind(null, authModule) + ) + break + } + case 'start': { await start( merge(defaultResolveConfig, appConfig, prodConfig, authModule) diff --git a/examples/shopping-list/config.cloud.js b/examples/shopping-list/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/shopping-list/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/shopping-list/package.json b/examples/shopping-list/package.json index 907d45bd5d..5a7897e1eb 100644 --- a/examples/shopping-list/package.json +++ b/examples/shopping-list/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "dev": "babel-node ./run.js dev", "start": "babel-node ./run.js start", "test": "jest --testMatch=**/test/unit/*.test.js --verbose", @@ -22,9 +23,15 @@ "react-router": "4.3.1", "react-router-dom": "4.3.1", "redux": "4.0.0", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", - "resolve-readmodel-memory": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "react-router-redux": "5.0.0-alpha.9", "redux-devtools-extension": "2.13.5", "uuid": "3.3.2" diff --git a/examples/shopping-list/run.js b/examples/shopping-list/run.js index 0c0ff4eebc..28b5230edf 100644 --- a/examples/shopping-list/run.js +++ b/examples/shopping-list/run.js @@ -8,6 +8,7 @@ import { } from 'resolve-scripts' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' @@ -26,6 +27,11 @@ void (async () => { break } + case 'cloud': { + await build(merge(defaultResolveConfig, appConfig, cloudConfig)) + break + } + case 'start': { await start(merge(defaultResolveConfig, appConfig, prodConfig)) break diff --git a/examples/with-postcss/config.cloud.js b/examples/with-postcss/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/with-postcss/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/with-postcss/package.json b/examples/with-postcss/package.json index 97104114a4..d5f1cfe950 100644 --- a/examples/with-postcss/package.json +++ b/examples/with-postcss/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "dev": "babel-node ./run.js dev", "start": "babel-node ./run.js start", "test": "jest --testMatch=**/test/unit/*.test.js --verbose", @@ -18,9 +19,15 @@ "react-dom": "16.6.0", "react-helmet": "5.2.0", "redux": "4.0.0", - "resolve-readmodel-memory": "0.17.4", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "redux-devtools-extension": "2.13.5" }, "devDependencies": { diff --git a/examples/with-postcss/run.js b/examples/with-postcss/run.js index d5d609a588..23e7ccb779 100644 --- a/examples/with-postcss/run.js +++ b/examples/with-postcss/run.js @@ -8,6 +8,7 @@ import { } from 'resolve-scripts' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' @@ -33,6 +34,14 @@ void (async () => { break } + case 'cloud': { + await build( + merge(defaultResolveConfig, appConfig, cloudConfig), + adjustWebpackConfigs + ) + break + } + case 'start': { await start(merge(defaultResolveConfig, appConfig, prodConfig)) break diff --git a/examples/with-saga/config.cloud.js b/examples/with-saga/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/with-saga/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/with-saga/package.json b/examples/with-saga/package.json index 05d60b5962..011c5606e8 100644 --- a/examples/with-saga/package.json +++ b/examples/with-saga/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "dev": "babel-node ./run.js dev", "start": "babel-node ./run.js start", "test": "jest --testMatch=**/test/unit/*.test.js --verbose", @@ -19,9 +20,15 @@ "react-helmet": "5.2.0", "react-redux": "5.1.1", "redux": "4.0.0", - "resolve-readmodel-memory": "0.17.4", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "seamless-immutable": "7.1.3", "testcafe-browser-tools": "1.6.5", "uuid": "3.3.2", diff --git a/examples/with-saga/run.js b/examples/with-saga/run.js index 0c0ff4eebc..28b5230edf 100644 --- a/examples/with-saga/run.js +++ b/examples/with-saga/run.js @@ -8,6 +8,7 @@ import { } from 'resolve-scripts' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' @@ -26,6 +27,11 @@ void (async () => { break } + case 'cloud': { + await build(merge(defaultResolveConfig, appConfig, cloudConfig)) + break + } + case 'start': { await start(merge(defaultResolveConfig, appConfig, prodConfig)) break diff --git a/examples/with-styled-components/config.cloud.js b/examples/with-styled-components/config.cloud.js new file mode 100644 index 0000000000..72815a66a5 --- /dev/null +++ b/examples/with-styled-components/config.cloud.js @@ -0,0 +1,30 @@ +import { declareRuntimeEnv } from 'resolve-scripts' + +export default { + target: 'cloud', + mode: 'production', + staticPath: declareRuntimeEnv('CLOUD_STATIC_URL'), + subscribeAdapter: { + module: 'resolve-subscribe-mqtt', + options: {} + }, + storageAdapter: { + module: 'resolve-storage-dynamo', + options: { + tableName: declareRuntimeEnv('DYNAMODB_TABLE_NAME'), + skipInit: true + } + }, + readModelAdapters: [ + { + name: 'default', + module: 'resolve-readmodel-mysql', + options: { + host: declareRuntimeEnv('SQL_HOST'), + database: declareRuntimeEnv('SQL_DATABASE'), + user: declareRuntimeEnv('SQL_USER'), + password: declareRuntimeEnv('SQL_PASSWORD') + } + } + ] +} diff --git a/examples/with-styled-components/package.json b/examples/with-styled-components/package.json index 792bdea759..7eedf6170a 100644 --- a/examples/with-styled-components/package.json +++ b/examples/with-styled-components/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "babel-node ./run.js build", + "cloud": "babel-node ./run.js cloud", "dev": "babel-node ./run.js dev", "start": "babel-node ./run.js start", "test": "jest --testMatch=**/test/unit/*.test.js --verbose", @@ -18,9 +19,15 @@ "react-dom": "16.6.0", "react-helmet": "5.2.0", "redux": "4.0.0", - "resolve-readmodel-memory": "0.17.4", + "resolve-bus-memory": "0.17.4", "resolve-redux": "0.17.4", "resolve-scripts": "0.17.4", + "resolve-storage-dynamo": "0.17.4", + "resolve-storage-lite": "0.17.4", + "resolve-readmodel-memory": "0.17.4", + "resolve-readmodel-mysql": "0.17.4", + "resolve-subscribe-mqtt": "0.17.4", + "resolve-subscribe-socket.io": "0.17.4", "styled-components": "4.1.1", "redux-devtools-extension": "2.13.5" }, diff --git a/examples/with-styled-components/run.js b/examples/with-styled-components/run.js index 0c0ff4eebc..28b5230edf 100644 --- a/examples/with-styled-components/run.js +++ b/examples/with-styled-components/run.js @@ -8,6 +8,7 @@ import { } from 'resolve-scripts' import appConfig from './config.app' +import cloudConfig from './config.cloud' import devConfig from './config.dev' import prodConfig from './config.prod' import testFunctionalConfig from './config.test_functional' @@ -26,6 +27,11 @@ void (async () => { break } + case 'cloud': { + await build(merge(defaultResolveConfig, appConfig, cloudConfig)) + break + } + case 'start': { await start(merge(defaultResolveConfig, appConfig, prodConfig)) break diff --git a/packages/core/resolve-runtime/package.json b/packages/core/resolve-runtime/package.json index 4b4b84318d..f812b59d62 100644 --- a/packages/core/resolve-runtime/package.json +++ b/packages/core/resolve-runtime/package.json @@ -27,6 +27,7 @@ "dependencies": { "@babel/runtime": "^7.0.0", "aws-sdk": "^2.353.0", + "aws-signature-v4": "^1.3.0", "cron": "^1.5.0", "express": "^4.16.4", "history": "^4.7.2", diff --git a/yarn.lock b/yarn.lock index c0f88e61ea..039843dfe9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1848,6 +1848,10 @@ aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" +aws-signature-v4@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/aws-signature-v4/-/aws-signature-v4-1.3.0.tgz#dacc7abb8dd806993ce4759fc6646813c6b52aa1" + aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"