Skip to content

Commit 69a7af9

Browse files
authored
Welcome message component + updated initial scaffolding (#13)
1 parent e79b910 commit 69a7af9

24 files changed

+11414
-5868
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/setup-node@v4
1616

1717
- name: Install dependencies
18-
run: yarn install
18+
run: npm install
1919

2020
- name: Run tests
21-
run: yarn run test
21+
run: npm run test
2222

23-
- name: Upload reports
24-
run: npx codecov
23+
# - name: Upload reports
24+
# run: npx codecov

.github/workflows/gh-pages-main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- uses: actions/setup-node@v4
2020

2121
- name: Install dependencies
22-
run: yarn install
22+
run: npm install
2323

2424
- name: Create build files for gh-pages deploy
25-
run: yarn ghpages:build
25+
run: npm run ghpages:build
2626

2727
# Reference: https://github.com/JamesIves/github-pages-deploy-action
2828
- name: Deploy 🚀

.github/workflows/pr-preview.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424

2525
- name: Install and Build
2626
run: |
27-
yarn install
28-
yarn ghpages:build
27+
npm install
28+
npm run ghpages:build
2929
3030
# Reference: https://github.com/rossjrw/pr-preview-action
3131
- name: Deploy preview

README.md

+10-134
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,20 @@
1-
![Build Status](https://github.com/internetarchive/iaux-typescript-wc-template/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/internetarchive/iaux-typescript-wc-template/branch/main/graph/badge.svg?token=ZOYRJ2BV9W)](https://codecov.io/gh/internetarchive/iaux-typescript-wc-template)
1+
@@ -1,144 +1,17 @@
2+
![Build Status](https://github.com/internetarchive/iaux-monthly-giving-circle/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/internetarchive/iaux-monthly-giving-circle/branch/main/graph/badge.svg?token=ZOYRJ2BV9W)](https://codecov.io/gh/internetarchive/iaux-monthly-giving-circle)
23

3-
# Internet Archive Typescript WebComponent Template
4+
# \<iaux-monthly-giving-circle>
45

5-
This is a base template for creating Typescript WebComponents. It is based off of the [Open WebComponents generator](https://open-wc.org/docs/development/generator/) with some IA-specific customizations and some development niceities.
6+
The Internet Archive monthly donation management, web components.
67

7-
## Usage
8-
9-
1. Click the "Use this Template" button in GitHub to create a new repository based on this one.
10-
2. Clone your new repo and update the things below:
11-
12-
### Things to update in your copy
13-
1. Remove this section
14-
2. Search for the strings `your-webcomponent` and `YourWebComponent` and those are most of the spots that need to be updated.
15-
3. `README.md` (this file). Update the readme in general, but also the badge URLs
16-
4. `package.json` Update the name and description
17-
5. Rename the `your-webcomponent.ts` and its associated `.test` file
18-
19-
## Local Demo with `web-dev-server`
20-
```bash
21-
yarn start
22-
```
23-
To run a local development server that serves the basic demo located in `demo/index.html`
24-
25-
## Testing with Web Test Runner
26-
To run the suite of Web Test Runner tests, run
27-
```bash
28-
yarn run test
29-
```
30-
31-
To run the tests in watch mode (for &lt;abbr title=&#34;test driven development&#34;&gt;TDD&lt;/abbr&gt;, for example), run
32-
33-
```bash
34-
yarn run test:watch
35-
```
36-
37-
## Linting with ESLint, Prettier, and Types
38-
To scan the project for linting errors, run
39-
```bash
40-
yarn run lint
41-
```
42-
43-
You can lint with ESLint and Prettier individually as well
44-
```bash
45-
yarn run lint:eslint
46-
```
8+
## Installation
479
```bash
48-
yarn run lint:prettier
10+
npm i @internetarchive/donation-monthly-portal
4911
```
5012

51-
To automatically fix many linting errors, run
52-
```bash
53-
yarn run format
13+
## Usage
14+
```html
15+
please see demo.
5416
```
5517

56-
You can format using ESLint and Prettier individually as well
5718
```bash
58-
yarn run format:eslint
59-
```
60-
```bash
61-
yarn run format:prettier
62-
```
63-
64-
## Tooling configs
65-
66-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
67-
68-
If you customize the configuration a lot, you can consider moving them to individual files.
69-
70-
### Add Codecov
71-
- after forking, add your repo to the authorized codecov list: `https://github.com/organizations/internetarchive/settings/installations/1268216`
72-
- then, go to the badge maker page for your repo: `https://app.codecov.io/gh/internetarchive/<repo-name>/settings/badge`
73-
- copy link & paste into top of README.md
74-
75-
## Steps to setup `gh-pages` static site generator
76-
77-
Let's start with creating a `gh-pages` branch.
78-
79-
This branch is where Github will look for the `index.html` to be hosted
80-
81-
```
82-
git checkout --orphan gh-pages
83-
git reset --hard
84-
git commit --allow-empty -m "Initializing gh-pages branch"
85-
git push origin gh-pages
86-
```
87-
88-
### Additional setup
89-
90-
- Go to repo `Settings` -> sidebar `Pages`
91-
- In the `Source` drop-down, choose the branch where you want to host your Github Pages and the `directory` where it was hosted
92-
- We'll use `gh-pages` branch for this but you can use other branch name for this
93-
- Just make sure that's the branch where the `index.html` that you want to host lives in
94-
95-
<p align="center">
96-
<img src="screenshot/gh-pages-settings.png" alt="Github Pages Settings" style="height:720px; width:890px;">
97-
</p>
98-
99-
## Manual Deploy using `gh-pages`
100-
101-
You can update the current Github Page without pushing a commit by running:
19+
npm i && npm start
10220
```
103-
yarn run ghpages:publish
104-
```
105-
106-
This build script does the following, see `package.json`:
107-
- `ghpages:publish`
108-
- This executes `ghpages:prepare` in the current branch you are currently working on
109-
- Note: The branch name is required so that it will not override the whole Github Pages directory
110-
- You can check it by navigating through the branch name files directory you set from the [step to setup `gh-pages` branch](#steps-to-setup-gh-pages)
111-
- You can checkout how it looks like in one of our projects here: [https://github.com/internetarchive/iaux-collection-browser/tree/gh-pages](https://github.com/internetarchive/iaux-collection-browser/tree/gh-pages)
112-
113-
- `ghpages:prepare`
114-
- This executes `ghpages:build` that builds the project dependencies and generates `vite` build from it
115-
- We use [vite](https://vitejs.dev/) to bundle and generate the static assets that we host in Github Pages
116-
- See `vite.config.ts` related to this
117-
118-
- `ghpages:generate`
119-
- This executes `gh-pages` [npm package](https://www.npmjs.com/package/gh-pages) command to publish/upload the generated files from our `vite` build files
120-
- Upon executing this command:
121-
- This generates a commit message formatted from the most recent commit message of the branch
122-
- Push the commit to `gh-pages` branch that we setup earlier
123-
124-
The live demo app URL from current branch will look something like this:
125-
`https://<organization_name_or_username>.github.io/<repo_name>/<branch_name>/demo`
126-
127-
## Automatic Deploy of Demo App
128-
129-
Things that trigger automatic site generation:
130-
- a merge to `main`
131-
- See workflow: `gh-pages-main.yml`
132-
- Example: `https://<organization_name_or_username>.github.io/<repo_name>/main`
133-
134-
- a pull request against `main`
135-
- See workflow: `pr-preview.yml`
136-
- The URL for your Pull Request will be deleted after merging to main but you can update that in the config
137-
- When you create a Pull Request, if your code passes codecov unit tests, it will be always served live at base URL/pull request number.
138-
- Example: `https://<organization_name_or_username>.github.io/<repo_name>/pr/<pr-number>/demo`
139-
- Note that `demo` is another directory where the `index.html` lives in
140-
- You are free to playaround with it and set your desired file directory/structure on your end
141-
142-
Another thing to note: pushing a branch up alone will not trigger site creation.
143-
144-
Happy devving ^_^ 🥳 🎉

demo/app-root.ts

-20
This file was deleted.

demo/assets/style.css

Whitespace-only changes.

demo/data-recent-donations.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"success": true,
3+
"value": {
4+
'donation1': {
5+
id: 1,
6+
amount: 100
7+
8+
}
9+
10+
}
11+
}

demo/data-short.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"success": true,
3+
"value": {
4+
"41": {
5+
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtYWlsc3luYyIsImlhdCI6MTcyMzc1MDI3OS41MjgwMjksIm5iZiI6MTcyMzc1MDIxOS41MjgwMjksImV4cCI6MTcyMzc1MDg3OS41MjgwMjksImtleSI6eyJwaWQiOiI1czUzazYiLCJjaWQiOjgwMzUzOCwiYW1vdW50IjoxMCwicGF5bWVudE1ldGhvZFRva2VuIjoiZ3l3ZnA5IiwiY3VzdG9tZXJJZCI6IjY5OTk2NjAyNiJ9LCJ1c2VyIjoiQGlzYS1hdC10aGUtYXJjaGl2ZSJ9.drnp9oK-UVsuzuRAW_MTFjdWjiS630B88P-c0jDzzVw",
6+
"amount": 10,
7+
"start_date": "2024-05-22 00:00:00",
8+
"contribution_status_id": 5,
9+
"is_test": true,
10+
"btdata": {
11+
"billingDayOfMonth": 22,
12+
"nextBillingDate": {
13+
"date": "2024-08-22 00:00:00.000000",
14+
"timezone_type": 3,
15+
"timezone": "UTC"
16+
},
17+
"status": "Active",
18+
"paymentMethodType": "Paypal",
19+
"last4": null,
20+
"cardType": null,
21+
"expirationMonth": null,
22+
"expirationYear": null,
23+
"paypalEmail": "[email protected]"
24+
}
25+
},
26+
"23764": {
27+
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtYWlsc3luYyIsImlhdCI6MTcyMzc1MDI3OS41Mjg3NzEsIm5iZiI6MTcyMzc1MDIxOS41Mjg3NzEsImV4cCI6MTcyMzc1MDg3OS41Mjg3NzEsImtleSI6eyJwaWQiOiI4NWRyNzIiLCJjaWQiOjgwMzUzOCwiYW1vdW50Ijo1LCJwYXltZW50TWV0aG9kVG9rZW4iOiJjZXBha256ZCIsImN1c3RvbWVySWQiOiIyOTY3MjM2OTUifSwidXNlciI6IkBpc2EtYXQtdGhlLWFyY2hpdmUifQ.csGjSCrk3FV-mm7O1SwoUKCghwTQCRaD8_LJemo4YhQ",
28+
"amount": 5,
29+
"start_date": "2022-12-09 00:00:00",
30+
"contribution_status_id": 5,
31+
"is_test": true,
32+
"btdata": {
33+
"billingDayOfMonth": 9,
34+
"nextBillingDate": {
35+
"date": "2024-09-09 00:00:00.000000",
36+
"timezone_type": 3,
37+
"timezone": "UTC"
38+
},
39+
"status": "Active",
40+
"paymentMethodType": "creditCard",
41+
"last4": "1111",
42+
"cardType": "Visa",
43+
"expirationMonth": "12",
44+
"expirationYear": "2023"
45+
}
46+
},
47+
"35406": {
48+
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtYWlsc3luYyIsImlhdCI6MTcyMzc1MDI3OS41MjcyMTYsIm5iZiI6MTcyMzc1MDIxOS41MjcyMTYsImV4cCI6MTcyMzc1MDg3OS41MjcyMTYsImtleSI6eyJwaWQiOiIyN21yNnIiLCJjaWQiOjgwMzUzOCwiYW1vdW50Ijo1LCJwYXltZW50TWV0aG9kVG9rZW4iOiI4dDduenFnIiwiY3VzdG9tZXJJZCI6Ijg1MzkzMjIxMyJ9LCJ1c2VyIjoiQGlzYS1hdC10aGUtYXJjaGl2ZSJ9.Si-IBV0VhSwTL1SDXpn5bfuFP4qp-r9Jkoe4bw4eRyw",
49+
"amount": 5,
50+
"start_date": "2024-07-01 00:00:00",
51+
"contribution_status_id": 5,
52+
"is_test": true,
53+
"btdata": {
54+
"billingDayOfMonth": 22,
55+
"nextBillingDate": {
56+
"date": "2024-08-22 00:00:00.000000",
57+
"timezone_type": 3,
58+
"timezone": "UTC"
59+
},
60+
"status": "Active",
61+
"paymentMethodType": "Venmo",
62+
"last4": null,
63+
"cardType": null,
64+
"expirationMonth": null,
65+
"expirationYear": null,
66+
"venmoUsername": "venmojoe"
67+
}
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)