@majordigital/create-acorn 1.0.2 → 1.0.4

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
@@ -37,16 +37,8 @@ First iteration of an interactive CLI to scaffold a Headless CMS skeleton with N
37
37
 
38
38
  Recommended usage (once published to npm):
39
39
 
40
- - Use npm init-style:
41
-
42
- ```bash
43
- npm create acorn@latest
44
- ```
45
-
46
- - Or via npx with the alias:
47
-
48
40
  ```bash
49
- npx major-acorn@latest
41
+ npx @majordigital/create-acorn@latest
50
42
  ```
51
43
 
52
44
  Local (from this repo):
@@ -70,7 +62,7 @@ You can also pass the repository name non-interactively:
70
62
  ```bash
71
63
  npm run acorn -- --cms prismic --repo my-repo
72
64
  # or
73
- npx major-acorn@latest --cms prismic --repo my-repo
65
+ npx @majordigital/create-acorn@latest --cms prismic --repo my-repo
74
66
  ```
75
67
 
76
68
  Repository name rules: lowercase letters, numbers, and hyphens only.
@@ -3,7 +3,8 @@
3
3
  import readline from 'node:readline';
4
4
  import { argv, exit } from 'node:process';
5
5
  import { spawn } from 'node:child_process';
6
- import { basename } from 'node:path';
6
+ import { basename, join } from 'node:path';
7
+ import { readFileSync, writeFileSync } from 'node:fs';
7
8
 
8
9
  const CMS_CHOICES = [
9
10
  { key: 'prismic', label: 'Prismic' },
@@ -139,19 +140,41 @@ async function setupPrismic() {
139
140
  }
140
141
  console.log('');
141
142
 
142
- const initArgs = ['@slicemachine/init@latest', '--repository', repo];
143
- if (isExisting) {
144
- initArgs.push('--existing-repo');
143
+ await runCommand('npx', ['@slicemachine/init@latest', '--repository', repo]);
144
+
145
+ // Ensure slicemachine script exists in package.json
146
+ const pkgPath = join(process.cwd(), 'package.json');
147
+ try {
148
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
149
+ if (!pkg.scripts) pkg.scripts = {};
150
+ if (!pkg.scripts.slicemachine) {
151
+ pkg.scripts.slicemachine = 'start-slicemachine';
152
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
153
+ console.log('');
154
+ console.log('Added "slicemachine" script to package.json.');
155
+ }
156
+ } catch {
157
+ console.log('Warning: Could not update package.json with slicemachine script.');
145
158
  }
146
159
 
147
- await runCommand('npx', initArgs);
148
-
149
160
  console.log('');
150
- console.log('Prismic Slice Machine initialization complete.');
161
+ console.log('=== Prismic Setup Complete ===');
151
162
  console.log('');
152
163
  console.log('NOTE: The default language is set to English - United States.');
153
164
  console.log('Please update it to English - Europe (en-eu) in your Prismic project settings:');
154
- console.log(`https://${repo}.prismic.io/settings/`);
165
+ console.log(` https://${repo}.prismic.io/settings/`);
166
+ console.log('');
167
+ console.log('=== Next Steps ===');
168
+ console.log('');
169
+ console.log(' 1. Start the Prismic Dev Tool (Slice Machine):');
170
+ console.log(' npm run slicemachine');
171
+ console.log('');
172
+ console.log(' 2. Create your custom types in Slice Machine (http://localhost:9999)');
173
+ console.log('');
174
+ console.log(' 3. Push your custom types to Prismic when ready');
175
+ console.log('');
176
+ console.log(' 4. Start your dev server:');
177
+ console.log(' npm run dev');
155
178
  console.log('');
156
179
  }
157
180
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majordigital/create-acorn",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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",