{"id":42457994,"url":"https://github.com/kksoftwareag/divi-url-importer","last_synced_at":"2026-01-28T09:08:37.285Z","repository":{"id":46514421,"uuid":"263005199","full_name":"kksoftwareag/divi-url-importer","owner":"kksoftwareag","description":"Render the source code of specified urls directly into your divi page","archived":false,"fork":false,"pushed_at":"2026-01-15T11:18:57.000Z","size":3934,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-15T15:46:48.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kksoftwareag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-11T10:02:32.000Z","updated_at":"2026-01-15T11:18:54.000Z","dependencies_parsed_at":"2022-09-15T18:24:16.132Z","dependency_job_id":null,"html_url":"https://github.com/kksoftwareag/divi-url-importer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kksoftwareag/divi-url-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksoftwareag%2Fdivi-url-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksoftwareag%2Fdivi-url-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksoftwareag%2Fdivi-url-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksoftwareag%2Fdivi-url-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kksoftwareag","download_url":"https://codeload.github.com/kksoftwareag/divi-url-importer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksoftwareag%2Fdivi-url-importer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28843200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-28T09:08:36.515Z","updated_at":"2026-01-28T09:08:37.275Z","avatar_url":"https://github.com/kksoftwareag.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project was bootstrapped with [Create Divi Extension](https://github.com/elegantthemes/create-divi-extension).\n\nBelow you will find some information on how to perform common tasks. You can find the most recent version of this guide [here](https://github.com/elegantthemes/create-divi-extension/blob/master/packages/divi-scripts/template/README.md).\n\n## Table of Contents\n\n- [Updating to New Releases](#updating-to-new-releases)\n- [Sending Feedback](#sending-feedback)\n- [Folder Structure](#folder-structure)\n- [Available Scripts](#available-scripts)\n  - [yarn start](#yarn-start)\n  - [yarn build](#yarn-build)\n  - [yarn zip](#yarn-zip)\n  - [yarn eject](#yarn-eject)\n- [Supported Browsers](#supported-browsers)\n- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)\n- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)\n- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)\n- [Debugging in the Editor](#debugging-in-the-editor)\n- [Formatting Code Automatically](#formatting-code-automatically)\n- [Installing a Dependency](#installing-a-dependency)\n- [Importing a Component](#importing-a-component)\n- [Adding a Stylesheet](#adding-a-stylesheet)\n- [Post-Processing CSS](#post-processing-css)\n- [Adding Flow](#adding-flow)\n- [Adding Custom Environment Variables](#adding-custom-environment-variables)\n  - [Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)\n  - [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)\n  - [Adding Development Environment Variables In `.env`](#adding-development-environment-variables-in-env)\n- [Can I Use Decorators?](#can-i-use-decorators)\n- [Fetching Data with AJAX Requests](#fetching-data-with-ajax-requests)\n- [Advanced Configuration](#advanced-configuration)\n- [Troubleshooting](#troubleshooting)\n  - [`yarn start` doesn’t detect changes](#npm-start-doesnt-detect-changes)\n  - [`yarn test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)\n  - [`yarn build` exits too early](#npm-run-build-exits-too-early)\n  - [`yarn build` fails to minify](#npm-run-build-fails-to-minify)\n  - [Moment.js locales are missing](#momentjs-locales-are-missing)\n- [Alternatives to Ejecting](#alternatives-to-ejecting)\n- [Something Missing?](#something-missing)\n\n## Updating to New Releases\n\nCreate Divi Extension is divided into two packages:\n\n* `create-divi-extension` is a global command-line utility that you use to create new projects.\n* `divi-scripts` is a development dependency in the generated projects (including this one).\n\nYou almost never need to update `create-divi-extension` itself: it delegates all the setup to `divi-scripts`.\n\nWhen you run `create-divi-extension`, it always creates the project with the latest version of `divi-scripts` so you’ll get all the new features and improvements in newly created extensions automatically.\n\nTo update an existing project to a new version of `divi-scripts`, [open the changelog](https://github.com/elegantthemes/create-divi-extension/blob/master/CHANGELOG.md), find the version you’re currently on (check `package.json` in this folder if you’re not sure), and apply the migration instructions for the newer versions.\n\nIn most cases bumping the `divi-scripts` version in `package.json` and running `npm install` in this folder should be enough, but it’s good to consult the [changelog](https://github.com/elegantthemes/create-divi-extension/blob/master/CHANGELOG.md) for potential breaking changes.\n\nWe commit to keeping the breaking changes minimal so you can upgrade `divi-scripts` painlessly.\n\n## Sending Feedback\n\nWe are always open to [your feedback](https://github.com/elegantthemes/create-divi-extension/issues).\n\n## Folder Structure\n\nAfter creation, your project should look like this:\n\n```\nmy-extension\n├── includes\n│   ├── modules\n│   │   └── HelloWorld\n│   │       ├── HelloWorld.jsx\n│   │       ├── HelloWorld.php\n│   │       └── style.css\n│   ├── loader.js\n│   ├── loader.php\n│   └── MyExtension.php\n├── languages\n├── node_modules\n├── scripts\n│   └── frontend.js\n├── styles\n├── my-extension.php\n├── package.json\n└── README.md\n```\n\nFor the project to build, **these files must exist with exact filenames**:\n\n* `includes/loader.js` is the JavaScript entry point.\n\nYou need to **put any JS and CSS files inside `includes`, `scripts`, and/or `styles`**, otherwise Webpack won’t see them.\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `yarn start`\n\nBuilds the extension in the development mode. Open your WordPress site to view it in the browser. The page will reload if you make edits to JavaScript files. You will also see any lint errors in the console.\n\n### `yarn build`\n\nBuilds the extension for production to the `build` folder. It correctly optimizes the build for the best performance.\n\n### `yarn zip`\n\nRuns `build` and then creates a production release zip file.\n\n### `yarn eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Supported Browsers\n\nBy default, the generated project uses the latest version of React.\n\nYou can refer [to the React documentation](https://reactjs.org/docs/react-dom.html#browser-support) for more information about supported browsers.\n\n## Supported Language Features and Polyfills\n\nThis project supports a superset of the latest JavaScript standard.\u003cbr\u003e\nIn addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:\n\n* [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016)\n* [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017)\n* [Object Rest/Spread Properties](https://github.com/tc39/proposal-object-rest-spread) (ES2018)\n* [Dynamic import()](https://github.com/tc39/proposal-dynamic-import) (stage 3 proposal)\n* [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (stage 3 proposal)\n* [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) syntax\n* [Flow](https://flowtype.org/) syntax\n\nLearn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-).\n\nWhile we recommend using experimental proposals with some caution, Facebook heavily uses these features in the product code, so they intend to provide [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) if any of these proposals change in the future.\n\nNote that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**:\n\n* [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) via [`object-assign`](https://github.com/sindresorhus/object-assign).\n* [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) via [`promise`](https://github.com/then/promise).\n* [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) via [`whatwg-fetch`](https://github.com/github/fetch).\n\nIf you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are including the appropriate polyfills manually, or that the browsers you are targeting already support them.\n\nAlso note that using some newer syntax features like `for...of` or `[...nonArrayValue]` causes Babel to emit code that depends on ES6 runtime features and might not work without a polyfill. When in doubt, use [Babel REPL](https://babeljs.io/repl/) to see what any specific syntax compiles down to.\n\n## Syntax Highlighting in the Editor\n\nTo configure the syntax highlighting in your favorite text editor, head to the [relevant Babel documentation page](https://babeljs.io/docs/editors) and follow the instructions. Some of the most popular editors are covered.\n\n## Displaying Lint Output in the Editor\n\nSome editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.\n\nThey are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.\n\nYou would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc` to the project root:\n\n```js\n{\n  \"extends\": \"divi-extension\"\n}\n```\n\nNow your editor should report the linting warnings.\n\nNote that even if you edit your `.eslintrc` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create Divi Extension intentionally provides a minimal set of rules that find common mistakes.\n\nIf you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules.\n\n## Debugging in the Editor\n\n**This feature is currently only supported by [Visual Studio Code](https://code.visualstudio.com) and [WebStorm](https://www.jetbrains.com/webstorm/).**\n\nVisual Studio Code and WebStorm support debugging out of the box with Create Divi Extension. This enables you as a developer to write and debug your React code without leaving the editor, and most importantly it enables you to have a continuous development workflow, where context switching is minimal, as you don’t have to switch between tools.\n\n### Visual Studio Code\n\nYou would need to have the latest version of [VS Code](https://code.visualstudio.com) and VS Code [Chrome Debugger Extension](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) installed.\n\nThen add the block below to your `launch.json` file and put it inside the `.vscode` folder in your app’s root directory.\n\n```json\n{\n  \"version\": \"0.2.0\",\n  \"configurations\": [{\n    \"name\": \"Chrome\",\n    \"type\": \"chrome\",\n    \"request\": \"launch\",\n    \"url\": \"http://localhost:3000\",\n    \"webRoot\": \"${workspaceRoot}/src\",\n    \"sourceMapPathOverrides\": {\n      \"webpack:///src/*\": \"${webRoot}/*\"\n    }\n  }]\n}\n```\n\u003eNote: the URL may be different if you've made adjustments via the [HOST or PORT environment variables](#advanced-configuration).\n\nStart your extension by running `yarn start`, and start debugging in VS Code by pressing `F5` or by clicking the green debug icon. You can now write code, set breakpoints, make changes to the code, and debug your newly modified code—all from your editor.\n\nHaving problems with VS Code Debugging? Please see their [troubleshooting guide](https://github.com/Microsoft/vscode-chrome-debug/blob/master/README.md#troubleshooting).\n\n### WebStorm\n\nYou would need to have [WebStorm](https://www.jetbrains.com/webstorm/) and [JetBrains IDE Support](https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji) Chrome extension installed.\n\nIn the WebStorm menu `Run` select `Edit Configurations...`. Then click `+` and select `JavaScript Debug`. Paste `http://localhost:3000` into the URL field and save the configuration.\n\n\u003eNote: the URL may be different if you've made adjustments via the [HOST or PORT environment variables](#advanced-configuration).\n\nStart your app by running `yarn start`, then press `^D` on macOS or `F9` on Windows and Linux or click the green debug icon to start debugging in WebStorm.\n\nYou can debug your application in IntelliJ IDEA Ultimate, PhpStorm, PyCharm Pro, and RubyMine the same way.\n\n## Formatting Code Automatically\n\nPrettier is an opinionated code formatter with support for JavaScript, CSS and JSON. With Prettier you can format the code you write automatically to ensure a code style within your project. See the [Prettier's GitHub page](https://github.com/prettier/prettier) for more information, and look at this [page to see it in action](https://prettier.github.io/prettier/).\n\nTo format our code whenever we make a commit in git, we need to install the following dependencies:\n\n```sh\nnpm install --save husky lint-staged prettier\n```\n\nAlternatively you may use `yarn`:\n\n```sh\nyarn add husky lint-staged prettier\n```\n\n* `husky` makes it easy to use githooks as if they are npm scripts.\n* `lint-staged` allows us to run scripts on staged files in git. See this [blog post about lint-staged to learn more about it](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8).\n* `prettier` is the JavaScript formatter we will run before commits.\n\nNow we can make sure every file is formatted correctly by adding a few lines to the `package.json` in the project root.\n\nAdd the following line to `scripts` section:\n\n```diff\n  \"scripts\": {\n+   \"precommit\": \"lint-staged\",\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n```\n\nNext we add a 'lint-staged' field to the `package.json`, for example:\n\n```diff\n  \"dependencies\": {\n    // ...\n  },\n+ \"lint-staged\": {\n+   \"src/**/*.{js,jsx,json,css}\": [\n+     \"prettier --single-quote --write\",\n+     \"git add\"\n+   ]\n+ },\n  \"scripts\": {\n```\n\nNow, whenever you make a commit, Prettier will format the changed files automatically. You can also run `./node_modules/.bin/prettier --single-quote --write \"src/**/*.{js,jsx,json,css}\"` to format your entire project for the first time.\n\nNext you might want to integrate Prettier in your favorite editor. Read the section on [Editor Integration](https://prettier.io/docs/en/editors.html) on the Prettier GitHub page.\n\n## Installing a Dependency\n\nThe generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create Divi Extension as a development dependency. You may install other dependencies with `npm`:\n\n```sh\nnpm install --save some-other-dependency\n```\n\nAlternatively you may use `yarn`:\n\n```sh\nyarn add some-other-dependency\n```\n\n## Importing a Component\n\nThis project setup supports ES6 modules thanks to Webpack.\u003cbr\u003e\nWhile you can still use `require()` and `module.exports`, we encourage you to use [`import` and `export`](http://exploringjs.com/es6/ch_modules.html) instead.\n\nFor example:\n\n### `Button.js`\n\n```js\nimport React, { Component } from 'react';\n\nclass Button extends Component {\n  render() {\n    // ...\n  }\n}\n\nexport default Button; // Don’t forget to use export default!\n```\n\n### `DangerButton.js`\n\n\n```js\nimport React, { Component } from 'react';\nimport Button from './Button'; // Import a component from another file\n\nclass DangerButton extends Component {\n  render() {\n    return \u003cButton color=\"red\" /\u003e;\n  }\n}\n\nexport default DangerButton;\n```\n\nBe aware of the [difference between default and named exports](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281). It is a common source of mistakes.\n\nWe suggest that you stick to using default imports and exports when a module only exports a single thing (for example, a component). That’s what you get when you use `export default Button` and `import Button from './Button'`.\n\nNamed exports are useful for utility modules that export several functions. A module may have at most one default export and as many named exports as you like.\n\nLearn more about ES6 modules:\n\n* [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)\n* [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)\n* [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)\n\n## Adding a Stylesheet\n\nThis project setup uses [Webpack](https://webpack.js.org/) for handling all assets. Webpack offers a custom way of “extending” the concept of `import` beyond JavaScript. To express that a JavaScript file depends on a CSS file, you need to **import the CSS from the JavaScript file**:\n\n### `Button.css`\n\n```css\n.Button {\n  padding: 20px;\n}\n```\n\n### `Button.js`\n\n```js\nimport React, { Component } from 'react';\nimport './Button.css'; // Tell Webpack that Button.js uses these styles\n\nclass Button extends Component {\n  render() {\n    // You can use them as regular CSS styles\n    return \u003cdiv className=\"Button\" /\u003e;\n  }\n}\n```\n\n**This is not required for React** but many people find this feature convenient. You can read about the benefits of this approach [here](https://medium.com/seek-ui-engineering/block-element-modifying-your-javascript-components-d7f99fcab52b). However you should be aware that this makes your code less portable to other build tools and environments than Webpack.\n\nIn development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.\n\n## Post-Processing CSS\n\nThis project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.\n\nFor example, this:\n\n```css\n.App {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n}\n```\n\nbecomes this:\n\n```css\n.App {\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-orient: horizontal;\n  -webkit-box-direction: normal;\n      -ms-flex-direction: row;\n          flex-direction: row;\n  -webkit-box-align: center;\n      -ms-flex-align: center;\n          align-items: center;\n}\n```\n\nIf you need to disable autoprefixing for some reason, [follow this section](https://github.com/postcss/autoprefixer#disabling).\n\n## Adding Flow\n\nFlow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept.\n\nRecent versions of [Flow](http://flowtype.org/) work with Create Divi Extension projects out of the box.\n\nTo add Flow to a Create Divi Extension project, follow these steps:\n\n1. Run `npm install --save flow-bin` (or `yarn add flow-bin`).\n2. Add `\"flow\": \"flow\"` to the `scripts` section of your `package.json`.\n3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flowtype.org/docs/advanced-configuration.html) in the root directory.\n4. Add `// @flow` to any files you want to type check (for example, to `includes/modules/HelloWorld/HelloWorld.jsx`).\n\nNow you can run `npm run flow` (or `yarn flow`) to check the files for type errors.\nYou can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience.\n\nTo learn more about Flow, check out [its documentation](https://flowtype.org/).\n\n## Adding Custom Environment Variables\n\nYour project can consume variables declared in your environment as if they were declared locally in your JS files. By\ndefault you will have `NODE_ENV` defined for you, and any other environment variables starting with `DIVI_EXTENSION_`.\n\n**The environment variables are embedded during build time**. Since Create Divi Extension produces static CSS/JS bundles, it can’t possibly read them at runtime.\n\n\u003eNote: You must create custom environment variables beginning with `DIVI_EXTENSION_`. Any other variables except `NODE_ENV` will be ignored to avoid accidentally [exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.\n\nThese environment variables will be defined for you on `process.env`. For example, having an environment variable named `DIVI_EXTENSION_SECRET_CODE` will be exposed in your JS as `process.env.DIVI_EXTENSION_SECRET_CODE`.\n\nThere is also a special built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.\n\nThese environment variables can be useful for displaying information conditionally based on where the project is\ndeployed or consuming sensitive data that lives outside of version control.\n\nFirst, you need to have environment variables defined. For example, let’s say you wanted to consume a secret defined\nin the environment inside a `\u003cform\u003e`:\n\n```jsx\nrender() {\n  return (\n    \u003cdiv\u003e\n      \u003csmall\u003eYou are running this application in \u003cb\u003e{process.env.NODE_ENV}\u003c/b\u003e mode.\u003c/small\u003e\n      \u003cform\u003e\n        \u003cinput type=\"hidden\" defaultValue={process.env.DIVI_EXTENSION_SECRET_CODE} /\u003e\n      \u003c/form\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\nDuring the build, `process.env.DIVI_EXTENSION_SECRET_CODE` will be replaced with the current value of the `DIVI_EXTENSION_SECRET_CODE` environment variable. Remember that the `NODE_ENV` variable will be set for you automatically.\n\nWhen you load the extension in the browser and inspect the `\u003cinput\u003e`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:\n\n```html\n\u003cdiv\u003e\n  \u003csmall\u003eYou are running this application in \u003cb\u003edevelopment\u003c/b\u003e mode.\u003c/small\u003e\n  \u003cform\u003e\n    \u003cinput type=\"hidden\" value=\"abcdef\" /\u003e\n  \u003c/form\u003e\n\u003c/div\u003e\n```\n\nThe above form is looking for a variable called `DIVI_EXTENSION_SECRET_CODE` from the environment. In order to consume this\nvalue, we need to have it defined in the environment. This can be done using two ways: either in your shell or in\na `.env` file. Both of these ways are described in the next few sections.\n\nHaving access to the `NODE_ENV` is also useful for performing actions conditionally:\n\n```js\nif (process.env.NODE_ENV !== 'production') {\n  analytics.disable();\n}\n```\n\nWhen you compile the extension with `npm run build`, the minification step will strip out this condition, and the resulting bundle will be smaller.\n\n### Adding Temporary Environment Variables In Your Shell\n\nDefining environment variables can vary between OSes. It’s also important to know that this is temporary for the life of the shell session.\n\n#### Windows (cmd.exe)\n\n```cmd\nset \"DIVI_EXTENSION_SECRET_CODE=abcdef\" \u0026\u0026 npm start\n```\n\n(Note: Quotes around the variable assignment are required to avoid a trailing whitespace.)\n\n#### Windows (Powershell)\n\n```Powershell\n($env:DIVI_EXTENSION_SECRET_CODE = \"abcdef\") -and (npm start)\n```\n\n#### Linux, macOS (Bash)\n\n```bash\nDIVI_EXTENSION_SECRET_CODE=abcdef npm start\n```\n\n### Adding Development Environment Variables In `.env`\n\nTo define permanent environment variables, create a file called `.env` in the root of your project:\n\n```\nDIVI_EXTENSION_SECRET_CODE=abcdef\n```\n\u003eNote: You must create custom environment variables beginning with `DIVI_EXTENSION_`. Any other variables except `NODE_ENV` will be ignored to avoid [accidentally exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.\n\n`.env` files **should be** checked into source control (with the exclusion of `.env*.local`).\n\n#### What other `.env` files can be used?\n\n* `.env`: Default.\n* `.env.local`: Local overrides. **This file is loaded for all environments except test.**\n* `.env.development`, `.env.test`, `.env.production`: Environment-specific settings.\n* `.env.development.local`, `.env.test.local`, `.env.production.local`: Local overrides of environment-specific settings.\n\nFiles on the left have more priority than files on the right:\n\n* `npm start`: `.env.development.local`, `.env.development`, `.env.local`, `.env`\n* `npm run build`: `.env.production.local`, `.env.production`, `.env.local`, `.env`\n* `npm test`: `.env.test.local`, `.env.test`, `.env` (note `.env.local` is missing)\n\nThese variables will act as the defaults if the machine does not explicitly set them.\u003cbr\u003e\nPlease refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.\n\n\u003eNote: If you are defining environment variables for development, your CI and/or hosting platform will most likely need\nthese defined as well. Consult their documentation how to do this. For example, see the documentation for [Travis CI](https://docs.travis-ci.com/user/environment-variables/) or [Heroku](https://devcenter.heroku.com/articles/config-vars).\n\n#### Expanding Environment Variables In `.env`\n\nExpand variables already on your machine for use in your `.env` file (using [dotenv-expand](https://github.com/motdotla/dotenv-expand)).\n\nFor example, to get the environment variable `npm_package_version`:\n\n```\nDIVI_EXTENSION_VERSION=$npm_package_version\n# also works:\n# DIVI_EXTENSION_VERSION=${npm_package_version}\n```\n\nOr expand variables local to the current `.env` file:\n\n```\nDOMAIN=www.example.com\nDIVI_EXTENSION_FOO=$DOMAIN/foo\nDIVI_EXTENSION_BAR=$DOMAIN/bar\n```\n\n## Can I Use Decorators?\n\nMany popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.\u003cbr\u003e\nCreate Divi Extension doesn’t support decorator syntax at the moment because:\n\n* It is an experimental proposal and is subject to change.\n* The current specification version is not officially supported by Babel.\n* If the specification changes, Facebook won’t be able to write a codemod because they don’t use them internally.\n\nHowever in many cases you can rewrite decorator-based code without decorators just as fine.\u003cbr\u003e\nPlease refer to these two threads for reference:\n\n* [#214](https://github.com/facebook/create-react-app/issues/214)\n* [#411](https://github.com/facebook/create-react-app/issues/411)\n\nCreate Divi Extension will add decorator support when the specification advances to a stable stage.\n\n## Fetching Data with AJAX Requests\n\nReact doesn't prescribe a specific approach to data fetching, but people commonly use either a library like [axios](https://github.com/axios/axios) or the [`fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) provided by the browser. Conveniently, Create Divi Extension includes a polyfill for `fetch()` so you can use it without worrying about the browser support.\n\nThe global `fetch` function allows you to easily make AJAX requests. It takes in a URL as an input and returns a `Promise` that resolves to a `Response` object. You can find more information about `fetch` [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).\n\nThis project also includes a [Promise polyfill](https://github.com/then/promise) which provides a full implementation of Promises/A+. A Promise represents the eventual result of an asynchronous operation, you can find more information about Promises [here](https://www.promisejs.org/) and [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Both axios and `fetch()` use Promises under the hood. You can also use the [`async / await`](https://davidwalsh.name/async-await) syntax to reduce the callback nesting.\n\nYou can learn more about making AJAX requests from React components in [the FAQ entry on the React website](https://reactjs.org/docs/faq-ajax.html).\n\n## Advanced Configuration\n\nYou can adjust various development and production settings by setting environment variables in your shell or with [.env](#adding-development-environment-variables-in-env).\n\nVariable | Development | Production | Usage\n:--- | :---: | :---: | :---\nBROWSER | :white_check_mark: | :x: | By default, Create Divi Extension will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/opn#app) to override this behavior, or set it to `none` to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to `npm start` will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the `.js` extension.\nHOST | :white_check_mark: | :x: | By default, the development web server binds to `localhost`. You may use this variable to specify a different host.\nPORT | :white_check_mark: | :x: | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port.\nHTTPS | :white_check_mark: | :x: | When set to `true`, Create Divi Extension will run the development server in `https` mode.\nPUBLIC_URL | :x: | :white_check_mark: | Create Divi Extension assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](#building-for-relative-paths). Normally, Create Divi Extension ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application.\nCI | :large_orange_diamond: | :white_check_mark: | When set to `true`, Create Divi Extension treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default.\nREACT_EDITOR | :white_check_mark: | :x: | When an app crashes in development, you will see an error overlay with clickable stack trace. When you click on it, Create Divi Extension will try to determine the editor you are using based on currently running processes, and open the relevant source file. You can [send a pull request to detect your editor of choice](https://github.com/facebook/create-react-app/issues/2636). Setting this environment variable overrides the automatic detection. If you do it, make sure your systems [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable points to your editor’s bin folder. You can also set it to `none` to disable it completely.\nCHOKIDAR_USEPOLLING | :white_check_mark: | :x: | When set to `true`, the watcher runs in polling mode, as necessary inside a VM. Use this option if `npm start` isn't detecting changes.\nGENERATE_SOURCEMAP | :x: | :white_check_mark: | When set to `false`, source maps are not generated for a production build. This solves OOM issues on some smaller machines.\nNODE_PATH | :white_check_mark: |  :white_check_mark: | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`.\n\n## Troubleshooting\n\n### `yarn start` doesn’t detect changes\n\nWhen you save a file while `yarn start` is running, the browser should refresh with the updated code.\u003cbr\u003e\nIf this doesn’t happen, try one of the following workarounds:\n\n* If your project is in a Dropbox folder, try moving it out.\n* If the watcher doesn’t see a file called `index.js` and you’re referencing it by the folder name, you [need to restart the watcher](https://github.com/facebook/create-react-app/issues/1164) due to a Webpack bug.\n* Some editors like Vim and IntelliJ have a “safe write” feature that currently breaks the watcher. You will need to disable it. Follow the instructions in [“Adjusting Your Text Editor”](https://webpack.js.org/guides/development/#adjusting-your-text-editor).\n* If your project path contains parentheses, try moving the project to a path without them. This is caused by a [Webpack watcher bug](https://github.com/webpack/watchpack/issues/42).\n* On Linux and macOS, you might need to [tweak system settings](https://github.com/webpack/docs/wiki/troubleshooting#not-enough-watchers) to allow more watchers.\n* If the project runs inside a virtual machine such as (a Vagrant provisioned) VirtualBox, create an `.env` file in your project directory if it doesn’t exist, and add `CHOKIDAR_USEPOLLING=true` to it. This ensures that the next time you run `npm start`, the watcher uses the polling mode, as necessary inside a VM.\n\nIf none of these solutions help please leave a comment [in this thread](https://github.com/facebook/create-react-app/issues/659).\n\n### `yarn build` exits too early\n\nIt is reported that `yarn build` can fail on machines with limited memory and no swap space, which is common in cloud environments. Even with small projects this command can increase RAM usage in your system by hundreds of megabytes, so if you have less than 1 GB of available memory your build is likely to fail with the following message:\n\n\u003e  The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.\n\nIf you are completely sure that you didn't terminate the process, consider [adding some swap space](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04) to the machine you’re building on, or build the project locally.\n\n### Moment.js locales are missing\n\nIf you use a [Moment.js](https://momentjs.com/), you might notice that only the English locale is available by default. This is because the locale files are large, and you probably only need a subset of [all the locales provided by Moment.js](https://momentjs.com/#multiple-locale-support).\n\nTo add a specific Moment.js locale to your bundle, you need to import it explicitly.\u003cbr\u003e\nFor example:\n\n```js\nimport moment from 'moment';\nimport 'moment/locale/fr';\n```\n\nIf import multiple locales this way, you can later switch between them by calling `moment.locale()` with the locale name:\n\n```js\nimport moment from 'moment';\nimport 'moment/locale/fr';\nimport 'moment/locale/es';\n\n// ...\n\nmoment.locale('fr');\n```\n\nThis will only work for locales that have been explicitly imported before.\n\n### `yarn build` fails to minify\n\nSome third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.\n\n\u003cbr\u003e\nTo resolve this:\n\n1. Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled.\n  * Note: Create Divi Extension can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the `module` field in `package.json`. Note that **even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers**.\n\n2. Fork the package and publish a corrected version yourself.\n\n3. If the dependency is small enough, copy it to your `src/` folder and treat it as application code.\n\nIn the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.\n\n## Alternatives to Ejecting\n\n[Ejecting](#yarn-eject) lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting if you have many similar projects. In such cases instead of ejecting we recommend to *fork* `divi-scripts` and any other packages you need. [This article](https://auth0.com/blog/how-to-configure-create-react-app/) dives into how to do it in depth. You can find more discussion in [this issue](https://github.com/facebook/create-react-app/issues/682).\n\n## Something Missing?\n\nIf you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/elegantthemes/create-divi-extension/issues) or [contribute some!](https://github.com/elegantthemes/create-divi-extension/edit/master/packages/divi-scripts/template/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkksoftwareag%2Fdivi-url-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkksoftwareag%2Fdivi-url-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkksoftwareag%2Fdivi-url-importer/lists"}