@kvihaugen/create-frontend-app 1.0.0 → 1.0.2

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 CHANGED
@@ -1,24 +1,30 @@
1
- import prompts from "prompts";
2
- import ExtraPackage from "./types/ExtraPackage";
3
- import chalk from "chalk";
4
- import promiseType from "./utils/functions/promiseType";
5
- import ora from "ora";
6
- import fs from "node:fs";
7
- import { execSync } from "node:child_process";
8
- 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";
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const prompts_1 = __importDefault(require("prompts"));
8
+ const ExtraPackage_1 = __importDefault(require("./types/ExtraPackage"));
9
+ const chalk_1 = __importDefault(require("chalk"));
10
+ const promiseType_1 = __importDefault(require("./utils/functions/promiseType"));
11
+ const ora_1 = __importDefault(require("ora"));
12
+ const node_fs_1 = __importDefault(require("node:fs"));
13
+ const node_path_1 = __importDefault(require("node:path"));
14
+ const postcss_config_1 = __importDefault(require("./text-templates/postcss-config"));
15
+ const next_layout_1 = __importDefault(require("./text-templates/next-layout"));
16
+ const next_page_1 = __importDefault(require("./text-templates/next-page"));
17
+ const providers_component_1 = __importDefault(require("./text-templates/providers-component"));
18
+ const global_css_notifs_1 = __importDefault(require("./text-templates/global-css-notifs"));
19
+ const global_css_1 = __importDefault(require("./text-templates/global-css"));
20
+ const language_resource_1 = __importDefault(require("./text-templates/language-resource"));
21
+ const i18n_config_1 = __importDefault(require("./text-templates/i18n-config"));
22
+ const parent_props_type_1 = __importDefault(require("./text-templates/parent-props-type"));
23
+ const node_child_process_1 = require("node:child_process");
18
24
  (async () => {
19
- console.log(chalk.cyan("🚀 Create a new frontend app!"));
25
+ console.log(chalk_1.default.cyan("🚀 Create a new frontend app!"));
20
26
  // Prompting
21
- const response = await prompts([
27
+ const response = await (0, prompts_1.default)([
22
28
  {
23
29
  type: "text",
24
30
  name: "name",
@@ -32,11 +38,11 @@ import parentPropsType from "./text-templates/parent-props-type";
32
38
  choices: [
33
39
  {
34
40
  title: "Mantine UI - Notifications",
35
- value: ExtraPackage.MantineUiNotifications
41
+ value: ExtraPackage_1.default.MantineUiNotifications
36
42
  },
37
43
  {
38
44
  title: "NextAuth",
39
- value: ExtraPackage.NextAuth
45
+ value: ExtraPackage_1.default.NextAuth
40
46
  }
41
47
  ]
42
48
  }
@@ -44,19 +50,19 @@ import parentPropsType from "./text-templates/parent-props-type";
44
50
  const { name, extraPackages } = response;
45
51
  if (!name || !extraPackages)
46
52
  process.exit(1);
47
- if (!promiseType(name))
53
+ if (!(0, promiseType_1.default)(name))
48
54
  return;
49
- if (!promiseType(extraPackages))
55
+ if (!(0, promiseType_1.default)(extraPackages))
50
56
  return;
51
57
  // Creating Next.js project
52
58
  {
53
- const spinner = ora("Creating Next.js project...").start();
59
+ const spinner = (0, ora_1.default)("Creating Next.js project...").start();
54
60
  try {
55
- execSync("npx create-next-app . --yes --empty");
56
- spinner.succeed(chalk.green("Created Next.js project!"));
61
+ (0, node_child_process_1.execSync)("npx create-next-app . --yes --empty");
62
+ spinner.succeed(chalk_1.default.green("Created Next.js project!"));
57
63
  }
58
64
  catch {
59
- spinner.fail(chalk.red("Could not create Next.js project!"));
65
+ spinner.fail(chalk_1.default.red("Could not create Next.js project!"));
60
66
  process.exit(1);
61
67
  }
62
68
  }
@@ -66,61 +72,61 @@ import parentPropsType from "./text-templates/parent-props-type";
66
72
  "@mantine/hooks",
67
73
  "react-i18next",
68
74
  "i18next",
69
- ...(extraPackages.includes(ExtraPackage.MantineUiNotifications)
75
+ ...(extraPackages.includes(ExtraPackage_1.default.MantineUiNotifications)
70
76
  ? ["@mantine/notifications"]
71
77
  : []),
72
- ...(extraPackages.includes(ExtraPackage.NextAuth)
78
+ ...(extraPackages.includes(ExtraPackage_1.default.NextAuth)
73
79
  ? ["next-auth"]
74
80
  : [])
75
81
  ];
76
82
  for (const pkg of packagesToInstall) {
77
- const spinner = ora(`Installing ${pkg}...`).start();
83
+ const spinner = (0, ora_1.default)(`Installing ${pkg}...`).start();
78
84
  try {
79
- execSync(`npm i ${pkg}`);
80
- spinner.succeed(chalk.green(`Installed ${pkg}!`));
85
+ (0, node_child_process_1.execSync)(`npm i ${pkg}`);
86
+ spinner.succeed(chalk_1.default.green(`Installed ${pkg}!`));
81
87
  }
82
88
  catch {
83
- spinner.fail(chalk.red(`Could not install ${pkg}!`));
89
+ spinner.fail(chalk_1.default.red(`Could not install ${pkg}!`));
84
90
  process.exit(1);
85
91
  }
86
92
  }
87
93
  // Setting up PostCSS
88
94
  {
89
- const spinner = ora("Setting up PostCSS...").start();
95
+ const spinner = (0, ora_1.default)("Setting up PostCSS...").start();
90
96
  try {
91
- execSync("npm i --save-dev postcss postcss-preset-mantine postcss-simple-vars");
92
- fs.writeFileSync(path.join(process.cwd(), "postcss.config.mjs"), postcssConfig);
93
- spinner.succeed(chalk.green("Set up PostCSS!"));
97
+ (0, node_child_process_1.execSync)("npm i --save-dev postcss postcss-preset-mantine postcss-simple-vars");
98
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "postcss.config.mjs"), postcss_config_1.default);
99
+ spinner.succeed(chalk_1.default.green("Set up PostCSS!"));
94
100
  }
95
101
  catch {
96
- spinner.fail(chalk.red("Could not set up PostCSS!"));
102
+ spinner.fail(chalk_1.default.red("Could not set up PostCSS!"));
97
103
  process.exit(1);
98
104
  }
99
105
  }
100
106
  // Setting up custom files
101
107
  {
102
- const spinner = ora("Setting up custom files...").start();
108
+ const spinner = (0, ora_1.default)("Setting up custom files...").start();
103
109
  try {
104
- fs.rmSync(path.join(process.cwd(), "src", "app"), { recursive: true, force: true });
105
- fs.rmSync(path.join(process.cwd(), "README.md"), { recursive: true, force: true });
106
- fs.mkdirSync(path.join(process.cwd(), "src", "app"), { recursive: true });
107
- fs.mkdirSync(path.join(process.cwd(), "src", "components", "common"), { recursive: true });
108
- fs.mkdirSync(path.join(process.cwd(), "src", "css"), { recursive: true });
109
- fs.mkdirSync(path.join(process.cwd(), "src", "utils", "i18n", "resources"), { recursive: true });
110
- fs.mkdirSync(path.join(process.cwd(), "src", "types", "common"), { recursive: true });
111
- fs.writeFileSync(path.join(process.cwd(), "src", "app", "layout.tsx"), nextLayout);
112
- fs.writeFileSync(path.join(process.cwd(), "src", "app", "page.tsx"), nextPage);
113
- fs.writeFileSync(path.join(process.cwd(), "src", "components", "common", "Providers.tsx"), providersComponent);
114
- fs.writeFileSync(path.join(process.cwd(), "src", "css", "globals.css"), extraPackages.includes(ExtraPackage.MantineUiNotifications)
115
- ? globalCssNotifs
116
- : globalCss);
117
- fs.writeFileSync(path.join(process.cwd(), "src", "utils", "i18n", "resources", "en.json"), languageResource);
118
- fs.writeFileSync(path.join(process.cwd(), "src", "utils", "i18n", "index.ts"), i18nConfig);
119
- fs.writeFileSync(path.join(process.cwd(), "src", "types", "common", "ParentProps.ts"), parentPropsType);
120
- spinner.succeed(chalk.green("Set up custom files!"));
110
+ node_fs_1.default.rmSync(node_path_1.default.join(process.cwd(), "src", "app"), { recursive: true, force: true });
111
+ node_fs_1.default.rmSync(node_path_1.default.join(process.cwd(), "README.md"), { recursive: true, force: true });
112
+ node_fs_1.default.mkdirSync(node_path_1.default.join(process.cwd(), "src", "app"), { recursive: true });
113
+ node_fs_1.default.mkdirSync(node_path_1.default.join(process.cwd(), "src", "components", "common"), { recursive: true });
114
+ node_fs_1.default.mkdirSync(node_path_1.default.join(process.cwd(), "src", "css"), { recursive: true });
115
+ node_fs_1.default.mkdirSync(node_path_1.default.join(process.cwd(), "src", "utils", "i18n", "resources"), { recursive: true });
116
+ node_fs_1.default.mkdirSync(node_path_1.default.join(process.cwd(), "src", "types", "common"), { recursive: true });
117
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "app", "layout.tsx"), next_layout_1.default);
118
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "app", "page.tsx"), next_page_1.default);
119
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "components", "common", "Providers.tsx"), providers_component_1.default);
120
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "css", "globals.css"), extraPackages.includes(ExtraPackage_1.default.MantineUiNotifications)
121
+ ? global_css_notifs_1.default
122
+ : global_css_1.default);
123
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "utils", "i18n", "resources", "en.json"), language_resource_1.default);
124
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "utils", "i18n", "index.ts"), i18n_config_1.default);
125
+ node_fs_1.default.writeFileSync(node_path_1.default.join(process.cwd(), "src", "types", "common", "ParentProps.ts"), parent_props_type_1.default);
126
+ spinner.succeed(chalk_1.default.green("Set up custom files!"));
121
127
  }
122
128
  catch (error) {
123
- spinner.fail(chalk.red("Could not set up custom files!"));
129
+ spinner.fail(chalk_1.default.red("Could not set up custom files!"));
124
130
  console.log(error);
125
131
  process.exit(1);
126
132
  }
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const globalCssNotifs = `
2
4
  @layer theme, base, components, mantine, utilities;
3
5
 
@@ -5,4 +7,4 @@ const globalCssNotifs = `
5
7
  @import "@mantine/core/styles.layer.css";
6
8
  @import "@mantine/notifications/styles.layer.css";
7
9
  `.trim();
8
- export default globalCssNotifs;
10
+ exports.default = globalCssNotifs;
@@ -1,7 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const globalCss = `
2
4
  @layer theme, base, components, mantine, utilities;
3
5
 
4
6
  @import "tailwindcss";
5
7
  @import "@mantine/core/styles.layer.css";
6
8
  `.trim();
7
- export default globalCss;
9
+ exports.default = globalCss;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const i18nConfig = `
2
4
  import i18next from "i18next";
3
5
  import en from "./resources/en.json";
@@ -15,4 +17,4 @@ i18next
15
17
  }
16
18
  });
17
19
  `.trim();
18
- export default i18nConfig;
20
+ exports.default = i18nConfig;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const languageResource = `
2
4
  {
3
5
  "translation": {
@@ -7,4 +9,4 @@ const languageResource = `
7
9
  }
8
10
  }
9
11
  `.trim();
10
- export default languageResource;
12
+ exports.default = languageResource;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const nextLayout = `
2
4
  import { Metadata } from "next";
3
5
  import { ColorSchemeScript, mantineHtmlProps } from "@mantine/core";
@@ -87,4 +89,4 @@ const RootLayout = ({ children }: ParentProps) => (
87
89
 
88
90
  export default RootLayout;
89
91
  `.trim();
90
- export default nextLayout;
92
+ exports.default = nextLayout;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const nextPage = `
2
4
  "use client";
3
5
 
@@ -14,4 +16,4 @@ const Page = () => {
14
16
 
15
17
  export default Page;
16
18
  `.trim();
17
- export default nextPage;
19
+ exports.default = nextPage;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const parentPropsType = `
2
4
  import { ReactNode } from "react";
3
5
 
@@ -7,4 +9,4 @@ type ParentProps<T = ReactNode> = {
7
9
 
8
10
  export default ParentProps;
9
11
  `.trim();
10
- export default parentPropsType;
12
+ exports.default = parentPropsType;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const postcssConfig = `
2
4
  const config = {
3
5
  plugins: {
@@ -17,4 +19,4 @@ const config = {
17
19
 
18
20
  export default config;
19
21
  `.trim();
20
- export default postcssConfig;
22
+ exports.default = postcssConfig;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const providersComponent = `
2
4
  "use client";
3
5
 
@@ -17,4 +19,4 @@ const Providers = ({ children }: ParentProps) => (
17
19
 
18
20
  export default Providers;
19
21
  `.trim();
20
- export default providersComponent;
22
+ exports.default = providersComponent;
@@ -1,6 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  var ExtraPackage;
2
4
  (function (ExtraPackage) {
3
5
  ExtraPackage[ExtraPackage["MantineUiNotifications"] = 0] = "MantineUiNotifications";
4
6
  ExtraPackage[ExtraPackage["NextAuth"] = 1] = "NextAuth";
5
7
  })(ExtraPackage || (ExtraPackage = {}));
6
- export default ExtraPackage;
8
+ exports.default = ExtraPackage;
@@ -1,2 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const promiseType = (v) => true;
2
- export default promiseType;
4
+ exports.default = promiseType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kvihaugen/create-frontend-app",
3
- "version": "1.0.0",
4
- "main": "index.js",
3
+ "version": "1.0.2",
4
+ "main": "dist/index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -11,6 +11,7 @@
11
11
  "scripts": {
12
12
  "build": "tsc"
13
13
  },
14
+ "files": ["dist"],
14
15
  "author": "",
15
16
  "license": "MIT",
16
17
  "description": "",
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
@@ -1,37 +0,0 @@
1
- name: Publish to NPM
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
-
12
- permissions:
13
- contents: write
14
- packages: write
15
- id-token: write
16
-
17
- steps:
18
-
19
- - name: Checkout repository
20
- uses: actions/checkout@v4
21
-
22
- - name: Set up Node.js
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: 20
26
- registry-url: 'https://registry.npmjs.org/'
27
-
28
- - name: Install dependencies
29
- run: npm ci
30
-
31
- - name: Build project
32
- run: npm run build
33
-
34
- - name: Publish to NPM registry
35
- env:
36
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37
- run: npm publish
package/src/index.ts DELETED
@@ -1,220 +0,0 @@
1
- import prompts from "prompts";
2
- import ExtraPackage from "./types/ExtraPackage";
3
- import chalk from "chalk";
4
- import promiseType from "./utils/functions/promiseType";
5
- import ora from "ora";
6
- import fs from "node:fs";
7
-
8
- import { execSync } from "node:child_process";
9
- import path from "node:path";
10
- import postcssConfig from "./text-templates/postcss-config";
11
- import nextLayout from "./text-templates/next-layout";
12
- import nextPage from "./text-templates/next-page";
13
- import providersComponent from "./text-templates/providers-component";
14
- import globalCssNotifs from "./text-templates/global-css-notifs";
15
- import globalCss from "./text-templates/global-css";
16
- import languageResource from "./text-templates/language-resource";
17
- import i18nConfig from "./text-templates/i18n-config";
18
- import parentPropsType from "./text-templates/parent-props-type";
19
-
20
- (async () => {
21
- console.log(chalk.cyan("🚀 Create a new frontend app!"));
22
-
23
-
24
-
25
- // Prompting
26
-
27
- const response = await prompts([
28
- {
29
- type: "text",
30
- name: "name",
31
- message: "Project name:",
32
- initial: "app"
33
- },
34
- {
35
- type: "multiselect",
36
- name: "extraPackages",
37
- message: "Extra packages:",
38
- choices: [
39
- {
40
- title: "Mantine UI - Notifications",
41
- value: ExtraPackage.MantineUiNotifications
42
- },
43
- {
44
- title: "NextAuth",
45
- value: ExtraPackage.NextAuth
46
- }
47
- ]
48
- }
49
- ]);
50
-
51
- const { name, extraPackages } = response;
52
-
53
- if (!name || !extraPackages) process.exit(1);
54
-
55
- if (!promiseType<string>(name)) return;
56
- if (!promiseType<number[]>(extraPackages)) return;
57
-
58
-
59
-
60
- // Creating Next.js project
61
- {
62
- const spinner = ora("Creating Next.js project...").start();
63
-
64
- try {
65
- execSync("npx create-next-app . --yes --empty");
66
-
67
- spinner.succeed(chalk.green("Created Next.js project!"));
68
- }
69
- catch {
70
- spinner.fail(chalk.red("Could not create Next.js project!"));
71
-
72
- process.exit(1);
73
- }
74
- }
75
-
76
-
77
-
78
- // Installing additional packages
79
-
80
- const packagesToInstall = [
81
- "@mantine/core",
82
- "@mantine/hooks",
83
- "react-i18next",
84
- "i18next",
85
- ...(
86
- extraPackages.includes(ExtraPackage.MantineUiNotifications)
87
- ? ["@mantine/notifications"]
88
- : []
89
- ),
90
- ...(
91
- extraPackages.includes(ExtraPackage.NextAuth)
92
- ? ["next-auth"]
93
- : []
94
- )
95
- ];
96
-
97
- for (const pkg of packagesToInstall) {
98
- const spinner = ora(`Installing ${pkg}...`).start();
99
-
100
- try {
101
- execSync(`npm i ${pkg}`);
102
-
103
- spinner.succeed(chalk.green(`Installed ${pkg}!`));
104
- }
105
- catch {
106
- spinner.fail(chalk.red(`Could not install ${pkg}!`));
107
-
108
- process.exit(1);
109
- }
110
- }
111
-
112
-
113
-
114
- // Setting up PostCSS
115
- {
116
- const spinner = ora("Setting up PostCSS...").start();
117
-
118
- try {
119
- execSync("npm i --save-dev postcss postcss-preset-mantine postcss-simple-vars");
120
-
121
- fs.writeFileSync(
122
- path.join(process.cwd(), "postcss.config.mjs"),
123
- postcssConfig
124
- );
125
-
126
- spinner.succeed(chalk.green("Set up PostCSS!"));
127
- }
128
- catch {
129
- spinner.fail(chalk.red("Could not set up PostCSS!"));
130
-
131
- process.exit(1);
132
- }
133
- }
134
-
135
-
136
-
137
- // Setting up custom files
138
- {
139
- const spinner = ora("Setting up custom files...").start();
140
-
141
- try {
142
- fs.rmSync(path.join(process.cwd(), "src", "app"), { recursive: true, force: true });
143
- fs.rmSync(path.join(process.cwd(), "README.md"), { recursive: true, force: true });
144
-
145
-
146
- fs.mkdirSync(
147
- path.join(process.cwd(), "src", "app"),
148
- { recursive: true }
149
- );
150
-
151
- fs.mkdirSync(
152
- path.join(process.cwd(), "src", "components", "common"),
153
- { recursive: true }
154
- );
155
-
156
- fs.mkdirSync(
157
- path.join(process.cwd(), "src", "css"),
158
- { recursive: true }
159
- );
160
-
161
- fs.mkdirSync(
162
- path.join(process.cwd(), "src", "utils", "i18n", "resources"),
163
- { recursive: true }
164
- );
165
-
166
- fs.mkdirSync(
167
- path.join(process.cwd(), "src", "types", "common"),
168
- { recursive: true }
169
- );
170
-
171
-
172
- fs.writeFileSync(
173
- path.join(process.cwd(), "src", "app", "layout.tsx"),
174
- nextLayout
175
- );
176
-
177
- fs.writeFileSync(
178
- path.join(process.cwd(), "src", "app", "page.tsx"),
179
- nextPage
180
- );
181
-
182
- fs.writeFileSync(
183
- path.join(process.cwd(), "src", "components", "common", "Providers.tsx"),
184
- providersComponent
185
- );
186
-
187
- fs.writeFileSync(
188
- path.join(process.cwd(), "src", "css", "globals.css"),
189
- extraPackages.includes(ExtraPackage.MantineUiNotifications)
190
- ? globalCssNotifs
191
- : globalCss
192
- );
193
-
194
- fs.writeFileSync(
195
- path.join(process.cwd(), "src", "utils", "i18n", "resources", "en.json"),
196
- languageResource
197
- );
198
-
199
- fs.writeFileSync(
200
- path.join(process.cwd(), "src", "utils", "i18n", "index.ts"),
201
- i18nConfig
202
- );
203
-
204
- fs.writeFileSync(
205
- path.join(process.cwd(), "src", "types", "common", "ParentProps.ts"),
206
- parentPropsType
207
- );
208
-
209
-
210
- spinner.succeed(chalk.green("Set up custom files!"));
211
- }
212
- catch (error) {
213
- spinner.fail(chalk.red("Could not set up custom files!"));
214
-
215
- console.log(error);
216
-
217
- process.exit(1);
218
- }
219
- }
220
- })();
@@ -1,9 +0,0 @@
1
- const globalCssNotifs = `
2
- @layer theme, base, components, mantine, utilities;
3
-
4
- @import "tailwindcss";
5
- @import "@mantine/core/styles.layer.css";
6
- @import "@mantine/notifications/styles.layer.css";
7
- `.trim();
8
-
9
- export default globalCssNotifs;
@@ -1,8 +0,0 @@
1
- const globalCss = `
2
- @layer theme, base, components, mantine, utilities;
3
-
4
- @import "tailwindcss";
5
- @import "@mantine/core/styles.layer.css";
6
- `.trim();
7
-
8
- export default globalCss;
@@ -1,19 +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
-
19
- export default i18nConfig;
@@ -1,11 +0,0 @@
1
- const languageResource = `
2
- {
3
- "translation": {
4
- "common": {
5
- "HelloWorld": "Hello world!"
6
- }
7
- }
8
- }
9
- `.trim();
10
-
11
- export default languageResource;
@@ -1,91 +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
-
91
- export default nextLayout;
@@ -1,18 +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
-
18
- export default nextPage;
@@ -1,11 +0,0 @@
1
- const parentPropsType = `
2
- import { ReactNode } from "react";
3
-
4
- type ParentProps<T = ReactNode> = {
5
- children?: T;
6
- };
7
-
8
- export default ParentProps;
9
- `.trim();
10
-
11
- export default parentPropsType;
@@ -1,21 +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
-
21
- export default postcssConfig;
@@ -1,21 +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
-
21
- export default providersComponent;
@@ -1,6 +0,0 @@
1
- enum ExtraPackage {
2
- MantineUiNotifications,
3
- NextAuth
4
- }
5
-
6
- export default ExtraPackage;
@@ -1,3 +0,0 @@
1
- const promiseType = <T>(v: any): v is T => true;
2
-
3
- export default promiseType;
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2020",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "outDir": "dist",
7
- "esModuleInterop": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "strict": true,
10
- "skipLibCheck": true
11
- },
12
- "include": ["src"]
13
- }