@kvihaugen/create-frontend-app 1.0.1 → 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,25 +1,30 @@
1
1
  #!/usr/bin/env node
2
- import prompts from "prompts";
3
- import ExtraPackage from "./types/ExtraPackage";
4
- import chalk from "chalk";
5
- import promiseType from "./utils/functions/promiseType";
6
- import ora from "ora";
7
- import fs from "node:fs";
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";
18
- import { execSync } from "node:child_process";
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");
19
24
  (async () => {
20
- console.log(chalk.cyan("🚀 Create a new frontend app!"));
25
+ console.log(chalk_1.default.cyan("🚀 Create a new frontend app!"));
21
26
  // Prompting
22
- const response = await prompts([
27
+ const response = await (0, prompts_1.default)([
23
28
  {
24
29
  type: "text",
25
30
  name: "name",
@@ -33,11 +38,11 @@ import { execSync } from "node:child_process";
33
38
  choices: [
34
39
  {
35
40
  title: "Mantine UI - Notifications",
36
- value: ExtraPackage.MantineUiNotifications
41
+ value: ExtraPackage_1.default.MantineUiNotifications
37
42
  },
38
43
  {
39
44
  title: "NextAuth",
40
- value: ExtraPackage.NextAuth
45
+ value: ExtraPackage_1.default.NextAuth
41
46
  }
42
47
  ]
43
48
  }
@@ -45,19 +50,19 @@ import { execSync } from "node:child_process";
45
50
  const { name, extraPackages } = response;
46
51
  if (!name || !extraPackages)
47
52
  process.exit(1);
48
- if (!promiseType(name))
53
+ if (!(0, promiseType_1.default)(name))
49
54
  return;
50
- if (!promiseType(extraPackages))
55
+ if (!(0, promiseType_1.default)(extraPackages))
51
56
  return;
52
57
  // Creating Next.js project
53
58
  {
54
- const spinner = ora("Creating Next.js project...").start();
59
+ const spinner = (0, ora_1.default)("Creating Next.js project...").start();
55
60
  try {
56
- execSync("npx create-next-app . --yes --empty");
57
- 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!"));
58
63
  }
59
64
  catch {
60
- spinner.fail(chalk.red("Could not create Next.js project!"));
65
+ spinner.fail(chalk_1.default.red("Could not create Next.js project!"));
61
66
  process.exit(1);
62
67
  }
63
68
  }
@@ -67,61 +72,61 @@ import { execSync } from "node:child_process";
67
72
  "@mantine/hooks",
68
73
  "react-i18next",
69
74
  "i18next",
70
- ...(extraPackages.includes(ExtraPackage.MantineUiNotifications)
75
+ ...(extraPackages.includes(ExtraPackage_1.default.MantineUiNotifications)
71
76
  ? ["@mantine/notifications"]
72
77
  : []),
73
- ...(extraPackages.includes(ExtraPackage.NextAuth)
78
+ ...(extraPackages.includes(ExtraPackage_1.default.NextAuth)
74
79
  ? ["next-auth"]
75
80
  : [])
76
81
  ];
77
82
  for (const pkg of packagesToInstall) {
78
- const spinner = ora(`Installing ${pkg}...`).start();
83
+ const spinner = (0, ora_1.default)(`Installing ${pkg}...`).start();
79
84
  try {
80
- execSync(`npm i ${pkg}`);
81
- 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}!`));
82
87
  }
83
88
  catch {
84
- spinner.fail(chalk.red(`Could not install ${pkg}!`));
89
+ spinner.fail(chalk_1.default.red(`Could not install ${pkg}!`));
85
90
  process.exit(1);
86
91
  }
87
92
  }
88
93
  // Setting up PostCSS
89
94
  {
90
- const spinner = ora("Setting up PostCSS...").start();
95
+ const spinner = (0, ora_1.default)("Setting up PostCSS...").start();
91
96
  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!"));
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!"));
95
100
  }
96
101
  catch {
97
- spinner.fail(chalk.red("Could not set up PostCSS!"));
102
+ spinner.fail(chalk_1.default.red("Could not set up PostCSS!"));
98
103
  process.exit(1);
99
104
  }
100
105
  }
101
106
  // Setting up custom files
102
107
  {
103
- const spinner = ora("Setting up custom files...").start();
108
+ const spinner = (0, ora_1.default)("Setting up custom files...").start();
104
109
  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!"));
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!"));
122
127
  }
123
128
  catch (error) {
124
- spinner.fail(chalk.red("Could not set up custom files!"));
129
+ spinner.fail(chalk_1.default.red("Could not set up custom files!"));
125
130
  console.log(error);
126
131
  process.exit(1);
127
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.1",
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,222 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import prompts from "prompts";
4
- import ExtraPackage from "./types/ExtraPackage";
5
- import chalk from "chalk";
6
- import promiseType from "./utils/functions/promiseType";
7
- import ora from "ora";
8
- import fs from "node:fs";
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
- import { execSync } from "node:child_process";
21
-
22
- (async () => {
23
- console.log(chalk.cyan("🚀 Create a new frontend app!"));
24
-
25
-
26
-
27
- // Prompting
28
-
29
- const response = await prompts([
30
- {
31
- type: "text",
32
- name: "name",
33
- message: "Project name:",
34
- initial: "app"
35
- },
36
- {
37
- type: "multiselect",
38
- name: "extraPackages",
39
- message: "Extra packages:",
40
- choices: [
41
- {
42
- title: "Mantine UI - Notifications",
43
- value: ExtraPackage.MantineUiNotifications
44
- },
45
- {
46
- title: "NextAuth",
47
- value: ExtraPackage.NextAuth
48
- }
49
- ]
50
- }
51
- ]);
52
-
53
- const { name, extraPackages } = response;
54
-
55
- if (!name || !extraPackages) process.exit(1);
56
-
57
- if (!promiseType<string>(name)) return;
58
- if (!promiseType<number[]>(extraPackages)) return;
59
-
60
-
61
-
62
- // Creating Next.js project
63
- {
64
- const spinner = ora("Creating Next.js project...").start();
65
-
66
- try {
67
- execSync("npx create-next-app . --yes --empty");
68
-
69
- spinner.succeed(chalk.green("Created Next.js project!"));
70
- }
71
- catch {
72
- spinner.fail(chalk.red("Could not create Next.js project!"));
73
-
74
- process.exit(1);
75
- }
76
- }
77
-
78
-
79
-
80
- // Installing additional packages
81
-
82
- const packagesToInstall = [
83
- "@mantine/core",
84
- "@mantine/hooks",
85
- "react-i18next",
86
- "i18next",
87
- ...(
88
- extraPackages.includes(ExtraPackage.MantineUiNotifications)
89
- ? ["@mantine/notifications"]
90
- : []
91
- ),
92
- ...(
93
- extraPackages.includes(ExtraPackage.NextAuth)
94
- ? ["next-auth"]
95
- : []
96
- )
97
- ];
98
-
99
- for (const pkg of packagesToInstall) {
100
- const spinner = ora(`Installing ${pkg}...`).start();
101
-
102
- try {
103
- execSync(`npm i ${pkg}`);
104
-
105
- spinner.succeed(chalk.green(`Installed ${pkg}!`));
106
- }
107
- catch {
108
- spinner.fail(chalk.red(`Could not install ${pkg}!`));
109
-
110
- process.exit(1);
111
- }
112
- }
113
-
114
-
115
-
116
- // Setting up PostCSS
117
- {
118
- const spinner = ora("Setting up PostCSS...").start();
119
-
120
- try {
121
- execSync("npm i --save-dev postcss postcss-preset-mantine postcss-simple-vars");
122
-
123
- fs.writeFileSync(
124
- path.join(process.cwd(), "postcss.config.mjs"),
125
- postcssConfig
126
- );
127
-
128
- spinner.succeed(chalk.green("Set up PostCSS!"));
129
- }
130
- catch {
131
- spinner.fail(chalk.red("Could not set up PostCSS!"));
132
-
133
- process.exit(1);
134
- }
135
- }
136
-
137
-
138
-
139
- // Setting up custom files
140
- {
141
- const spinner = ora("Setting up custom files...").start();
142
-
143
- try {
144
- fs.rmSync(path.join(process.cwd(), "src", "app"), { recursive: true, force: true });
145
- fs.rmSync(path.join(process.cwd(), "README.md"), { recursive: true, force: true });
146
-
147
-
148
- fs.mkdirSync(
149
- path.join(process.cwd(), "src", "app"),
150
- { recursive: true }
151
- );
152
-
153
- fs.mkdirSync(
154
- path.join(process.cwd(), "src", "components", "common"),
155
- { recursive: true }
156
- );
157
-
158
- fs.mkdirSync(
159
- path.join(process.cwd(), "src", "css"),
160
- { recursive: true }
161
- );
162
-
163
- fs.mkdirSync(
164
- path.join(process.cwd(), "src", "utils", "i18n", "resources"),
165
- { recursive: true }
166
- );
167
-
168
- fs.mkdirSync(
169
- path.join(process.cwd(), "src", "types", "common"),
170
- { recursive: true }
171
- );
172
-
173
-
174
- fs.writeFileSync(
175
- path.join(process.cwd(), "src", "app", "layout.tsx"),
176
- nextLayout
177
- );
178
-
179
- fs.writeFileSync(
180
- path.join(process.cwd(), "src", "app", "page.tsx"),
181
- nextPage
182
- );
183
-
184
- fs.writeFileSync(
185
- path.join(process.cwd(), "src", "components", "common", "Providers.tsx"),
186
- providersComponent
187
- );
188
-
189
- fs.writeFileSync(
190
- path.join(process.cwd(), "src", "css", "globals.css"),
191
- extraPackages.includes(ExtraPackage.MantineUiNotifications)
192
- ? globalCssNotifs
193
- : globalCss
194
- );
195
-
196
- fs.writeFileSync(
197
- path.join(process.cwd(), "src", "utils", "i18n", "resources", "en.json"),
198
- languageResource
199
- );
200
-
201
- fs.writeFileSync(
202
- path.join(process.cwd(), "src", "utils", "i18n", "index.ts"),
203
- i18nConfig
204
- );
205
-
206
- fs.writeFileSync(
207
- path.join(process.cwd(), "src", "types", "common", "ParentProps.ts"),
208
- parentPropsType
209
- );
210
-
211
-
212
- spinner.succeed(chalk.green("Set up custom files!"));
213
- }
214
- catch (error) {
215
- spinner.fail(chalk.red("Could not set up custom files!"));
216
-
217
- console.log(error);
218
-
219
- process.exit(1);
220
- }
221
- }
222
- })();
@@ -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
- }