@orangelogic/orange-dam-content-browser-sdk 2.1.54 → 2.1.55
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/build/ApiService.d.ts +15 -0
- package/build/App.d.ts +62 -0
- package/build/AppContext.d.ts +18 -0
- package/build/GlobalConfigContext.d.ts +32 -0
- package/build/OrangeDAMContentBrowserSDK.min.css +2 -0
- package/build/OrangeDAMContentBrowserSDK.min.css.map +1 -0
- package/build/OrangeDAMContentBrowserSDK.min.js +11468 -0
- package/build/OrangeDAMContentBrowserSDK.min.js.map +1 -0
- package/build/asset-manifest.json +13 -0
- package/build/components/ArrayClamp/ArrayClamp.d.ts +10 -0
- package/build/components/ArrayClamp/ArrayClamp.styled.d.ts +1 -0
- package/build/components/ArrayClamp/index.d.ts +1 -0
- package/build/components/Browser/Browser.constants.d.ts +3 -0
- package/build/components/Browser/Browser.d.ts +21 -0
- package/build/components/Browser/Browser.styled.d.ts +2 -0
- package/build/components/Browser/BrowserItem.d.ts +13 -0
- package/build/components/Browser/LoadMoreButton.d.ts +9 -0
- package/build/components/ControlBar/ControlBar.constants.d.ts +10 -0
- package/build/components/ControlBar/ControlBar.d.ts +23 -0
- package/build/components/ControlBar/ControlBar.styled.d.ts +1 -0
- package/build/components/ControlBar/Facet/Facet.d.ts +14 -0
- package/build/components/ControlBar/Facet/index.d.ts +1 -0
- package/build/components/FormatDialog/CropPreviewer/CropPreviewer.d.ts +41 -0
- package/{src/components/FormatDialog/CropPreviewer/index.ts → build/components/FormatDialog/CropPreviewer/index.d.ts} +1 -1
- package/build/components/FormatDialog/CustomRendition/CustomRendition.constants.d.ts +5 -0
- package/build/components/FormatDialog/CustomRendition/CustomRendition.d.ts +56 -0
- package/build/components/FormatDialog/CustomRendition/CustomRendition.styled.d.ts +1 -0
- package/build/components/FormatDialog/CustomRendition/index.d.ts +1 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Crop.d.ts +26 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Extension.d.ts +11 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Format.d.ts +10 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Metadata.d.ts +7 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Quality.d.ts +7 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Resize.d.ts +18 -0
- package/build/components/FormatDialog/CustomRendition/transformations/Rotate.d.ts +8 -0
- package/{src/components/FormatDialog/CustomRendition/transformations/index.ts → build/components/FormatDialog/CustomRendition/transformations/index.d.ts} +3 -1
- package/build/components/FormatDialog/FormatDialog.d.ts +49 -0
- package/build/components/FormatDialog/FormatDialog.styled.d.ts +3 -0
- package/build/components/FormatDialog/Previewer/Previewer.d.ts +17 -0
- package/build/components/FormatDialog/Previewer/Previewer.styled.d.ts +1 -0
- package/build/components/FormatDialog/Previewer/index.d.ts +1 -0
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.d.ts +20 -0
- package/build/components/FormatDialog/ProxyMenu/ProxyMenu.styled.d.ts +2 -0
- package/build/components/FormatDialog/ProxyMenu/index.d.ts +1 -0
- package/build/components/FormatDialog/TrackingParameters/TrackingParameters.d.ts +13 -0
- package/build/components/FormatDialog/TrackingParameters/index.d.ts +1 -0
- package/build/components/FormatDialog/VersionHistory/VersionHistory.d.ts +6 -0
- package/build/components/FormatDialog/VersionHistory/VersionHistory.styled.d.ts +1 -0
- package/build/components/FormatDialog/VersionHistory/index.d.ts +1 -0
- package/build/components/FormatDialog/index.d.ts +1 -0
- package/build/components/Header/Header.d.ts +15 -0
- package/build/components/Header/Header.styled.d.ts +5 -0
- package/build/components/Loader/Loader.d.ts +7 -0
- package/build/components/Loader/index.d.ts +1 -0
- package/build/components/NoResult/NoResult.d.ts +7 -0
- package/build/components/NoResult/index.d.ts +1 -0
- package/build/components/Result/AssetCard/AssetCard.d.ts +15 -0
- package/build/components/Result/AssetCard/AssetCard.styled.d.ts +2 -0
- package/build/components/Result/AssetCard/AssetCardWrapper.d.ts +18 -0
- package/build/components/Result/AssetCard/AssetCardWrapper.styled.d.ts +1 -0
- package/build/components/Result/AssetCard/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/AssetPreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/AssetPreview.styled.d.ts +1 -0
- package/build/components/Result/AssetPreview/ImagePreview/ImagePreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/ImagePreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.d.ts +9 -0
- package/build/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.d.ts +1 -0
- package/build/components/Result/AssetPreview/OtherPreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/VideoPreview/VideoPreview.d.ts +11 -0
- package/build/components/Result/AssetPreview/VideoPreview/index.d.ts +1 -0
- package/build/components/Result/AssetPreview/index.d.ts +1 -0
- package/build/consts/asset.d.ts +14 -0
- package/build/consts/auth.d.ts +4 -0
- package/build/consts/data.d.ts +21 -0
- package/build/index.d.ts +225 -0
- package/build/index.html +1 -0
- package/build/page/Authenticate/Authenticate.d.ts +2 -0
- package/build/page/Authenticate/ConnectingBackground.d.ts +8 -0
- package/build/page/Authenticate/index.d.ts +2 -0
- package/build/page/Home/Home.d.ts +6 -0
- package/build/page/Home/Home.styled.d.ts +2 -0
- package/build/setupTests.d.ts +1 -0
- package/build/store/assets/assets.api.d.ts +66 -0
- package/build/store/assets/assets.service.d.ts +23 -0
- package/build/store/assets/assets.slice.d.ts +65 -0
- package/build/store/auth/auth.service.d.ts +10 -0
- package/build/store/auth/auth.slice.d.ts +76 -0
- package/build/store/index.d.ts +368 -0
- package/build/store/search/search.api.d.ts +39 -0
- package/build/store/search/search.slice.d.ts +12 -0
- package/build/store/user/user.api.d.ts +5 -0
- package/build/types/assets.d.ts +68 -0
- package/build/types/auth.d.ts +35 -0
- package/build/types/common.d.ts +11 -0
- package/build/types/download.d.ts +8 -0
- package/build/types/navigation.d.ts +3 -0
- package/build/types/search.d.ts +148 -0
- package/{src/types/storage.ts → build/types/storage.d.ts} +1 -1
- package/build/types/user.d.ts +7 -0
- package/build/utils/api.d.ts +27 -0
- package/build/utils/array.d.ts +13 -0
- package/build/utils/constants.d.ts +11 -0
- package/build/utils/function.d.ts +1 -0
- package/build/utils/getRequestUrl.d.ts +1 -0
- package/build/utils/hooks.d.ts +1 -0
- package/build/utils/icon.d.ts +3 -0
- package/build/utils/image.d.ts +24 -0
- package/build/utils/number.d.ts +4 -0
- package/build/utils/rotate.d.ts +4 -0
- package/build/utils/storage.d.ts +23 -0
- package/build/utils/string.d.ts +12 -0
- package/build/view/AssetsPicker.d.ts +6 -0
- package/package.json +49 -8
- package/.env +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -82
- package/.releaserc +0 -17
- package/.travis.yml +0 -20
- package/CBSDKdemo.html +0 -315
- package/GitVersion.yml +0 -18
- package/azure-pipeline.yaml +0 -93
- package/clientlib.config.js +0 -36
- package/config/env.js +0 -105
- package/config/getHttpsConfig.js +0 -67
- package/config/jest/babelTransform.js +0 -30
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -41
- package/config/modules.js +0 -135
- package/config/paths.js +0 -79
- package/config/webpack/persistentCache/createEnvironmentHash.js +0 -10
- package/config/webpack.config.js +0 -762
- package/config/webpackDevServer.config.js +0 -128
- package/config-overrides.js +0 -8
- package/gab_extension/GAB.html +0 -85
- package/gab_extension/GoogleChrome/manifest.json +0 -28
- package/gab_extension/GoogleChrome/src/assets/icon48.png +0 -0
- package/gab_extension/GoogleChrome/src/background/index.js +0 -6
- package/gab_extension/GoogleChrome/src/scripts/index.js +0 -347
- package/gab_extension/MozillaFirefox/manifest.json +0 -20
- package/gab_extension/MozillaFirefox/src/assets/icon.png +0 -0
- package/gab_extension/MozillaFirefox/src/background/index.js +0 -5
- package/gab_extension/MozillaFirefox/src/scripts/index.js +0 -347
- package/gab_extension/README.md +0 -11
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.pbxproj +0 -927
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/project.xcworkspace/xcuserdata/oldevmac01.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Orange DAM Asset Browser Extension.xcodeproj/xcuserdata/oldevmac01.xcuserdatad/xcschemes/xcschememanagement.plist +0 -19
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/Contents.json +0 -6
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -20
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Base.lproj/Main.html +0 -23
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Icon.png +0 -0
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Script.js +0 -24
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/Resources/Style.css +0 -61
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (App)/ViewController.swift +0 -81
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/Shared (Extension)/SafariWebExtensionHandler.swift +0 -26
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/AppDelegate.swift +0 -24
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Base.lproj/Main.storyboard +0 -38
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/Info.plist +0 -27
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (App)/SceneDelegate.swift +0 -18
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/iOS (Extension)/Info.plist +0 -13
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/AppDelegate.swift +0 -21
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Base.lproj/Main.storyboard +0 -125
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Info.plist +0 -8
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (App)/Orange DAM Asset Browser Extension.entitlements +0 -12
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Info.plist +0 -13
- package/gab_extension/Safari/Orange DAM Asset Browser Extension/macOS (Extension)/Orange DAM Asset Browser Extension.entitlements +0 -10
- package/public/index.html +0 -92
- package/scripts/build.js +0 -218
- package/scripts/start.js +0 -154
- package/scripts/test.js +0 -53
- package/src/App.tsx +0 -98
- package/src/AppContext.ts +0 -18
- package/src/GlobalConfigContext.ts +0 -46
- package/src/components/ArrayClamp/ArrayClamp.styled.ts +0 -42
- package/src/components/ArrayClamp/ArrayClamp.tsx +0 -167
- package/src/components/ArrayClamp/index.ts +0 -1
- package/src/components/Browser/Browser.styled.ts +0 -82
- package/src/components/Browser/Browser.tsx +0 -284
- package/src/components/Browser/BrowserItem.tsx +0 -98
- package/src/components/ControlBar/ControlBar.constants.tsx +0 -66
- package/src/components/ControlBar/ControlBar.styled.ts +0 -82
- package/src/components/ControlBar/ControlBar.tsx +0 -528
- package/src/components/ControlBar/Facet/Facet.tsx +0 -113
- package/src/components/ControlBar/Facet/index.ts +0 -1
- package/src/components/FormatDialog/CropPreviewer/CropPreviewer.tsx +0 -224
- package/src/components/FormatDialog/CustomRendition/CustomRendition.constants.ts +0 -24
- package/src/components/FormatDialog/CustomRendition/CustomRendition.styled.ts +0 -57
- package/src/components/FormatDialog/CustomRendition/CustomRendition.tsx +0 -178
- package/src/components/FormatDialog/CustomRendition/index.ts +0 -1
- package/src/components/FormatDialog/CustomRendition/transformations/Crop.tsx +0 -249
- package/src/components/FormatDialog/CustomRendition/transformations/Extension.tsx +0 -54
- package/src/components/FormatDialog/CustomRendition/transformations/Format.tsx +0 -86
- package/src/components/FormatDialog/CustomRendition/transformations/Resize.tsx +0 -176
- package/src/components/FormatDialog/CustomRendition/transformations/Rotate.tsx +0 -101
- package/src/components/FormatDialog/FormatDialog.styled.ts +0 -137
- package/src/components/FormatDialog/FormatDialog.tsx +0 -1533
- package/src/components/FormatDialog/Previewer/Previewer.styled.ts +0 -31
- package/src/components/FormatDialog/Previewer/Previewer.tsx +0 -143
- package/src/components/FormatDialog/Previewer/index.ts +0 -1
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.styled.ts +0 -88
- package/src/components/FormatDialog/ProxyMenu/ProxyMenu.tsx +0 -74
- package/src/components/FormatDialog/ProxyMenu/index.ts +0 -1
- package/src/components/FormatDialog/TrackingParameters/TrackingParameters.tsx +0 -59
- package/src/components/FormatDialog/TrackingParameters/index.ts +0 -1
- package/src/components/FormatDialog/index.ts +0 -1
- package/src/components/Header/Header.styled.ts +0 -51
- package/src/components/Header/Header.tsx +0 -118
- package/src/components/Loader/Loader.tsx +0 -37
- package/src/components/Loader/index.ts +0 -1
- package/src/components/NoResult/NoResult.tsx +0 -37
- package/src/components/NoResult/index.tsx +0 -1
- package/src/components/Result/AssetCard/AssetCard.styled.ts +0 -120
- package/src/components/Result/AssetCard/AssetCard.tsx +0 -192
- package/src/components/Result/AssetCard/AssetCardWrapper.styled.ts +0 -35
- package/src/components/Result/AssetCard/AssetCardWrapper.tsx +0 -165
- package/src/components/Result/AssetCard/index.ts +0 -1
- package/src/components/Result/AssetPreview/AssetPreview.styled.ts +0 -108
- package/src/components/Result/AssetPreview/AssetPreview.tsx +0 -78
- package/src/components/Result/AssetPreview/ImagePreview/ImagePreview.tsx +0 -42
- package/src/components/Result/AssetPreview/ImagePreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.styled.ts +0 -23
- package/src/components/Result/AssetPreview/OtherPreview/OtherPreview.tsx +0 -28
- package/src/components/Result/AssetPreview/OtherPreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/VideoPreview/VideoPreview.tsx +0 -132
- package/src/components/Result/AssetPreview/VideoPreview/index.ts +0 -1
- package/src/components/Result/AssetPreview/index.ts +0 -1
- package/src/consts/asset.ts +0 -16
- package/src/consts/data.ts +0 -17
- package/src/index.tsx +0 -305
- package/src/page/Authenticate/Authenticate.tsx +0 -232
- package/src/page/Authenticate/ConnectingBackground.tsx +0 -44
- package/src/page/Authenticate/index.tsx +0 -94
- package/src/page/Home/Home.styled.ts +0 -46
- package/src/page/Home/Home.tsx +0 -941
- package/src/react-web-component.d.ts +0 -4617
- package/src/store/assets/assets.api.ts +0 -167
- package/src/store/assets/assets.service.ts +0 -223
- package/src/store/assets/assets.slice.ts +0 -104
- package/src/store/auth/auth.service.ts +0 -71
- package/src/store/auth/auth.slice.ts +0 -295
- package/src/store/index.ts +0 -27
- package/src/store/search/search.api.ts +0 -319
- package/src/store/search/search.slice.ts +0 -28
- package/src/store/user/user.api.ts +0 -29
- package/src/styles.css +0 -42
- package/src/types/assets.ts +0 -71
- package/src/types/auth.ts +0 -42
- package/src/types/common.ts +0 -11
- package/src/types/download.ts +0 -8
- package/src/types/navigation.ts +0 -3
- package/src/types/search.ts +0 -116
- package/src/types/user.ts +0 -6
- package/src/utils/api.ts +0 -186
- package/src/utils/array.ts +0 -25
- package/src/utils/constants.ts +0 -12
- package/src/utils/fetch.ts +0 -116
- package/src/utils/getRequestUrl.ts +0 -15
- package/src/utils/hooks.ts +0 -36
- package/src/utils/icon.ts +0 -22
- package/src/utils/image.ts +0 -157
- package/src/utils/number.ts +0 -11
- package/src/utils/rotate.ts +0 -23
- package/src/utils/storage.ts +0 -184
- package/src/utils/string.ts +0 -24
- package/src/view/AssetsPicker.tsx +0 -24
- package/src/web-component.d.ts +0 -8151
- package/tsconfig.eslint.json +0 -10
- package/tsconfig.json +0 -37
- /package/{src/components/Browser/index.ts → build/components/Browser/index.d.ts} +0 -0
- /package/{src/components/ControlBar/index.ts → build/components/ControlBar/index.d.ts} +0 -0
- /package/{src/components/Header/index.ts → build/components/Header/index.d.ts} +0 -0
- /package/{public → build}/favicon.ico +0 -0
- /package/{public → build}/logo192.png +0 -0
- /package/{public → build}/logo512.png +0 -0
- /package/{public → build}/manifest.json +0 -0
- /package/{src/page/Home/index.ts → build/page/Home/index.d.ts} +0 -0
- /package/{public → build}/robots.txt +0 -0
package/config/getHttpsConfig.js
DELETED
|
@@ -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;
|