-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from vivid-planet/add-demo-mailing-frontend
Add demo mailing frontend
- Loading branch information
Showing
66 changed files
with
2,609 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ chart/*/templates/* | |
admin/ | ||
api/ | ||
site/ | ||
campaign/ | ||
schema.graphql | ||
lang/ | ||
create-app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"eslint.workingDirectories": ["admin", "api", "site", "create-app"] | ||
"eslint.workingDirectories": ["admin", "api", "site", "create-app", "campaign"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const environment = ["API_URL", "ADMIN_URL", "SITES_CONFIG", "BUILD_DATE", "BUILD_NUMBER", "COMMIT_SHA", "CAMPAIGNS_FRONTEND_URL"]; | ||
export const environment = ["API_URL", "ADMIN_URL", "SITES_CONFIG", "BUILD_DATE", "BUILD_NUMBER", "COMMIT_SHA", "CAMPAIGN_URL"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ["./.eslintrc.json"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "@comet/eslint-config/nextjs", | ||
"ignorePatterns": ["**/**/*.generated.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
/lang-compiled/ | ||
/lang-extracted/ | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.secrets | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
.env | ||
schema.gql | ||
schema.json | ||
block-meta.json | ||
src/**/*.generated.ts | ||
preBuild/**/*.generated.ts | ||
comet-config.json | ||
|
||
public/sitemap.xml | ||
public/robots.txt | ||
|
||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 150, | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
client: { | ||
service: { | ||
name: "api", | ||
localSchemaFile: "./schema.graphql", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { CodegenConfig } from "@graphql-codegen/cli"; | ||
import { readFileSync } from "fs"; | ||
import { buildSchema } from "graphql"; | ||
|
||
const schema = buildSchema(readFileSync("./schema.gql").toString()); | ||
|
||
const rootBlocks = Object.keys(schema.getTypeMap()).filter((type) => type.endsWith("BlockData")); | ||
|
||
const pluginConfig = { | ||
avoidOptionals: { | ||
field: true, | ||
}, | ||
enumsAsTypes: true, | ||
namingConvention: "keep", | ||
scalars: rootBlocks.reduce((scalars, rootBlock) => ({ ...scalars, [rootBlock]: rootBlock }), { DateTime: "string" }), | ||
typesPrefix: "GQL", | ||
}; | ||
|
||
const config: CodegenConfig = { | ||
schema: "schema.gql", | ||
generates: { | ||
"./src/graphql.generated.ts": { | ||
plugins: [{ add: { content: `import { ${rootBlocks.sort().join(", ")} } from "./blocks.generated";` } }, "typescript"], | ||
config: pluginConfig, | ||
}, | ||
"./src/": { | ||
documents: ["./src/**/!(*.generated).{ts,tsx}", "./preBuild/src/**/!(*.generated).{ts,tsx}"], | ||
preset: "near-operation-file", | ||
presetConfig: { | ||
extension: ".generated.ts", | ||
baseTypesPath: "graphql.generated.ts", | ||
}, | ||
plugins: [ | ||
{ add: { content: `import { ${rootBlocks.sort().join(", ")} } from "@src/blocks.generated";` } }, | ||
"named-operations-object", | ||
"typescript-operations", | ||
], | ||
config: pluginConfig, | ||
}, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
|
||
cd "$(dirname "$0")" || exit | ||
|
||
rm -rf ./lang/ | ||
mkdir -p ./lang | ||
|
||
git clone https://github.com/vivid-planet/comet-starter-lang.git lang/comet-brevo-module-demo-lang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* eslint-disable */ | ||
|
||
// @ts-check | ||
const withBundleAnalyzer = require("@next/bundle-analyzer")({ | ||
enabled: process.env.ANALYZE === "true", | ||
}); | ||
|
||
const cometConfig = require("./comet-config.json"); | ||
|
||
/** | ||
* @type {import('next').NextConfig['i18n'] | undefined} | ||
**/ | ||
let i18n = undefined; | ||
|
||
if (process.env.NEXT_PUBLIC_CAMPAIGN_IS_PREVIEW !== "true") { | ||
if (!process.env.NEXT_PUBLIC_CAMPAIGN_LANGUAGES) { | ||
throw new Error("Missing environment variable NEXT_PUBLIC_CAMPAIGN_LANGUAGES"); | ||
} | ||
|
||
if (!process.env.NEXT_PUBLIC_CAMPAIGN_DEFAULT_LANGUAGE) { | ||
throw new Error("Missing environment variable NEXT_PUBLIC_CAMPAIGN_DEFAULT_LANGUAGE"); | ||
} | ||
|
||
i18n = { | ||
locales: process.env.NEXT_PUBLIC_CAMPAIGN_LANGUAGES.split(","), | ||
defaultLocale: process.env.NEXT_PUBLIC_CAMPAIGN_DEFAULT_LANGUAGE, | ||
localeDetection: process.env.NODE_ENV === "development" ? false : undefined, | ||
}; | ||
} | ||
|
||
/** | ||
* @type {import('next').NextConfig} | ||
**/ | ||
const nextConfig = { | ||
pageExtensions: ["page.ts", "page.tsx"], | ||
basePath: process.env.NEXT_PUBLIC_CAMPAIGN_IS_PREVIEW === "true" ? "/campaign" : "", | ||
images: { | ||
deviceSizes: cometConfig.dam.allowedImageSizes, | ||
}, | ||
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { | ||
var path = require("path"); | ||
|
||
config.resolve.alias["@src"] = path.resolve(__dirname, "src/"); | ||
|
||
return config; | ||
}, | ||
i18n, | ||
typescript: { | ||
ignoreBuildErrors: process.env.NODE_ENV === "production", | ||
}, | ||
eslint: { | ||
ignoreDuringBuilds: process.env.NODE_ENV === "production", | ||
}, | ||
compiler: { | ||
styledComponents: true, | ||
}, | ||
async rewrites() { | ||
return [ | ||
{ | ||
source: "/", | ||
destination: "/api", | ||
}, | ||
]; | ||
}, | ||
// https://nextjs.org/docs/advanced-features/security-headers | ||
headers: async () => [ | ||
{ | ||
source: "/:path*", | ||
headers: [ | ||
{ | ||
key: "X-DNS-Prefetch-Control", | ||
value: "on", | ||
}, | ||
{ | ||
key: "Strict-Transport-Security", | ||
value: "max-age=63072000; includeSubDomains; preload", | ||
}, | ||
{ | ||
key: "X-XSS-Protection", | ||
value: "1; mode=block", | ||
}, | ||
{ | ||
key: "X-Frame-Options", | ||
value: "SAMEORIGIN", | ||
}, | ||
{ | ||
key: "Permissions-Policy", | ||
value: "", | ||
}, | ||
{ | ||
key: "X-Content-Type-Options", | ||
value: "nosniff", | ||
}, | ||
{ | ||
key: "Referrer-Policy", | ||
value: "strict-origin-when-cross-origin", | ||
}, | ||
{ | ||
key: "Content-Security-Policy", | ||
value: ` | ||
default-src 'self' https:; | ||
img-src 'self' https: data:${process.env.NODE_ENV === "development" ? " http:" : ""}; | ||
media-src 'self' https: data:${process.env.NODE_ENV === "development" ? " http:" : ""}; | ||
style-src 'self' 'unsafe-inline'; | ||
font-src 'self' https: data:; | ||
script-src 'self' 'unsafe-inline' https:${process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""}; | ||
connect-src 'self' https:${process.env.NODE_ENV === "development" ? " http:" : ""}; | ||
frame-ancestors ${process.env.ADMIN_URL}; | ||
` | ||
.replace(/\s{2,}/g, " ") | ||
.trim(), | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = withBundleAnalyzer(nextConfig); |
Oops, something went wrong.