Skip to content

Commit

Permalink
Merge branch 'be/axios' of https://github.com/AdaGold/weather-report
Browse files Browse the repository at this point in the history
…into be/axios
  • Loading branch information
beccaelenzil committed May 26, 2022
2 parents 678cfe2 + 240e836 commit 15212b1
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ You are required to use vanilla JavaScript for all parts of this project, includ
## Axios
The only extra JavaScript library we should load is [`Axios`](https://axios-http.com/docs/intro).

To download the `axios` node module, run `npm install`
To download the `axios` node module, run `yarn install`

To include axios in your project, include the following script tag below the script tag linking `index.js`:
- `<script src="./node_modules/axios/dist/axios.min.js"></script>`

This should be done during the Wave 1 initial setup of your `index.html` page.

## Workflow Requirements

- Create at least five git commits throughout this project
Expand All @@ -73,7 +75,9 @@ To include axios in your project, include the following script tag below the scr

## Content Requirements

For this project, there are no requirements around color schemes, font choices, or layouts.
For this project, there are no requirements around color schemes, font choices, or layouts.

Note that applying styles with CSS is one of many learning goals of this project -- it is not the central learning goal. You may enjoy being creative with styles, but we encourage you to not concern yourself with getting the styles perfect. Remember, you can always choose to continue working on styling after you've completed all functional requirements.

However, _at a minimum_, your project must contain these elements:

Expand Down
59 changes: 59 additions & 0 deletions ada-project-docs/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Deploying to GitHub Pages with `parcel-bundler`

Follow the steps below to deploy to GitHub Pages using `parcel-bundler`

1. Create a new branch called `deployed-solution`
1. Install `parcel-bundler`
```bash
yarn add --dev parcel-bundler@1.12.5
```
1. 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`
```js
import 'regenerator-runtime/runtime';
import axios from 'axios';
```
1. Add a `"scripts"` section to your `package.json`:
```json
"scripts": {
"predeploy": "rm -rf dist && yarn 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/"
}
```
<details>
<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",
"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/"
}
}
```

</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.

## Resources
- [How to Use Axios with Javascript](https://www.digitalocean.com/community/tutorials/js-axios-vanilla-js)
- [How to publish a single page application at no cost with GitHub Pages (React, Svelte, etc)](https://levelup.gitconnected.com/how-to-publish-a-single-page-application-at-no-cost-with-github-pages-react-svelte-etc-897b8f75a22b)
- [Parcel with gh-pages GitHub issue](https://github.com/parcel-bundler/parcel/issues/505)
5 changes: 4 additions & 1 deletion ada-project-docs/optional-enhancements.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ It is more important and more valuable to do good work with the requirements, an
- Changing the sky should change the page's background.
- Include transitions and animations for any appearance change.
- Customize the theme of your app to something other than a landscape and sky (while retaining the same functionality).
- Deploy/host your project onto the Internet: If you deploy your *Weather Report web app*, you will also need to deploy the *Weather Report proxy server*.
- Deploy/host your project onto the Internet
- If you deploy your *Weather Report web app*, you will also need to deploy the *Weather Report proxy server*.
- We recommend deploying to GitHub Pages.
- We encourage you to do some of your own research and then review [our resource on deploying to GitHub Pages using `parcel-bundler`](./deploy.md) as needed.
3 changes: 2 additions & 1 deletion ada-project-docs/wave-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ You will need to link:
## Tips

- This project will require you to select _a lot_ of elements. Creating logical, well-organized HTML structures in the beginning will help you later on.
- Create as many `id`s as you need. Sometimes, it's more effective to select by ID, compared to selecting by class, element, or relationship.
- Create as many `id`s as you need. Sometimes, it's more effective to select by ID, compared to selecting by class, element, or relationship.
- To get a little more error reporting help from the browser, we can request [strict behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode). To turn this behavior on, add the literal string `"use strict";` to the top of your `index.js` file.
54 changes: 54 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==

axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.14.9"
form-data "^4.0.0"

combined-stream@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"

delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=

follow-redirects@^1.14.9:
version "1.15.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4"
integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==

form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==

mime-types@^2.1.12:
version "2.1.35"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
dependencies:
mime-db "1.52.0"

0 comments on commit 15212b1

Please sign in to comment.