@mapcomponents/deck-gl 0.0.7

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 (129) hide show
  1. package/.babelrc +22 -0
  2. package/.editorconfig +19 -0
  3. package/.eslintignore +12 -0
  4. package/.eslintrc.js +30 -0
  5. package/.prettierignore +11 -0
  6. package/.prettierrc.json +6 -0
  7. package/.storybook/.babelrc +26 -0
  8. package/.storybook/main.js +40 -0
  9. package/.storybook/manager.js +6 -0
  10. package/.storybook/mapcomponents_logo.png +0 -0
  11. package/.storybook/preview.js +33 -0
  12. package/.storybook/style.css +15 -0
  13. package/.storybook/wheregroupTheme.js +9 -0
  14. package/CHANGELOG.md +1 -0
  15. package/LICENSE +21 -0
  16. package/README.md +1 -0
  17. package/config/env.js +106 -0
  18. package/config/jest/babelTransform.js +29 -0
  19. package/config/jest/cssTransform.js +14 -0
  20. package/config/jest/fileTransform.js +40 -0
  21. package/config/paths.js +75 -0
  22. package/coverage/clover.xml +6 -0
  23. package/coverage/coverage-final.json +1 -0
  24. package/coverage/lcov-report/base.css +224 -0
  25. package/coverage/lcov-report/block-navigation.js +87 -0
  26. package/coverage/lcov-report/favicon.png +0 -0
  27. package/coverage/lcov-report/index.html +101 -0
  28. package/coverage/lcov-report/prettify.css +1 -0
  29. package/coverage/lcov-report/prettify.js +2 -0
  30. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  31. package/coverage/lcov-report/sorter.js +196 -0
  32. package/coverage/lcov.info +0 -0
  33. package/cypress/support/commands.ts +37 -0
  34. package/cypress/support/component-index.html +12 -0
  35. package/cypress/support/component.ts +46 -0
  36. package/cypress.config.ts +101 -0
  37. package/dist/components/MlHexagonMap/MlHexagonMap.d.ts +19 -0
  38. package/dist/components/MlHexagonMap/MlHexagonMap.stories.d.ts +14 -0
  39. package/dist/contexts/DeckGlContext.d.ts +15 -0
  40. package/dist/decorators/MapContextDecorator.d.ts +2 -0
  41. package/dist/hooks/useDeckGl.d.ts +7 -0
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.esm.js +105 -0
  44. package/dist/index.esm.js.map +1 -0
  45. package/dist/setupTests.d.ts +13 -0
  46. package/dist/stories/components/Readme.d.ts +2 -0
  47. package/dist/util/BubbleForInstructions.d.ts +2 -0
  48. package/dist/util/Instructions.d.ts +14 -0
  49. package/dist/util/index.d.ts +3 -0
  50. package/dist/util/layerRemovalTest.d.ts +2 -0
  51. package/dist/util/sourceRemovalTest.d.ts +2 -0
  52. package/eslintErrorTest.js +10 -0
  53. package/package.json +199 -0
  54. package/public/assets/3D/godzilla_simple.glb +0 -0
  55. package/public/assets/3D/hexa.json +4 -0
  56. package/public/assets/3D/laerm_points.json +1 -0
  57. package/public/assets/dop.png +0 -0
  58. package/public/assets/historic.png +0 -0
  59. package/public/assets/marker.png +0 -0
  60. package/public/assets/osm.png +0 -0
  61. package/public/assets/sample.gpx +716 -0
  62. package/public/assets/sample1.gpx +3003 -0
  63. package/public/assets/sample2.gpx +1264 -0
  64. package/public/assets/sample3.gpx +912 -0
  65. package/public/assets/wg-marker.png +0 -0
  66. package/public/catalogue/.gitkeep +0 -0
  67. package/public/catalogue/mc_meta.json +1 -0
  68. package/public/favicon.ico +0 -0
  69. package/public/index.html +39 -0
  70. package/public/logo.png +0 -0
  71. package/public/manifest.json +25 -0
  72. package/public/robots.txt +3 -0
  73. package/public/thumbnails/MapLibreMap.png +0 -0
  74. package/public/thumbnails/MlCameraFollowPath.png +0 -0
  75. package/public/thumbnails/MlCreatePdfButton.png +0 -0
  76. package/public/thumbnails/MlCreatePdfForm.png +0 -0
  77. package/public/thumbnails/MlDeckGlLayer.png +0 -0
  78. package/public/thumbnails/MlDeckGlTerrainLayer.png +0 -0
  79. package/public/thumbnails/MlDemoDashboard.png +0 -0
  80. package/public/thumbnails/MlFeatureEditor.png +0 -0
  81. package/public/thumbnails/MlFillExtrusionLayer.png +0 -0
  82. package/public/thumbnails/MlFollowGps.png +0 -0
  83. package/public/thumbnails/MlGeoJsonLayer.png +0 -0
  84. package/public/thumbnails/MlGpxViewer.png +0 -0
  85. package/public/thumbnails/MlHillshadeLayer.png +0 -0
  86. package/public/thumbnails/MlIconLayer.png +0 -0
  87. package/public/thumbnails/MlLaermkarte.png +0 -0
  88. package/public/thumbnails/MlLayerMagnify.png +0 -0
  89. package/public/thumbnails/MlLayerSwipe.png +0 -0
  90. package/public/thumbnails/MlMapDrawTools.png +0 -0
  91. package/public/thumbnails/MlMeasureTool.png +0 -0
  92. package/public/thumbnails/MlMobilerImker.png +0 -0
  93. package/public/thumbnails/MlNavigationCompass.png +0 -0
  94. package/public/thumbnails/MlNavigationTools.png +0 -0
  95. package/public/thumbnails/MlOsmLayer.png +0 -0
  96. package/public/thumbnails/MlScaleReference.png +0 -0
  97. package/public/thumbnails/MlSketchTool.png +0 -0
  98. package/public/thumbnails/MlSpatialElevationProfile.png +0 -0
  99. package/public/thumbnails/MlThreeJsLayer.png +0 -0
  100. package/public/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
  101. package/public/thumbnails/MlVectorTileLayer.png +0 -0
  102. package/public/thumbnails/MlWanderApp.png +0 -0
  103. package/public/thumbnails/MlWmsLayer.png +0 -0
  104. package/public/thumbnails/MlWmsLoader.png +0 -0
  105. package/public/thumbnails/useCameraFollowPath.png +0 -0
  106. package/rollup.config.js +67 -0
  107. package/scripts/build-catalogue-markdown-docs.js +28 -0
  108. package/scripts/build-catalogue-meta.js +42 -0
  109. package/scripts/create-map-component.sh +36 -0
  110. package/scripts/test.js +53 -0
  111. package/src/@types/assets/index.d.ts +20 -0
  112. package/src/App.css +0 -0
  113. package/src/components/MlHexagonMap/MlHexagonMap.meta_.json +14 -0
  114. package/src/components/MlHexagonMap/MlHexagonMap.stories.tsx +29 -0
  115. package/src/components/MlHexagonMap/MlHexagonMap.tsx +143 -0
  116. package/src/contexts/DeckGlContext.tsx +66 -0
  117. package/src/custom.d.ts +4 -0
  118. package/src/decorators/MapContextDecorator.js +41 -0
  119. package/src/decorators/style.css +34 -0
  120. package/src/hooks/useDeckGl.tsx +24 -0
  121. package/src/index.ts +2 -0
  122. package/src/setupTests.js +113 -0
  123. package/src/stories/components/Readme.js +7 -0
  124. package/src/util/BubbleForInstructions.js +48 -0
  125. package/src/util/Instructions.tsx +60 -0
  126. package/src/util/index.js +4 -0
  127. package/src/util/layerRemovalTest.js +121 -0
  128. package/src/util/sourceRemovalTest.js +113 -0
  129. package/tsconfig.json +34 -0
package/.babelrc ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "plugins": [
3
+ "@babel/plugin-transform-typescript",
4
+ "babel-plugin-styled-components",
5
+ [
6
+ "inline-react-svg",
7
+ {
8
+ "svgo": {
9
+ "plugins": [
10
+ {
11
+ "name": "preset-default",
12
+ "params": {
13
+ "overrides": { "mergePaths": false }
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ ]
20
+ ],
21
+ "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"]
22
+ }
package/.editorconfig ADDED
@@ -0,0 +1,19 @@
1
+ # EditorConfig is awesome: https://editorconfig.org/
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*.md]
7
+ trim_trailing_whitespace = false
8
+
9
+ [*.js]
10
+ trim_trailing_whitespace = true
11
+
12
+ # Unix-style newlines with a newline ending every file
13
+ [*]
14
+ indent_style = tab
15
+ indent_size = 2
16
+ end_of_line = lf
17
+ charset = utf-8
18
+ insert_final_newline = true
19
+ max_line_length = 100
package/.eslintignore ADDED
@@ -0,0 +1,12 @@
1
+ .cache
2
+ .github
3
+ .storybook
4
+ .vscode
5
+ coverage
6
+ dist
7
+ docs
8
+ docs-build
9
+ js-docs
10
+ node_modules
11
+ storybook-static
12
+ scripts
package/.eslintrc.js ADDED
@@ -0,0 +1,30 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ node: true,
5
+ es2021: true,
6
+ },
7
+ extends: [
8
+ 'eslint:recommended',
9
+ 'plugin:react/recommended',
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'prettier',
12
+ ],
13
+ overrides: [],
14
+ parser: '@typescript-eslint/parser',
15
+ parserOptions: {
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module',
18
+ },
19
+ plugins: ['react', '@typescript-eslint'],
20
+ rules: {
21
+ 'react/prop-types': 'off',
22
+ // empty functions can sometimes be set intentionally. e.g. with useRef/useState, if we want an empty function first
23
+ '@typescript-eslint/no-empty-function': 'off',
24
+ },
25
+ settings: {
26
+ react: {
27
+ version: 'detect',
28
+ },
29
+ },
30
+ };
@@ -0,0 +1,11 @@
1
+ .cache
2
+ .github
3
+ .storybook
4
+ .vscode
5
+ coverage
6
+ dist
7
+ docs
8
+ docs-build
9
+ js-docs
10
+ node_modules
11
+ storybook-static
@@ -0,0 +1,6 @@
1
+ {
2
+ "printWidth": 100,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5",
5
+ "useTabs": true
6
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "plugins": [
3
+ "@babel/plugin-transform-typescript",
4
+ "babel-plugin-styled-components",
5
+ [
6
+ "inline-react-svg",
7
+ {
8
+ "svgo": {
9
+ "plugins": [
10
+ {
11
+ "name": "preset-default",
12
+ "params": {
13
+ "overrides": { "mergePaths": false }
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ ]
20
+ ],
21
+ "presets": [
22
+ "@babel/preset-env",
23
+ "@babel/preset-typescript",
24
+ "@babel/preset-react"
25
+ ]
26
+ }
@@ -0,0 +1,40 @@
1
+ module.exports = {
2
+ core: {
3
+ builder: '@storybook/builder-webpack5',
4
+ },
5
+ stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
6
+ addons: [
7
+ 'storybook-source-link',
8
+ '@storybook/addon-storysource',
9
+ '@storybook/addon-links',
10
+ '@storybook/addon-essentials',
11
+ {
12
+ name: '@storybook/addon-docs',
13
+ options: {
14
+ configureJSX: true,
15
+ },
16
+ },
17
+ ],
18
+ framework: '@storybook/react',
19
+ webpackFinal: async (config, { configType }) => {
20
+ // split into more chunks
21
+ config.optimization = {
22
+ splitChunks: {
23
+ chunks: 'all',
24
+ minSize: 30 * 1024, // 30KB
25
+ maxSize: 1024 * 1024, // 1MB
26
+ },
27
+ };
28
+
29
+ return config;
30
+ },
31
+ typescript: {
32
+ check: false,
33
+ checkOptions: {},
34
+ reactDocgen: 'react-docgen-typescript',
35
+ reactDocgenTypescriptOptions: {
36
+ shouldExtractLiteralValuesFromEnum: true,
37
+ propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
38
+ },
39
+ },
40
+ };
@@ -0,0 +1,6 @@
1
+ import { addons } from "@storybook/addons";
2
+ import wheregroupTheme from "./wheregroupTheme";
3
+
4
+ addons.setConfig({
5
+ theme: wheregroupTheme,
6
+ });
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+
3
+ import { themes } from "@storybook/theming";
4
+
5
+ import "./style.css";
6
+
7
+ console.log('ReactDOM.render warning is from storybook still using react 17 to render the UI; The components shown are using 18 thoug. See https://github.com/storybookjs/storybook/issues/17831 for more info. The issue will eventually be resolved by upgrading storybook, once it fully supports React 18');
8
+
9
+ export const parameters = {
10
+ docs: {
11
+ inlineStories: false,
12
+ },
13
+ actions: { argTypesRegex: "^on[A-Z].*" },
14
+
15
+ sourceLinkPrefix: 'https://github.com/mapcomponents/react-map-components-maplibre/blob/main/src/'
16
+ };
17
+
18
+ export const globalTypes = {
19
+ theme: {
20
+ name: 'Theme',
21
+ title: 'Theme',
22
+ description: 'Theme for your components',
23
+ defaultValue: 'light',
24
+ toolbar: {
25
+ icon: 'paintbrush',
26
+ dynamicTitle: true,
27
+ items: [
28
+ { value: 'light', left: '☀️', title: 'Light mode' },
29
+ { value: 'dark', left: '🌙', title: 'Dark mode' },
30
+ ],
31
+ },
32
+ },
33
+ };
@@ -0,0 +1,15 @@
1
+ .docs-story > div:first-child{
2
+ z-index:0;
3
+ }
4
+
5
+ .docs-story > div > div:first-child, .innerZoomElementWrapper, .innerZoomElementWrapper > div:first-child, .innerZoomElementWrapper > div:first-child > div:first-child{
6
+
7
+ position: absolute;
8
+ top: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ right: 0;
12
+ }
13
+ .innerZoomElementWrapper > div > div > div:first-child{
14
+ height: 100% !important;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { create } from "@storybook/theming";
2
+ import logo from "./mapcomponents_logo.png";
3
+
4
+ export default create({
5
+ base: "light",
6
+ brandTitle: "WhereGroup GmbH",
7
+ brandUrl: "https://wheregroup.com",
8
+ brandImage: logo,
9
+ });
package/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ # DeckGL Change Log
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 WhereGroup GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # DeckGl Readme
package/config/env.js ADDED
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const paths = require('./paths');
6
+
7
+ // Make sure that including paths.js after env.js will read .env variables.
8
+ delete require.cache[require.resolve('./paths')];
9
+
10
+ const NODE_ENV = process.env.NODE_ENV;
11
+ if (!NODE_ENV) {
12
+ throw new Error(
13
+ 'The NODE_ENV environment variable is required but was not specified.'
14
+ );
15
+ }
16
+
17
+ // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
18
+ const dotenvFiles = [
19
+ `${paths.dotenv}.${NODE_ENV}.local`,
20
+ // Don't include `.env.local` for `test` environment
21
+ // since normally you expect tests to produce the same
22
+ // results for everyone
23
+ NODE_ENV !== 'test' && `${paths.dotenv}.local`,
24
+ `${paths.dotenv}.${NODE_ENV}`,
25
+ paths.dotenv,
26
+ ].filter(Boolean);
27
+
28
+ // Load environment variables from .env* files. Suppress warnings using silent
29
+ // if this file is missing. dotenv will never modify any environment variables
30
+ // that have already been set. Variable expansion is supported in .env files.
31
+ // https://github.com/motdotla/dotenv
32
+ // https://github.com/motdotla/dotenv-expand
33
+ dotenvFiles.forEach(dotenvFile => {
34
+ if (fs.existsSync(dotenvFile)) {
35
+ require('dotenv-expand')(
36
+ require('dotenv').config({
37
+ path: dotenvFile,
38
+ })
39
+ );
40
+ }
41
+ });
42
+
43
+ // We support resolving modules according to `NODE_PATH`.
44
+ // This lets you use absolute paths in imports inside large monorepos:
45
+ // https://github.com/facebook/create-react-app/issues/253.
46
+ // It works similar to `NODE_PATH` in Node itself:
47
+ // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
48
+ // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
49
+ // Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
50
+ // https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
51
+ // We also resolve them to make sure all tools using them work consistently.
52
+ const appDirectory = fs.realpathSync(process.cwd());
53
+ process.env.NODE_PATH = (process.env.NODE_PATH || '')
54
+ .split(path.delimiter)
55
+ .filter(folder => folder && !path.isAbsolute(folder))
56
+ .map(folder => path.resolve(appDirectory, folder))
57
+ .join(path.delimiter);
58
+
59
+ // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
60
+ // injected into the application via DefinePlugin in webpack configuration.
61
+ const REACT_APP = /^REACT_APP_/i;
62
+
63
+ function getClientEnvironment(publicUrl) {
64
+ const raw = Object.keys(process.env)
65
+ .filter(key => REACT_APP.test(key))
66
+ .reduce(
67
+ (env, key) => {
68
+ env[key] = process.env[key];
69
+ return env;
70
+ },
71
+ {
72
+ // Useful for determining whether we’re running in production mode.
73
+ // Most importantly, it switches React into the correct mode.
74
+ NODE_ENV: process.env.NODE_ENV || 'development',
75
+ // Useful for resolving the correct path to static assets in `public`.
76
+ // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
77
+ // This should only be used as an escape hatch. Normally you would put
78
+ // images into the `src` and `import` them in code to get their paths.
79
+ PUBLIC_URL: publicUrl,
80
+ // We support configuring the sockjs pathname during development.
81
+ // These settings let a developer run multiple simultaneous projects.
82
+ // They are used as the connection `hostname`, `pathname` and `port`
83
+ // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
84
+ // and `sockPort` options in webpack-dev-server.
85
+ WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
86
+ WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
87
+ WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
88
+ // Whether or not react-refresh is enabled.
89
+ // react-refresh is not 100% stable at this time,
90
+ // which is why it's disabled by default.
91
+ // It is defined here so it is available in the webpackHotDevClient.
92
+ FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
93
+ }
94
+ );
95
+ // Stringify all values so we can feed into webpack DefinePlugin
96
+ const stringified = {
97
+ 'process.env': Object.keys(raw).reduce((env, key) => {
98
+ env[key] = JSON.stringify(raw[key]);
99
+ return env;
100
+ }, {}),
101
+ };
102
+
103
+ return { raw, stringified };
104
+ }
105
+
106
+ module.exports = getClientEnvironment;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const babelJest = require('babel-jest');
4
+
5
+ const hasJsxRuntime = (() => {
6
+ if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
7
+ return false;
8
+ }
9
+
10
+ try {
11
+ require.resolve('react/jsx-runtime');
12
+ return true;
13
+ } catch (e) {
14
+ return false;
15
+ }
16
+ })();
17
+
18
+ module.exports = babelJest.createTransformer({
19
+ presets: [
20
+ [
21
+ require.resolve('babel-preset-react-app'),
22
+ {
23
+ runtime: hasJsxRuntime ? 'automatic' : 'classic',
24
+ },
25
+ ],
26
+ ],
27
+ babelrc: false,
28
+ configFile: false,
29
+ });
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const camelcase = require('camelcase');
5
+
6
+ // This is a custom Jest transformer turning file imports into filenames.
7
+ // http://facebook.github.io/jest/docs/en/webpack.html
8
+
9
+ module.exports = {
10
+ process(src, filename) {
11
+ const assetFilename = JSON.stringify(path.basename(filename));
12
+
13
+ if (filename.match(/\.svg$/)) {
14
+ // Based on how SVGR generates a component name:
15
+ // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
16
+ const pascalCaseFilename = camelcase(path.parse(filename).name, {
17
+ pascalCase: true,
18
+ });
19
+ const componentName = `Svg${pascalCaseFilename}`;
20
+ return `const React = require('react');
21
+ module.exports = {
22
+ __esModule: true,
23
+ default: ${assetFilename},
24
+ ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
25
+ return {
26
+ $$typeof: Symbol.for('react.element'),
27
+ type: 'svg',
28
+ ref: ref,
29
+ key: null,
30
+ props: Object.assign({}, props, {
31
+ children: ${assetFilename}
32
+ })
33
+ };
34
+ }),
35
+ };`;
36
+ }
37
+
38
+ return `module.exports = ${assetFilename};`;
39
+ },
40
+ };
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
6
+
7
+ // Make sure any symlinks in the project folder are resolved:
8
+ // https://github.com/facebook/create-react-app/issues/637
9
+ const appDirectory = fs.realpathSync(process.cwd());
10
+ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
11
+
12
+ // We use `PUBLIC_URL` environment variable or "homepage" field to infer
13
+ // "public path" at which the app is served.
14
+ // webpack needs to know it to put the right <script> hrefs into HTML even in
15
+ // single-page apps that may serve index.html for nested URLs like /todos/42.
16
+ // We can't use a relative path in HTML because we don't want to load something
17
+ // like /todos/42/static/js/bundle.7289d.js. We have to know the root.
18
+ const publicUrlOrPath = getPublicUrlOrPath(
19
+ process.env.NODE_ENV === 'development',
20
+ require(resolveApp('package.json')).homepage,
21
+ process.env.PUBLIC_URL
22
+ );
23
+
24
+ const buildPath = process.env.BUILD_PATH || 'build';
25
+
26
+ const moduleFileExtensions = [
27
+ 'web.mjs',
28
+ 'mjs',
29
+ 'web.js',
30
+ 'js',
31
+ 'web.ts',
32
+ 'ts',
33
+ 'web.tsx',
34
+ 'tsx',
35
+ 'json',
36
+ 'web.jsx',
37
+ 'jsx',
38
+ ];
39
+
40
+ // Resolve file paths in the same order as webpack
41
+ const resolveModule = (resolveFn, filePath) => {
42
+ const extension = moduleFileExtensions.find(extension =>
43
+ fs.existsSync(resolveFn(`${filePath}.${extension}`))
44
+ );
45
+
46
+ if (extension) {
47
+ return resolveFn(`${filePath}.${extension}`);
48
+ }
49
+
50
+ return resolveFn(`${filePath}.js`);
51
+ };
52
+
53
+ // config after eject: we're in ./config/
54
+ module.exports = {
55
+ dotenv: resolveApp('.env'),
56
+ appPath: resolveApp('.'),
57
+ appBuild: resolveApp(buildPath),
58
+ appPublic: resolveApp('public'),
59
+ appHtml: resolveApp('public/index.html'),
60
+ appIndexJs: resolveModule(resolveApp, 'src/index'),
61
+ appPackageJson: resolveApp('package.json'),
62
+ appSrc: resolveApp('src'),
63
+ appTsConfig: resolveApp('tsconfig.json'),
64
+ appJsConfig: resolveApp('jsconfig.json'),
65
+ yarnLockFile: resolveApp('yarn.lock'),
66
+ testsSetup: resolveModule(resolveApp, 'src/setupTests'),
67
+ proxySetup: resolveApp('src/setupProxy.js'),
68
+ appNodeModules: resolveApp('node_modules'),
69
+ swSrc: resolveModule(resolveApp, 'src/service-worker'),
70
+ publicUrlOrPath,
71
+ };
72
+
73
+
74
+
75
+ module.exports.moduleFileExtensions = moduleFileExtensions;
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <coverage generated="1688125160432" clover="3.2.0">
3
+ <project timestamp="1688125160432" name="All files">
4
+ <metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
5
+ </project>
6
+ </coverage>
@@ -0,0 +1 @@
1
+ {}