@orangelogic/orange-dam-content-browser-sdk 2.1.54 → 2.1.57

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 (281) hide show
  1. package/build/ApiService.d.ts +15 -0
  2. package/build/App.d.ts +62 -0
  3. package/build/AppContext.d.ts +18 -0
  4. package/build/GlobalConfigContext.d.ts +33 -0
  5. package/build/OrangeDAMContentBrowserSDK.min.css +2 -0
  6. package/build/OrangeDAMContentBrowserSDK.min.css.map +1 -0
  7. package/build/OrangeDAMContentBrowserSDK.min.js +11481 -0
  8. package/build/OrangeDAMContentBrowserSDK.min.js.map +1 -0
  9. package/build/asset-manifest.json +13 -0
  10. package/build/components/ArrayClamp/ArrayClamp.d.ts +10 -0
  11. package/build/components/ArrayClamp/ArrayClamp.styled.d.ts +1 -0
  12. package/build/components/ArrayClamp/index.d.ts +1 -0
  13. package/build/components/Browser/Browser.constants.d.ts +3 -0
  14. package/build/components/Browser/Browser.d.ts +22 -0
  15. package/build/components/Browser/Browser.styled.d.ts +2 -0
  16. package/build/components/Browser/BrowserItem.d.ts +13 -0
  17. package/build/components/Browser/LoadMoreButton.d.ts +9 -0
  18. package/build/components/ControlBar/ControlBar.constants.d.ts +10 -0
  19. package/build/components/ControlBar/ControlBar.d.ts +23 -0
  20. package/build/components/ControlBar/ControlBar.styled.d.ts +1 -0
  21. package/build/components/ControlBar/Facet/Facet.d.ts +14 -0
  22. package/build/components/ControlBar/Facet/index.d.ts +1 -0
  23. package/build/components/FormatDialog/CropPreviewer/CropPreviewer.d.ts +41 -0
  24. package/{src/components/FormatDialog/CropPreviewer/index.ts → build/components/FormatDialog/CropPreviewer/index.d.ts} +1 -1
  25. package/build/components/FormatDialog/CustomRendition/CustomRendition.constants.d.ts +5 -0
  26. package/build/components/FormatDialog/CustomRendition/CustomRendition.d.ts +56 -0
  27. package/build/components/FormatDialog/CustomRendition/CustomRendition.styled.d.ts +1 -0
  28. package/build/components/FormatDialog/CustomRendition/index.d.ts +1 -0
  29. package/build/components/FormatDialog/CustomRendition/transformations/Crop.d.ts +26 -0
  30. package/build/components/FormatDialog/CustomRendition/transformations/Extension.d.ts +11 -0
  31. package/build/components/FormatDialog/CustomRendition/transformations/Format.d.ts +10 -0
  32. package/build/components/FormatDialog/CustomRendition/transformations/Metadata.d.ts +7 -0
  33. package/build/components/FormatDialog/CustomRendition/transformations/Quality.d.ts +7 -0
  34. package/build/components/FormatDialog/CustomRendition/transformations/Resize.d.ts +18 -0
  35. package/build/components/FormatDialog/CustomRendition/transformations/Rotate.d.ts +8 -0
  36. package/{src/components/FormatDialog/CustomRendition/transformations/index.ts → build/components/FormatDialog/CustomRendition/transformations/index.d.ts} +3 -1
  37. package/build/components/FormatDialog/FormatDialog.d.ts +49 -0
  38. package/build/components/FormatDialog/FormatDialog.styled.d.ts +3 -0
  39. package/build/components/FormatDialog/Previewer/Previewer.d.ts +17 -0
  40. package/build/components/FormatDialog/Previewer/Previewer.styled.d.ts +1 -0
  41. package/build/components/FormatDialog/Previewer/index.d.ts +1 -0
  42. package/build/components/FormatDialog/ProxyMenu/ProxyMenu.d.ts +20 -0
  43. package/build/components/FormatDialog/ProxyMenu/ProxyMenu.styled.d.ts +2 -0
  44. package/build/components/FormatDialog/ProxyMenu/index.d.ts +1 -0
  45. package/build/components/FormatDialog/TrackingParameters/TrackingParameters.d.ts +13 -0
  46. package/build/components/FormatDialog/TrackingParameters/index.d.ts +1 -0
  47. package/build/components/FormatDialog/VersionHistory/VersionHistory.d.ts +6 -0
  48. package/build/components/FormatDialog/VersionHistory/VersionHistory.styled.d.ts +1 -0
  49. package/build/components/FormatDialog/VersionHistory/index.d.ts +1 -0
  50. package/build/components/FormatDialog/index.d.ts +1 -0
  51. package/build/components/Header/Header.d.ts +15 -0
  52. package/build/components/Header/Header.styled.d.ts +5 -0
  53. package/build/components/Loader/Loader.d.ts +7 -0
  54. package/build/components/Loader/index.d.ts +1 -0
  55. package/build/components/NoResult/NoResult.d.ts +7 -0
  56. package/build/components/NoResult/index.d.ts +1 -0
  57. package/build/components/Result/AssetCard/AssetCard.d.ts +15 -0
  58. package/build/components/Result/AssetCard/AssetCard.styled.d.ts +2 -0
  59. package/build/components/Result/AssetCard/AssetCardWrapper.d.ts +18 -0
  60. package/build/components/Result/AssetCard/AssetCardWrapper.styled.d.ts +1 -0
  61. package/build/components/Result/AssetCard/index.d.ts +1 -0
  62. package/build/components/Result/AssetPreview/AssetPreview.d.ts +11 -0
  63. package/build/components/Result/AssetPreview/AssetPreview.styled.d.ts +1 -0
  64. package/build/components/Result/AssetPreview/ImagePreview/ImagePreview.d.ts +11 -0
  65. package/build/components/Result/AssetPreview/ImagePreview/index.d.ts +1 -0
  66. package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.d.ts +9 -0
  67. package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.d.ts +1 -0
  68. package/build/components/Result/AssetPreview/OtherPreview/index.d.ts +1 -0
  69. package/build/components/Result/AssetPreview/VideoPreview/VideoPreview.d.ts +11 -0
  70. package/build/components/Result/AssetPreview/VideoPreview/index.d.ts +1 -0
  71. package/build/components/Result/AssetPreview/index.d.ts +1 -0
  72. package/build/consts/asset.d.ts +14 -0
  73. package/build/consts/auth.d.ts +4 -0
  74. package/build/consts/data.d.ts +21 -0
  75. package/build/index.d.ts +229 -0
  76. package/build/index.html +1 -0
  77. package/build/page/Authenticate/Authenticate.d.ts +2 -0
  78. package/build/page/Authenticate/ConnectingBackground.d.ts +8 -0
  79. package/build/page/Authenticate/index.d.ts +2 -0
  80. package/build/page/Home/Home.d.ts +6 -0
  81. package/build/page/Home/Home.styled.d.ts +2 -0
  82. package/build/setupTests.d.ts +1 -0
  83. package/build/store/assets/assets.api.d.ts +66 -0
  84. package/build/store/assets/assets.service.d.ts +23 -0
  85. package/build/store/assets/assets.slice.d.ts +65 -0
  86. package/build/store/auth/auth.service.d.ts +10 -0
  87. package/build/store/auth/auth.slice.d.ts +76 -0
  88. package/build/store/index.d.ts +368 -0
  89. package/build/store/search/search.api.d.ts +39 -0
  90. package/build/store/search/search.slice.d.ts +12 -0
  91. package/build/store/user/user.api.d.ts +5 -0
  92. package/build/types/assets.d.ts +68 -0
  93. package/build/types/auth.d.ts +35 -0
  94. package/build/types/common.d.ts +11 -0
  95. package/build/types/download.d.ts +8 -0
  96. package/build/types/navigation.d.ts +3 -0
  97. package/build/types/search.d.ts +148 -0
  98. package/{src/types/storage.ts → build/types/storage.d.ts} +1 -1
  99. package/build/types/user.d.ts +7 -0
  100. package/build/utils/api.d.ts +27 -0
  101. package/build/utils/array.d.ts +13 -0
  102. package/build/utils/constants.d.ts +11 -0
  103. package/build/utils/function.d.ts +1 -0
  104. package/build/utils/getRequestUrl.d.ts +1 -0
  105. package/build/utils/hooks.d.ts +1 -0
  106. package/build/utils/icon.d.ts +3 -0
  107. package/build/utils/image.d.ts +24 -0
  108. package/build/utils/number.d.ts +4 -0
  109. package/build/utils/rotate.d.ts +4 -0
  110. package/build/utils/storage.d.ts +23 -0
  111. package/build/utils/string.d.ts +12 -0
  112. package/build/view/AssetsPicker.d.ts +6 -0
  113. package/package.json +49 -8
  114. package/.env +0 -1
  115. package/.eslintignore +0 -2
  116. package/.eslintrc.json +0 -82
  117. package/.releaserc +0 -17
  118. package/.travis.yml +0 -20
  119. package/CBSDKdemo.html +0 -315
  120. package/GitVersion.yml +0 -18
  121. package/azure-pipeline.yaml +0 -93
  122. package/clientlib.config.js +0 -36
  123. package/config/env.js +0 -105
  124. package/config/getHttpsConfig.js +0 -67
  125. package/config/jest/babelTransform.js +0 -30
  126. package/config/jest/cssTransform.js +0 -14
  127. package/config/jest/fileTransform.js +0 -41
  128. package/config/modules.js +0 -135
  129. package/config/paths.js +0 -79
  130. package/config/webpack/persistentCache/createEnvironmentHash.js +0 -10
  131. package/config/webpack.config.js +0 -762
  132. package/config/webpackDevServer.config.js +0 -128
  133. package/config-overrides.js +0 -8
  134. package/gab_extension/GAB.html +0 -85
  135. package/gab_extension/GoogleChrome/manifest.json +0 -28
  136. package/gab_extension/GoogleChrome/src/assets/icon48.png +0 -0
  137. package/gab_extension/GoogleChrome/src/background/index.js +0 -6
  138. package/gab_extension/GoogleChrome/src/scripts/index.js +0 -347
  139. package/gab_extension/MozillaFirefox/manifest.json +0 -20
  140. package/gab_extension/MozillaFirefox/src/assets/icon.png +0 -0
  141. package/gab_extension/MozillaFirefox/src/background/index.js +0 -5
  142. package/gab_extension/MozillaFirefox/src/scripts/index.js +0 -347
  143. package/gab_extension/README.md +0 -11
  144. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.pbxproj +0 -927
  145. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  146. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  147. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcuserdata/oldevmac01.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  148. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/xcuserdata/oldevmac01.xcuserdatad/xcschemes/xcschememanagement.plist +0 -19
  149. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
  150. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
  151. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/Contents.json +0 -6
  152. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -20
  153. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Base.lproj/Main.html +0 -23
  154. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Icon.png +0 -0
  155. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Script.js +0 -24
  156. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Style.css +0 -61
  157. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/ViewController.swift +0 -81
  158. package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (Extension)/SafariWebExtensionHandler.swift +0 -26
  159. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/AppDelegate.swift +0 -24
  160. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
  161. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/Main.storyboard +0 -38
  162. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Info.plist +0 -27
  163. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/SceneDelegate.swift +0 -18
  164. package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (Extension)/Info.plist +0 -13
  165. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/AppDelegate.swift +0 -21
  166. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Base.lproj/Main.storyboard +0 -125
  167. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Info.plist +0 -8
  168. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Orange DAM Asset Browser Extension.entitlements +0 -12
  169. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Info.plist +0 -13
  170. package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Orange DAM Asset Browser Extension.entitlements +0 -10
  171. package/public/index.html +0 -92
  172. package/scripts/build.js +0 -218
  173. package/scripts/start.js +0 -154
  174. package/scripts/test.js +0 -53
  175. package/src/App.tsx +0 -98
  176. package/src/AppContext.ts +0 -18
  177. package/src/GlobalConfigContext.ts +0 -46
  178. package/src/components/ArrayClamp/ArrayClamp.styled.ts +0 -42
  179. package/src/components/ArrayClamp/ArrayClamp.tsx +0 -167
  180. package/src/components/ArrayClamp/index.ts +0 -1
  181. package/src/components/Browser/Browser.styled.ts +0 -82
  182. package/src/components/Browser/Browser.tsx +0 -284
  183. package/src/components/Browser/BrowserItem.tsx +0 -98
  184. package/src/components/ControlBar/ControlBar.constants.tsx +0 -66
  185. package/src/components/ControlBar/ControlBar.styled.ts +0 -82
  186. package/src/components/ControlBar/ControlBar.tsx +0 -528
  187. package/src/components/ControlBar/Facet/Facet.tsx +0 -113
  188. package/src/components/ControlBar/Facet/index.ts +0 -1
  189. package/src/components/FormatDialog/CropPreviewer/CropPreviewer.tsx +0 -224
  190. package/src/components/FormatDialog/CustomRendition/CustomRendition.constants.ts +0 -24
  191. package/src/components/FormatDialog/CustomRendition/CustomRendition.styled.ts +0 -57
  192. package/src/components/FormatDialog/CustomRendition/CustomRendition.tsx +0 -178
  193. package/src/components/FormatDialog/CustomRendition/index.ts +0 -1
  194. package/src/components/FormatDialog/CustomRendition/transformations/Crop.tsx +0 -249
  195. package/src/components/FormatDialog/CustomRendition/transformations/Extension.tsx +0 -54
  196. package/src/components/FormatDialog/CustomRendition/transformations/Format.tsx +0 -86
  197. package/src/components/FormatDialog/CustomRendition/transformations/Resize.tsx +0 -176
  198. package/src/components/FormatDialog/CustomRendition/transformations/Rotate.tsx +0 -101
  199. package/src/components/FormatDialog/FormatDialog.styled.ts +0 -137
  200. package/src/components/FormatDialog/FormatDialog.tsx +0 -1533
  201. package/src/components/FormatDialog/Previewer/Previewer.styled.ts +0 -31
  202. package/src/components/FormatDialog/Previewer/Previewer.tsx +0 -143
  203. package/src/components/FormatDialog/Previewer/index.ts +0 -1
  204. package/src/components/FormatDialog/ProxyMenu/ProxyMenu.styled.ts +0 -88
  205. package/src/components/FormatDialog/ProxyMenu/ProxyMenu.tsx +0 -74
  206. package/src/components/FormatDialog/ProxyMenu/index.ts +0 -1
  207. package/src/components/FormatDialog/TrackingParameters/TrackingParameters.tsx +0 -59
  208. package/src/components/FormatDialog/TrackingParameters/index.ts +0 -1
  209. package/src/components/FormatDialog/index.ts +0 -1
  210. package/src/components/Header/Header.styled.ts +0 -51
  211. package/src/components/Header/Header.tsx +0 -118
  212. package/src/components/Loader/Loader.tsx +0 -37
  213. package/src/components/Loader/index.ts +0 -1
  214. package/src/components/NoResult/NoResult.tsx +0 -37
  215. package/src/components/NoResult/index.tsx +0 -1
  216. package/src/components/Result/AssetCard/AssetCard.styled.ts +0 -120
  217. package/src/components/Result/AssetCard/AssetCard.tsx +0 -192
  218. package/src/components/Result/AssetCard/AssetCardWrapper.styled.ts +0 -35
  219. package/src/components/Result/AssetCard/AssetCardWrapper.tsx +0 -165
  220. package/src/components/Result/AssetCard/index.ts +0 -1
  221. package/src/components/Result/AssetPreview/AssetPreview.styled.ts +0 -108
  222. package/src/components/Result/AssetPreview/AssetPreview.tsx +0 -78
  223. package/src/components/Result/AssetPreview/ImagePreview/ImagePreview.tsx +0 -42
  224. package/src/components/Result/AssetPreview/ImagePreview/index.ts +0 -1
  225. package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.ts +0 -23
  226. package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.tsx +0 -28
  227. package/src/components/Result/AssetPreview/OtherPreview/index.ts +0 -1
  228. package/src/components/Result/AssetPreview/VideoPreview/VideoPreview.tsx +0 -132
  229. package/src/components/Result/AssetPreview/VideoPreview/index.ts +0 -1
  230. package/src/components/Result/AssetPreview/index.ts +0 -1
  231. package/src/consts/asset.ts +0 -16
  232. package/src/consts/data.ts +0 -17
  233. package/src/index.tsx +0 -305
  234. package/src/page/Authenticate/Authenticate.tsx +0 -232
  235. package/src/page/Authenticate/ConnectingBackground.tsx +0 -44
  236. package/src/page/Authenticate/index.tsx +0 -94
  237. package/src/page/Home/Home.styled.ts +0 -46
  238. package/src/page/Home/Home.tsx +0 -941
  239. package/src/react-web-component.d.ts +0 -4617
  240. package/src/store/assets/assets.api.ts +0 -167
  241. package/src/store/assets/assets.service.ts +0 -223
  242. package/src/store/assets/assets.slice.ts +0 -104
  243. package/src/store/auth/auth.service.ts +0 -71
  244. package/src/store/auth/auth.slice.ts +0 -295
  245. package/src/store/index.ts +0 -27
  246. package/src/store/search/search.api.ts +0 -319
  247. package/src/store/search/search.slice.ts +0 -28
  248. package/src/store/user/user.api.ts +0 -29
  249. package/src/styles.css +0 -42
  250. package/src/types/assets.ts +0 -71
  251. package/src/types/auth.ts +0 -42
  252. package/src/types/common.ts +0 -11
  253. package/src/types/download.ts +0 -8
  254. package/src/types/navigation.ts +0 -3
  255. package/src/types/search.ts +0 -116
  256. package/src/types/user.ts +0 -6
  257. package/src/utils/api.ts +0 -186
  258. package/src/utils/array.ts +0 -25
  259. package/src/utils/constants.ts +0 -12
  260. package/src/utils/fetch.ts +0 -116
  261. package/src/utils/getRequestUrl.ts +0 -15
  262. package/src/utils/hooks.ts +0 -36
  263. package/src/utils/icon.ts +0 -22
  264. package/src/utils/image.ts +0 -157
  265. package/src/utils/number.ts +0 -11
  266. package/src/utils/rotate.ts +0 -23
  267. package/src/utils/storage.ts +0 -184
  268. package/src/utils/string.ts +0 -24
  269. package/src/view/AssetsPicker.tsx +0 -24
  270. package/src/web-component.d.ts +0 -8151
  271. package/tsconfig.eslint.json +0 -10
  272. package/tsconfig.json +0 -37
  273. /package/{src/components/Browser/index.ts → build/components/Browser/index.d.ts} +0 -0
  274. /package/{src/components/ControlBar/index.ts → build/components/ControlBar/index.d.ts} +0 -0
  275. /package/{src/components/Header/index.ts → build/components/Header/index.d.ts} +0 -0
  276. /package/{public → build}/favicon.ico +0 -0
  277. /package/{public → build}/logo192.png +0 -0
  278. /package/{public → build}/logo512.png +0 -0
  279. /package/{public → build}/manifest.json +0 -0
  280. /package/{src/page/Home/index.ts → build/page/Home/index.d.ts} +0 -0
  281. /package/{public → build}/robots.txt +0 -0
@@ -1,67 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
-
4
- const fs = require('fs');
5
- const path = require('path');
6
- const crypto = require('crypto');
7
- const chalk = require('react-dev-utils/chalk');
8
- const paths = require('./paths');
9
-
10
- // Ensure the certificate and key provided are valid and if not
11
- // throw an easy to debug error
12
- function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
13
- let encrypted;
14
- try {
15
- // publicEncrypt will throw an error with an invalid cert
16
- encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
17
- } catch (err) {
18
- throw new Error(
19
- `The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`,
20
- );
21
- }
22
-
23
- try {
24
- // privateDecrypt will throw an error with an invalid key
25
- crypto.privateDecrypt(key, encrypted);
26
- } catch (err) {
27
- throw new Error(
28
- `The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
29
- err.message
30
- }`,
31
- );
32
- }
33
- }
34
-
35
- // Read file and throw an error if it doesn't exist
36
- function readEnvFile(file, type) {
37
- if (!fs.existsSync(file)) {
38
- throw new Error(
39
- `You specified ${chalk.cyan(
40
- type,
41
- )} in your env, but the file "${chalk.yellow(file)}" can't be found.`,
42
- );
43
- }
44
- return fs.readFileSync(file);
45
- }
46
-
47
- // Get the https config
48
- // Return cert files if provided in env, otherwise just true or false
49
- function getHttpsConfig() {
50
- const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
51
- const isHttps = HTTPS === 'true';
52
-
53
- if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
54
- const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
55
- const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
56
- const config = {
57
- cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
58
- key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
59
- };
60
-
61
- validateKeyAndCerts({ ...config, keyFile, crtFile });
62
- return config;
63
- }
64
- return isHttps;
65
- }
66
-
67
- module.exports = getHttpsConfig;
@@ -1,30 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
-
4
- const babelJest = require('babel-jest').default;
5
-
6
- const hasJsxRuntime = (() => {
7
- if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
8
- return false;
9
- }
10
-
11
- try {
12
- require.resolve('react/jsx-runtime');
13
- return true;
14
- } catch (e) {
15
- return false;
16
- }
17
- })();
18
-
19
- module.exports = babelJest.createTransformer({
20
- presets: [
21
- [
22
- require.resolve('babel-preset-react-app'),
23
- {
24
- runtime: hasJsxRuntime ? 'automatic' : 'classic',
25
- },
26
- ],
27
- ],
28
- babelrc: false,
29
- configFile: false,
30
- });
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- // This is a custom Jest transformer turning style imports into empty objects.
4
- // http://facebook.github.io/jest/docs/en/webpack.html
5
-
6
- module.exports = {
7
- process() {
8
- return 'module.exports = {};';
9
- },
10
- getCacheKey() {
11
- // The output is always the same.
12
- return 'cssTransform';
13
- },
14
- };
@@ -1,41 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
-
4
- const path = require('path');
5
- const camelcase = require('camelcase');
6
-
7
- // This is a custom Jest transformer turning file imports into filenames.
8
- // http://facebook.github.io/jest/docs/en/webpack.html
9
-
10
- module.exports = {
11
- process(src, filename) {
12
- const assetFilename = JSON.stringify(path.basename(filename));
13
-
14
- if (filename.match(/\.svg$/)) {
15
- // Based on how SVGR generates a component name:
16
- // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
17
- const pascalCaseFilename = camelcase(path.parse(filename).name, {
18
- pascalCase: true,
19
- });
20
- const componentName = `Svg${pascalCaseFilename}`;
21
- return `const React = require('react');
22
- module.exports = {
23
- __esModule: true,
24
- default: ${assetFilename},
25
- ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
26
- return {
27
- $$typeof: Symbol.for('react.element'),
28
- type: 'svg',
29
- ref: ref,
30
- key: null,
31
- props: Object.assign({}, props, {
32
- children: ${assetFilename}
33
- })
34
- };
35
- }),
36
- };`;
37
- }
38
-
39
- return `module.exports = ${assetFilename};`;
40
- },
41
- };
package/config/modules.js DELETED
@@ -1,135 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
-
4
- const fs = require('fs');
5
- const path = require('path');
6
- const paths = require('./paths');
7
- const chalk = require('react-dev-utils/chalk');
8
- const resolve = require('resolve');
9
-
10
- /**
11
- * Get additional module paths based on the baseUrl of a compilerOptions object.
12
- *
13
- * @param {Object} options
14
- */
15
- function getAdditionalModulePaths(options = {}) {
16
- const baseUrl = options.baseUrl;
17
-
18
- if (!baseUrl) {
19
- return '';
20
- }
21
-
22
- const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
23
-
24
- // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
25
- // the default behavior.
26
- if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
27
- return null;
28
- }
29
-
30
- // Allow the user set the `baseUrl` to `appSrc`.
31
- if (path.relative(paths.appSrc, baseUrlResolved) === '') {
32
- return [paths.appSrc];
33
- }
34
-
35
- // If the path is equal to the root directory we ignore it here.
36
- // We don't want to allow importing from the root directly as source files are
37
- // not transpiled outside of `src`. We do allow importing them with the
38
- // absolute path (e.g. `src/Components/Button.js`) but we set that up with
39
- // an alias.
40
- if (path.relative(paths.appPath, baseUrlResolved) === '') {
41
- return null;
42
- }
43
-
44
- // Otherwise, throw an error.
45
- throw new Error(
46
- chalk.red.bold(
47
- "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
48
- ' Create React App does not support other values at this time.',
49
- ),
50
- );
51
- }
52
-
53
- /**
54
- * Get webpack aliases based on the baseUrl of a compilerOptions object.
55
- *
56
- * @param {*} options
57
- */
58
- function getWebpackAliases(options = {}) {
59
- const baseUrl = options.baseUrl;
60
-
61
- if (!baseUrl) {
62
- return {};
63
- }
64
-
65
- const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
66
-
67
- if (path.relative(paths.appPath, baseUrlResolved) === '') {
68
- return {
69
- src: paths.appSrc,
70
- };
71
- }
72
- }
73
-
74
- /**
75
- * Get jest aliases based on the baseUrl of a compilerOptions object.
76
- *
77
- * @param {*} options
78
- */
79
- function getJestAliases(options = {}) {
80
- const baseUrl = options.baseUrl;
81
-
82
- if (!baseUrl) {
83
- return {};
84
- }
85
-
86
- const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
87
-
88
- if (path.relative(paths.appPath, baseUrlResolved) === '') {
89
- return {
90
- '^src/(.*)$': '<rootDir>/src/$1',
91
- };
92
- }
93
- }
94
-
95
- function getModules() {
96
- // Check if TypeScript is setup
97
- const hasTsConfig = fs.existsSync(paths.appTsConfig);
98
- const hasJsConfig = fs.existsSync(paths.appJsConfig);
99
-
100
- if (hasTsConfig && hasJsConfig) {
101
- throw new Error(
102
- 'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.',
103
- );
104
- }
105
-
106
- let config;
107
-
108
- // If there's a tsconfig.json we assume it's a
109
- // TypeScript project and set up the config
110
- // based on tsconfig.json
111
- if (hasTsConfig) {
112
- const ts = require(resolve.sync('typescript', {
113
- basedir: paths.appNodeModules,
114
- }));
115
- config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
116
- // Otherwise we'll check if there is jsconfig.json
117
- // for non TS projects.
118
- } else if (hasJsConfig) {
119
- config = require(paths.appJsConfig);
120
- }
121
-
122
- config = config || {};
123
- const options = config.compilerOptions || {};
124
-
125
- const additionalModulePaths = getAdditionalModulePaths(options);
126
-
127
- return {
128
- additionalModulePaths: additionalModulePaths,
129
- webpackAliases: getWebpackAliases(options),
130
- jestAliases: getJestAliases(options),
131
- hasTsConfig,
132
- };
133
- }
134
-
135
- module.exports = getModules();
package/config/paths.js DELETED
@@ -1,79 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
-
4
- const path = require('path');
5
- const fs = require('fs');
6
- const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
7
-
8
- // Make sure any symlinks in the project folder are resolved:
9
- // https://github.com/facebook/create-react-app/issues/637
10
- const appDirectory = fs.realpathSync(process.cwd());
11
- const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
12
-
13
- // We use `PUBLIC_URL` environment variable or "homepage" field to infer
14
- // "public path" at which the app is served.
15
- // webpack needs to know it to put the right <script> hrefs into HTML even in
16
- // single-page apps that may serve index.html for nested URLs like /todos/42.
17
- // We can't use a relative path in HTML because we don't want to load something
18
- // like /todos/42/static/js/bundle.7289d.js. We have to know the root.
19
- const publicUrlOrPath = getPublicUrlOrPath(
20
- process.env.NODE_ENV === 'development',
21
- require(resolveApp('package.json')).homepage,
22
- process.env.PUBLIC_URL,
23
- );
24
-
25
- const buildPath = process.env.BUILD_PATH || 'build';
26
-
27
- const moduleFileExtensions = [
28
- 'web.mjs',
29
- 'mjs',
30
- 'web.js',
31
- 'js',
32
- 'web.ts',
33
- 'ts',
34
- 'web.tsx',
35
- 'tsx',
36
- 'json',
37
- 'web.jsx',
38
- 'jsx',
39
- ];
40
-
41
- // Resolve file paths in the same order as webpack
42
- const resolveModule = (resolveFn, filePath) => {
43
- // eslint-disable-next-line @typescript-eslint/no-shadow
44
- const extension = moduleFileExtensions.find(extension =>
45
- fs.existsSync(resolveFn(`${filePath}.${extension}`)),
46
- );
47
-
48
- if (extension) {
49
- return resolveFn(`${filePath}.${extension}`);
50
- }
51
-
52
- return resolveFn(`${filePath}.js`);
53
- };
54
-
55
- // config after eject: we're in ./config/
56
- module.exports = {
57
- dotenv: resolveApp('.env'),
58
- appPath: resolveApp('.'),
59
- appBuild: resolveApp(buildPath),
60
- appPublic: resolveApp('public'),
61
- appHtml: resolveApp('public/index.html'),
62
- appIndexJs: resolveModule(resolveApp, 'src/index'),
63
- appPackageJson: resolveApp('package.json'),
64
- appSrc: resolveApp('src'),
65
- appTsConfig: resolveApp('tsconfig.json'),
66
- appJsConfig: resolveApp('jsconfig.json'),
67
- yarnLockFile: resolveApp('yarn.lock'),
68
- testsSetup: resolveModule(resolveApp, 'src/setupTests'),
69
- proxySetup: resolveApp('src/setupProxy.js'),
70
- appNodeModules: resolveApp('node_modules'),
71
- appWebpackCache: resolveApp('node_modules/.cache'),
72
- appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
73
- swSrc: resolveModule(resolveApp, 'src/service-worker'),
74
- publicUrlOrPath,
75
- };
76
-
77
-
78
-
79
- module.exports.moduleFileExtensions = moduleFileExtensions;
@@ -1,10 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- 'use strict';
3
- const { createHash } = require('crypto');
4
-
5
- module.exports = env => {
6
- const hash = createHash('md5');
7
- hash.update(JSON.stringify(env));
8
-
9
- return hash.digest('hex');
10
- };