diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..0abe39f
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,11 @@
+{
+ "presets": [
+ // "@babel/preset-env"
+ "@babel/preset-react"
+ // "react-app"
+ ],
+ "plugins": [
+ // "@babel/plugin-proposal-class-properties",
+ "react-hot-loader/babel"
+ ]
+}
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..5f05a95
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "react-app",
+ "globals": {
+ "chrome": "readonly"
+ }
+}
diff --git a/.gitignore b/.gitignore
index c47fedd..57839e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,8 +2,25 @@
*.zip
*.css.map
+deploy.sh
+
/extras
/.sass-cache
/node_modules
/dist
-/build
\ No newline at end of file
+/build
+
+
+# testing
+/coverage
+
+
+# misc
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+.history
+
+# secrets
+secrets.*.js
diff --git a/.node-version b/.node-version
new file mode 100644
index 0000000..62df50f
--- /dev/null
+++ b/.node-version
@@ -0,0 +1 @@
+14.17.0
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..08979ae
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,6 @@
+{
+ "singleQuote": true,
+ "trailingComma": "es5",
+ "requirePragma": false,
+ "arrowParens": "always"
+}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1b49231
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2019 Michael Xieyang Liu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 74969ac..af30289
--- a/README.md
+++ b/README.md
@@ -1,77 +1,159 @@
-## Astronomy Picture of the Day (APOD) Extension by Travis Lawrence!
+
-I really love space and astronomy pictures and for about 10 or 15 years I've had APOD as my home page! But I don't specifically see my homepage that much anymore and I've been missing out on my APOD fix.
+# APOD
-So what did I do??? I built an extension to show me an APOD on every new tab I open!
+Sun image:
-[Get the plug-in for Chrome!](https://chrome.google.com/webstore/detail/apod-by-the-trav/aedpginojmhafbemcoelnppdcmlfjcdj)
+- [Original video](https://www.youtube.com/watch?time_continue=2020&v=l3QQQu7QLoM&feature=emb_title&ab_channel=NASAGoddard)
+- [Generate gif](https://gifrun.com/youtube/?v=l3QQQu7QLoM)
+- [Made transparent](https://onlinegiftools.com/create-transparent-gif)
-[Get the plug-in for Firefox!](https://addons.mozilla.org/en-US/firefox/addon/apod-by-the-trav/)
+# Chrome Extension Boilerplate with React 17 and Webpack 5
-This extension might seem like a lot of work for such a simple purpose. This is not by accident, I set out to build the best APOD viewing extension that I could think of and if you think there's something that could be added to make this better I can't wait to hear from you!
+[![npm](https://img.shields.io/npm/v/chrome-extension-boilerplate-react)](https://www.npmjs.com/package/chrome-extension-boilerplate-react)
+[![npm-download](https://img.shields.io/npm/dw/chrome-extension-boilerplate-react)](https://www.npmjs.com/package/chrome-extension-boilerplate-react)
+[![npm](https://img.shields.io/npm/dm/chrome-extension-boilerplate-react)](https://www.npmjs.com/package/chrome-extension-boilerplate-react)
-## APOD By The Trav Features
+[![dependencies Status](https://david-dm.org/lxieyang/chrome-extension-boilerplate-react/status.svg)](https://david-dm.org/lxieyang/chrome-extension-boilerplate-react)
+[![devDependencies Status](https://david-dm.org/lxieyang/chrome-extension-boilerplate-react/dev-status.svg)](https://david-dm.org/lxieyang/chrome-extension-boilerplate-react?type=dev)
-Your New Tab page will now be the Astronomy Picture of the Day (APOD)! Your top sites are shown in the top left of the page to maintain some usefulness from the default new tab screen.
+## Announcements
-- Save your favorite APOD's for viewing again with the "Save Favorites" button at the bottom right.
-- Click the date in the title bar to display a `date selector`.
+- **_This boilerplate adopts [Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-overview/)!_** For V2 users, please check out the [manifest-v2](https://github.com/lxieyang/chrome-extension-boilerplate-react/tree/manifest-v2) branch, or use version [3.x](https://www.npmjs.com/package/chrome-extension-boilerplate-react/v/3.3.0).
+ - Check out the [Manifest V3 Migration Guide](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/).
+- Recently added [devtools](https://developer.chrome.com/docs/extensions/mv3/devtools/) Support! Thanks [GeekaholicLin](https://github.com/lxieyang/chrome-extension-boilerplate-react/issues/17)!
+- Recently updated from **[React](https://reactjs.org)** ~~16~~ to **17**!
+- Recently updated from **[Webpack Dev Server](https://webpack.js.org/configuration/dev-server/)** ~~3.x~~ to **4.x** and **[Webpack](https://webpack.js.org/)** ~~4~~ to **5**!
+- Recently added [TypeScript](https://www.typescriptlang.org/) Support!
-##### APOD Options
+## Features
-- Use the options in the Chrome menu bar to set `Today` or a `Random` APOD on new tab.
-- High definition photos only. Each APOD has a standard-res and hi-res image, initially the hi-res image is attempted to be shown but if the file size is too large (takes too long to download) it'll default to the standard resolution image. This setting will force high resolution photos only.
-- Toggle showing your Top sites, or hide them to focus on the space pics.
-- Toggle showing your viewing history bar which is shown at the bottom of the page.
-- Enable the ability to see `Todays` APOD a certain number of times before a `random` photo is selected. This allows you to see the most recent APOD a few times and then move onto some new pictures (thanks [Hambly](https://github.com/hambly)!).
+This is a basic Chrome Extensions boilerplate to help you write modular and modern Javascript code, load CSS easily and [automatic reload the browser on code changes](https://webpack.github.io/docs/webpack-dev-server.html#automatic-refresh).
-##### Navigation shortcuts:
+This boilerplate is updated with:
-- Random APOD - `r`
-- Today's APOD - `t`
-- Previous Day APOD - `j`
-- Next Day APOD - `k`
+- [Chrome Extension Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-overview/)
+- [React 17](https://reactjs.org)
+- [Webpack 5](https://webpack.js.org/)
+- [Webpack Dev Server 4](https://webpack.js.org/configuration/dev-server/)
+- [React Hot Loader](https://github.com/gaearon/react-hot-loader)
+- [eslint-config-react-app](https://www.npmjs.com/package/eslint-config-react-app)
+- [Prettier](https://prettier.io/)
+- [TypeScript](https://www.typescriptlang.org/)
-##### Tab Shortcuts:
+This boilerplate is heavily inspired by and adapted from [https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate), with additional support for React 17 features, Webpack 5, and Webpack Dev Server 4.
-- Toggle Explanation - `e`
-- Toggle Favorites - `f`
-- Toggle Search - `s`
+Please open up an issue to nudge me to keep the npm packages up-to-date. FYI, it takes time to make different packages with different versions work together nicely.
-##### History Navigation (previously viewed APOD's):
+## Installing and Running
-- Previous History - `left-arrow`
-- Next History - `right-arrow`
+### Procedures:
-## Development
+1. Check if your [Node.js](https://nodejs.org/) version is >= **14**.
+2. Clone this repository.
+3. Change the package's `name`, `description`, and `repository` fields in `package.json`.
+4. Change the name of your extension on `src/manifest.json`.
+5. Run `npm install` to install the dependencies.
+6. Run `npm start`
+7. Load your extension on Chrome following:
+ 1. Access `chrome://extensions/`
+ 2. Check `Developer mode`
+ 3. Click on `Load unpacked extension`
+ 4. Select the `build` folder.
+8. Happy hacking.
-If you want to fork, develop and build this extension locally then follow these steps:
+## Structure
-- Fork/Download the repository and using the terminal navigate to the directory.
+All your extension's code must be placed in the `src` folder.
-- Build the dependencies by running `yarn` or `npm install` ([Yarn is recommended](https://yarnpkg.com/en/)).
+The boilerplate is already prepared to have a popup, an options page, a background page, and a new tab page (which replaces the new tab page of your browser). But feel free to customize these.
-- For active development you must re-build the extension after changes are made using `yarn build`.
+## TypeScript
-- Add the unpacked extension in Chrome (after running `yarn watch` or `yarn build`). Do this by opening up the Chrome preferences:
- - On the left sidebar click `extensions` (or just navigate directly to `chrome://extensions/`).
- - Make sure `Developer mode` is activated in the top right of the page.
- - Select `Load Unpacked` at the top left of the page, navigate to the `build` folder inside the project directory. Go open a new tab in Chrome and you'll now be running the development version.
-- Again, you must re-run `yarn build` after every save of the files for them to show up.
+This boilerplate now supports TypeScript! The `Options` Page is implemented using TypeScript. Please refer to `src/pages/Options/` for example usages.
-## Reviewer notes
+## Webpack auto-reload and HRM
-#### Firefox validation warnings
+To make your workflow much more efficient this boilerplate uses the [webpack server](https://webpack.github.io/docs/webpack-dev-server.html) to development (started with `npm start`) with auto reload feature that reloads the browser automatically every time that you save some file in your editor.
-- Firefox has issued a warning for the use of `innerHTML` which is performed one time to avoid more widespread use. This single use
- is done inside a wrapper element and has been reviewed to avoid becoming an injection vector.
+You can run the dev mode on other port if you want. Just specify the env var `port` like this:
-#### Dependencies
+```
+$ PORT=6002 npm run start
+```
-- [axios](https://github.com/axios/axios) - This is strictly used for ajax calls to the NASA API.
+## Content Scripts
-- Additional dependencies are considered well known sources as they all pertain to the use of webpack (i.e. babel, uglifyJS, path, etc.)
+Although this boilerplate uses the webpack dev server, it's also prepared to write all your bundles files on the disk at every code change, so you can point, on your extension manifest, to your bundles that you want to use as [content scripts](https://developer.chrome.com/extensions/content_scripts), but you need to exclude these entry points from hot reloading [(why?)](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/issues/4#issuecomment-261788690). To do so you need to expose which entry points are content scripts on the `webpack.config.js` using the `chromeExtensionBoilerplate -> notHotReload` config. Look the example below.
-#### Service Worker tips
+Let's say that you want use the `myContentScript` entry point as content script, so on your `webpack.config.js` you will configure the entry point and exclude it from hot reloading, like this:
-[How I got service workers working](https://dev.to/idoshamun/devtip-two-steps-for-using-workbox-in-a-chrome-extension-1ejb)
+```js
+{
+ …
+ entry: {
+ myContentScript: "./src/js/myContentScript.js"
+ },
+ chromeExtensionBoilerplate: {
+ notHotReload: ["myContentScript"]
+ }
+ …
+}
+```
+
+and on your `src/manifest.json`:
+
+```json
+{
+ "content_scripts": [
+ {
+ "matches": ["https://www.google.com/*"],
+ "js": ["myContentScript.bundle.js"]
+ }
+ ]
+}
+```
+
+## Intelligent Code Completion
+
+Thanks to [@hudidit](https://github.com/lxieyang/chrome-extension-boilerplate-react/issues/4)'s kind suggestions, this boilerplate supports chrome-specific intelligent code completion using [@types/chrome](https://www.npmjs.com/package/@types/chrome).
+
+## Packing
+
+After the development of your extension run the command
+
+```
+$ NODE_ENV=production npm run build
+```
+
+Now, the content of `build` folder will be the extension ready to be submitted to the Chrome Web Store. Just take a look at the [official guide](https://developer.chrome.com/webstore/publish) to more infos about publishing.
+
+## Secrets
+
+If you are developing an extension that talks with some API you probably are using different keys for testing and production. Is a good practice you not commit your secret keys and expose to anyone that have access to the repository.
+
+To this task this boilerplate import the file `./secrets..js` on your modules through the module named as `secrets`, so you can do things like this:
+
+_./secrets.development.js_
+
+```js
+export default { key: '123' };
+```
+
+_./src/popup.js_
+
+```js
+import secrets from 'secrets';
+ApiCall({ key: secrets.key });
+```
+
+:point_right: The files with name `secrets.*.js` already are ignored on the repository.
+
+## Resources:
+
+- [Webpack documentation](https://webpack.js.org/concepts/)
+- [Chrome Extension documentation](https://developer.chrome.com/extensions/getstarted)
+
+---
+
+Michael Xieyang Liu | [Website](https://lxieyang.github.io)
diff --git a/apod-web/index.html b/apod-web/index.html
new file mode 100644
index 0000000..0cfe049
--- /dev/null
+++ b/apod-web/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+ apod-web
+
+
+
+
+
+
diff --git a/apod-web/package.json b/apod-web/package.json
new file mode 100644
index 0000000..fd704c5
--- /dev/null
+++ b/apod-web/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "apod-web",
+ "version": "1.0.0",
+ "main": "index.js",
+ "license": "MIT",
+ "scripts": {
+ "start": "http-server ."
+ }
+}
diff --git a/apod-web/public/scripts/application.js b/apod-web/public/scripts/application.js
new file mode 100644
index 0000000..fd90683
--- /dev/null
+++ b/apod-web/public/scripts/application.js
@@ -0,0 +1,30 @@
+(function () {
+ const root = document.getElementById("root");
+ const APOD_API_URL = "https://api.nasa.gov/planetary/apod";
+ const API_KEY = "hPgI2kGa1jCxvfXjv6hq6hsYBQawAqvjMaZNs447";
+
+ async function fetchImage() {
+ const params = new URLSearchParams(location.search);
+ const date = params.get("date");
+ if (!date) {
+ console.log("NO DATE!");
+ return;
+ }
+
+ const url = `${APOD_API_URL}?api_key=${API_KEY}&date=${date}`;
+ const resp = await fetch(url);
+ const data = await resp.json();
+ generatePage(data);
+ }
+
+ function generatePage(data) {
+ const img = new Image();
+ img.src = data.url;
+ root.innerHTML = `
+
${data.title}
+ `;
+ root.append(img);
+ }
+
+ fetchImage();
+})();
diff --git a/apod-web/public/styles/styles.css b/apod-web/public/styles/styles.css
new file mode 100644
index 0000000..e69de29
diff --git a/chrome_store/sun_icon.png b/chrome_store/sun_icon.png
new file mode 100644
index 0000000..679af2e
Binary files /dev/null and b/chrome_store/sun_icon.png differ
diff --git a/config/env.js b/config/env.js
deleted file mode 100644
index b0344c5..0000000
--- a/config/env.js
+++ /dev/null
@@ -1,93 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const path = require('path');
-const paths = require('./paths');
-
-// Make sure that including paths.js after env.js will read .env variables.
-delete require.cache[require.resolve('./paths')];
-
-const NODE_ENV = process.env.NODE_ENV;
-if (!NODE_ENV) {
- throw new Error(
- 'The NODE_ENV environment variable is required but was not specified.'
- );
-}
-
-// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
-var dotenvFiles = [
- `${paths.dotenv}.${NODE_ENV}.local`,
- `${paths.dotenv}.${NODE_ENV}`,
- // Don't include `.env.local` for `test` environment
- // since normally you expect tests to produce the same
- // results for everyone
- NODE_ENV !== 'test' && `${paths.dotenv}.local`,
- paths.dotenv,
-].filter(Boolean);
-
-// Load environment variables from .env* files. Suppress warnings using silent
-// if this file is missing. dotenv will never modify any environment variables
-// that have already been set. Variable expansion is supported in .env files.
-// https://github.com/motdotla/dotenv
-// https://github.com/motdotla/dotenv-expand
-dotenvFiles.forEach(dotenvFile => {
- if (fs.existsSync(dotenvFile)) {
- require('dotenv-expand')(
- require('dotenv').config({
- path: dotenvFile,
- })
- );
- }
-});
-
-// We support resolving modules according to `NODE_PATH`.
-// This lets you use absolute paths in imports inside large monorepos:
-// https://github.com/facebook/create-react-app/issues/253.
-// It works similar to `NODE_PATH` in Node itself:
-// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
-// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
-// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
-// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
-// We also resolve them to make sure all tools using them work consistently.
-const appDirectory = fs.realpathSync(process.cwd());
-process.env.NODE_PATH = (process.env.NODE_PATH || '')
- .split(path.delimiter)
- .filter(folder => folder && !path.isAbsolute(folder))
- .map(folder => path.resolve(appDirectory, folder))
- .join(path.delimiter);
-
-// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
-// injected into the application via DefinePlugin in Webpack configuration.
-const REACT_APP = /^REACT_APP_/i;
-
-function getClientEnvironment(publicUrl) {
- const raw = Object.keys(process.env)
- .filter(key => REACT_APP.test(key))
- .reduce(
- (env, key) => {
- env[key] = process.env[key];
- return env;
- },
- {
- // Useful for determining whether we’re running in production mode.
- // Most importantly, it switches React into the correct mode.
- NODE_ENV: process.env.NODE_ENV || 'development',
- // Useful for resolving the correct path to static assets in `public`.
- // For example, .
- // This should only be used as an escape hatch. Normally you would put
- // images into the `src` and `import` them in code to get their paths.
- PUBLIC_URL: publicUrl,
- }
- );
- // Stringify all values so we can feed into Webpack DefinePlugin
- const stringified = {
- 'process.env': Object.keys(raw).reduce((env, key) => {
- env[key] = JSON.stringify(raw[key]);
- return env;
- }, {}),
- };
-
- return { raw, stringified };
-}
-
-module.exports = getClientEnvironment;
diff --git a/config/jest/cssTransform.js b/config/jest/cssTransform.js
deleted file mode 100644
index 8f65114..0000000
--- a/config/jest/cssTransform.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-// This is a custom Jest transformer turning style imports into empty objects.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process() {
- return 'module.exports = {};';
- },
- getCacheKey() {
- // The output is always the same.
- return 'cssTransform';
- },
-};
diff --git a/config/jest/fileTransform.js b/config/jest/fileTransform.js
deleted file mode 100644
index 74dc1aa..0000000
--- a/config/jest/fileTransform.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-
-const path = require('path');
-const camelcase = require('camelcase');
-
-// This is a custom Jest transformer turning file imports into filenames.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process(src, filename) {
- const assetFilename = JSON.stringify(path.basename(filename));
-
- if (filename.match(/\.svg$/)) {
- // Based on how SVGR generates a component name:
- // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
- const pascalCaseFileName = camelcase(path.parse(filename).name, {
- pascalCase: true,
- });
- const componentName = `Svg${pascalCaseFileName}`;
- return `const React = require('react');
- module.exports = {
- __esModule: true,
- default: ${assetFilename},
- ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
- return {
- $$typeof: Symbol.for('react.element'),
- type: 'svg',
- ref: ref,
- key: null,
- props: Object.assign({}, props, {
- children: ${assetFilename}
- })
- };
- }),
- };`;
- }
-
- return `module.exports = ${assetFilename};`;
- },
-};
diff --git a/config/modules.js b/config/modules.js
deleted file mode 100644
index 46d9c9e..0000000
--- a/config/modules.js
+++ /dev/null
@@ -1,88 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const path = require('path');
-const paths = require('./paths');
-const chalk = require('react-dev-utils/chalk');
-const resolve = require('resolve');
-
-/**
- * Get the baseUrl of a compilerOptions object.
- *
- * @param {Object} options
- */
-function getAdditionalModulePaths(options = {}) {
- const baseUrl = options.baseUrl;
-
- // We need to explicitly check for null and undefined (and not a falsy value) because
- // TypeScript treats an empty string as `.`.
- if (baseUrl == null) {
- // If there's no baseUrl set we respect NODE_PATH
- // Note that NODE_PATH is deprecated and will be removed
- // in the next major release of create-react-app.
-
- const nodePath = process.env.NODE_PATH || '';
- return nodePath.split(path.delimiter).filter(Boolean);
- }
-
- const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
-
- // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
- // the default behavior.
- if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
- return null;
- }
-
- // Allow the user set the `baseUrl` to `appSrc`.
- if (path.relative(paths.appSrc, baseUrlResolved) === '') {
- return [paths.appSrc];
- }
-
- // Otherwise, throw an error.
- throw new Error(
- chalk.red.bold(
- "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
- ' Create React App does not support other values at this time.'
- )
- );
-}
-
-function getModules() {
- // Check if TypeScript is setup
- const hasTsConfig = fs.existsSync(paths.appTsConfig);
- const hasJsConfig = fs.existsSync(paths.appJsConfig);
-
- if (hasTsConfig && hasJsConfig) {
- throw new Error(
- 'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
- );
- }
-
- let config;
-
- // If there's a tsconfig.json we assume it's a
- // TypeScript project and set up the config
- // based on tsconfig.json
- if (hasTsConfig) {
- const ts = require(resolve.sync('typescript', {
- basedir: paths.appNodeModules,
- }));
- config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
- // Otherwise we'll check if there is jsconfig.json
- // for non TS projects.
- } else if (hasJsConfig) {
- config = require(paths.appJsConfig);
- }
-
- config = config || {};
- const options = config.compilerOptions || {};
-
- const additionalModulePaths = getAdditionalModulePaths(options);
-
- return {
- additionalModulePaths: additionalModulePaths,
- hasTsConfig,
- };
-}
-
-module.exports = getModules();
diff --git a/config/paths.js b/config/paths.js
deleted file mode 100644
index f23c121..0000000
--- a/config/paths.js
+++ /dev/null
@@ -1,90 +0,0 @@
-'use strict';
-
-const path = require('path');
-const fs = require('fs');
-const url = require('url');
-
-// Make sure any symlinks in the project folder are resolved:
-// https://github.com/facebook/create-react-app/issues/637
-const appDirectory = fs.realpathSync(process.cwd());
-const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
-
-const envPublicUrl = process.env.PUBLIC_URL;
-
-function ensureSlash(inputPath, needsSlash) {
- const hasSlash = inputPath.endsWith('/');
- if (hasSlash && !needsSlash) {
- return inputPath.substr(0, inputPath.length - 1);
- } else if (!hasSlash && needsSlash) {
- return `${inputPath}/`;
- } else {
- return inputPath;
- }
-}
-
-const getPublicUrl = appPackageJson =>
- envPublicUrl || require(appPackageJson).homepage;
-
-// We use `PUBLIC_URL` environment variable or "homepage" field to infer
-// "public path" at which the app is served.
-// Webpack needs to know it to put the right
-