Skip to content

Commit a614ac8

Browse files
authored
Merge pull request #112 from soup-bowl/beta
Ionic verison
2 parents a5e3125 + b4fd305 commit a614ac8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7063
-3477
lines changed

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
},
6+
extends: ["plugin:react/recommended", "eslint:recommended"],
7+
parserOptions: {
8+
ecmaVersion: 2020,
9+
},
10+
rules: {
11+
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
13+
},
14+
}

.github/dependabot.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "npm"
9-
directory: "/"
10-
schedule:
11-
interval: "monthly"
12-
groups:
13-
dev-dependencies:
14-
patterns:
15-
- "*"
8+
- package-ecosystem: "npm"
9+
directory: "/"
10+
schedule:
11+
interval: "monthly"
12+
groups:
13+
dev-dependencies:
14+
patterns:
15+
- "*"

.github/docker-compose.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
version: "3.6"
22
services:
3-
db:
4-
image: docker.io/library/mariadb:10.5.15
5-
volumes:
6-
- db_persist:/var/lib/mysql
7-
environment:
8-
MYSQL_ROOT_PASSWORD: password
9-
MYSQL_DATABASE: wordpress
10-
wp:
11-
depends_on:
12-
- db
13-
build:
14-
context: .
15-
volumes:
16-
- "wp_persist:/var/www/html"
17-
ports:
18-
- 8080:80
19-
environment:
20-
WORDPRESS_DB_HOST: db
21-
WORDPRESS_DB_USER: root
22-
WORDPRESS_DB_PASSWORD: password
23-
WORDPRESS_DEBUG: 1
24-
WORDPRESS_CONFIG_EXTRA: |
25-
define( 'WP_ALLOW_MULTISITE', true );
3+
db:
4+
image: docker.io/library/mariadb:10.5.15
5+
volumes:
6+
- db_persist:/var/lib/mysql
7+
environment:
8+
MYSQL_ROOT_PASSWORD: password
9+
MYSQL_DATABASE: wordpress
10+
wp:
11+
depends_on:
12+
- db
13+
build:
14+
context: .
15+
volumes:
16+
- "wp_persist:/var/www/html"
17+
ports:
18+
- 8080:80
19+
environment:
20+
WORDPRESS_DB_HOST: db
21+
WORDPRESS_DB_USER: root
22+
WORDPRESS_DB_PASSWORD: password
23+
WORDPRESS_DEBUG: 1
24+
WORDPRESS_CONFIG_EXTRA: |
25+
define( 'WP_ALLOW_MULTISITE', true );
2626
volumes:
27-
wp_persist:
28-
db_persist:
27+
wp_persist:
28+
db_persist:

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@
99
/coverage
1010

1111
# production
12-
/build
1312
/dist
14-
/dev-dist
1513

1614
# misc
1715
.DS_Store
1816
.env.local
1917
.env.development.local
2018
.env.test.local
2119
.env.production.local
22-
*.local
20+
/.nx
21+
/.nx/cache
22+
/.vscode/*
23+
!/.vscode/extensions.json
24+
.idea
2325

2426
npm-debug.log*
2527
yarn-debug.log*
2628
yarn-error.log*
29+
30+
# Optional eslint cache
31+
.eslintcache

.gitpod.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
tasks:
2-
- name: WordPress Mock Site
3-
before: |
4-
docker-compose -f .github/docker-compose.yml build
5-
command: |
6-
docker-compose -f .github/docker-compose.yml up -d
7-
echo "Pausing for MySQL to complete..." && sleep 30
8-
docker-compose -f .github/docker-compose.yml exec wp wp core install --url="$(gp url 8080)" --title="Dummy Site" \
9-
--admin_user="admin" --admin_password="password" --admin_email="site@example.com" --allow-root
10-
docker-compose -f .github/docker-compose.yml exec wp wp rewrite structure '/%year%/%monthnum%/%postname%' \
11-
--allow-root
12-
docker-compose -f .github/docker-compose.yml logs -f
13-
- name: WordPress App
14-
before: |
15-
npm install
16-
command: |
17-
echo "PUBLIC_URL=$(gp url 3000)" > .env.development.local
18-
echo "REACT_APP_VERSION=\$npm_package_version" >> .env.development.local
19-
cp .env.development.local .env.production.local
20-
npm start
2+
- name: WordPress Mock Site
3+
before: |
4+
docker-compose -f .github/docker-compose.yml build
5+
command: |
6+
docker-compose -f .github/docker-compose.yml up -d
7+
echo "Pausing for MySQL to complete..." && sleep 30
8+
docker-compose -f .github/docker-compose.yml exec wp wp core install --url="$(gp url 8080)" --title="Dummy Site" \
9+
--admin_user="admin" --admin_password="password" --admin_email="site@example.com" --allow-root
10+
docker-compose -f .github/docker-compose.yml exec wp wp rewrite structure '/%year%/%monthnum%/%postname%' \
11+
--allow-root
12+
docker-compose -f .github/docker-compose.yml logs -f
13+
- name: WordPress App
14+
before: |
15+
npm i -g @ionic/cli
16+
npm ci
17+
command: |
18+
npm i -g @ionic/cli
19+
echo "PUBLIC_URL=$(gp url 3000)" > .env.development.local
20+
echo "REACT_APP_VERSION=\$npm_package_version" >> .env.development.local
21+
cp .env.development.local .env.production.local
22+
ionic serve --no-open
2123
2224
ports:
23-
- name: Frontend
24-
port: 3000
25-
description: React PWA app
26-
visibility: public
27-
onOpen: open-browser
28-
- name: Mock WordPress
29-
port: 8080
30-
description: To run tests against.
31-
visibility: public
32-
onOpen: ignore
25+
- name: Frontend
26+
port: 8100
27+
description: Ionic app
28+
visibility: public
29+
onOpen: open-browser
30+
- name: Mock WordPress
31+
port: 8080
32+
description: To run tests against.
33+
visibility: public
34+
onOpen: ignore

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"trailingComma": "es5",
33
"printWidth": 120,
44
"useTabs": true,
5+
"tabWidth": 4,
56
"semi": false
67
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["ionic.ionic"]
3+
}

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</p>
66

77
<p align="center">
8-
<img src="https://f.subo.dev/i/pressify-app-image.webp" />
8+
<img src="https://f.subo.dev/i/pressify2-app-image.webp" />
99
</p>
1010

1111
Uses the power of the **[WordPress REST API][wapi]** and **[Progressive Web Apps][pwa]** to form a portable app viewer for WordPress-based sites.
@@ -14,12 +14,12 @@ Uses the power of the **[WordPress REST API][wapi]** and **[Progressive Web Apps
1414

1515
For a site to work, it has to meet the following criteria:
1616

17-
- A **WordPress site** with the **WP-JSON API endpoint** visible.
18-
- This is 'on' by default, but some security plugins suggest disabling it for 'security' reasons.
19-
- The API is **not** behind a **strict CORS policy**.
20-
- The WordPress site hasn't customised the default access policies.
21-
- A typical custom config will be to require authentication for viewing endpoints, which this tool will not handle.
22-
- The tool is built to handle these scenarios, but will degrade the experience.
17+
- A **WordPress site** with the **WP-JSON API endpoint** visible.
18+
- This is 'on' by default, but some security plugins suggest disabling it for 'security' reasons.
19+
- The API is **not** behind a **strict CORS policy**.
20+
- The WordPress site hasn't customised the default access policies.
21+
- A typical custom config will be to require authentication for viewing endpoints, which this tool will not handle.
22+
- The tool is built to handle these scenarios, but will degrade the experience.
2323

2424
> [!WARNING]
2525
> While we will [sanitise the HTML response](https://www.npmjs.com/package/dompurify) from the source API, this tool will obtain and display HTML from the specified site. Please only **use this tool with websites you trust**!
@@ -40,8 +40,8 @@ For a site to work, it has to meet the following criteria:
4040
This project requires NodeJS to develop, test and compile the code. The following will quickstart you.
4141

4242
```bash
43-
npm install
44-
npm start
43+
npm ci
44+
npm run serve
4545
```
4646

4747
The API the system will communicate with is defined in the appropriate `.env`.
@@ -54,12 +54,6 @@ If you want to test the PWA functionality locally, you can add the following to
5454
devOptions: { enabled: true },
5555
```
5656

57-
## react-hooks/exhaustive-deps
58-
59-
This has been ignored on the UseEffect commands where the WP API is called. This is because once wp is added to the
60-
dependency array, an infinite loop is triggered. I welcome thoughts and suggestions to fix this, but until then (and it
61-
causing no foreseeable bugs), it has been disabled.
62-
6357
[live]: https://pressify.app
6458
[wapi]: https://developer.wordpress.org/rest-api/
6559
[wapj]: https://github.com/WP-API/node-wpapi

capacitor.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { CapacitorConfig } from "@capacitor/cli"
2+
3+
const config: CapacitorConfig = {
4+
appId: "io.ionic.starter",
5+
appName: "pressify2",
6+
webDir: "dist",
7+
}
8+
9+
export default config

eslint.config.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)