@edx/frontend-platform 4.6.0 → 4.6.2

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.
Files changed (229) hide show
  1. package/.env.development +30 -0
  2. package/.env.test +30 -0
  3. package/.eslintignore +6 -0
  4. package/.eslintrc.js +28 -0
  5. package/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  6. package/.github/workflows/add-depr-ticket-to-depr-board.yml +19 -0
  7. package/.github/workflows/add-remove-label-on-comment.yml +20 -0
  8. package/.github/workflows/ci.yml +42 -0
  9. package/.github/workflows/commitlint.yml +10 -0
  10. package/.github/workflows/lockfileversion-check.yml +13 -0
  11. package/.github/workflows/manual-publish.yml +43 -0
  12. package/.github/workflows/npm-deprecate.yml +22 -0
  13. package/.github/workflows/release.yml +45 -0
  14. package/.github/workflows/self-assign-issue.yml +12 -0
  15. package/.github/workflows/update-browserslist-db.yml +12 -0
  16. package/.nvmrc +1 -0
  17. package/.releaserc +32 -0
  18. package/catalog-info.yaml +21 -0
  19. package/dist/LICENSE +661 -0
  20. package/dist/README.md +155 -0
  21. package/dist/package.json +86 -0
  22. package/docs/addTagsPlugin.js +10 -0
  23. package/docs/auth-API.md +114 -0
  24. package/docs/decisions/0001-record-architecture-decisions.rst +32 -0
  25. package/docs/decisions/0002-frontend-base-design-goals.rst +222 -0
  26. package/docs/decisions/0003-consolidation-into-frontend-platform.rst +71 -0
  27. package/docs/decisions/0004-axios-caching-implementation.rst +88 -0
  28. package/docs/decisions/0005-token-null-after-successful-refresh.rst +69 -0
  29. package/docs/decisions/0006-middleware-support-for-http-clients.rst +44 -0
  30. package/docs/decisions/0007-javascript-file-configuration.rst +143 -0
  31. package/docs/how_tos/automatic-case-conversion.rst +58 -0
  32. package/docs/how_tos/caching.rst +93 -0
  33. package/docs/how_tos/i18n.rst +305 -0
  34. package/docs/removeExport.js +24 -0
  35. package/docs/template/edx/README.md +12 -0
  36. package/docs/template/edx/publish.js +713 -0
  37. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  38. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.svg +1830 -0
  39. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  40. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  41. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  42. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  43. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  44. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.svg +1830 -0
  45. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  46. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.eot +0 -0
  47. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.svg +1831 -0
  48. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.woff +0 -0
  49. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  50. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  51. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  52. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  53. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.svg +1831 -0
  54. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  55. package/docs/template/edx/static/scripts/linenumber.js +25 -0
  56. package/docs/template/edx/static/scripts/prettify/Apache-License-2.0.txt +202 -0
  57. package/docs/template/edx/static/scripts/prettify/lang-css.js +2 -0
  58. package/docs/template/edx/static/scripts/prettify/prettify.js +28 -0
  59. package/docs/template/edx/static/styles/jsdoc-default.css +356 -0
  60. package/docs/template/edx/static/styles/prettify-jsdoc.css +111 -0
  61. package/docs/template/edx/static/styles/prettify-tomorrow.css +132 -0
  62. package/docs/template/edx/tmpl/augments.tmpl +10 -0
  63. package/docs/template/edx/tmpl/container.tmpl +196 -0
  64. package/docs/template/edx/tmpl/details.tmpl +143 -0
  65. package/docs/template/edx/tmpl/example.tmpl +2 -0
  66. package/docs/template/edx/tmpl/examples.tmpl +13 -0
  67. package/docs/template/edx/tmpl/exceptions.tmpl +32 -0
  68. package/docs/template/edx/tmpl/layout.tmpl +39 -0
  69. package/docs/template/edx/tmpl/mainpage.tmpl +10 -0
  70. package/docs/template/edx/tmpl/members.tmpl +38 -0
  71. package/docs/template/edx/tmpl/method.tmpl +131 -0
  72. package/docs/template/edx/tmpl/modifies.tmpl +14 -0
  73. package/docs/template/edx/tmpl/params.tmpl +131 -0
  74. package/docs/template/edx/tmpl/properties.tmpl +108 -0
  75. package/docs/template/edx/tmpl/returns.tmpl +19 -0
  76. package/docs/template/edx/tmpl/source.tmpl +8 -0
  77. package/docs/template/edx/tmpl/tutorial.tmpl +19 -0
  78. package/docs/template/edx/tmpl/type.tmpl +7 -0
  79. package/env.config.js +8 -0
  80. package/jsdoc.json +36 -0
  81. package/openedx.yaml +12 -0
  82. package/package.json +6 -6
  83. package/service-interface.png +0 -0
  84. package/src/analytics/MockAnalyticsService.js +71 -0
  85. package/src/analytics/SegmentAnalyticsService.js +243 -0
  86. package/src/analytics/index.js +12 -0
  87. package/src/analytics/interface.js +142 -0
  88. package/src/auth/AxiosCsrfTokenService.js +60 -0
  89. package/src/auth/AxiosJwtAuthService.js +364 -0
  90. package/src/auth/AxiosJwtTokenService.js +134 -0
  91. package/src/auth/LocalForageCache.js +78 -0
  92. package/src/auth/MockAuthService.js +285 -0
  93. package/src/auth/index.js +19 -0
  94. package/src/auth/interceptors/createCsrfTokenProviderInterceptor.js +37 -0
  95. package/src/auth/interceptors/createJwtTokenProviderInterceptor.js +38 -0
  96. package/src/auth/interceptors/createProcessAxiosRequestErrorInterceptor.js +20 -0
  97. package/src/auth/interceptors/createRetryInterceptor.js +72 -0
  98. package/src/auth/interface.js +309 -0
  99. package/src/auth/utils.js +105 -0
  100. package/src/config.js +327 -0
  101. package/src/constants.js +66 -0
  102. package/src/i18n/countries.js +57 -0
  103. package/src/i18n/index.js +123 -0
  104. package/src/i18n/injectIntlWithShim.jsx +45 -0
  105. package/src/i18n/languages.js +60 -0
  106. package/src/i18n/lib.js +282 -0
  107. package/src/i18n/scripts/README.md +29 -0
  108. package/src/i18n/scripts/intl-imports.js +259 -0
  109. package/src/i18n/scripts/transifex-utils.js +75 -0
  110. package/src/index.js +42 -0
  111. package/src/initialize.js +357 -0
  112. package/src/logging/MockLoggingService.js +31 -0
  113. package/src/logging/NewRelicLoggingService.js +181 -0
  114. package/src/logging/index.js +9 -0
  115. package/src/logging/interface.js +110 -0
  116. package/src/pubSub.js +47 -0
  117. package/src/react/AppContext.jsx +24 -0
  118. package/src/react/AppProvider.jsx +93 -0
  119. package/src/react/AuthenticatedPageRoute.jsx +60 -0
  120. package/src/react/ErrorBoundary.jsx +44 -0
  121. package/src/react/ErrorPage.jsx +76 -0
  122. package/src/react/LoginRedirect.jsx +16 -0
  123. package/src/react/OptionalReduxProvider.jsx +28 -0
  124. package/src/react/PageRoute.jsx +31 -0
  125. package/src/react/hooks.js +50 -0
  126. package/src/react/index.js +16 -0
  127. package/src/scripts/GoogleAnalyticsLoader.js +53 -0
  128. package/src/scripts/index.js +2 -0
  129. package/src/testing/index.js +9 -0
  130. package/src/testing/initializeMockApp.js +77 -0
  131. package/src/testing/mockMessages.js +21 -0
  132. package/src/utils.js +167 -0
  133. /package/{analytics → dist/analytics}/MockAnalyticsService.js +0 -0
  134. /package/{analytics → dist/analytics}/MockAnalyticsService.js.map +0 -0
  135. /package/{analytics → dist/analytics}/SegmentAnalyticsService.js +0 -0
  136. /package/{analytics → dist/analytics}/SegmentAnalyticsService.js.map +0 -0
  137. /package/{analytics → dist/analytics}/index.js +0 -0
  138. /package/{analytics → dist/analytics}/index.js.map +0 -0
  139. /package/{analytics → dist/analytics}/interface.js +0 -0
  140. /package/{analytics → dist/analytics}/interface.js.map +0 -0
  141. /package/{auth → dist/auth}/AxiosCsrfTokenService.js +0 -0
  142. /package/{auth → dist/auth}/AxiosCsrfTokenService.js.map +0 -0
  143. /package/{auth → dist/auth}/AxiosJwtAuthService.js +0 -0
  144. /package/{auth → dist/auth}/AxiosJwtAuthService.js.map +0 -0
  145. /package/{auth → dist/auth}/AxiosJwtTokenService.js +0 -0
  146. /package/{auth → dist/auth}/AxiosJwtTokenService.js.map +0 -0
  147. /package/{auth → dist/auth}/LocalForageCache.js +0 -0
  148. /package/{auth → dist/auth}/LocalForageCache.js.map +0 -0
  149. /package/{auth → dist/auth}/MockAuthService.js +0 -0
  150. /package/{auth → dist/auth}/MockAuthService.js.map +0 -0
  151. /package/{auth → dist/auth}/index.js +0 -0
  152. /package/{auth → dist/auth}/index.js.map +0 -0
  153. /package/{auth → dist/auth}/interceptors/createCsrfTokenProviderInterceptor.js +0 -0
  154. /package/{auth → dist/auth}/interceptors/createCsrfTokenProviderInterceptor.js.map +0 -0
  155. /package/{auth → dist/auth}/interceptors/createJwtTokenProviderInterceptor.js +0 -0
  156. /package/{auth → dist/auth}/interceptors/createJwtTokenProviderInterceptor.js.map +0 -0
  157. /package/{auth → dist/auth}/interceptors/createProcessAxiosRequestErrorInterceptor.js +0 -0
  158. /package/{auth → dist/auth}/interceptors/createProcessAxiosRequestErrorInterceptor.js.map +0 -0
  159. /package/{auth → dist/auth}/interceptors/createRetryInterceptor.js +0 -0
  160. /package/{auth → dist/auth}/interceptors/createRetryInterceptor.js.map +0 -0
  161. /package/{auth → dist/auth}/interface.js +0 -0
  162. /package/{auth → dist/auth}/interface.js.map +0 -0
  163. /package/{auth → dist/auth}/utils.js +0 -0
  164. /package/{auth → dist/auth}/utils.js.map +0 -0
  165. /package/{config.js → dist/config.js} +0 -0
  166. /package/{config.js.map → dist/config.js.map} +0 -0
  167. /package/{constants.js → dist/constants.js} +0 -0
  168. /package/{constants.js.map → dist/constants.js.map} +0 -0
  169. /package/{i18n → dist/i18n}/countries.js +0 -0
  170. /package/{i18n → dist/i18n}/countries.js.map +0 -0
  171. /package/{i18n → dist/i18n}/index.js +0 -0
  172. /package/{i18n → dist/i18n}/index.js.map +0 -0
  173. /package/{i18n → dist/i18n}/injectIntlWithShim.js +0 -0
  174. /package/{i18n → dist/i18n}/injectIntlWithShim.js.map +0 -0
  175. /package/{i18n → dist/i18n}/languages.js +0 -0
  176. /package/{i18n → dist/i18n}/languages.js.map +0 -0
  177. /package/{i18n → dist/i18n}/lib.js +0 -0
  178. /package/{i18n → dist/i18n}/lib.js.map +0 -0
  179. /package/{i18n → dist/i18n}/scripts/README.md +0 -0
  180. /package/{i18n → dist/i18n}/scripts/intl-imports.js +0 -0
  181. /package/{i18n → dist/i18n}/scripts/intl-imports.js.map +0 -0
  182. /package/{i18n → dist/i18n}/scripts/transifex-utils.js +0 -0
  183. /package/{i18n → dist/i18n}/scripts/transifex-utils.js.map +0 -0
  184. /package/{index.js → dist/index.js} +0 -0
  185. /package/{index.js.map → dist/index.js.map} +0 -0
  186. /package/{initialize.js → dist/initialize.js} +0 -0
  187. /package/{initialize.js.map → dist/initialize.js.map} +0 -0
  188. /package/{logging → dist/logging}/MockLoggingService.js +0 -0
  189. /package/{logging → dist/logging}/MockLoggingService.js.map +0 -0
  190. /package/{logging → dist/logging}/NewRelicLoggingService.js +0 -0
  191. /package/{logging → dist/logging}/NewRelicLoggingService.js.map +0 -0
  192. /package/{logging → dist/logging}/index.js +0 -0
  193. /package/{logging → dist/logging}/index.js.map +0 -0
  194. /package/{logging → dist/logging}/interface.js +0 -0
  195. /package/{logging → dist/logging}/interface.js.map +0 -0
  196. /package/{pubSub.js → dist/pubSub.js} +0 -0
  197. /package/{pubSub.js.map → dist/pubSub.js.map} +0 -0
  198. /package/{react → dist/react}/AppContext.js +0 -0
  199. /package/{react → dist/react}/AppContext.js.map +0 -0
  200. /package/{react → dist/react}/AppProvider.js +0 -0
  201. /package/{react → dist/react}/AppProvider.js.map +0 -0
  202. /package/{react → dist/react}/AuthenticatedPageRoute.js +0 -0
  203. /package/{react → dist/react}/AuthenticatedPageRoute.js.map +0 -0
  204. /package/{react → dist/react}/ErrorBoundary.js +0 -0
  205. /package/{react → dist/react}/ErrorBoundary.js.map +0 -0
  206. /package/{react → dist/react}/ErrorPage.js +0 -0
  207. /package/{react → dist/react}/ErrorPage.js.map +0 -0
  208. /package/{react → dist/react}/LoginRedirect.js +0 -0
  209. /package/{react → dist/react}/LoginRedirect.js.map +0 -0
  210. /package/{react → dist/react}/OptionalReduxProvider.js +0 -0
  211. /package/{react → dist/react}/OptionalReduxProvider.js.map +0 -0
  212. /package/{react → dist/react}/PageRoute.js +0 -0
  213. /package/{react → dist/react}/PageRoute.js.map +0 -0
  214. /package/{react → dist/react}/hooks.js +0 -0
  215. /package/{react → dist/react}/hooks.js.map +0 -0
  216. /package/{react → dist/react}/index.js +0 -0
  217. /package/{react → dist/react}/index.js.map +0 -0
  218. /package/{scripts → dist/scripts}/GoogleAnalyticsLoader.js +0 -0
  219. /package/{scripts → dist/scripts}/GoogleAnalyticsLoader.js.map +0 -0
  220. /package/{scripts → dist/scripts}/index.js +0 -0
  221. /package/{scripts → dist/scripts}/index.js.map +0 -0
  222. /package/{testing → dist/testing}/index.js +0 -0
  223. /package/{testing → dist/testing}/index.js.map +0 -0
  224. /package/{testing → dist/testing}/initializeMockApp.js +0 -0
  225. /package/{testing → dist/testing}/initializeMockApp.js.map +0 -0
  226. /package/{testing → dist/testing}/mockMessages.js +0 -0
  227. /package/{testing → dist/testing}/mockMessages.js.map +0 -0
  228. /package/{utils.js → dist/utils.js} +0 -0
  229. /package/{utils.js.map → dist/utils.js.map} +0 -0
@@ -0,0 +1,30 @@
1
+ EXAMPLE_VAR=Example Value
2
+ ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
3
+ ACCOUNT_PROFILE_URL=http://localhost:1995
4
+ ACCOUNT_SETTINGS_URL=http://localhost:1997
5
+ BASE_URL=http://localhost:8080
6
+ CREDENTIALS_BASE_URL=http://localhost:18150
7
+ CSRF_TOKEN_API_PATH=/csrf/api/v1/token
8
+ DISCOVERY_API_BASE_URL=http://localhost:18381
9
+ PUBLISHER_BASE_URL=http://localhost:18400
10
+ ECOMMERCE_BASE_URL=http://localhost:18130
11
+ LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
12
+ LEARNING_BASE_URL=http://localhost:2000
13
+ LMS_BASE_URL=http://localhost:18000
14
+ LOGIN_URL=http://localhost:18000/login
15
+ LOGOUT_URL=http://localhost:18000/logout
16
+ STUDIO_BASE_URL=http://localhost:18010
17
+ MARKETING_SITE_BASE_URL=http://localhost:18000
18
+ ORDER_HISTORY_URL=http://localhost:1996/orders
19
+ REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
20
+ SEGMENT_KEY=''
21
+ SITE_NAME=localhost
22
+ USER_INFO_COOKIE_NAME=edx-user-info
23
+ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
24
+ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
25
+ LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
26
+ FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
27
+ IGNORED_ERROR_REGEX=
28
+ MFE_CONFIG_API_URL=
29
+ APP_ID=
30
+ SUPPORT_URL=https://support.edx.org
package/.env.test ADDED
@@ -0,0 +1,30 @@
1
+ EXAMPLE_VAR=Example Value
2
+ ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
3
+ ACCOUNT_PROFILE_URL=http://localhost:1995
4
+ ACCOUNT_SETTINGS_URL=http://localhost:1997
5
+ BASE_URL=http://localhost:8080
6
+ CREDENTIALS_BASE_URL=http://localhost:18150
7
+ CSRF_TOKEN_API_PATH=/csrf/api/v1/token
8
+ DISCOVERY_API_BASE_URL=http://localhost:18381
9
+ PUBLISHER_BASE_URL=http://localhost:18400
10
+ ECOMMERCE_BASE_URL=http://localhost:18130
11
+ LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
12
+ LEARNING_BASE_URL=http://localhost:2000
13
+ LMS_BASE_URL=http://localhost:18000
14
+ LOGIN_URL=http://localhost:18000/login
15
+ LOGOUT_URL=http://localhost:18000/logout
16
+ STUDIO_BASE_URL=http://localhost:18010
17
+ MARKETING_SITE_BASE_URL=http://localhost:18000
18
+ ORDER_HISTORY_URL=http://localhost:1996/orders
19
+ REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
20
+ SEGMENT_KEY=''
21
+ SITE_NAME=localhost
22
+ USER_INFO_COOKIE_NAME=edx-user-info
23
+ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
24
+ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
25
+ LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
26
+ FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
27
+ IGNORED_ERROR_REGEX=
28
+ MFE_CONFIG_API_URL=
29
+ APP_ID=
30
+ SUPPORT_URL=https://support.edx.org
package/.eslintignore ADDED
@@ -0,0 +1,6 @@
1
+ .idea
2
+ coverage
3
+ dist
4
+ docs
5
+ node_modules
6
+ src/analytics/segment.js
package/.eslintrc.js ADDED
@@ -0,0 +1,28 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ const { getBaseConfig } = require('@edx/frontend-build');
3
+
4
+ const config = getBaseConfig('eslint');
5
+
6
+ config.rules = {
7
+ 'import/no-extraneous-dependencies': ['error', {
8
+ devDependencies: [
9
+ '**/*.config.js',
10
+ '**/*.test.jsx',
11
+ '**/*.test.js',
12
+ 'example/*',
13
+ ],
14
+ }],
15
+ 'import/extensions': ['error', {
16
+ ignore: ['@edx/frontend-platform*'],
17
+ }],
18
+ 'import/no-unresolved': ['error', {
19
+ ignore: ['@edx/frontend-platform*'],
20
+ }],
21
+ 'jsx-a11y/anchor-is-valid': ['error', {
22
+ components: ['Link'],
23
+ specialLink: ['to'],
24
+ aspects: ['noHref', 'invalidHref', 'preferButton'],
25
+ }],
26
+ };
27
+
28
+ module.exports = config;
@@ -0,0 +1,13 @@
1
+ **Description:**
2
+
3
+ Describe what this pull request changes, and why. Include implications for people using this change.
4
+
5
+ **Merge checklist:**
6
+
7
+ - [ ] Consider running your code modifications in the included example app within `frontend-platform`. This can be done by running `npm start` and opening http://localhost:8080.
8
+ - [ ] Consider testing your code modifications in another local micro-frontend using local aliases configured via [the `module.config.js` file in `frontend-build`](https://github.com/openedx/frontend-build#local-module-configuration-for-webpack).
9
+ - [ ] Verify your commit title/body conforms to the conventional commits format (e.g., `fix`, `feat`) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.
10
+
11
+ **Post merge:**
12
+
13
+ - [ ] After the build finishes for the merged commit, verify the new release has been pushed to [NPM](https://www.npmjs.com/package/@edx/frontend-platform).
@@ -0,0 +1,19 @@
1
+ # Run the workflow that adds new tickets that are either:
2
+ # - labelled "DEPR"
3
+ # - title starts with "[DEPR]"
4
+ # - body starts with "Proposal Date" (this is the first template field)
5
+ # to the org-wide DEPR project board
6
+
7
+ name: Add newly created DEPR issues to the DEPR project board
8
+
9
+ on:
10
+ issues:
11
+ types: [opened]
12
+
13
+ jobs:
14
+ routeissue:
15
+ uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master
16
+ secrets:
17
+ GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
18
+ GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
19
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
@@ -0,0 +1,20 @@
1
+ # This workflow runs when a comment is made on the ticket
2
+ # If the comment starts with "label: " it tries to apply
3
+ # the label indicated in rest of comment.
4
+ # If the comment starts with "remove label: ", it tries
5
+ # to remove the indicated label.
6
+ # Note: Labels are allowed to have spaces and this script does
7
+ # not parse spaces (as often a space is legitimate), so the command
8
+ # "label: really long lots of words label" will apply the
9
+ # label "really long lots of words label"
10
+
11
+ name: Allows for the adding and removing of labels via comment
12
+
13
+ on:
14
+ issue_comment:
15
+ types: [created]
16
+
17
+ jobs:
18
+ add_remove_labels:
19
+ uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master
20
+
@@ -0,0 +1,42 @@
1
+ name: node_js CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - "**"
10
+
11
+ jobs:
12
+ tests:
13
+ runs-on: ubuntu-20.04
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v3
17
+
18
+ - name: Setup Nodejs Env
19
+ run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
20
+
21
+ - name: Setup Nodejs
22
+ uses: actions/setup-node@v3
23
+ with:
24
+ node-version: ${{ env.NODE_VER }}
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Lint
30
+ run: npm run lint
31
+
32
+ - name: Test
33
+ run: npm run test
34
+
35
+ - name: Build
36
+ run: npm run build
37
+
38
+ - name: Docs
39
+ run: npm run docs
40
+
41
+ - name: Run Coverage
42
+ uses: codecov/codecov-action@v3
@@ -0,0 +1,10 @@
1
+ # Run commitlint on the commit messages in a pull request.
2
+
3
+ name: Lint Commit Messages
4
+
5
+ on:
6
+ - pull_request
7
+
8
+ jobs:
9
+ commitlint:
10
+ uses: openedx/.github/.github/workflows/commitlint.yml@master
@@ -0,0 +1,13 @@
1
+ #check package-lock file version
2
+
3
+ name: lockfileVersion check
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - master
9
+ pull_request:
10
+
11
+ jobs:
12
+ version-check:
13
+ uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
@@ -0,0 +1,43 @@
1
+ name: Manual Publish
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ tag:
6
+ required: true
7
+ description: NPM distribution tag to use for the backported release (npm publish --tag <tag>)
8
+ jobs:
9
+ release:
10
+ name: Manual Publish
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ - name: Setup Nodejs Env
18
+ run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
19
+ - name: Setup Node.js
20
+ uses: actions/setup-node@v2
21
+ with:
22
+ node-version: ${{ env.NODE_VER }}
23
+ - name: Install dependencies
24
+ run: npm ci
25
+ - name: Lint
26
+ run: npm run lint
27
+ - name: Test
28
+ run: npm run test
29
+ - name: Coverage
30
+ uses: codecov/codecov-action@v2
31
+ - name: Build
32
+ run: npm run build
33
+ # NPM expects to be authenticated for publishing. This step will fail CI if NPM is not authenticated
34
+ - name: Check NPM authentication
35
+ run: |
36
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
37
+ npm whoami
38
+ - name: Release
39
+ env:
40
+ GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
41
+ NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
42
+ # `npm publish` relies on version specified in package.json file
43
+ run: npm publish --tag ${{github.event.inputs.tag}} # e.g., old-version
@@ -0,0 +1,22 @@
1
+ name: NPM Deprecate
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ version:
6
+ description: 'Version to deprecate'
7
+ required: true
8
+ message:
9
+ description: 'Reason for deprecation'
10
+ required: true
11
+
12
+ jobs:
13
+ deprecate:
14
+ name: Deprecate
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Check NPM authentication
18
+ run: |
19
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
20
+ npm whoami
21
+ - name: NPM deprecate
22
+ run: npm deprecate @edx/frontend-platform@"${{ github.event.inputs.version }}" "${{ github.event.inputs.message }}"
@@ -0,0 +1,45 @@
1
+ name: Release CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+
7
+ jobs:
8
+ release:
9
+ name: Release
10
+ runs-on: ubuntu-20.04
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+
17
+ - name: Setup Nodejs Env
18
+ run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: ${{ env.NODE_VER }}
24
+
25
+ - name: Install dependencies
26
+ run: npm ci
27
+
28
+ - name: Create Build
29
+ run: npm run build
30
+
31
+ - name: Release to npm/Github
32
+ run: npx semantic-release
33
+ env:
34
+ GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
35
+ NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
36
+
37
+ - name: Docs
38
+ run: npm run docs
39
+
40
+ - name: Deploy to GitHub Pages
41
+ uses: JamesIves/github-pages-deploy-action@v4.4.3
42
+ with:
43
+ branch: gh-pages # The branch the action should deploy to.
44
+ folder: docs/api/@edx/frontend-platform/1.0.0-semantically-released # The folder the action should deploy.
45
+ clean: true # Automatically remove deleted files from the deploy branch
@@ -0,0 +1,12 @@
1
+ # This workflow runs when a comment is made on the ticket
2
+ # If the comment starts with "assign me" it assigns the author to the
3
+ # ticket (case insensitive)
4
+
5
+ name: Assign comment author to ticket if they say "assign me"
6
+ on:
7
+ issue_comment:
8
+ types: [created]
9
+
10
+ jobs:
11
+ self_assign_by_comment:
12
+ uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
@@ -0,0 +1,12 @@
1
+ name: Update Browserslist DB
2
+ on:
3
+ schedule:
4
+ - cron: '0 0 * * 1'
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ update-browserslist:
9
+ uses: openedx/.github/.github/workflows/update-browserslist-db.yml@master
10
+
11
+ secrets:
12
+ requirements_bot_github_token: ${{ secrets.requirements_bot_github_token }}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18
package/.releaserc ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "branch": "master",
3
+ "tagFormat": "v${version}",
4
+ "verifyConditions": [
5
+ {
6
+ "path": "@semantic-release/npm",
7
+ "pkgRoot": "dist"
8
+ },
9
+ {
10
+ "path": "@semantic-release/github"
11
+ }
12
+ ],
13
+ "analyzeCommits": "@semantic-release/commit-analyzer",
14
+ "generateNotes": "@semantic-release/release-notes-generator",
15
+ "prepare": [
16
+ {
17
+ "path": "@semantic-release/npm",
18
+ "pkgRoot": "dist"
19
+ }
20
+ ],
21
+ "publish": [
22
+ {
23
+ "path": "@semantic-release/npm",
24
+ "pkgRoot": "dist"
25
+ },
26
+ {
27
+ "path": "@semantic-release/github"
28
+ }
29
+ ],
30
+ "success": [],
31
+ "fail": []
32
+ }
@@ -0,0 +1,21 @@
1
+ # This file records information about this repo. Its use is described in OEP-55:
2
+ # https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html
3
+
4
+ apiVersion: backstage.io/v1alpha1
5
+ kind: Component
6
+ metadata:
7
+ name: 'frontend-platform'
8
+ description: "A modest application framework for Open edX micro-frontend applications and their supporting libraries"
9
+ links:
10
+ - url: "https://github.com/openedx/frontend-platform"
11
+ title: "Frontend Platform"
12
+ icon: "Code"
13
+ - url: "https://openedx.github.io/frontend-platform/"
14
+ title: "Documentation"
15
+ icon: "Article"
16
+ annotations:
17
+ openedx.org/arch-interest-groups: "jmbowman"
18
+ spec:
19
+ owner: group:fed-bom
20
+ type: 'library'
21
+ lifecycle: 'production'