@edx/frontend-platform 4.0.3 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/i18n/scripts/README.md +9 -5
- package/i18n/scripts/intl-imports.js +178 -0
- package/i18n/scripts/intl-imports.js.map +1 -0
- package/initialize.js +41 -29
- package/initialize.js.map +1 -1
- package/package.json +3 -2
- package/scripts/GoogleAnalyticsLoader.js +57 -0
- package/scripts/GoogleAnalyticsLoader.js.map +1 -0
- package/scripts/index.js +3 -0
- package/scripts/index.js.map +1 -0
package/i18n/scripts/README.md
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
# i18n/scripts
|
|
2
2
|
|
|
3
|
-
This directory contains the `transifex-utils.js`
|
|
3
|
+
This directory contains the `transifex-utils.js` and `intl-imports.js` files which are shared across all micro-frontends.
|
|
4
4
|
|
|
5
|
-
The package.json of `frontend-platform` includes the following
|
|
5
|
+
The package.json of `frontend-platform` includes the following sections:
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
"bin": {
|
|
9
|
+
"intl-imports.js": "i18n/scripts/intl-imports.js"
|
|
9
10
|
"transifex-utils.js": "i18n/scripts/transifex-utils.js"
|
|
10
11
|
},
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
This config block causes
|
|
14
|
+
This config block causes boths scripts to be copied to the following path when `frontend-platform` is installed as a
|
|
15
|
+
dependency of a micro-frontend:
|
|
14
16
|
|
|
15
17
|
```
|
|
18
|
+
/node_modules/.bin/intl-imports.js
|
|
16
19
|
/node_modules/.bin/transifex-utils.js
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
All micro-frontends have a `Makefile` with a line that loads
|
|
22
|
+
All micro-frontends have a `Makefile` with a line that loads the scripts from the above path:
|
|
20
23
|
|
|
21
24
|
```
|
|
25
|
+
intl_imports = ./node_modules/.bin/intl-imports.js
|
|
22
26
|
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
So if you delete
|
|
29
|
+
So if you delete either of the files or the `scripts` directory, you'll break all micro-frontend builds. Happy coding!
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var scriptHelpDocument = "\nNAME\n intl-imports.js \u2014 Script to generate the src/i18n/index.js file that exports messages from all the languages for Micro-frontends.\n\nSYNOPSIS\n intl-imports.js [DIRECTORY ...]\n\nDESCRIPTION\n This script is intended to run after 'atlas' has pulled the files.\n \n This expects to run inside a Micro-frontend root directory with the following structure:\n \n frontend-app-learning $ tree src/i18n/\n src/i18n/\n \u251C\u2500\u2500 index.js\n \u2514\u2500\u2500 messages\n \u251C\u2500\u2500 frontend-app-example\n \u2502 \u251C\u2500\u2500 ar.json\n \u2502 \u251C\u2500\u2500 es_419.json\n \u2502 \u2514\u2500\u2500 zh_CN.json\n \u251C\u2500\u2500 frontend-component-footer\n \u2502 \u251C\u2500\u2500 ar.json\n \u2502 \u251C\u2500\u2500 es_419.json\n \u2502 \u2514\u2500\u2500 zh_CN.json\n \u2514\u2500\u2500 frontend-component-header (empty directory)\n \n \n \n With the structure above it's expected to run with the following command in Makefile:\n \n \n $ node_modules/.bin/intl-imports.js frontend-component-footer frontend-component-header frontend-app-example\n \n \n It will generate two type of files:\n \n - Main src/i18n/index.js which overrides the Micro-frontend provided with a sample output of:\n \n \"\"\"\n import messagesFromFrontendComponentFooter from './messages/frontend-component-footer';\n // Skipped import due to missing './messages/frontend-component-footer/index.js' likely due to empty translations.\n import messagesFromFrontendAppExample from './messages/frontend-app-example';\n \n export default [\n messagesFromFrontendComponentFooter,\n messagesFromFrontendAppExample,\n ];\n \"\"\"\n \n - Each sub-directory has src/i18n/messages/frontend-component-header/index.js which is imported by the main file.:\n \n \"\"\"\n import messagesOfArLanguage from './ar.json';\n import messagesOfDeLanguage from './de.json';\n import messagesOfEs419Language from './es_419.json';\n export default {\n 'ar': messagesOfArLanguage,\n 'de': messagesOfDeLanguage,\n 'es-419': messagesOfEs419Language,\n };\n \"\"\"\n";
|
|
3
|
+
var fs = require('fs');
|
|
4
|
+
var path = require('path');
|
|
5
|
+
var camelCase = require('lodash.camelcase');
|
|
6
|
+
var loggingPrefix = path.basename("".concat(__filename)); // the name of this JS file
|
|
7
|
+
|
|
8
|
+
// Header note for generated src/i18n/index.js file
|
|
9
|
+
var filesCodeGeneratorNoticeHeader = "// This file is generated by the openedx/frontend-platform's \"intl-import.js\" script.\n//\n// Refer to the i18n documents in https://docs.openedx.org/en/latest/developers/references/i18n.html to update\n// the file and use the Micro-frontend i18n pattern in new repositories.\n//\n";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Create frontend-app-example/index.js file with proper imports.
|
|
13
|
+
*
|
|
14
|
+
* @param directory - a directory name containing .json files from Transifex e.g. "frontend-app-example".
|
|
15
|
+
* @param log - Mockable process.stdout.write
|
|
16
|
+
* @param writeFileSync - Mockable fs.writeFileSync
|
|
17
|
+
* @param i18nDir - Path to `src/i18n` directory
|
|
18
|
+
*
|
|
19
|
+
* @return object - An object containing directory name and whether its "index.js" file was successfully written.
|
|
20
|
+
*/
|
|
21
|
+
function generateSubdirectoryMessageFile(_ref) {
|
|
22
|
+
var directory = _ref.directory,
|
|
23
|
+
log = _ref.log,
|
|
24
|
+
writeFileSync = _ref.writeFileSync,
|
|
25
|
+
i18nDir = _ref.i18nDir;
|
|
26
|
+
var importLines = [];
|
|
27
|
+
var messagesLines = [];
|
|
28
|
+
var counter = {
|
|
29
|
+
nonEmptyLanguages: 0
|
|
30
|
+
};
|
|
31
|
+
var messagesDir = "".concat(i18nDir, "/messages"); // The directory of Micro-frontend i18n messages
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
var files = fs.readdirSync("".concat(messagesDir, "/").concat(directory), {
|
|
35
|
+
withFileTypes: true
|
|
36
|
+
});
|
|
37
|
+
files.sort(); // Sorting ensures a consistent generated `index.js` order of imports cross-platforms.
|
|
38
|
+
|
|
39
|
+
var jsonFiles = files.filter(function (file) {
|
|
40
|
+
return file.isFile() && file.name.endsWith('.json');
|
|
41
|
+
});
|
|
42
|
+
if (!jsonFiles.length) {
|
|
43
|
+
log("".concat(loggingPrefix, ": Not creating '").concat(directory, "/index.js' because no .json translation files were found.\n"));
|
|
44
|
+
return {
|
|
45
|
+
directory: directory,
|
|
46
|
+
isWritten: false
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
jsonFiles.forEach(function (file) {
|
|
50
|
+
var filename = file.name;
|
|
51
|
+
// Gets `fr_CA` from `fr_CA.json`
|
|
52
|
+
var languageCode = filename.replace(/\.json$/, '');
|
|
53
|
+
// React-friendly language code fr_CA --> fr-ca
|
|
54
|
+
var reactIntlLanguageCode = languageCode.toLowerCase().replace(/_/g, '-');
|
|
55
|
+
// camelCase variable name
|
|
56
|
+
var messagesCamelCaseVar = camelCase("messages_Of_".concat(languageCode, "_Language"));
|
|
57
|
+
var filePath = "".concat(messagesDir, "/").concat(directory, "/").concat(filename);
|
|
58
|
+
try {
|
|
59
|
+
var entries = JSON.parse(fs.readFileSync(filePath, {
|
|
60
|
+
encoding: 'utf8'
|
|
61
|
+
}));
|
|
62
|
+
if (!Object.keys(entries).length) {
|
|
63
|
+
importLines.push("// Note: Skipped empty '".concat(filename, "' messages file."));
|
|
64
|
+
return; // Skip the language
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
importLines.push("// Error: unable to parse '".concat(filename, "' messages file."));
|
|
68
|
+
log("".concat(loggingPrefix, ": NOTICE: Skipping '").concat(directory, "/").concat(filename, "' due to error: ").concat(e, ".\n"));
|
|
69
|
+
return; // Skip the language
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
counter.nonEmptyLanguages += 1;
|
|
73
|
+
importLines.push("import ".concat(messagesCamelCaseVar, " from './").concat(filename, "';"));
|
|
74
|
+
messagesLines.splice(1, 0, " '".concat(reactIntlLanguageCode, "': ").concat(messagesCamelCaseVar, ","));
|
|
75
|
+
});
|
|
76
|
+
if (counter.nonEmptyLanguages) {
|
|
77
|
+
// See the help message above for sample output.
|
|
78
|
+
var messagesFileContent = [filesCodeGeneratorNoticeHeader, importLines.join('\n'), '\nexport default {', messagesLines.join('\n'), '};\n'].join('\n');
|
|
79
|
+
writeFileSync("".concat(messagesDir, "/").concat(directory, "/index.js"), messagesFileContent);
|
|
80
|
+
return {
|
|
81
|
+
directory: directory,
|
|
82
|
+
isWritten: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
log("".concat(loggingPrefix, ": Skipping '").concat(directory, "' because no languages were found.\n"));
|
|
86
|
+
} catch (e) {
|
|
87
|
+
log("".concat(loggingPrefix, ": NOTICE: Skipping '").concat(directory, "' due to error: ").concat(e, ".\n"));
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
directory: directory,
|
|
91
|
+
isWritten: false
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Create main `src/i18n/index.js` messages import file.
|
|
97
|
+
*
|
|
98
|
+
*
|
|
99
|
+
* @param processedDirectories - List of directories with a boolean flag whether its "index.js" file is written
|
|
100
|
+
* The format is "[\{ directory: "frontend-component-example", isWritten: false \}, ...]"
|
|
101
|
+
* @param log - Mockable process.stdout.write
|
|
102
|
+
* @param writeFileSync - Mockable fs.writeFileSync
|
|
103
|
+
* @param i18nDir` - Path to `src/i18n` directory
|
|
104
|
+
*/
|
|
105
|
+
function generateMainMessagesFile(_ref2) {
|
|
106
|
+
var processedDirectories = _ref2.processedDirectories,
|
|
107
|
+
log = _ref2.log,
|
|
108
|
+
writeFileSync = _ref2.writeFileSync,
|
|
109
|
+
i18nDir = _ref2.i18nDir;
|
|
110
|
+
var importLines = [];
|
|
111
|
+
var exportLines = [];
|
|
112
|
+
processedDirectories.forEach(function (processedDirectory) {
|
|
113
|
+
var directory = processedDirectory.directory,
|
|
114
|
+
isWritten = processedDirectory.isWritten;
|
|
115
|
+
if (isWritten) {
|
|
116
|
+
var moduleCamelCaseVariableName = camelCase("messages_from_".concat(directory));
|
|
117
|
+
importLines.push("import ".concat(moduleCamelCaseVariableName, " from './messages/").concat(directory, "';"));
|
|
118
|
+
exportLines.push(" ".concat(moduleCamelCaseVariableName, ","));
|
|
119
|
+
} else {
|
|
120
|
+
var skipMessage = "Skipped import due to missing '".concat(directory, "/index.js' likely due to empty translations.");
|
|
121
|
+
importLines.push("// ".concat(skipMessage, "."));
|
|
122
|
+
log("".concat(loggingPrefix, ": ").concat(skipMessage, "\n"));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// See the help message above for sample output.
|
|
127
|
+
var indexFileContent = [filesCodeGeneratorNoticeHeader, importLines.join('\n'), '\nexport default [', exportLines.join('\n'), '];\n'].join('\n');
|
|
128
|
+
writeFileSync("".concat(i18nDir, "/index.js"), indexFileContent);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/*
|
|
132
|
+
* Main function of the file.
|
|
133
|
+
*/
|
|
134
|
+
function main(_ref3) {
|
|
135
|
+
var directories = _ref3.directories,
|
|
136
|
+
log = _ref3.log,
|
|
137
|
+
writeFileSync = _ref3.writeFileSync,
|
|
138
|
+
pwd = _ref3.pwd;
|
|
139
|
+
var i18nDir = "".concat(pwd, "/src/i18n"); // The Micro-frontend i18n root directory
|
|
140
|
+
|
|
141
|
+
if (directories.includes('--help') || directories.includes('-h')) {
|
|
142
|
+
log(scriptHelpDocument);
|
|
143
|
+
} else if (!directories.length) {
|
|
144
|
+
log(scriptHelpDocument);
|
|
145
|
+
log("".concat(loggingPrefix, ": Error: A list of directories is required.\n"));
|
|
146
|
+
} else if (!fs.existsSync(i18nDir) || !fs.lstatSync(i18nDir).isDirectory()) {
|
|
147
|
+
log(scriptHelpDocument);
|
|
148
|
+
log("".concat(loggingPrefix, ": Error: src/i18n directory was not found.\n"));
|
|
149
|
+
} else {
|
|
150
|
+
var processedDirectories = directories.map(function (directory) {
|
|
151
|
+
return generateSubdirectoryMessageFile({
|
|
152
|
+
directory: directory,
|
|
153
|
+
log: log,
|
|
154
|
+
writeFileSync: writeFileSync,
|
|
155
|
+
i18nDir: i18nDir
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
generateMainMessagesFile({
|
|
159
|
+
processedDirectories: processedDirectories,
|
|
160
|
+
log: log,
|
|
161
|
+
writeFileSync: writeFileSync,
|
|
162
|
+
i18nDir: i18nDir
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (require.main === module) {
|
|
167
|
+
// Run the main() function if called from the command line.
|
|
168
|
+
main({
|
|
169
|
+
directories: process.argv.slice(2),
|
|
170
|
+
log: function log(text) {
|
|
171
|
+
return process.stdout.write(text);
|
|
172
|
+
},
|
|
173
|
+
writeFileSync: fs.writeFileSync,
|
|
174
|
+
pwd: process.env.PWD
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
module.exports.main = main; // Allow tests to use the main function.
|
|
178
|
+
//# sourceMappingURL=intl-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intl-imports.js","names":["scriptHelpDocument","fs","require","path","camelCase","loggingPrefix","basename","concat","__filename","filesCodeGeneratorNoticeHeader","generateSubdirectoryMessageFile","_ref","directory","log","writeFileSync","i18nDir","importLines","messagesLines","counter","nonEmptyLanguages","messagesDir","files","readdirSync","withFileTypes","sort","jsonFiles","filter","file","isFile","name","endsWith","length","isWritten","forEach","filename","languageCode","replace","reactIntlLanguageCode","toLowerCase","messagesCamelCaseVar","filePath","entries","JSON","parse","readFileSync","encoding","Object","keys","push","e","splice","messagesFileContent","join","generateMainMessagesFile","_ref2","processedDirectories","exportLines","processedDirectory","moduleCamelCaseVariableName","skipMessage","indexFileContent","main","_ref3","directories","pwd","includes","existsSync","lstatSync","isDirectory","map","module","process","argv","slice","text","stdout","write","env","PWD","exports"],"sources":["../../../src/i18n/scripts/intl-imports.js"],"sourcesContent":["#!/usr/bin/env node\n\nconst scriptHelpDocument = `\nNAME\n intl-imports.js — Script to generate the src/i18n/index.js file that exports messages from all the languages for Micro-frontends.\n\nSYNOPSIS\n intl-imports.js [DIRECTORY ...]\n\nDESCRIPTION\n This script is intended to run after 'atlas' has pulled the files.\n \n This expects to run inside a Micro-frontend root directory with the following structure:\n \n frontend-app-learning $ tree src/i18n/\n src/i18n/\n ├── index.js\n └── messages\n ├── frontend-app-example\n │ ├── ar.json\n │ ├── es_419.json\n │ └── zh_CN.json\n ├── frontend-component-footer\n │ ├── ar.json\n │ ├── es_419.json\n │ └── zh_CN.json\n └── frontend-component-header (empty directory)\n \n \n \n With the structure above it's expected to run with the following command in Makefile:\n \n \n $ node_modules/.bin/intl-imports.js frontend-component-footer frontend-component-header frontend-app-example\n \n \n It will generate two type of files:\n \n - Main src/i18n/index.js which overrides the Micro-frontend provided with a sample output of:\n \n \"\"\"\n import messagesFromFrontendComponentFooter from './messages/frontend-component-footer';\n // Skipped import due to missing './messages/frontend-component-footer/index.js' likely due to empty translations.\n import messagesFromFrontendAppExample from './messages/frontend-app-example';\n \n export default [\n messagesFromFrontendComponentFooter,\n messagesFromFrontendAppExample,\n ];\n \"\"\"\n \n - Each sub-directory has src/i18n/messages/frontend-component-header/index.js which is imported by the main file.:\n \n \"\"\"\n import messagesOfArLanguage from './ar.json';\n import messagesOfDeLanguage from './de.json';\n import messagesOfEs419Language from './es_419.json';\n export default {\n 'ar': messagesOfArLanguage,\n 'de': messagesOfDeLanguage,\n 'es-419': messagesOfEs419Language,\n };\n \"\"\"\n`;\n\nconst fs = require('fs');\nconst path = require('path');\nconst camelCase = require('lodash.camelcase');\n\nconst loggingPrefix = path.basename(`${__filename}`); // the name of this JS file\n\n// Header note for generated src/i18n/index.js file\nconst filesCodeGeneratorNoticeHeader = `// This file is generated by the openedx/frontend-platform's \"intl-import.js\" script.\n//\n// Refer to the i18n documents in https://docs.openedx.org/en/latest/developers/references/i18n.html to update\n// the file and use the Micro-frontend i18n pattern in new repositories.\n//\n`;\n\n/**\n * Create frontend-app-example/index.js file with proper imports.\n *\n * @param directory - a directory name containing .json files from Transifex e.g. \"frontend-app-example\".\n * @param log - Mockable process.stdout.write\n * @param writeFileSync - Mockable fs.writeFileSync\n * @param i18nDir - Path to `src/i18n` directory\n *\n * @return object - An object containing directory name and whether its \"index.js\" file was successfully written.\n */\nfunction generateSubdirectoryMessageFile({\n directory,\n log,\n writeFileSync,\n i18nDir,\n}) {\n const importLines = [];\n const messagesLines = [];\n const counter = { nonEmptyLanguages: 0 };\n const messagesDir = `${i18nDir}/messages`; // The directory of Micro-frontend i18n messages\n\n try {\n const files = fs.readdirSync(`${messagesDir}/${directory}`, { withFileTypes: true });\n files.sort(); // Sorting ensures a consistent generated `index.js` order of imports cross-platforms.\n\n const jsonFiles = files.filter(file => file.isFile() && file.name.endsWith('.json'));\n\n if (!jsonFiles.length) {\n log(`${loggingPrefix}: Not creating '${directory}/index.js' because no .json translation files were found.\\n`);\n return {\n directory,\n isWritten: false,\n };\n }\n\n jsonFiles.forEach((file) => {\n const filename = file.name;\n // Gets `fr_CA` from `fr_CA.json`\n const languageCode = filename.replace(/\\.json$/, '');\n // React-friendly language code fr_CA --> fr-ca\n const reactIntlLanguageCode = languageCode.toLowerCase().replace(/_/g, '-');\n // camelCase variable name\n const messagesCamelCaseVar = camelCase(`messages_Of_${languageCode}_Language`);\n const filePath = `${messagesDir}/${directory}/${filename}`;\n\n try {\n const entries = JSON.parse(fs.readFileSync(filePath, { encoding: 'utf8' }));\n\n if (!Object.keys(entries).length) {\n importLines.push(`// Note: Skipped empty '${filename}' messages file.`);\n return; // Skip the language\n }\n } catch (e) {\n importLines.push(`// Error: unable to parse '${filename}' messages file.`);\n log(`${loggingPrefix}: NOTICE: Skipping '${directory}/${filename}' due to error: ${e}.\\n`);\n return; // Skip the language\n }\n\n counter.nonEmptyLanguages += 1;\n importLines.push(`import ${messagesCamelCaseVar} from './${filename}';`);\n messagesLines.splice(1, 0, ` '${reactIntlLanguageCode}': ${messagesCamelCaseVar},`);\n });\n\n if (counter.nonEmptyLanguages) {\n // See the help message above for sample output.\n const messagesFileContent = [\n filesCodeGeneratorNoticeHeader,\n importLines.join('\\n'),\n '\\nexport default {',\n messagesLines.join('\\n'),\n '};\\n',\n ].join('\\n');\n\n writeFileSync(`${messagesDir}/${directory}/index.js`, messagesFileContent);\n return {\n directory,\n isWritten: true,\n };\n }\n log(`${loggingPrefix}: Skipping '${directory}' because no languages were found.\\n`);\n } catch (e) {\n log(`${loggingPrefix}: NOTICE: Skipping '${directory}' due to error: ${e}.\\n`);\n }\n\n return {\n directory,\n isWritten: false,\n };\n}\n\n/**\n * Create main `src/i18n/index.js` messages import file.\n *\n *\n * @param processedDirectories - List of directories with a boolean flag whether its \"index.js\" file is written\n * The format is \"[\\{ directory: \"frontend-component-example\", isWritten: false \\}, ...]\"\n * @param log - Mockable process.stdout.write\n * @param writeFileSync - Mockable fs.writeFileSync\n * @param i18nDir` - Path to `src/i18n` directory\n */\nfunction generateMainMessagesFile({\n processedDirectories,\n log,\n writeFileSync,\n i18nDir,\n}) {\n const importLines = [];\n const exportLines = [];\n\n processedDirectories.forEach(processedDirectory => {\n const { directory, isWritten } = processedDirectory;\n if (isWritten) {\n const moduleCamelCaseVariableName = camelCase(`messages_from_${directory}`);\n importLines.push(`import ${moduleCamelCaseVariableName} from './messages/${directory}';`);\n exportLines.push(` ${moduleCamelCaseVariableName},`);\n } else {\n const skipMessage = `Skipped import due to missing '${directory}/index.js' likely due to empty translations.`;\n importLines.push(`// ${skipMessage}.`);\n log(`${loggingPrefix}: ${skipMessage}\\n`);\n }\n });\n\n // See the help message above for sample output.\n const indexFileContent = [\n filesCodeGeneratorNoticeHeader,\n importLines.join('\\n'),\n '\\nexport default [',\n exportLines.join('\\n'),\n '];\\n',\n ].join('\\n');\n\n writeFileSync(`${i18nDir}/index.js`, indexFileContent);\n}\n\n/*\n * Main function of the file.\n */\nfunction main({\n directories,\n log,\n writeFileSync,\n pwd,\n}) {\n const i18nDir = `${pwd}/src/i18n`; // The Micro-frontend i18n root directory\n\n if (directories.includes('--help') || directories.includes('-h')) {\n log(scriptHelpDocument);\n } else if (!directories.length) {\n log(scriptHelpDocument);\n log(`${loggingPrefix}: Error: A list of directories is required.\\n`);\n } else if (!fs.existsSync(i18nDir) || !fs.lstatSync(i18nDir).isDirectory()) {\n log(scriptHelpDocument);\n log(`${loggingPrefix}: Error: src/i18n directory was not found.\\n`);\n } else {\n const processedDirectories = directories.map(directory => generateSubdirectoryMessageFile({\n directory,\n log,\n writeFileSync,\n i18nDir,\n }));\n generateMainMessagesFile({\n processedDirectories,\n log,\n writeFileSync,\n i18nDir,\n });\n }\n}\n\nif (require.main === module) {\n // Run the main() function if called from the command line.\n main({\n directories: process.argv.slice(2),\n log: text => process.stdout.write(text),\n writeFileSync: fs.writeFileSync,\n pwd: process.env.PWD,\n });\n}\n\nmodule.exports.main = main; // Allow tests to use the main function.\n"],"mappings":"AAAA;AAEA,IAAMA,kBAAkB,suEA6DvB;AAED,IAAMC,EAAE,GAAGC,OAAO,CAAC,IAAI,CAAC;AACxB,IAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC5B,IAAME,SAAS,GAAGF,OAAO,CAAC,kBAAkB,CAAC;AAE7C,IAAMG,aAAa,GAAGF,IAAI,CAACG,QAAQ,IAAAC,MAAA,CAAIC,UAAU,EAAG,CAAC,CAAC;;AAEtD;AACA,IAAMC,8BAA8B,gSAKnC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CAAAC,IAAA,EAKrC;EAAA,IAJDC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;EAEP,IAAMC,WAAW,GAAG,EAAE;EACtB,IAAMC,aAAa,GAAG,EAAE;EACxB,I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G;QACHC,aAAa,EAAbA,aAAa;QACbC,OAAO,EAAPA;MACF,CAAC,CAAC;IAAA,EAAC;IACHsC,wBAAwB,CAAC;MACvBE,oBAAoB,EAApBA,oBAAoB;MACpB1C,GAAG,EAAHA,GAAG;MACHC,aAAa,EAAbA,aAAa;MACbC,OAAO,EAAPA;IACF,CAAC,CAAC;EACJ;AACF;AAEA,IAAIb,OAAO,CAAC2D,IAAI,KAAKS,MAAM,EAAE;EAC3B;EACAT,IAAI,CAAC;IACHE,WAAW,EAAEQ,OAAO,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC;IAClC5D,GAAG,EAAE,SAAAA,IAAA6D,IAAI;MAAA,OAAIH,OAAO,CAACI,MAAM,CAACC,KAAK,CAACF,IAAI,CAAC;IAAA;IACvC5D,aAAa,EAAEb,EAAE,CAACa,aAAa;IAC/BkD,GAAG,EAAEO,OAAO,CAACM,GAAG,CAACC;EACnB,CAAC,CAAC;AACJ;AAEAR,MAAM,CAACS,OAAO,CAAClB,IAAI,GAAGA,IAAI,CAAC,CAAC"}
|
package/initialize.js
CHANGED
|
@@ -60,6 +60,7 @@ import { publish } from './pubSub';
|
|
|
60
60
|
import { getConfig, mergeConfig } from './config';
|
|
61
61
|
import { configure as configureLogging, getLoggingService, NewRelicLoggingService, logError } from './logging';
|
|
62
62
|
import { configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser } from './analytics';
|
|
63
|
+
import { GoogleAnalyticsLoader } from './scripts';
|
|
63
64
|
import { getAuthenticatedHttpClient, configure as configureAuth, ensureAuthenticatedUser, fetchAuthenticatedUser, hydrateAuthenticatedUser, getAuthenticatedUser, AxiosJwtAuthService } from './auth';
|
|
64
65
|
import { configure as configureI18n } from './i18n';
|
|
65
66
|
import { APP_PUBSUB_INITIALIZED, APP_CONFIG_INITIALIZED, APP_AUTH_INITIALIZED, APP_I18N_INITIALIZED, APP_LOGGING_INITIALIZED, APP_ANALYTICS_INITIALIZED, APP_READY, APP_INIT_ERROR } from './constants';
|
|
@@ -157,15 +158,6 @@ function _auth() {
|
|
|
157
158
|
export function runtimeConfig() {
|
|
158
159
|
return _runtimeConfig.apply(this, arguments);
|
|
159
160
|
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* The default handler for the initialization lifecycle's `analytics` phase.
|
|
163
|
-
*
|
|
164
|
-
* The handler is responsible for identifying authenticated and anonymous users with the analytics
|
|
165
|
-
* service. This is a pre-requisite for sending analytics events, thus, we do it during the
|
|
166
|
-
* initialization sequence so that analytics is ready once the application's UI code starts to load.
|
|
167
|
-
*
|
|
168
|
-
*/
|
|
169
161
|
function _runtimeConfig() {
|
|
170
162
|
_runtimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
171
163
|
var _getConfig, MFE_CONFIG_API_URL, APP_ID, apiConfig, apiService, params, url, _yield$apiService$get, data;
|
|
@@ -212,6 +204,21 @@ function _runtimeConfig() {
|
|
|
212
204
|
}));
|
|
213
205
|
return _runtimeConfig.apply(this, arguments);
|
|
214
206
|
}
|
|
207
|
+
export function loadExternalScripts(externalScripts, data) {
|
|
208
|
+
externalScripts.forEach(function (ExternalScript) {
|
|
209
|
+
var script = new ExternalScript(data);
|
|
210
|
+
script.loadScript();
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The default handler for the initialization lifecycle's `analytics` phase.
|
|
216
|
+
*
|
|
217
|
+
* The handler is responsible for identifying authenticated and anonymous users with the analytics
|
|
218
|
+
* service. This is a pre-requisite for sending analytics events, thus, we do it during the
|
|
219
|
+
* initialization sequence so that analytics is ready once the application's UI code starts to load.
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
215
222
|
export function analytics() {
|
|
216
223
|
return _analytics.apply(this, arguments);
|
|
217
224
|
}
|
|
@@ -299,6 +306,8 @@ function applyOverrideHandlers(overrides) {
|
|
|
299
306
|
* @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`
|
|
300
307
|
* implementation to use.
|
|
301
308
|
* @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.
|
|
309
|
+
* @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.
|
|
310
|
+
* By default added GoogleAnalyticsLoader.
|
|
302
311
|
* @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login
|
|
303
312
|
* redirection for unauthenticated users. Defaults to false, meaning that by default the
|
|
304
313
|
* application will allow anonymous/unauthenticated sessions.
|
|
@@ -318,11 +327,11 @@ export function initialize(_x4) {
|
|
|
318
327
|
}
|
|
319
328
|
function _initialize() {
|
|
320
329
|
_initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref2) {
|
|
321
|
-
var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers;
|
|
330
|
+
var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$externalScripts, externalScripts, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers;
|
|
322
331
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
323
332
|
while (1) switch (_context6.prev = _context6.next) {
|
|
324
333
|
case 0:
|
|
325
|
-
_ref2$loggingService = _ref2.loggingService, loggingService = _ref2$loggingService === void 0 ? NewRelicLoggingService : _ref2$loggingService, _ref2$analyticsServic = _ref2.analyticsService, analyticsService = _ref2$analyticsServic === void 0 ? SegmentAnalyticsService : _ref2$analyticsServic, _ref2$authService = _ref2.authService, authService = _ref2$authService === void 0 ? AxiosJwtAuthService : _ref2$authService, _ref2$authMiddleware = _ref2.authMiddleware, authMiddleware = _ref2$authMiddleware === void 0 ? [] : _ref2$authMiddleware, _ref2$requireAuthenti = _ref2.requireAuthenticatedUser, requireUser = _ref2$requireAuthenti === void 0 ? false : _ref2$requireAuthenti, _ref2$hydrateAuthenti = _ref2.hydrateAuthenticatedUser, hydrateUser = _ref2$hydrateAuthenti === void 0 ? false : _ref2$hydrateAuthenti, messages = _ref2.messages, _ref2$handlers = _ref2.handlers, overrideHandlers = _ref2$handlers === void 0 ? {} : _ref2$handlers;
|
|
334
|
+
_ref2$loggingService = _ref2.loggingService, loggingService = _ref2$loggingService === void 0 ? NewRelicLoggingService : _ref2$loggingService, _ref2$analyticsServic = _ref2.analyticsService, analyticsService = _ref2$analyticsServic === void 0 ? SegmentAnalyticsService : _ref2$analyticsServic, _ref2$authService = _ref2.authService, authService = _ref2$authService === void 0 ? AxiosJwtAuthService : _ref2$authService, _ref2$authMiddleware = _ref2.authMiddleware, authMiddleware = _ref2$authMiddleware === void 0 ? [] : _ref2$authMiddleware, _ref2$externalScripts = _ref2.externalScripts, externalScripts = _ref2$externalScripts === void 0 ? [GoogleAnalyticsLoader] : _ref2$externalScripts, _ref2$requireAuthenti = _ref2.requireAuthenticatedUser, requireUser = _ref2$requireAuthenti === void 0 ? false : _ref2$requireAuthenti, _ref2$hydrateAuthenti = _ref2.hydrateAuthenticatedUser, hydrateUser = _ref2$hydrateAuthenti === void 0 ? false : _ref2$hydrateAuthenti, messages = _ref2.messages, _ref2$handlers = _ref2.handlers, overrideHandlers = _ref2$handlers === void 0 ? {} : _ref2$handlers;
|
|
326
335
|
handlers = applyOverrideHandlers(overrideHandlers);
|
|
327
336
|
_context6.prev = 2;
|
|
328
337
|
_context6.next = 5;
|
|
@@ -338,14 +347,17 @@ function _initialize() {
|
|
|
338
347
|
return runtimeConfig();
|
|
339
348
|
case 10:
|
|
340
349
|
publish(APP_CONFIG_INITIALIZED);
|
|
350
|
+
loadExternalScripts(externalScripts, {
|
|
351
|
+
config: getConfig()
|
|
352
|
+
});
|
|
341
353
|
|
|
342
354
|
// Logging
|
|
343
355
|
configureLogging(loggingService, {
|
|
344
356
|
config: getConfig()
|
|
345
357
|
});
|
|
346
|
-
_context6.next =
|
|
358
|
+
_context6.next = 15;
|
|
347
359
|
return handlers.logging();
|
|
348
|
-
case
|
|
360
|
+
case 15:
|
|
349
361
|
publish(APP_LOGGING_INITIALIZED);
|
|
350
362
|
|
|
351
363
|
// Authentication
|
|
@@ -354,9 +366,9 @@ function _initialize() {
|
|
|
354
366
|
config: getConfig(),
|
|
355
367
|
middleware: authMiddleware
|
|
356
368
|
});
|
|
357
|
-
_context6.next =
|
|
369
|
+
_context6.next = 19;
|
|
358
370
|
return handlers.auth(requireUser, hydrateUser);
|
|
359
|
-
case
|
|
371
|
+
case 19:
|
|
360
372
|
publish(APP_AUTH_INITIALIZED);
|
|
361
373
|
|
|
362
374
|
// Analytics
|
|
@@ -365,9 +377,9 @@ function _initialize() {
|
|
|
365
377
|
loggingService: getLoggingService(),
|
|
366
378
|
httpClient: getAuthenticatedHttpClient()
|
|
367
379
|
});
|
|
368
|
-
_context6.next =
|
|
380
|
+
_context6.next = 23;
|
|
369
381
|
return handlers.analytics();
|
|
370
|
-
case
|
|
382
|
+
case 23:
|
|
371
383
|
publish(APP_ANALYTICS_INITIALIZED);
|
|
372
384
|
|
|
373
385
|
// Internationalization
|
|
@@ -376,34 +388,34 @@ function _initialize() {
|
|
|
376
388
|
config: getConfig(),
|
|
377
389
|
loggingService: getLoggingService()
|
|
378
390
|
});
|
|
379
|
-
_context6.next =
|
|
391
|
+
_context6.next = 27;
|
|
380
392
|
return handlers.i18n();
|
|
381
|
-
case
|
|
393
|
+
case 27:
|
|
382
394
|
publish(APP_I18N_INITIALIZED);
|
|
383
395
|
|
|
384
396
|
// Application Ready
|
|
385
|
-
_context6.next =
|
|
397
|
+
_context6.next = 30;
|
|
386
398
|
return handlers.ready();
|
|
387
|
-
case
|
|
399
|
+
case 30:
|
|
388
400
|
publish(APP_READY);
|
|
389
|
-
_context6.next =
|
|
401
|
+
_context6.next = 39;
|
|
390
402
|
break;
|
|
391
|
-
case
|
|
392
|
-
_context6.prev =
|
|
403
|
+
case 33:
|
|
404
|
+
_context6.prev = 33;
|
|
393
405
|
_context6.t0 = _context6["catch"](2);
|
|
394
406
|
if (_context6.t0.isRedirecting) {
|
|
395
|
-
_context6.next =
|
|
407
|
+
_context6.next = 39;
|
|
396
408
|
break;
|
|
397
409
|
}
|
|
398
|
-
_context6.next =
|
|
410
|
+
_context6.next = 38;
|
|
399
411
|
return handlers.initError(_context6.t0);
|
|
400
|
-
case 37:
|
|
401
|
-
publish(APP_INIT_ERROR, _context6.t0);
|
|
402
412
|
case 38:
|
|
413
|
+
publish(APP_INIT_ERROR, _context6.t0);
|
|
414
|
+
case 39:
|
|
403
415
|
case "end":
|
|
404
416
|
return _context6.stop();
|
|
405
417
|
}
|
|
406
|
-
}, _callee6, null, [[2,
|
|
418
|
+
}, _callee6, null, [[2, 33]]);
|
|
407
419
|
}));
|
|
408
420
|
return _initialize.apply(this, arguments);
|
|
409
421
|
}
|
package/initialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,KAAA,KAAAC,OAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,cAAA,GAAAF,OAAA,CAAAG,QAAA,kBAAAC,mBAAA,GAAAJ,OAAA,CAAAK,aAAA,uBAAAC,iBAAA,GAAAN,OAAA,CAAAO,WAAA,8BAAAC,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAR,MAAA,CAAAI,cAAA,CAAAC,GAAA,EAAAC,GAAA,IAAAE,KAAA,EAAAA,KAAA,EAAAU,UAAA,MAAAC,YAAA,MAAAC,QAAA,SAAAf,GAAA,CAAAC,GAAA,WAAAW,MAAA,mBAAAI,GAAA,IAAAJ,MAAA,YAAAA,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAH,GAAA,CAAAC,GAAA,IAAAE,KAAA,gBAAAc,KAAAC,OAAA,EAAAC,OAAA,EAAAC,IAAA,EAAAC,WAAA,QAAAC,cAAA,GAAAH,OAAA,IAAAA,OAAA,CAAAvB,SAAA,YAAA2B,SAAA,GAAAJ,OAAA,GAAAI,SAAA,EAAAC,SAAA,GAAA7B,MAAA,CAAA8B,MAAA,CAAAH,cAAA,CAAA1B,SAAA,GAAA8B,OAAA,OAAAC,OAAA,CAAAN,WAAA,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E;QAAA;UACtB9F,OAAO,CAAC0B,SAAS,CAAC;UAACyF,SAAA,CAAArL,IAAA;UAAA;QAAA;UAAAqL,SAAA,CAAA/I,IAAA;UAAA+I,SAAA,CAAA3C,EAAA,GAAA2C,SAAA;UAAA,IAEdA,SAAA,CAAA3C,EAAA,CAAM+C,aAAa;YAAAJ,SAAA,CAAArL,IAAA;YAAA;UAAA;UAAAqL,SAAA,CAAArL,IAAA;UAAA,OAEhBmL,QAAQ,CAAChF,SAAS,CAAAkF,SAAA,CAAA3C,EAAA,CAAO;QAAA;UAC/BxE,OAAO,CAAC2B,cAAc,EAAAwF,SAAA,CAAA3C,EAAA,CAAQ;QAAC;QAAA;UAAA,OAAA2C,SAAA,CAAA5I,IAAA;MAAA;IAAA,GAAA2H,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAApG,KAAA,OAAAD,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,KAAA,KAAAC,OAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,cAAA,GAAAF,OAAA,CAAAG,QAAA,kBAAAC,mBAAA,GAAAJ,OAAA,CAAAK,aAAA,uBAAAC,iBAAA,GAAAN,OAAA,CAAAO,WAAA,8BAAAC,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAR,MAAA,CAAAI,cAAA,CAAAC,GAAA,EAAAC,GAAA,IAAAE,KAAA,EAAAA,KAAA,EAAAU,UAAA,MAAAC,YAAA,MAAAC,QAAA,SAAAf,GAAA,CAAAC,GAAA,WAAAW,MAAA,mBAAAI,GAAA,IAAAJ,MAAA,YAAAA,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAH,GAAA,CAAAC,GAAA,IAAAE,KAAA,gBAAAc,KAAAC,OAAA,EAAAC,OAAA,EAAAC,IAAA,EAAAC,WAAA,QAAAC,cAAA,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G,KAAA,OAAAD,SAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edx/frontend-platform",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Foundational application framework for Open edX micro-frontend applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"test:watch": "npm run test -- --watch"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
+
"intl-imports.js": "i18n/scripts/intl-imports.js",
|
|
21
22
|
"transifex-utils.js": "i18n/scripts/transifex-utils.js"
|
|
22
23
|
},
|
|
23
24
|
"repository": {
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"enzyme": "3.11.0",
|
|
42
43
|
"enzyme-adapter-react-16": "1.15.7",
|
|
43
44
|
"husky": "8.0.3",
|
|
44
|
-
"jsdoc": "
|
|
45
|
+
"jsdoc": "^4.0.0",
|
|
45
46
|
"nodemon": "2.0.21",
|
|
46
47
|
"prop-types": "15.8.1",
|
|
47
48
|
"react": "16.14.0",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
/**
|
|
8
|
+
* @implements {GoogleAnalyticsLoader}
|
|
9
|
+
* @memberof module:GoogleAnalytics
|
|
10
|
+
*/
|
|
11
|
+
var GoogleAnalyticsLoader = /*#__PURE__*/function () {
|
|
12
|
+
function GoogleAnalyticsLoader(_ref) {
|
|
13
|
+
var config = _ref.config;
|
|
14
|
+
_classCallCheck(this, GoogleAnalyticsLoader);
|
|
15
|
+
this.analyticsId = config.GOOGLE_ANALYTICS_4_ID;
|
|
16
|
+
}
|
|
17
|
+
_createClass(GoogleAnalyticsLoader, [{
|
|
18
|
+
key: "loadScript",
|
|
19
|
+
value: function loadScript() {
|
|
20
|
+
if (!this.analyticsId) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
global.googleAnalytics = global.googleAnalytics || [];
|
|
24
|
+
var _global = global,
|
|
25
|
+
googleAnalytics = _global.googleAnalytics;
|
|
26
|
+
|
|
27
|
+
// If the snippet was invoked do nothing.
|
|
28
|
+
if (googleAnalytics.invoked) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Invoked flag, to make sure the snippet
|
|
33
|
+
// is never invoked twice.
|
|
34
|
+
googleAnalytics.invoked = true;
|
|
35
|
+
googleAnalytics.load = function (key, options) {
|
|
36
|
+
var scriptSrc = document.createElement('script');
|
|
37
|
+
scriptSrc.type = 'text/javascript';
|
|
38
|
+
scriptSrc.async = true;
|
|
39
|
+
scriptSrc.src = "https://www.googletagmanager.com/gtag/js?id=".concat(key);
|
|
40
|
+
var scriptGtag = document.createElement('script');
|
|
41
|
+
scriptGtag.innerHTML = "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(key, "');\n ");
|
|
42
|
+
|
|
43
|
+
// Insert our scripts next to the first script element.
|
|
44
|
+
var first = document.getElementsByTagName('script')[0];
|
|
45
|
+
first.parentNode.insertBefore(scriptSrc, first);
|
|
46
|
+
first.parentNode.insertBefore(scriptGtag, first);
|
|
47
|
+
googleAnalytics._loadOptions = options; // eslint-disable-line no-underscore-dangle
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Load GoogleAnalytics with your key.
|
|
51
|
+
googleAnalytics.load(this.analyticsId);
|
|
52
|
+
}
|
|
53
|
+
}]);
|
|
54
|
+
return GoogleAnalyticsLoader;
|
|
55
|
+
}();
|
|
56
|
+
export default GoogleAnalyticsLoader;
|
|
57
|
+
//# sourceMappingURL=GoogleAnalyticsLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleAnalyticsLoader.js","names":["GoogleAnalyticsLoader","_ref","config","_classCallCheck","analyticsId","GOOGLE_ANALYTICS_4_ID","_createClass","key","value","loadScript","global","googleAnalytics","_global","invoked","load","options","scriptSrc","document","createElement","type","async","src","concat","scriptGtag","innerHTML","first","getElementsByTagName","parentNode","insertBefore","_loadOptions"],"sources":["../../src/scripts/GoogleAnalyticsLoader.js"],"sourcesContent":["/**\n * @implements {GoogleAnalyticsLoader}\n * @memberof module:GoogleAnalytics\n */\nclass GoogleAnalyticsLoader {\n constructor({ config }) {\n this.analyticsId = config.GOOGLE_ANALYTICS_4_ID;\n }\n\n loadScript() {\n if (!this.analyticsId) {\n return;\n }\n\n global.googleAnalytics = global.googleAnalytics || [];\n const { googleAnalytics } = global;\n\n // If the snippet was invoked do nothing.\n if (googleAnalytics.invoked) {\n return;\n }\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n googleAnalytics.invoked = true;\n\n googleAnalytics.load = (key, options) => {\n const scriptSrc = document.createElement('script');\n scriptSrc.type = 'text/javascript';\n scriptSrc.async = true;\n scriptSrc.src = `https://www.googletagmanager.com/gtag/js?id=${key}`;\n\n const scriptGtag = document.createElement('script');\n scriptGtag.innerHTML = `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${key}');\n `;\n\n // Insert our scripts next to the first script element.\n const first = document.getElementsByTagName('script')[0];\n first.parentNode.insertBefore(scriptSrc, first);\n first.parentNode.insertBefore(scriptGtag, first);\n googleAnalytics._loadOptions = options; // eslint-disable-line no-underscore-dangle\n };\n\n // Load GoogleAnalytics with your key.\n googleAnalytics.load(this.analyticsId);\n }\n}\n\nexport default GoogleAnalyticsLoader;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAHA,IAIMA,qBAAqB;EACzB,SAAAA,sBAAAC,IAAA,EAAwB;IAAA,IAAVC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAAC,eAAA,OAAAH,qBAAA;IAClB,IAAI,CAACI,WAAW,GAAGF,MAAM,CAACG,qBAAqB;EACjD;EAACC,YAAA,CAAAN,qBAAA;IAAAO,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAA,EAAa;MACX,IAAI,CAAC,IAAI,CAACL,WAAW,EAAE;QACrB;MACF;MAEAM,MAAM,CAACC,eAAe,GAAGD,MAAM,CAACC,eAAe,IAAI,EAAE;MACrD,IAAAC,OAAA,GAA4BF,MAAM;QAA1BC,eAAe,GAAAC,OAAA,CAAfD,eAAe;;MAEvB;MACA,IAAIA,eAAe,CAACE,OAAO,EAAE;QAC3B;MACF;;MAEA;MACA;MACAF,eAAe,CAACE,OAAO,GAAG,IAAI;MAE9BF,eAAe,CAACG,IAAI,GAAG,UAACP,GAAG,EAAEQ,OAAO,EAAK;QACvC,IAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC;QAClDF,SAAS,CAACG,IAAI,GAAG,iBAAiB;QAClCH,SAAS,CAACI,KAAK,GAAG,IAAI;QACtBJ,SAAS,CAACK,GAAG,kDAAAC,MAAA,CAAkDf,GAAG,CAAE;QAEpE,IAAMgB,UAAU,GAAGN,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC;QACnDK,UAAU,CAACC,SAAS,0KAAAF,MAAA,CAIAf,GAAG,gBACtB;;QAED;QACA,IAAMkB,KAAK,GAAGR,QAAQ,CAACS,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxDD,KAAK,CAACE,UAAU,CAACC,YAAY,CAACZ,SAAS,EAAES,KAAK,CAAC;QAC/CA,KAAK,CAACE,UAAU,CAACC,YAAY,CAACL,UAAU,EAAEE,KAAK,CAAC;QAChDd,eAAe,CAACkB,YAAY,GAAGd,OAAO,CAAC,CAAC;MAC1C,CAAC;;MAED;MACAJ,eAAe,CAACG,IAAI,CAAC,IAAI,CAACV,WAAW,CAAC;IACxC;EAAC;EAAA,OAAAJ,qBAAA;AAAA;AAGH,eAAeA,qBAAqB"}
|
package/scripts/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","GoogleAnalyticsLoader"],"sources":["../../src/scripts/index.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport { default as GoogleAnalyticsLoader } from './GoogleAnalyticsLoader';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,yBAAyB"}
|