@majordigital/create-acorn 1.0.9 → 1.1.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.
@@ -127,11 +127,15 @@ async function scaffoldNextApp() {
127
127
  console.log('Acorn dependencies installed.');
128
128
  console.log('');
129
129
 
130
- console.log('Installing Biome for linting...');
130
+ console.log('Installing Biome, commitlint, and lefthook...');
131
131
  await runCommand('npm', ['install', '--save-dev', '--save-exact', '@biomejs/biome']);
132
- await runCommand('npx', ['@biomejs/biome', 'init']);
132
+ await runCommand('npm', ['install', '--save-dev',
133
+ '@commitlint/cli', '@commitlint/config-conventional', '@commitlint/types', 'lefthook'
134
+ ]);
135
+ // Remove default biome.json if created — we use biome.jsonc from the template
136
+ try { rmSync(join(process.cwd(), 'biome.json')); } catch {}
133
137
  console.log('');
134
- console.log('Biome configured successfully.');
138
+ console.log('Biome, commitlint, and lefthook configured.');
135
139
  console.log('');
136
140
  }
137
141
 
@@ -357,15 +361,7 @@ async function main() {
357
361
 
358
362
  await scaffoldNextApp();
359
363
 
360
- if (selection.key === 'prismic') {
361
- await setupPrismic();
362
- } else {
363
- console.log(`CMS preset ${selection.label} scaffolding is coming next.`);
364
- console.log('This run only confirms selection for non-Prismic options.');
365
- console.log('');
366
- }
367
-
368
- // Generate .env.example
364
+ // Generate .env.example and README before CMS setup (CMS setup may block if user starts Slice Machine)
369
365
  const envExamples = {
370
366
  prismic: `PRISMIC_ACCESS_TOKEN=
371
367
  SITE_URL=
@@ -388,14 +384,20 @@ SITE_URL=
388
384
  };
389
385
  writeFileSync(join(process.cwd(), '.env.example'), envExamples[selection.key]);
390
386
  console.log('.env.example generated.');
391
- console.log('');
392
387
 
393
- // Generate project README
394
388
  const projectName = basename(process.cwd());
395
389
  const readme = generateReadme(projectName, selection.key);
396
390
  writeFileSync(join(process.cwd(), 'README.md'), readme);
397
391
  console.log('README.md generated.');
398
392
  console.log('');
393
+
394
+ if (selection.key === 'prismic') {
395
+ await setupPrismic();
396
+ } else {
397
+ console.log(`CMS preset ${selection.label} scaffolding is coming next.`);
398
+ console.log('This run only confirms selection for non-Prismic options.');
399
+ console.log('');
400
+ }
399
401
  }
400
402
 
401
403
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majordigital/create-acorn",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Interactive scaffold for Acorn with Storyblok/Prismic/DatoCMS, TypeScript, and Tailwind.",
5
5
  "bin": {
6
6
  "create-acorn": "bin/create-acorn.mjs",
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false
10
+ },
11
+ "formatter": {
12
+ "enabled": true,
13
+ "indentWidth": 4,
14
+ "indentStyle": "tab",
15
+ "lineWidth": 80,
16
+ "lineEnding": "lf"
17
+ },
18
+ "linter": {
19
+ "enabled": true,
20
+ "domains": {
21
+ "react": "recommended",
22
+ "next": "recommended"
23
+ },
24
+ "rules": {
25
+ "style": {
26
+ "noNonNullAssertion": "off"
27
+ },
28
+ "correctness": {
29
+ "noUnusedImports": {
30
+ "level": "error",
31
+ "fix": "safe",
32
+ "options": {}
33
+ },
34
+ "noUnusedVariables": "error",
35
+ "useUniqueElementIds": "error"
36
+ },
37
+ "complexity": {
38
+ "noUselessFragments": {
39
+ "level": "warn",
40
+ "fix": "safe",
41
+ "options": {}
42
+ }
43
+ },
44
+ "suspicious": {
45
+ "noExplicitAny": "off",
46
+ "noImplicitAnyLet": "off",
47
+ "noConsole": {
48
+ "fix": "unsafe",
49
+ "level": "error",
50
+ "options": {}
51
+ },
52
+ "noUnknownAtRules": "off"
53
+ },
54
+ "nursery": {
55
+ "useSortedClasses": {
56
+ "level": "error",
57
+ "fix": "safe",
58
+ "options": {
59
+ "functions": ["clsx"]
60
+ }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "javascript": {
66
+ "formatter": {
67
+ "quoteStyle": "single",
68
+ "trailingCommas": "es5",
69
+ "semicolons": "always",
70
+ "arrowParentheses": "asNeeded"
71
+ }
72
+ },
73
+ "css": {
74
+ "formatter": {
75
+ "quoteStyle": "single"
76
+ },
77
+ "parser": {
78
+ "tailwindDirectives": true
79
+ }
80
+ },
81
+ "assist": {
82
+ "enabled": true,
83
+ "actions": {
84
+ "source": {
85
+ "organizeImports": {
86
+ "level": "on",
87
+ "options": {
88
+ "groups": [
89
+ ":NODE:",
90
+ ":BLANK_LINE:",
91
+ [":PACKAGE:", ":PACKAGE_WITH_PROTOCOL:"],
92
+ ":BLANK_LINE:",
93
+ ":ALIAS:",
94
+ ":BLANK_LINE:",
95
+ ":PATH:",
96
+ ":BLANK_LINE:",
97
+ ":URL:"
98
+ ]
99
+ }
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "overrides": []
105
+ }
@@ -0,0 +1,7 @@
1
+ import type { UserConfig } from '@commitlint/types';
2
+
3
+ const commitlintConfig: UserConfig = {
4
+ extends: ['@commitlint/config-conventional'],
5
+ };
6
+
7
+ export default commitlintConfig;
@@ -0,0 +1,15 @@
1
+ pre-commit:
2
+ parallel: true
3
+ commands:
4
+ check-js:
5
+ glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
6
+ run: npx biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
7
+ stage_fixed: true
8
+ check-toml:
9
+ glob: "*.toml"
10
+ run: test -z "{staged_files}" || (npx taplo format {staged_files} && git update-index --again)
11
+
12
+ commit-msg:
13
+ scripts:
14
+ "commitlint.sh":
15
+ runner: bash