Skip to content

Commit

Permalink
Merge branch 'api-platform:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
CobraSphere-IB authored Sep 20, 2024
2 parents 768248e + 707679b commit fe0cbd9
Show file tree
Hide file tree
Showing 9 changed files with 800 additions and 865 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ jobs:
compose.yaml
compose.override.yaml
set: |
*.cache-from=type=gha,scope=${{github.ref}}
*.cache-from=type=gha,scope=refs/heads/main
*.cache-to=type=gha,scope=${{github.ref}},mode=max
php.cache-from=type=gha,scope=php-${{github.ref}}
php.cache-from=type=gha,scope=php-refs/heads/main
php.cache-to=type=gha,scope=php-${{github.ref}},mode=max
pwa.cache-from=type=gha,scope=pwa-${{github.ref}}
pwa.cache-from=type=gha,scope=pwa-refs/heads/main
pwa.cache-to=type=gha,scope=pwa-${{github.ref}},mode=max
-
name: Start services
run: docker compose up --wait --no-build
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ jobs:
compose.yaml
compose.override.yaml
set: |
*.cache-from=type=gha,scope=${{github.ref}}
*.cache-from=type=gha,scope=refs/heads/main
*.cache-to=type=gha,scope=${{github.ref}},mode=max
php.cache-from=type=gha,scope=php-${{github.ref}}
php.cache-from=type=gha,scope=php-refs/heads/main
php.cache-to=type=gha,scope=php-${{github.ref}},mode=max
pwa.cache-from=type=gha,scope=pwa-${{github.ref}}
pwa.cache-from=type=gha,scope=pwa-refs/heads/main
pwa.cache-to=type=gha,scope=pwa-${{github.ref}},mode=max
-
name: Update API Platform
run: docker compose run php composer update api-platform/core:${{ inputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#syntax=docker/dockerfile:1.4
#syntax=docker/dockerfile:1

# Adapted from https://github.com/dunglas/symfony-docker

Expand Down
13 changes: 9 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ services:
# You should definitely change the password in production
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-!ChangeMe!}
- POSTGRES_USER=${POSTGRES_USER:-app}
healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- db_data:/var/lib/postgresql/data
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./api/docker/db/data:/var/lib/postgresql/data
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./api/docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###

# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
Expand All @@ -59,7 +64,7 @@ volumes:
caddy_data:
caddy_config:
###> doctrine/doctrine-bundle ###
db_data:
database_data:
###< doctrine/doctrine-bundle ###
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
2 changes: 1 addition & 1 deletion pwa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#syntax=docker/dockerfile:1.4
#syntax=docker/dockerfile:1


# Versions
Expand Down
10 changes: 10 additions & 0 deletions pwa/components/admin/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { HydraAdmin } from "@api-platform/admin";

const App = () => (
<HydraAdmin
entrypoint={window.origin}
title="API Platform admin"
></HydraAdmin>
);

export default App;
19 changes: 9 additions & 10 deletions pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@
"lint": "next lint"
},
"dependencies": {
"@api-platform/admin": "^3.4.7",
"@api-platform/admin": "^4.0.1",
"@fontsource/poppins": "^5.0.14",
"@tailwindcss/forms": "^0.5.7",
"admin:v3.4.8": "link:@api-platform/admin:v3.4.8",
"formik": "^2.4.6",
"isomorphic-unfetch": "^4.0.2",
"next": "^14.2.3",
"postcss": "^8.4.38",
"next": "^14.2.5",
"postcss": "^8.4.41",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-query": "^3.39.3"
},
"devDependencies": {
"@babel/core": "^7.24.6",
"@babel/core": "^7.25.2",
"@popperjs/core": "^2.11.8",
"@types/node": "^20.12.12",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.3",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
"eslint-config-next": "^14.2.5",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
},
"peerDependencies": {
"@babel/core": "^7.19.0",
Expand Down
29 changes: 8 additions & 21 deletions pwa/pages/admin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import Head from "next/head";
import { useEffect, useState } from "react";
import type { NextPage } from "next";
import dynamic from "next/dynamic";

const Admin = () => {
// Load the admin client-side
const [DynamicAdmin, setDynamicAdmin] = useState(<p>Loading...</p>);
useEffect(() => {
(async () => {
const HydraAdmin = (await import("@api-platform/admin")).HydraAdmin;
// load the admin client-side
const App = dynamic(() => import("../../components/admin/App"), {
ssr: false,
loading: () => <p>Loading...</p>,
});

setDynamicAdmin(<HydraAdmin entrypoint={window.origin}></HydraAdmin>);
})();
}, []);
const Admin: NextPage = () => <App />;

return (
<>
<Head>
<title>API Platform Admin</title>
</Head>

{DynamicAdmin}
</>
);
};
export default Admin;
Loading

0 comments on commit fe0cbd9

Please sign in to comment.