From c05ad5bd60fd87b742f834469e2d6b02abec3056 Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Tue, 7 Apr 2020 23:43:12 +0530 Subject: [PATCH] refactor: move files to source folder --- .eslintrc.json | 18 ++++++++++-------- README.md | 2 +- {src => source}/Background/index.ts | 0 {src => source}/ContentScript/index.ts | 0 {src => source}/Options/Options.tsx | 0 {src => source}/Options/index.tsx | 0 {src => source}/Options/styles.scss | 0 {src => source}/Popup/Popup.tsx | 0 {src => source}/Popup/index.tsx | 0 {src => source}/Popup/styles.scss | 0 {src => source}/assets/icons/favicon-128.png | Bin {src => source}/assets/icons/favicon-16.png | Bin {src => source}/assets/icons/favicon-32.png | Bin {src => source}/assets/icons/favicon-48.png | Bin {src => source}/manifest.json | 0 {src => source}/styles/_fonts.scss | 0 {src => source}/styles/_reset.scss | 0 {src => source}/styles/_variables.scss | 0 tsconfig.json | 2 +- webpack.config.js | 4 ++-- 20 files changed, 14 insertions(+), 12 deletions(-) rename {src => source}/Background/index.ts (100%) rename {src => source}/ContentScript/index.ts (100%) rename {src => source}/Options/Options.tsx (100%) rename {src => source}/Options/index.tsx (100%) rename {src => source}/Options/styles.scss (100%) rename {src => source}/Popup/Popup.tsx (100%) rename {src => source}/Popup/index.tsx (100%) rename {src => source}/Popup/styles.scss (100%) rename {src => source}/assets/icons/favicon-128.png (100%) rename {src => source}/assets/icons/favicon-16.png (100%) rename {src => source}/assets/icons/favicon-32.png (100%) rename {src => source}/assets/icons/favicon-48.png (100%) rename {src => source}/manifest.json (100%) rename {src => source}/styles/_fonts.scss (100%) rename {src => source}/styles/_reset.scss (100%) rename {src => source}/styles/_variables.scss (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 1b3a617..46d86d1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,9 +1,11 @@ { - "extends":["onepass"], + "extends": ["onepass"], "rules": { "no-console": 0, "no-extend-native": 0, - "react/jsx-filename-extension": [1, { "extensions": [".jsx", "tsx"] }], + "react/jsx-filename-extension": [1, { + "extensions": [".jsx", "tsx"] + }], "react/jsx-props-no-spreading": 0, "jsx-a11y/label-has-associated-control": 0, "prettier/prettier": [ @@ -17,11 +19,11 @@ ] }, "settings": { - "import/resolver": { - "node": { + "import/resolver": { + "node": { "extensions": [".js", ".jsx", ".ts", ".tsx"], - "moduleDirectory": ["node_modules", "src/"] - } - } - } + "moduleDirectory": ["node_modules", "source/"] + } + } + } } \ No newline at end of file diff --git a/README.md b/README.md index bd9f41e..963206a 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Then run the following: - Check the `Developer Mode` and load as unpacked from extension’s extracted directory. ### Generating browser specific manifest.json -Update `src/manifest.json` file with browser vendor prefixed manifest keys +Update `source/manifest.json` file with browser vendor prefixed manifest keys ```js { diff --git a/src/Background/index.ts b/source/Background/index.ts similarity index 100% rename from src/Background/index.ts rename to source/Background/index.ts diff --git a/src/ContentScript/index.ts b/source/ContentScript/index.ts similarity index 100% rename from src/ContentScript/index.ts rename to source/ContentScript/index.ts diff --git a/src/Options/Options.tsx b/source/Options/Options.tsx similarity index 100% rename from src/Options/Options.tsx rename to source/Options/Options.tsx diff --git a/src/Options/index.tsx b/source/Options/index.tsx similarity index 100% rename from src/Options/index.tsx rename to source/Options/index.tsx diff --git a/src/Options/styles.scss b/source/Options/styles.scss similarity index 100% rename from src/Options/styles.scss rename to source/Options/styles.scss diff --git a/src/Popup/Popup.tsx b/source/Popup/Popup.tsx similarity index 100% rename from src/Popup/Popup.tsx rename to source/Popup/Popup.tsx diff --git a/src/Popup/index.tsx b/source/Popup/index.tsx similarity index 100% rename from src/Popup/index.tsx rename to source/Popup/index.tsx diff --git a/src/Popup/styles.scss b/source/Popup/styles.scss similarity index 100% rename from src/Popup/styles.scss rename to source/Popup/styles.scss diff --git a/src/assets/icons/favicon-128.png b/source/assets/icons/favicon-128.png similarity index 100% rename from src/assets/icons/favicon-128.png rename to source/assets/icons/favicon-128.png diff --git a/src/assets/icons/favicon-16.png b/source/assets/icons/favicon-16.png similarity index 100% rename from src/assets/icons/favicon-16.png rename to source/assets/icons/favicon-16.png diff --git a/src/assets/icons/favicon-32.png b/source/assets/icons/favicon-32.png similarity index 100% rename from src/assets/icons/favicon-32.png rename to source/assets/icons/favicon-32.png diff --git a/src/assets/icons/favicon-48.png b/source/assets/icons/favicon-48.png similarity index 100% rename from src/assets/icons/favicon-48.png rename to source/assets/icons/favicon-48.png diff --git a/src/manifest.json b/source/manifest.json similarity index 100% rename from src/manifest.json rename to source/manifest.json diff --git a/src/styles/_fonts.scss b/source/styles/_fonts.scss similarity index 100% rename from src/styles/_fonts.scss rename to source/styles/_fonts.scss diff --git a/src/styles/_reset.scss b/source/styles/_reset.scss similarity index 100% rename from src/styles/_reset.scss rename to source/styles/_reset.scss diff --git a/src/styles/_variables.scss b/source/styles/_variables.scss similarity index 100% rename from src/styles/_variables.scss rename to source/styles/_variables.scss diff --git a/tsconfig.json b/tsconfig.json index 008dead..9c284fc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,6 @@ "skipLibCheck": true, }, "include": [ - "src" + "source" ] } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index dfac131..9c24bfd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,7 +12,7 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const viewsPath = path.join(__dirname, 'views'); -const sourcePath = path.join(__dirname, 'src'); +const sourcePath = path.join(__dirname, 'source'); const destPath = path.join(__dirname, 'extension'); const nodeEnv = process.env.NODE_ENV || 'development'; const targetBrowser = process.env.TARGET_BROWSER; @@ -143,7 +143,7 @@ module.exports = { // write css file(s) to build folder new MiniCssExtractPlugin({ filename: 'css/[name].css' }), // copy static assets - new CopyWebpackPlugin([{ from: 'src/assets', to: 'assets' }]), + new CopyWebpackPlugin([{ from: 'source/assets', to: 'assets' }]), // plugin to enable browser reloading in development mode extensionReloaderPlugin, ],