inikit 1.1.0 → 1.2.1

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/README.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # Inikit
2
2
 
3
- Inikit is a Node.js project designed to streamline your development workflow.
4
-
5
- ## Features
6
-
7
- - Modular and scalable architecture
8
- - Easy setup and configuration
9
- - Built with modern JavaScript
3
+ Best way to get started with Next.js and React project.
10
4
 
11
5
  ## Getting Started
12
6
 
@@ -14,6 +8,20 @@ Inikit is a Node.js project designed to streamline your development workflow.
14
8
  npx inikit@latest
15
9
  ```
16
10
 
11
+ ### Frameworks
12
+
13
+ - Next.js
14
+
15
+ - React
16
+
17
+ ### DevTools
18
+
19
+ - TailwindCSS
20
+
21
+ - Prettier
22
+
23
+ - Commitlint, Husky
24
+
17
25
  ## Contributing
18
26
 
19
27
  Contributions are welcome! Please open issues or submit pull requests.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import * as p from '@clack/prompts';
3
3
  import { chalkStderr } from 'chalk';
4
- import { titleCase, addCommitlint, addGit, addPrettier, createNextApp, } from './utils.js';
4
+ import { titleCase, addCommitlint, addGit, addPrettier, createNextApp, createReactApp, addTailwind, } from './utils.js';
5
5
  import path from 'node:path';
6
6
  import packageJSON from './package.json' with { type: 'json' };
7
- const { cyan, green, yellow } = chalkStderr;
7
+ const { cyan, green, yellow, gray } = chalkStderr;
8
8
  const response = async () => await p.group({
9
9
  projectName: () => {
10
- p.log.info(`Welcome to ${green(titleCase(packageJSON.name) + ' v' + packageJSON.version)}\n- ${packageJSON.author.name} (${packageJSON.author.username})`);
10
+ p.log.info(`Welcome to ${green(titleCase(packageJSON.name) + ' v' + packageJSON.version)}\n${gray(`- by ${packageJSON.author.name}`)}`);
11
11
  return p.text({
12
12
  message: `Enter the ${cyan('project name')}`,
13
13
  placeholder: 'my-app',
@@ -29,8 +29,8 @@ const response = async () => await p.group({
29
29
  framework: () => p.select({
30
30
  message: `Select a ${cyan('framework')}`,
31
31
  options: [
32
- { value: 'next', label: 'Next.js', hint: 'recommended' },
33
- // { value: 'react', label: 'React' },
32
+ { value: 'next', label: 'Next.js', hint: 'using create-next-app' },
33
+ { value: 'react', label: 'React', hint: 'using vite' },
34
34
  ],
35
35
  }),
36
36
  typeScript: () => p.confirm({
@@ -42,15 +42,16 @@ const response = async () => await p.group({
42
42
  return p.multiselect({
43
43
  message: `Select ${cyan('dev tools')}`,
44
44
  options: [
45
- { value: 'eslint', label: 'ESLint' },
45
+ { value: 'tailwind', label: 'Tailwind CSS' },
46
46
  { value: 'prettier', label: 'Prettier' },
47
47
  {
48
48
  value: 'commitlint',
49
49
  label: 'Husky',
50
- hint: 'commitlint + husky + lint-staged',
50
+ hint: 'commitlint + husky',
51
51
  },
52
52
  ],
53
- initialValues: ['eslint', 'prettier', 'commitlint'],
53
+ initialValues: ['tailwind', 'prettier', 'commitlint'],
54
+ required: false,
54
55
  });
55
56
  },
56
57
  // libraries: () =>
@@ -72,12 +73,26 @@ const response = async () => await p.group({
72
73
  });
73
74
  response()
74
75
  .then(async (res) => {
75
- const { projectName, typeScript, devTools } = res;
76
+ const { projectName, framework, typeScript, devTools } = res;
76
77
  const projectPath = path.resolve(process.cwd(), projectName);
77
- const nextSpinner = p.spinner();
78
- nextSpinner.start(`Creating a new Next.js app in ${yellow(projectPath)}`);
79
- await createNextApp(projectName, typeScript, devTools.includes('eslint'));
80
- nextSpinner.stop(`Created ${projectName} at ${projectPath}`);
78
+ if (framework === 'next') {
79
+ const nextSpinner = p.spinner();
80
+ nextSpinner.start(`Creating a new Next.js app in ${yellow(projectPath)}`);
81
+ await createNextApp(projectName, typeScript, devTools.includes('tailwind'));
82
+ nextSpinner.stop(`Created ${projectName} at ${projectPath}`);
83
+ }
84
+ else if (framework === 'react') {
85
+ const reactSpinner = p.spinner();
86
+ reactSpinner.start(`Creating a new React app in ${yellow(projectPath)}`);
87
+ await createReactApp(projectName, typeScript);
88
+ reactSpinner.stop(`Created ${projectName} at ${projectPath}`);
89
+ if (devTools.includes('tailwind')) {
90
+ const tailwindSpinner = p.spinner();
91
+ tailwindSpinner.start(`Adding Tailwind CSS to the project`);
92
+ await addTailwind(projectPath, typeScript);
93
+ tailwindSpinner.stop(`Added Tailwind CSS configuration`);
94
+ }
95
+ }
81
96
  if (devTools.includes('prettier')) {
82
97
  const prettierSpinner = p.spinner();
83
98
  prettierSpinner.start(`Adding prettier to the project`);
package/dist/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "inikit",
3
- "version": "1.1.0",
4
- "description": "Inikit is a CLI tool that scaffolds modern Next.js projects with integrated support for TypeScript, ESLint, Prettier, and commitlint to enforce a robust development workflow.",
3
+ "version": "1.2.1",
4
+ "description": "Best way to get started with Next.js and React project.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
8
  "build": "npx eslint . && npm run clean && tsc && cp -r templates dist/templates",
9
9
  "clean": "rm -rf dist",
10
+ "lint": "eslint . ",
11
+ "lint:fix": "eslint . --fix",
12
+ "format": "prettier --write .",
10
13
  "dev": "tsx index.ts",
11
14
  "prepare": "husky",
12
15
  "deploy": "npm run build && npm publish --access public"
@@ -17,6 +20,10 @@
17
20
  "files": [
18
21
  "dist"
19
22
  ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/ajaykumarn3000/Inikit.git"
26
+ },
20
27
  "keywords": [
21
28
  "inikit",
22
29
  "cli",
@@ -1,2 +1,2 @@
1
1
  npm run lint
2
- npx prettier . --write
2
+ npx prettier . --check
@@ -0,0 +1,70 @@
1
+ @import 'tailwindcss';
2
+
3
+ :root {
4
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
5
+ line-height: 1.5;
6
+ font-weight: 400;
7
+
8
+ color-scheme: light dark;
9
+ color: rgba(255, 255, 255, 0.87);
10
+ background-color: #242424;
11
+
12
+ font-synthesis: none;
13
+ text-rendering: optimizeLegibility;
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ button {
41
+ border-radius: 8px;
42
+ border: 1px solid transparent;
43
+ padding: 0.6em 1.2em;
44
+ font-size: 1em;
45
+ font-weight: 500;
46
+ font-family: inherit;
47
+ background-color: #1a1a1a;
48
+ cursor: pointer;
49
+ transition: border-color 0.25s;
50
+ }
51
+ button:hover {
52
+ border-color: #646cff;
53
+ }
54
+ button:focus,
55
+ button:focus-visible {
56
+ outline: 4px auto -webkit-focus-ring-color;
57
+ }
58
+
59
+ @media (prefers-color-scheme: light) {
60
+ :root {
61
+ color: #213547;
62
+ background-color: #ffffff;
63
+ }
64
+ a:hover {
65
+ color: #747bff;
66
+ }
67
+ button {
68
+ background-color: #f9f9f9;
69
+ }
70
+ }
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ });
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ });
package/dist/utils.js CHANGED
@@ -10,12 +10,28 @@ export const titleCase = (str) => {
10
10
  .map(word => word.charAt(0).toUpperCase() + word.slice(1))
11
11
  .join(' ');
12
12
  };
13
- export const createNextApp = async (appName, typeScript, eslint) => {
13
+ export const createNextApp = async (appName, typeScript, tailwind = true) => {
14
14
  const { stdout } = await $({
15
15
  cwd: process.cwd(),
16
- }) `npx create-next-app@latest ${appName} ${typeScript ? '--ts' : '--js'} ${eslint ? '--eslint' : '--no-eslint'} --app --turbopack --use-npm --yes --disable-git`;
16
+ }) `npx create-next-app@latest ${appName} ${typeScript ? '--ts' : '--js'} ${tailwind ? '--tailwind' : '--no-tailwind'} --eslint --app --turbopack --use-npm --yes --disable-git`;
17
17
  return stdout;
18
18
  };
19
+ export const createReactApp = async (appName, typeScript) => {
20
+ const { stdout } = await $({
21
+ cwd: process.cwd(),
22
+ }) `npm create vite@latest ${appName} --- --template ${typeScript ? 'react-ts' : 'react'}`;
23
+ await $({
24
+ cwd: path.resolve(process.cwd(), appName),
25
+ }) `npm install`;
26
+ return stdout;
27
+ };
28
+ export const addTailwind = async (appPath, typeScript) => {
29
+ await $({
30
+ cwd: appPath,
31
+ }) `npm install tailwindcss @tailwindcss/vite`;
32
+ copyFileSync(path.join(templateDir, 'tailwind', `vite.config.${typeScript ? 'ts' : 'js'}`), path.resolve(appPath, `vite.config.${typeScript ? 'ts' : 'js'}`));
33
+ copyFileSync(path.join(templateDir, 'tailwind', 'index.css'), path.resolve(appPath, 'src', 'index.css'));
34
+ };
19
35
  export const addPrettier = async (appPath) => {
20
36
  await $({
21
37
  cwd: appPath,
@@ -44,7 +60,7 @@ export const addCommitlint = async (appPath) => {
44
60
  force: true,
45
61
  recursive: true,
46
62
  });
47
- copyFileSync(path.join(templateDir, 'commitlint', 'commitlint.config.js'), path.resolve(appPath, 'commitlint.config.js'));
63
+ copyFileSync(path.join(templateDir, 'commitlint', 'commitlint.config.cjs'), path.resolve(appPath, 'commitlint.config.cjs'));
48
64
  await $({
49
65
  cwd: appPath,
50
66
  }) `npm run prepare`;
package/package.json CHANGED
@@ -1,60 +1,67 @@
1
- {
2
- "name": "inikit",
3
- "version": "1.1.0",
4
- "description": "Inikit is a CLI tool that scaffolds modern Next.js projects with integrated support for TypeScript, ESLint, Prettier, and commitlint to enforce a robust development workflow.",
5
- "main": "./dist/index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "npx eslint . && npm run clean && tsc && cp -r templates dist/templates",
9
- "clean": "rm -rf dist",
10
- "dev": "tsx index.ts",
11
- "prepare": "husky",
12
- "deploy": "npm run build && npm publish --access public"
13
- },
14
- "bin": {
15
- "inikit": "./dist/index.js"
16
- },
17
- "files": [
18
- "dist"
19
- ],
20
- "keywords": [
21
- "inikit",
22
- "cli",
23
- "nextjs",
24
- "typescript",
25
- "eslint",
26
- "prettier",
27
- "commitlint",
28
- "scaffold",
29
- "development",
30
- "tools"
31
- ],
32
- "author": {
33
- "username": "ajaykumarn3000",
34
- "url": "https://ajaykumarn3000.github.io",
35
- "name": "Ajaykumar Nadar",
36
- "email": "ajaykumarn3000@gmail.com"
37
- },
38
- "license": "MIT",
39
- "type": "module",
40
- "devDependencies": {
41
- "@commitlint/cli": "^19.8.1",
42
- "@commitlint/config-conventional": "^19.8.1",
43
- "@eslint/js": "^9.27.0",
44
- "@eslint/json": "^0.12.0",
45
- "@eslint/markdown": "^6.4.0",
46
- "@types/node": "^22.15.21",
47
- "eslint": "^9.27.0",
48
- "globals": "^16.2.0",
49
- "husky": "^9.1.7",
50
- "prettier": "^3.5.3",
51
- "typescript": "^5.8.3",
52
- "typescript-eslint": "^8.32.1"
53
- },
54
- "dependencies": {
55
- "@clack/prompts": "^0.11.0",
56
- "chalk": "^5.4.1",
57
- "execa": "^9.5.3",
58
- "tsx": "^4.19.4"
59
- }
60
- }
1
+ {
2
+ "name": "inikit",
3
+ "version": "1.2.1",
4
+ "description": "Best way to get started with Next.js and React project.",
5
+ "main": "./dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "npx eslint . && npm run clean && tsc && cp -r templates dist/templates",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint . ",
11
+ "lint:fix": "eslint . --fix",
12
+ "format": "prettier --write .",
13
+ "dev": "tsx index.ts",
14
+ "prepare": "husky",
15
+ "deploy": "npm run build && npm publish --access public"
16
+ },
17
+ "bin": {
18
+ "inikit": "./dist/index.js"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/ajaykumarn3000/Inikit.git"
26
+ },
27
+ "keywords": [
28
+ "inikit",
29
+ "cli",
30
+ "nextjs",
31
+ "typescript",
32
+ "eslint",
33
+ "prettier",
34
+ "commitlint",
35
+ "scaffold",
36
+ "development",
37
+ "tools"
38
+ ],
39
+ "author": {
40
+ "username": "ajaykumarn3000",
41
+ "url": "https://ajaykumarn3000.github.io",
42
+ "name": "Ajaykumar Nadar",
43
+ "email": "ajaykumarn3000@gmail.com"
44
+ },
45
+ "license": "MIT",
46
+ "type": "module",
47
+ "devDependencies": {
48
+ "@commitlint/cli": "^19.8.1",
49
+ "@commitlint/config-conventional": "^19.8.1",
50
+ "@eslint/js": "^9.27.0",
51
+ "@eslint/json": "^0.12.0",
52
+ "@eslint/markdown": "^6.4.0",
53
+ "@types/node": "^22.15.21",
54
+ "eslint": "^9.27.0",
55
+ "globals": "^16.2.0",
56
+ "husky": "^9.1.7",
57
+ "prettier": "^3.5.3",
58
+ "typescript": "^5.8.3",
59
+ "typescript-eslint": "^8.32.1"
60
+ },
61
+ "dependencies": {
62
+ "@clack/prompts": "^0.11.0",
63
+ "chalk": "^5.4.1",
64
+ "execa": "^9.5.3",
65
+ "tsx": "^4.19.4"
66
+ }
67
+ }