create-skaff 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skaff",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Interactive Next.js project scaffolder: Tailwind, shadcn/ui, Motion, Lucide, Oxlint, Oxfmt, Ultracite, Claude and Codex config",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- export type FeatureId = "typography" | "shadcn" | "motion" | "lucide" | "ultracite" | "claude" | "codex";
1
+ export type FeatureId = "typography" | "shadcn" | "motion" | "lucide" | "hugeicons" | "ultracite" | "claude" | "codex";
2
2
 
3
3
  export type Feature = { id: FeatureId; label: string };
4
4
 
@@ -17,6 +17,7 @@ export const featureGroups: FeatureGroup[] = [
17
17
  features: [
18
18
  { id: "motion", label: "Motion (framer-motion)" },
19
19
  { id: "lucide", label: "Lucide icons" },
20
+ { id: "hugeicons", label: "Hugeicons (free)" },
20
21
  ],
21
22
  },
22
23
  {
@@ -2,6 +2,7 @@ import { join } from "node:path";
2
2
  import type { FeatureId } from "./features";
3
3
  import { type PackageManager, packageManagerCommands } from "./package-manager";
4
4
  import { addTypographyPlugin } from "./utils/add-typography-plugin";
5
+ import { extendGitignore } from "./utils/extend-gitignore";
5
6
  import { type CommandResult, runCommand } from "./utils/run-command";
6
7
  import { writeAgentConfig } from "./utils/write-agent-config";
7
8
 
@@ -30,25 +31,34 @@ const command = (
30
31
  run: (config, onOutput) => runCommand(build(config), inProject ? projectDir(config) : config.cwd, onOutput),
31
32
  });
32
33
 
34
+ const createNextApp = command(
35
+ ({ name, packageManager }) => [
36
+ ...packageManagerCommands[packageManager].dlx,
37
+ "create-next-app@latest",
38
+ name,
39
+ "--ts",
40
+ "--tailwind",
41
+ "--app",
42
+ "--no-src-dir",
43
+ "--import-alias",
44
+ "@/*",
45
+ "--yes",
46
+ packageManagerCommands[packageManager].createNextFlag,
47
+ ],
48
+ false,
49
+ );
50
+
33
51
  const nextStep: ScaffoldStep = {
34
52
  id: "next",
35
53
  label: "Next.js + Tailwind (create-next-app)",
36
- ...command(
37
- ({ name, packageManager }) => [
38
- ...packageManagerCommands[packageManager].dlx,
39
- "create-next-app@latest",
40
- name,
41
- "--ts",
42
- "--tailwind",
43
- "--app",
44
- "--no-src-dir",
45
- "--import-alias",
46
- "@/*",
47
- "--yes",
48
- packageManagerCommands[packageManager].createNextFlag,
49
- ],
50
- false,
51
- ),
54
+ describe: (config) => `${createNextApp.describe(config)}, then extend .gitignore`,
55
+ run: async (config, onOutput) => {
56
+ const result = await createNextApp.run(config, onOutput);
57
+ if (result.ok) {
58
+ await extendGitignore(projectDir(config));
59
+ }
60
+ return result;
61
+ },
52
62
  };
53
63
 
54
64
  const typographyStep: ScaffoldStep = {
@@ -136,7 +146,11 @@ const agentConfigStep = (agents: FeatureId[]): ScaffoldStep => ({
136
146
 
137
147
  export function buildScaffoldSteps(features: FeatureId[]): ScaffoldStep[] {
138
148
  const has = (id: FeatureId) => features.includes(id);
139
- const libraries = [...(has("motion") ? ["motion"] : []), ...(has("lucide") ? ["lucide-react"] : [])];
149
+ const libraries = [
150
+ ...(has("motion") ? ["motion"] : []),
151
+ ...(has("lucide") ? ["lucide-react"] : []),
152
+ ...(has("hugeicons") ? ["@hugeicons/react", "@hugeicons/core-free-icons"] : []),
153
+ ];
140
154
  const agents = features.filter((id): id is "claude" | "codex" => id === "claude" || id === "codex");
141
155
  return [
142
156
  nextStep,
@@ -0,0 +1,15 @@
1
+ import { readFile, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+
4
+ const extraSections = [["# playwright mcp", "/.playwright-mcp/"]];
5
+
6
+ export async function extendGitignore(projectDir: string): Promise<void> {
7
+ const path = join(projectDir, ".gitignore");
8
+ const current = await readFile(path, "utf8").catch(() => "");
9
+ const missing = extraSections.filter((section) => !current.includes(section[1]));
10
+ if (missing.length === 0) {
11
+ return;
12
+ }
13
+ const body = missing.map((section) => section.join("\n")).join("\n\n");
14
+ await writeFile(path, `${current.trimEnd()}\n\n${body}\n`);
15
+ }