@kvihaugen/create-frontend-app 1.1.2 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/src/index.ts +5 -10
- package/template/next.config.ts +21 -0
- package/template/postcss.config.mjs +18 -0
- package/template/public/.well-known/app.webmanifest +1 -0
- package/template/public/.well-known/robots.txt +7 -0
- package/template/public/.well-known/security.txt +29 -0
- package/template/src/app/layout.tsx +87 -0
- package/template/src/app/page.tsx +14 -0
- package/template/src/components/common/Providers.tsx +17 -0
- package/template/src/css/globals.css +4 -0
- package/template/src/types/common/ParentProps.ts +7 -0
- package/template/src/utils/csp-policy.ts +15 -0
- package/template/src/utils/hooks/useColorScheme.ts +30 -0
- package/template/src/utils/hooks/usePrimaryColorShade.ts +17 -0
- package/template/src/utils/i18n/index.ts +15 -0
- package/template/src/utils/i18n/resources/en.json +7 -0
package/dist/index.js
CHANGED
|
@@ -10,19 +10,14 @@ const cwd = process.cwd();
|
|
|
10
10
|
const tempFolderPath = path.join(os.tmpdir(), `${Date.now()}-create-frontend-app`);
|
|
11
11
|
{
|
|
12
12
|
console.log("\t- 🔃 Generating Next.js app...");
|
|
13
|
-
const emitter = degit("LarsSK06/frontend-template");
|
|
14
|
-
await emitter.clone(tempFolderPath);
|
|
15
13
|
execSync("npx create-next-app . --yes --empty --skip-install");
|
|
16
14
|
console.log("\t ✅ Generated Next.js app!\n");
|
|
17
15
|
}
|
|
18
16
|
{
|
|
19
17
|
console.log("\t- 🔃 Cloning files from template...");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"postcss.config.mjs",
|
|
24
|
-
"next.config.ts"
|
|
25
|
-
]) {
|
|
18
|
+
const emitter = degit("LarsSK06/create-frontend-app/template");
|
|
19
|
+
await emitter.clone(tempFolderPath);
|
|
20
|
+
for (const objName of fs.readdirSync(tempFolderPath)) {
|
|
26
21
|
const absoluteCwdPath = path.join(cwd, objName);
|
|
27
22
|
const absoluteTempFolderPath = path.join(tempFolderPath, objName);
|
|
28
23
|
if (fs.existsSync(absoluteCwdPath)) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1B,CAAC,KAAK,IAAI,EAAE;IAER,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAG7C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;IAGnF,CAAC;QACG,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAEhD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1B,CAAC,KAAK,IAAI,EAAE;IAER,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAG7C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,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ACf,gBAAgB;YAChB,qBAAqB;YACrB,SAAS;YACT,eAAe;SAClB,CAAC;QAEF,QAAQ,CAAC,SAAS,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE5C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IACnD,CAAC;IAGD,CAAC;QACG,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAE7D,MAAM,YAAY,GAAG;YACjB,SAAS;YACT,wBAAwB;YACxB,qBAAqB;SACxB,CAAC;QAEF,QAAQ,CAAC,oBAAoB,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEvD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IAC7D,CAAC;AAEL,CAAC,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvihaugen/create-frontend-app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,5 +23,9 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"degit": "^2.8.4",
|
|
25
25
|
"prompts": "^2.4.2"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"url": "https://github.com/LarsSK06/create-frontend-app",
|
|
29
|
+
"type": "git"
|
|
26
30
|
}
|
|
27
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -20,10 +20,6 @@ const cwd = process.cwd();
|
|
|
20
20
|
{
|
|
21
21
|
console.log("\t- 🔃 Generating Next.js app...");
|
|
22
22
|
|
|
23
|
-
const emitter = degit("LarsSK06/frontend-template");
|
|
24
|
-
|
|
25
|
-
await emitter.clone(tempFolderPath);
|
|
26
|
-
|
|
27
23
|
execSync("npx create-next-app . --yes --empty --skip-install");
|
|
28
24
|
|
|
29
25
|
console.log("\t ✅ Generated Next.js app!\n");
|
|
@@ -32,13 +28,12 @@ const cwd = process.cwd();
|
|
|
32
28
|
|
|
33
29
|
{
|
|
34
30
|
console.log("\t- 🔃 Cloning files from template...");
|
|
31
|
+
|
|
32
|
+
const emitter = degit("LarsSK06/create-frontend-app/template");
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"postcss.config.mjs",
|
|
40
|
-
"next.config.ts"
|
|
41
|
-
]) {
|
|
34
|
+
await emitter.clone(tempFolderPath);
|
|
35
|
+
|
|
36
|
+
for (const objName of fs.readdirSync(tempFolderPath)) {
|
|
42
37
|
const absoluteCwdPath = path.join(cwd, objName);
|
|
43
38
|
const absoluteTempFolderPath = path.join(tempFolderPath, objName);
|
|
44
39
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import policy from "@/utils/csp-policy";
|
|
2
|
+
|
|
3
|
+
import { NextConfig } from "next";
|
|
4
|
+
|
|
5
|
+
const nextConfig: NextConfig = {
|
|
6
|
+
async headers() {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
source: "/(.*)",
|
|
10
|
+
headers: [
|
|
11
|
+
{
|
|
12
|
+
key: "Content-Security-Policy",
|
|
13
|
+
value: policy
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default nextConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
plugins: ["@tailwindcss/postcss"],
|
|
3
|
+
plugins: {
|
|
4
|
+
"@tailwindcss/postcss": {},
|
|
5
|
+
"postcss-preset-mantine": {},
|
|
6
|
+
"postcss-simple-vars": {
|
|
7
|
+
variables: {
|
|
8
|
+
"mantine-breakpoint-xs": "36em",
|
|
9
|
+
"mantine-breakpoint-sm": "48em",
|
|
10
|
+
"mantine-breakpoint-md": "62em",
|
|
11
|
+
"mantine-breakpoint-lg": "75em",
|
|
12
|
+
"mantine-breakpoint-xl": "88em"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# https://securitytxt.org/
|
|
2
|
+
# Fields marked with * are required
|
|
3
|
+
|
|
4
|
+
# Contact *
|
|
5
|
+
Contact: mailto:your.email@example.com
|
|
6
|
+
|
|
7
|
+
# Expires *(max 1)
|
|
8
|
+
Expires: YYYY-MM-DDThh:mm:ss.SSSZ
|
|
9
|
+
|
|
10
|
+
# Encryption
|
|
11
|
+
Encryption: https://example.com/encryption
|
|
12
|
+
|
|
13
|
+
# Acknowledgments
|
|
14
|
+
Acknowledgments: https://example.com/acknowledgments
|
|
15
|
+
|
|
16
|
+
# Preferred languages (max 1)
|
|
17
|
+
Preferred-Languages: en,no
|
|
18
|
+
|
|
19
|
+
# Canonical
|
|
20
|
+
Canonical: https://example.com/security.txt
|
|
21
|
+
|
|
22
|
+
# Policy
|
|
23
|
+
Policy: https://example.com/policy
|
|
24
|
+
|
|
25
|
+
# Hiring
|
|
26
|
+
Hiring: https://example.com/hiring
|
|
27
|
+
|
|
28
|
+
# CSAF
|
|
29
|
+
CSAF: https://example.com/csaf-provider-metadata.json
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { ColorSchemeScript, mantineHtmlProps } from "@mantine/core";
|
|
3
|
+
|
|
4
|
+
import ParentProps from "@/types/common/ParentProps";
|
|
5
|
+
import Providers from "@/components/common/Providers";
|
|
6
|
+
|
|
7
|
+
import "@/css/globals.css";
|
|
8
|
+
|
|
9
|
+
// https://seostudio.tools/meta-tag-generator
|
|
10
|
+
// https://www.searchenginejournal.com/important-tags-seo/156440/
|
|
11
|
+
|
|
12
|
+
export const metadata = {
|
|
13
|
+
title: "Frontend template",
|
|
14
|
+
description: "My preferred template for frontend projects - tailored to my needs",
|
|
15
|
+
applicationName: "Frontend template",
|
|
16
|
+
authors: [{
|
|
17
|
+
url: "https://lars.kvihaugen.no",
|
|
18
|
+
name: "Lars Kvihaugen"
|
|
19
|
+
}],
|
|
20
|
+
generator: "Next.js",
|
|
21
|
+
keywords: [
|
|
22
|
+
"next.js",
|
|
23
|
+
"next",
|
|
24
|
+
"react",
|
|
25
|
+
"frontend",
|
|
26
|
+
"development",
|
|
27
|
+
"dev"
|
|
28
|
+
],
|
|
29
|
+
referrer: "origin",
|
|
30
|
+
creator: "Lars Kvihaugen",
|
|
31
|
+
publisher: "Lars Kvihaugen",
|
|
32
|
+
robots: {
|
|
33
|
+
index: true,
|
|
34
|
+
follow: true
|
|
35
|
+
},
|
|
36
|
+
alternates: {
|
|
37
|
+
canonical: "https://frontend-template.kvihaugen.no",
|
|
38
|
+
languages: {
|
|
39
|
+
en: "https://frontend-template.kvihaugen.no",
|
|
40
|
+
no: "https://no.frontend-template.kvihaugen.no"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
icons: {
|
|
44
|
+
icon: [{
|
|
45
|
+
url: "/icons/icon-128x128.png",
|
|
46
|
+
sizes: "128x128"
|
|
47
|
+
}],
|
|
48
|
+
apple: [{
|
|
49
|
+
url: "/icons/icon-apple/128x128.png",
|
|
50
|
+
sizes: "128x128"
|
|
51
|
+
}]
|
|
52
|
+
},
|
|
53
|
+
manifest: "/.well-known/app.webmanifest",
|
|
54
|
+
openGraph: {
|
|
55
|
+
type: "website",
|
|
56
|
+
title: "Frontend template",
|
|
57
|
+
description: "My preferred template for frontend projects - tailored to my needs",
|
|
58
|
+
emails: ["lars@kvihaugen.no"],
|
|
59
|
+
phoneNumbers: ["+00 000 00 000"],
|
|
60
|
+
siteName: "Frontend template",
|
|
61
|
+
locale: "en",
|
|
62
|
+
alternateLocale: ["no"],
|
|
63
|
+
images: [{
|
|
64
|
+
url: "/images/hero.png",
|
|
65
|
+
alt: "The page hero",
|
|
66
|
+
width: 1920,
|
|
67
|
+
height: 1080
|
|
68
|
+
}],
|
|
69
|
+
url: "https://frontend-template.kvihaugen.no"
|
|
70
|
+
},
|
|
71
|
+
metadataBase: new URL("https://frontend-template.kvihaugen.no")
|
|
72
|
+
} satisfies Metadata as Metadata;
|
|
73
|
+
|
|
74
|
+
const RootLayout = ({ children }: ParentProps) => (
|
|
75
|
+
<html {...mantineHtmlProps}>
|
|
76
|
+
<head>
|
|
77
|
+
<ColorSchemeScript />
|
|
78
|
+
</head>
|
|
79
|
+
<body className="antialiased">
|
|
80
|
+
<Providers>
|
|
81
|
+
{children}
|
|
82
|
+
</Providers>
|
|
83
|
+
</body>
|
|
84
|
+
</html>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export default RootLayout;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import ParentProps from "@/types/common/ParentProps";
|
|
4
|
+
|
|
5
|
+
import { createTheme, MantineProvider } from "@mantine/core";
|
|
6
|
+
|
|
7
|
+
import "@/utils/i18n";
|
|
8
|
+
|
|
9
|
+
const theme = createTheme({});
|
|
10
|
+
|
|
11
|
+
const Providers = ({ children }: ParentProps) => (
|
|
12
|
+
<MantineProvider theme={theme}>
|
|
13
|
+
{children}
|
|
14
|
+
</MantineProvider>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export default Providers;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy#fetch_directives
|
|
2
|
+
// https://www.validbot.com/tools/csp-wizard.php
|
|
3
|
+
|
|
4
|
+
const policy = `
|
|
5
|
+
|
|
6
|
+
default-src 'self';
|
|
7
|
+
script-src 'self' 'unsafe-inline' 'unsafe-eval';
|
|
8
|
+
connect-src 'self';
|
|
9
|
+
img-src 'self' data: blob:;
|
|
10
|
+
style-src 'self' 'unsafe-inline';
|
|
11
|
+
frame-src;
|
|
12
|
+
|
|
13
|
+
`.replaceAll("\n", " ").trim();
|
|
14
|
+
|
|
15
|
+
export default policy;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMantineColorScheme } from "@mantine/core";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
|
|
4
|
+
const useColorScheme = () => {
|
|
5
|
+
const [isBrowserColorSchemeDark, setIsBrowserColorSchemeDark] = useState<boolean>(false);
|
|
6
|
+
|
|
7
|
+
const { colorScheme } = useMantineColorScheme();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const handleSetAccordingColorScheme = () => setIsBrowserColorSchemeDark(window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
11
|
+
|
|
12
|
+
handleSetAccordingColorScheme();
|
|
13
|
+
|
|
14
|
+
window.addEventListener("change", handleSetAccordingColorScheme);
|
|
15
|
+
|
|
16
|
+
return () => window.removeEventListener("change", handleSetAccordingColorScheme);
|
|
17
|
+
}, []);
|
|
18
|
+
|
|
19
|
+
const isColorSchemeDark = useMemo(() => (
|
|
20
|
+
(colorScheme === "auto" && isBrowserColorSchemeDark) ||
|
|
21
|
+
colorScheme === "dark"
|
|
22
|
+
), [isBrowserColorSchemeDark, colorScheme]);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
isDark: isColorSchemeDark,
|
|
26
|
+
isLight: !isColorSchemeDark
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default useColorScheme;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useMantineTheme } from "@mantine/core";
|
|
2
|
+
|
|
3
|
+
import useColorScheme from "./useColorScheme";
|
|
4
|
+
|
|
5
|
+
const usePrimaryColorShade = () => {
|
|
6
|
+
const { primaryColor, primaryShade, colors } = useMantineTheme();
|
|
7
|
+
const { isDark: isColorSchemeDark } = useColorScheme();
|
|
8
|
+
|
|
9
|
+
const shadeIndexer =
|
|
10
|
+
typeof primaryShade === "object"
|
|
11
|
+
? primaryShade[isColorSchemeDark ? "dark" : "light"]
|
|
12
|
+
: primaryShade;
|
|
13
|
+
|
|
14
|
+
return colors[primaryColor][shadeIndexer];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default usePrimaryColorShade;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import i18next from "i18next";
|
|
2
|
+
import en from "./resources/en.json";
|
|
3
|
+
|
|
4
|
+
import { initReactI18next } from "react-i18next";
|
|
5
|
+
|
|
6
|
+
i18next
|
|
7
|
+
.use(initReactI18next)
|
|
8
|
+
.init({
|
|
9
|
+
resources: { en },
|
|
10
|
+
lng: "en",
|
|
11
|
+
fallbackLng: "en",
|
|
12
|
+
interpolation: {
|
|
13
|
+
escapeValue: false
|
|
14
|
+
}
|
|
15
|
+
});
|