Skip to content

Commit

Permalink
feat(candidat): finalized project migration
Browse files Browse the repository at this point in the history
  • Loading branch information
fbonniec committed Jul 10, 2024
1 parent b86503f commit 3f5665e
Show file tree
Hide file tree
Showing 123 changed files with 12,766 additions and 590 deletions.
6 changes: 6 additions & 0 deletions packages/reva-api/infra/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import keycloakPlugin from "./plugins/keycloak-plugin";
const APP_ROUTE_PATH = "/app";
const ADMIN_ROUTE_PATH = "/admin";
const ADMIN_REACT_ROUTE_PATH = "/admin2";
const CANDIDAT_ROUTE_PATH = "/candidat";

type BuilAppOptions = FastifyServerOptions & {
keycloakPluginMock?: FastifyPluginAsync<FastifyPluginOptions>;
Expand Down Expand Up @@ -85,6 +86,11 @@ export const buildApp = async (
prefix: ADMIN_REACT_ROUTE_PATH,
});

app.register(proxy, {
upstream: "http://localhost:3004/candidat",
prefix: CANDIDAT_ROUTE_PATH,
});

app.register(cors, {
origin: true,
});
Expand Down
5 changes: 5 additions & 0 deletions packages/reva-candidat/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NEXT_PUBLIC_REACT_STRICT_MODE=

NEXT_PUBLIC_APP_CANDIDAT_KEYCLOAK_CLIENT_ID=
NEXT_PUBLIC_APP_CANDIDAT_KEYCLOAK_REALM=
NEXT_PUBLIC_APP_CANDIDAT_KEYCLOAK_URL=
2 changes: 1 addition & 1 deletion packages/reva-candidat/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"]
}
2 changes: 2 additions & 0 deletions packages/reva-candidat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

/**/generated/
4 changes: 4 additions & 0 deletions packages/reva-candidat/.graphqlrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .graphqlrc.yml
# config for the vscode graphql plugin (https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql)
schema: "../reva-api/modules/generated-graphql-schema.graphql"
documents: "src/**/*.{graphql,js,ts,jsx,tsx}"
19 changes: 19 additions & 0 deletions packages/reva-candidat/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
overwrite: true,
schema: "../reva-api/modules/generated-graphql-schema.graphql",
documents: ["src/**/*.tsx", "src/**/*.ts"],
generates: {
"src/graphql/generated/": {
preset: "client",
plugins: [],
config: {
enumsAsTypes: true,
},
},
},
config: { scalars: { Timestamp: "number" } },
};

export default config;
29 changes: 29 additions & 0 deletions packages/reva-candidat/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: "/candidat",
reactStrictMode:
process.env.NEXT_PUBLIC_REACT_STRICT_MODE != undefined
? JSON.parse(process.env.NEXT_PUBLIC_REACT_STRICT_MODE)
: true,
transpilePackages: ["@codegouvfr/react-dsfr"],
swcMinify: true,
images: { unoptimized: true }, //needed for next export
trailingSlash: true,
webpack: (config) => {
config.module.rules.push({
test: /\.woff2$/,
type: "asset/resource",
});
return config;
},
rewrites: async () => {
return [
{
source: "/api/preview/:path*",
destination: "http://localhost:8080/api/preview/:path*",
},
];
},
};

module.exports = nextConfig;
4 changes: 0 additions & 4 deletions packages/reva-candidat/next.config.mjs

This file was deleted.

Loading

0 comments on commit 3f5665e

Please sign in to comment.