@kvihaugen/create-frontend-app 1.0.3 → 1.0.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/.gitattributes +2 -0
- package/.github/workflows/build-and-publish.yaml +35 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -122
- package/dist/index.js.map +1 -0
- package/package.json +9 -14
- package/src/index.ts +49 -0
- package/tsconfig.json +29 -0
- package/dist/text-templates/global-css-notifs.js +0 -8
- package/dist/text-templates/global-css.js +0 -7
- package/dist/text-templates/i18n-config.js +0 -18
- package/dist/text-templates/language-resource.js +0 -10
- package/dist/text-templates/next-layout.js +0 -90
- package/dist/text-templates/next-page.js +0 -17
- package/dist/text-templates/parent-props-type.js +0 -10
- package/dist/text-templates/postcss-config.js +0 -20
- package/dist/text-templates/providers-component.js +0 -20
- package/dist/types/ExtraPackage.js +0 -6
- package/dist/utils/functions/promiseType.js +0 -2
package/.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Build and publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '20'
|
|
23
|
+
registry-url: 'https://registry.npmjs.org'
|
|
24
|
+
|
|
25
|
+
- name: Update NPM
|
|
26
|
+
run: npm install -g npm@latest
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
30
|
+
|
|
31
|
+
- name: Build project
|
|
32
|
+
run: npm run build --if-present
|
|
33
|
+
|
|
34
|
+
- name: Publish artifact
|
|
35
|
+
run: npm publish
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,129 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import ExtraPackage from "./types/ExtraPackage";
|
|
4
|
-
import chalk from "chalk";
|
|
5
|
-
import promiseType from "./utils/functions/promiseType";
|
|
6
|
-
import ora from "ora";
|
|
2
|
+
import os from "node:os";
|
|
7
3
|
import fs from "node:fs";
|
|
4
|
+
import degit from "degit";
|
|
8
5
|
import path from "node:path";
|
|
9
|
-
import postcssConfig from "./text-templates/postcss-config";
|
|
10
|
-
import nextLayout from "./text-templates/next-layout";
|
|
11
|
-
import nextPage from "./text-templates/next-page";
|
|
12
|
-
import providersComponent from "./text-templates/providers-component";
|
|
13
|
-
import globalCssNotifs from "./text-templates/global-css-notifs";
|
|
14
|
-
import globalCss from "./text-templates/global-css";
|
|
15
|
-
import languageResource from "./text-templates/language-resource";
|
|
16
|
-
import i18nConfig from "./text-templates/i18n-config";
|
|
17
|
-
import parentPropsType from "./text-templates/parent-props-type";
|
|
18
6
|
import { execSync } from "node:child_process";
|
|
7
|
+
const cwd = process.cwd();
|
|
19
8
|
(async () => {
|
|
20
|
-
console.log(
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]);
|
|
45
|
-
const { name, extraPackages } = response;
|
|
46
|
-
if (!name || !extraPackages)
|
|
47
|
-
process.exit(1);
|
|
48
|
-
if (!promiseType(name))
|
|
49
|
-
return;
|
|
50
|
-
if (!promiseType(extraPackages))
|
|
51
|
-
return;
|
|
52
|
-
// Creating Next.js project
|
|
53
|
-
{
|
|
54
|
-
const spinner = ora("Creating Next.js project...").start();
|
|
55
|
-
try {
|
|
56
|
-
execSync("npx create-next-app . --yes --empty");
|
|
57
|
-
spinner.succeed(chalk.green("Created Next.js project!"));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
spinner.fail(chalk.red("Could not create Next.js project!"));
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// Installing additional packages
|
|
65
|
-
const packagesToInstall = [
|
|
66
|
-
"@mantine/core",
|
|
67
|
-
"@mantine/hooks",
|
|
68
|
-
"react-i18next",
|
|
69
|
-
"i18next",
|
|
70
|
-
...(extraPackages.includes(ExtraPackage.MantineUiNotifications)
|
|
71
|
-
? ["@mantine/notifications"]
|
|
72
|
-
: []),
|
|
73
|
-
...(extraPackages.includes(ExtraPackage.NextAuth)
|
|
74
|
-
? ["next-auth"]
|
|
75
|
-
: [])
|
|
76
|
-
];
|
|
77
|
-
for (const pkg of packagesToInstall) {
|
|
78
|
-
const spinner = ora(`Installing ${pkg}...`).start();
|
|
79
|
-
try {
|
|
80
|
-
execSync(`npm i ${pkg}`);
|
|
81
|
-
spinner.succeed(chalk.green(`Installed ${pkg}!`));
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
spinner.fail(chalk.red(`Could not install ${pkg}!`));
|
|
85
|
-
process.exit(1);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Setting up PostCSS
|
|
89
|
-
{
|
|
90
|
-
const spinner = ora("Setting up PostCSS...").start();
|
|
91
|
-
try {
|
|
92
|
-
execSync("npm i --save-dev postcss postcss-preset-mantine postcss-simple-vars");
|
|
93
|
-
fs.writeFileSync(path.join(process.cwd(), "postcss.config.mjs"), postcssConfig);
|
|
94
|
-
spinner.succeed(chalk.green("Set up PostCSS!"));
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
spinner.fail(chalk.red("Could not set up PostCSS!"));
|
|
98
|
-
process.exit(1);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// Setting up custom files
|
|
102
|
-
{
|
|
103
|
-
const spinner = ora("Setting up custom files...").start();
|
|
104
|
-
try {
|
|
105
|
-
fs.rmSync(path.join(process.cwd(), "src", "app"), { recursive: true, force: true });
|
|
106
|
-
fs.rmSync(path.join(process.cwd(), "README.md"), { recursive: true, force: true });
|
|
107
|
-
fs.mkdirSync(path.join(process.cwd(), "src", "app"), { recursive: true });
|
|
108
|
-
fs.mkdirSync(path.join(process.cwd(), "src", "components", "common"), { recursive: true });
|
|
109
|
-
fs.mkdirSync(path.join(process.cwd(), "src", "css"), { recursive: true });
|
|
110
|
-
fs.mkdirSync(path.join(process.cwd(), "src", "utils", "i18n", "resources"), { recursive: true });
|
|
111
|
-
fs.mkdirSync(path.join(process.cwd(), "src", "types", "common"), { recursive: true });
|
|
112
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "app", "layout.tsx"), nextLayout);
|
|
113
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "app", "page.tsx"), nextPage);
|
|
114
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "components", "common", "Providers.tsx"), providersComponent);
|
|
115
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "css", "globals.css"), extraPackages.includes(ExtraPackage.MantineUiNotifications)
|
|
116
|
-
? globalCssNotifs
|
|
117
|
-
: globalCss);
|
|
118
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "utils", "i18n", "resources", "en.json"), languageResource);
|
|
119
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "utils", "i18n", "index.ts"), i18nConfig);
|
|
120
|
-
fs.writeFileSync(path.join(process.cwd(), "src", "types", "common", "ParentProps.ts"), parentPropsType);
|
|
121
|
-
spinner.succeed(chalk.green("Set up custom files!"));
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
spinner.fail(chalk.red("Could not set up custom files!"));
|
|
125
|
-
console.log(error);
|
|
126
|
-
process.exit(1);
|
|
127
|
-
}
|
|
9
|
+
console.log("🔃 Creating frontend app...");
|
|
10
|
+
const emitter = degit("LarsSK06/frontend-template");
|
|
11
|
+
const tempFolderPath = path.join(os.tmpdir(), `${Date.now()}-create-frontend-app`);
|
|
12
|
+
await emitter.clone(tempFolderPath);
|
|
13
|
+
execSync("npx create-next-app . --yes --empty --skip-install");
|
|
14
|
+
for (const objName of [
|
|
15
|
+
"src",
|
|
16
|
+
"public",
|
|
17
|
+
"postcss.config.mjs",
|
|
18
|
+
"next.config.ts"
|
|
19
|
+
]) {
|
|
20
|
+
const absoluteCwdPath = path.join(cwd, objName);
|
|
21
|
+
const absoluteTempFolderPath = path.join(tempFolderPath, objName);
|
|
22
|
+
if (fs.existsSync(absoluteCwdPath)) {
|
|
23
|
+
const stat = fs.statSync(absoluteCwdPath);
|
|
24
|
+
if (stat.isFile())
|
|
25
|
+
fs.unlinkSync(absoluteCwdPath);
|
|
26
|
+
else
|
|
27
|
+
fs.rmSync(absoluteCwdPath, { recursive: true, force: true });
|
|
28
|
+
}
|
|
29
|
+
fs.cpSync(absoluteTempFolderPath, absoluteCwdPath, { recursive: true });
|
|
128
30
|
}
|
|
31
|
+
console.log("✅ Created frontend app!");
|
|
129
32
|
})();
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,6BAA6B,CAAC,CAAC;IAE3C,MAAM,OAAO,GAAG,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAEpD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;IAEnF,MAAM,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAEpC,QAAQ,CAAC,oDAAoD,CAAC,CAAC;IAE/D,KAAK,MAAM,OAAO,IAAI;QAClB,KAAK;QACL,QAAQ;QACR,oBAAoB;QACpB,gBAAgB;KACnB,EAAE,CAAC;QACA,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAElE,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YAE1C,IAAI,IAAI,CAAC,MAAM,EAAE;gBAAE,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;;gBAC7C,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,EAAE,CAAC,MAAM,CACL,sBAAsB,EACtB,eAAe,EACf,EAAE,SAAS,EAAE,IAAI,EAAE,CACtB,CAAC;IACN,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAE3C,CAAC,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvihaugen/create-frontend-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
6
|
"bin": {
|
|
10
|
-
"create-frontend-app": "dist/index.js"
|
|
7
|
+
"create-frontend-app": "./dist/index.js"
|
|
11
8
|
},
|
|
12
9
|
"scripts": {
|
|
13
|
-
"build": "tsc"
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
14
12
|
},
|
|
15
|
-
"files": ["dist"],
|
|
16
13
|
"author": "",
|
|
17
14
|
"license": "MIT",
|
|
18
15
|
"description": "",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"chalk": "^5.6.2",
|
|
21
|
-
"ora": "^9.0.0",
|
|
22
|
-
"prompts": "^2.4.2"
|
|
23
|
-
},
|
|
24
16
|
"devDependencies": {
|
|
25
|
-
"@types/
|
|
17
|
+
"@types/degit": "^2.8.6",
|
|
26
18
|
"@types/node": "^24.10.0",
|
|
27
|
-
"@types/ora": "^3.1.0",
|
|
28
19
|
"@types/prompts": "^2.4.9",
|
|
29
20
|
"ts-node": "^10.9.2",
|
|
30
21
|
"typescript": "^5.9.3"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"degit": "^2.8.4",
|
|
25
|
+
"prompts": "^2.4.2"
|
|
31
26
|
}
|
|
32
27
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import degit from "degit";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
|
|
8
|
+
import { execSync } from "node:child_process";
|
|
9
|
+
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
|
|
12
|
+
(async () => {
|
|
13
|
+
|
|
14
|
+
console.log("🔃 Creating frontend app...");
|
|
15
|
+
|
|
16
|
+
const emitter = degit("LarsSK06/frontend-template");
|
|
17
|
+
|
|
18
|
+
const tempFolderPath = path.join(os.tmpdir(), `${Date.now()}-create-frontend-app`);
|
|
19
|
+
|
|
20
|
+
await emitter.clone(tempFolderPath);
|
|
21
|
+
|
|
22
|
+
execSync("npx create-next-app . --yes --empty --skip-install");
|
|
23
|
+
|
|
24
|
+
for (const objName of [
|
|
25
|
+
"src",
|
|
26
|
+
"public",
|
|
27
|
+
"postcss.config.mjs",
|
|
28
|
+
"next.config.ts"
|
|
29
|
+
]) {
|
|
30
|
+
const absoluteCwdPath = path.join(cwd, objName);
|
|
31
|
+
const absoluteTempFolderPath = path.join(tempFolderPath, objName);
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(absoluteCwdPath)) {
|
|
34
|
+
const stat = fs.statSync(absoluteCwdPath);
|
|
35
|
+
|
|
36
|
+
if (stat.isFile()) fs.unlinkSync(absoluteCwdPath);
|
|
37
|
+
else fs.rmSync(absoluteCwdPath, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
fs.cpSync(
|
|
41
|
+
absoluteTempFolderPath,
|
|
42
|
+
absoluteCwdPath,
|
|
43
|
+
{ recursive: true }
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log("✅ Created frontend app!");
|
|
48
|
+
|
|
49
|
+
})();
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": "./src",
|
|
4
|
+
"outDir": "./dist",
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"target": "esnext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"noUncheckedIndexedAccess": true,
|
|
12
|
+
"exactOptionalPropertyTypes": true,
|
|
13
|
+
// "noImplicitReturns": true,
|
|
14
|
+
// "noImplicitOverride": true,
|
|
15
|
+
// "noUnusedLocals": true,
|
|
16
|
+
// "noUnusedParameters": true,
|
|
17
|
+
// "noFallthroughCasesInSwitch": true,
|
|
18
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
19
|
+
"strict": true,
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
|
+
"verbatimModuleSyntax": true,
|
|
22
|
+
"isolatedModules": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true,
|
|
24
|
+
"moduleDetection": "force",
|
|
25
|
+
"skipLibCheck": true
|
|
26
|
+
},
|
|
27
|
+
"include": ["src/**/*"],
|
|
28
|
+
"exclude": ["node_modules", "dist"]
|
|
29
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const i18nConfig = `
|
|
2
|
-
import i18next from "i18next";
|
|
3
|
-
import en from "./resources/en.json";
|
|
4
|
-
|
|
5
|
-
import { initReactI18next } from "react-i18next";
|
|
6
|
-
|
|
7
|
-
i18next
|
|
8
|
-
.use(initReactI18next)
|
|
9
|
-
.init({
|
|
10
|
-
resources: { en },
|
|
11
|
-
lng: "en",
|
|
12
|
-
fallbackLng: "en",
|
|
13
|
-
interpolation: {
|
|
14
|
-
escapeValue: false
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
`.trim();
|
|
18
|
-
export default i18nConfig;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const nextLayout = `
|
|
2
|
-
import { Metadata } from "next";
|
|
3
|
-
import { ColorSchemeScript, mantineHtmlProps } from "@mantine/core";
|
|
4
|
-
|
|
5
|
-
import ParentProps from "@/types/common/ParentProps";
|
|
6
|
-
import Providers from "@/components/common/Providers";
|
|
7
|
-
|
|
8
|
-
import "@/css/globals.css";
|
|
9
|
-
|
|
10
|
-
// https://seostudio.tools/meta-tag-generator
|
|
11
|
-
// https://www.searchenginejournal.com/important-tags-seo/156440/
|
|
12
|
-
|
|
13
|
-
export const metadata = {
|
|
14
|
-
title: "Frontend template",
|
|
15
|
-
description: "My preferred template for frontend projects - tailored to my needs",
|
|
16
|
-
applicationName: "Frontend template",
|
|
17
|
-
authors: [{
|
|
18
|
-
url: "https://lars.kvihaugen.no",
|
|
19
|
-
name: "Lars Kvihaugen"
|
|
20
|
-
}],
|
|
21
|
-
generator: "Next.js",
|
|
22
|
-
keywords: [
|
|
23
|
-
"next.js",
|
|
24
|
-
"next",
|
|
25
|
-
"react",
|
|
26
|
-
"frontend",
|
|
27
|
-
"development",
|
|
28
|
-
"dev"
|
|
29
|
-
],
|
|
30
|
-
referrer: "origin",
|
|
31
|
-
creator: "Lars Kvihaugen",
|
|
32
|
-
publisher: "Lars Kvihaugen",
|
|
33
|
-
robots: {
|
|
34
|
-
index: true,
|
|
35
|
-
follow: true
|
|
36
|
-
},
|
|
37
|
-
alternates: {
|
|
38
|
-
canonical: "https://frontend-template.kvihaugen.no",
|
|
39
|
-
languages: {
|
|
40
|
-
en: "https://frontend-template.kvihaugen.no",
|
|
41
|
-
no: "https://no.frontend-template.kvihaugen.no"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
icons: {
|
|
45
|
-
icon: [{
|
|
46
|
-
url: "/icons/icon-128x128.png",
|
|
47
|
-
sizes: "128x128"
|
|
48
|
-
}],
|
|
49
|
-
apple: [{
|
|
50
|
-
url: "/icons/icon-apple/128x128.png",
|
|
51
|
-
sizes: "128x128"
|
|
52
|
-
}]
|
|
53
|
-
},
|
|
54
|
-
manifest: "/.well-known/app.webmanifest",
|
|
55
|
-
openGraph: {
|
|
56
|
-
type: "website",
|
|
57
|
-
title: "Frontend template",
|
|
58
|
-
description: "My preferred template for frontend projects - tailored to my needs",
|
|
59
|
-
emails: ["lars@kvihaugen.no"],
|
|
60
|
-
phoneNumbers: ["+00 000 00 000"],
|
|
61
|
-
siteName: "Frontend template",
|
|
62
|
-
locale: "en",
|
|
63
|
-
alternateLocale: ["no"],
|
|
64
|
-
images: [{
|
|
65
|
-
url: "/images/hero.png",
|
|
66
|
-
alt: "The page hero",
|
|
67
|
-
width: 1920,
|
|
68
|
-
height: 1080
|
|
69
|
-
}],
|
|
70
|
-
url: "https://frontend-template.kvihaugen.no"
|
|
71
|
-
},
|
|
72
|
-
metadataBase: new URL("https://frontend-template.kvihaugen.no")
|
|
73
|
-
} satisfies Metadata as Metadata;
|
|
74
|
-
|
|
75
|
-
const RootLayout = ({ children }: ParentProps) => (
|
|
76
|
-
<html {...mantineHtmlProps}>
|
|
77
|
-
<head>
|
|
78
|
-
<ColorSchemeScript />
|
|
79
|
-
</head>
|
|
80
|
-
<body className="antialiased">
|
|
81
|
-
<Providers>
|
|
82
|
-
{children}
|
|
83
|
-
</Providers>
|
|
84
|
-
</body>
|
|
85
|
-
</html>
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
export default RootLayout;
|
|
89
|
-
`.trim();
|
|
90
|
-
export default nextLayout;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const nextPage = `
|
|
2
|
-
"use client";
|
|
3
|
-
|
|
4
|
-
import { Button } from "@mantine/core";
|
|
5
|
-
import { t } from "i18next";
|
|
6
|
-
|
|
7
|
-
const Page = () => {
|
|
8
|
-
return (
|
|
9
|
-
<Button>
|
|
10
|
-
{t("common.HelloWorld")}
|
|
11
|
-
</Button>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default Page;
|
|
16
|
-
`.trim();
|
|
17
|
-
export default nextPage;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const postcssConfig = `
|
|
2
|
-
const config = {
|
|
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;
|
|
19
|
-
`.trim();
|
|
20
|
-
export default postcssConfig;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const providersComponent = `
|
|
2
|
-
"use client";
|
|
3
|
-
|
|
4
|
-
import ParentProps from "@/types/common/ParentProps";
|
|
5
|
-
|
|
6
|
-
import { createTheme, MantineProvider } from "@mantine/core";
|
|
7
|
-
|
|
8
|
-
import "@/utils/i18n";
|
|
9
|
-
|
|
10
|
-
const theme = createTheme({});
|
|
11
|
-
|
|
12
|
-
const Providers = ({ children }: ParentProps) => (
|
|
13
|
-
<MantineProvider theme={theme}>
|
|
14
|
-
{children}
|
|
15
|
-
</MantineProvider>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export default Providers;
|
|
19
|
-
`.trim();
|
|
20
|
-
export default providersComponent;
|