forked from Ada-C22/weather-report
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove references of yarn and upgrade parcel/eslint.config
- Loading branch information
Mikelle Wade
committed
Oct 23, 2024
1 parent
9fcb2e9
commit 0f78174
Showing
8 changed files
with
7,207 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.vscode | ||
.DS_Store | ||
node_modules | ||
.cache | ||
.parcel_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# Deploying to GitHub Pages with `parcel-bundler` | ||
# Deploying to GitHub Pages with `parcel` | ||
|
||
Follow the steps below to deploy to GitHub Pages using `parcel-bundler` | ||
Follow the steps below to deploy to GitHub Pages using `parcel` | ||
|
||
1. Create a new branch called `deployed-version` and switch to it. | ||
1. Install `parcel-bundler` | ||
2. Install `parcel-bundler` | ||
```bash | ||
yarn add --dev parcel[email protected] | ||
npm install parcel -D | ||
``` | ||
1. Install `gh-pages` | ||
3. Install `gh-pages` | ||
```bash | ||
yarn add --dev gh-pages | ||
1. Remove `script` tag with `"./node_modules/axios/dist/axios.min.js"` from `index.html` | ||
1. Add `import` statements to `index.js` | ||
npm install gh-pages -D | ||
4. Remove `script` tag with `"./node_modules/axios/dist/axios.min.js"` from `index.html` | ||
5. Add `import` statements to `index.js` | ||
```js | ||
import 'regenerator-runtime/runtime'; | ||
import axios from 'axios'; | ||
``` | ||
1. Add a `"scripts"` section to your `package.json`: | ||
6. Add a `"scripts"` section to your `package.json`: | ||
```json | ||
"scripts": { | ||
"predeploy": "rm -rf dist && yarn run build", | ||
"predeploy": "rm -rf dist && np, run build", | ||
"deploy": "gh-pages -d dist", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"dev": "parcel index.html ", | ||
|
@@ -30,28 +30,28 @@ Follow the steps below to deploy to GitHub Pages using `parcel-bundler` | |
<summary>Complete <code>package.json</code></summary> | ||
|
||
```json | ||
{ | ||
"dependencies": { | ||
"axios": "^0.27.2" | ||
}, | ||
"devDependencies": { | ||
"gh-pages": "^4.0.0", | ||
"parcel-bundler": "^1.12.5" | ||
}, | ||
{ | ||
"scripts": { | ||
"predeploy": "rm -rf dist && yarn run build", | ||
"predeploy": "rm -rf dist && npm run build", | ||
"deploy": "gh-pages -d dist", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"dev": "parcel index.html ", | ||
"build": "parcel build index.html --public-url /weather-report/" | ||
}, | ||
"dependencies": { | ||
"axios": "^1.7.7" | ||
}, | ||
"devDependencies": { | ||
"gh-pages": "^6.2.0", | ||
"parcel": "^2.12.0" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</details> | ||
1. Run `yarn run deploy` | ||
1. Confirm that the GitHub Pages branch is set to `gh-pages` in the GitHub UI by going to **Settings** --> **Pages** --> **Source** | ||
1. Navigate to `https://{your-user-name}.github.io/weather-report/` to see your deployed site. | ||
7. Run `npm run deploy` | ||
8. Confirm that the GitHub Pages branch is set to `gh-pages` in the GitHub UI by going to **Settings** --> **Pages** --> **Source** | ||
9. Navigate to `https://{your-user-name}.github.io/weather-report/` to see your deployed site. | ||
|
||
## Resources | ||
- [How to Use Axios with Javascript](https://www.digitalocean.com/community/tutorials/js-axios-vanilla-js) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import jest from "eslint-plugin-jest"; | ||
import react from "eslint-plugin-react"; | ||
import globals from "globals"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [...compat.extends("plugin:react/recommended", "standard"), { | ||
plugins: { | ||
jest, | ||
react, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
|
||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
|
||
rules: { | ||
"max-len": [1, 120, 2, { | ||
ignoreComments: true, | ||
}], | ||
|
||
"no-console": "off", | ||
quotes: ["warn", "single"], | ||
|
||
camelcase: ["error", { | ||
properties: "always", | ||
}], | ||
|
||
semi: ["warn", "always"], | ||
}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.