diff --git a/config/watcher.ts b/config/watcher.ts index 916d3dcd2..e83e7d5b4 100644 --- a/config/watcher.ts +++ b/config/watcher.ts @@ -65,6 +65,23 @@ const config: Config = { runOnInit: true, }), }, + compileRelayInstall: { + paths: [ + "core/client/install/**/*.ts", + "core/client/install/**/*.tsx", + "core/client/install/**/*.graphql", + "core/server/**/*.graphql", + ], + ignore: [ + "core/**/*.d.ts", + "core/**/*.graphql.ts", + "**/test/**/*", + "core/**/*.spec.*", + ], + executor: new CommandExecutor("npm run compile:relay-install", { + runOnInit: true, + }), + }, compileCSSTypes: { paths: ["**/*.css"], executor: new CommandExecutor("npm run compile:css-types", { @@ -94,6 +111,7 @@ const config: Config = { "compileCSSTypes", "compileRelayStream", "compileRelayAuth", + "compileRelayInstall", "compileRelayAdmin", "compileSchema", ], @@ -103,6 +121,7 @@ const config: Config = { "compileCSSTypes", "compileRelayStream", "compileRelayAuth", + "compileRelayInstall", ], }, }; diff --git a/package-lock.json b/package-lock.json index 76ca05f4d..09d01caac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1675,6 +1675,15 @@ "@types/node": "*" } }, + "@types/bunyan-prettystream": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/@types/bunyan-prettystream/-/bunyan-prettystream-0.1.31.tgz", + "integrity": "sha512-NE7fq2ZcX7OSMK+VhTNJkVEHlo+hm0uVXpuLeH1ifGm52Qwuo/kLD2GHo7UcEXMFu3duKver/AFo8C4TME93zw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/case-sensitive-paths-webpack-plugin": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@types/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.1.2.tgz", @@ -5714,6 +5723,11 @@ "safe-json-stringify": "~1" } }, + "bunyan-prettystream": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/bunyan-prettystream/-/bunyan-prettystream-0.1.3.tgz", + "integrity": "sha1-bDtxMmb2rTIAfHtqsemYokU0nZg=" + }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -6671,6 +6685,13 @@ "moment": "2.22.2", "validator": "7.2.0", "yargs-parser": "10.0.0" + }, + "dependencies": { + "validator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-7.2.0.tgz", + "integrity": "sha512-c8NGTUYeBEcUIGeMppmNVKHE7wwfm3mYbNZxV+c5mlv9fDHI7Ad3p07qfNrn/CvpdkK2k61fOLRO2sTEhgQXmg==" + } } }, "cookie": { @@ -25297,11 +25318,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "validator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-7.2.0.tgz", - "integrity": "sha512-c8NGTUYeBEcUIGeMppmNVKHE7wwfm3mYbNZxV+c5mlv9fDHI7Ad3p07qfNrn/CvpdkK2k61fOLRO2sTEhgQXmg==" - }, "value-equal": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz", diff --git a/package.json b/package.json index 8768e7e0a..22ec9c61d 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "compile:css-types": "tcm src/core/client/", "compile:relay-stream": "ts-node ./scripts/compileRelay --src ./src/core/client/stream --schema tenant", "compile:relay-auth": "ts-node ./scripts/compileRelay --src ./src/core/client/auth --schema tenant", + "compile:relay-install": "ts-node ./scripts/compileRelay --src ./src/core/client/install --schema tenant", "compile:relay-admin": "ts-node ./scripts/compileRelay --src ./src/core/client/admin --schema tenant", "compile:schema": "node ./scripts/generateSchemaTypes.js", "docz": "docz", @@ -38,6 +39,7 @@ "bcryptjs": "^2.4.3", "bull": "^3.4.4", "bunyan": "^1.8.12", + "bunyan-prettystream": "^0.1.3", "cheerio": "^1.0.0-rc.2", "consolidate": "0.14.0", "convict": "^4.3.1", @@ -96,6 +98,7 @@ "@types/bcryptjs": "^2.4.1", "@types/bull": "^3.3.16", "@types/bunyan": "^1.8.4", + "@types/bunyan-prettystream": "^0.1.31", "@types/case-sensitive-paths-webpack-plugin": "^2.1.2", "@types/cheerio": "^0.22.8", "@types/chokidar": "^1.7.5", diff --git a/src/core/build/createWebpackConfig.ts b/src/core/build/createWebpackConfig.ts index 54cf4b3ca..8e0b32ddd 100644 --- a/src/core/build/createWebpackConfig.ts +++ b/src/core/build/createWebpackConfig.ts @@ -255,6 +255,22 @@ export default function createWebpackConfig({ }, ], }, + { + test: paths.appInstallLocalesTemplate, + use: [ + // This is the locales loader that loads available locales + // from a particular target. + { + loader: "locales-loader", + options: { + ...localesOptions, + // Target specifies the prefix for fluent files to be loaded. + // ${target}-xyz.ftl and ${†arget}.ftl are loaded into the locales. + target: "install", + }, + }, + ], + }, // Loader for our fluent files. { test: /\.ftl$/, @@ -432,6 +448,12 @@ export default function createWebpackConfig({ paths.appAuthIndex, // Remove deactivated entries. ], + install: [ + // We ship polyfills by default + paths.appPolyfill, + ...devServerEntries, + paths.appInstallIndex, + ], admin: [ // We ship polyfills by default paths.appPolyfill, @@ -457,6 +479,14 @@ export default function createWebpackConfig({ inject: "body", ...htmlWebpackConfig, }), + // Generates an `install.html` file with the