create-nextblock 0.2.66 → 0.2.69
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/bin/create-nextblock.js
CHANGED
|
@@ -156,6 +156,9 @@ async function handleCommand(projectDirectory, options) {
|
|
|
156
156
|
await transformPackageJson(projectDir);
|
|
157
157
|
console.log(chalk.green('Dependencies updated for public packages.'));
|
|
158
158
|
|
|
159
|
+
await ensurePublicNpmrc(projectDir);
|
|
160
|
+
console.log(chalk.green('Enforced public registry for initial install.'));
|
|
161
|
+
|
|
159
162
|
if (!skipInstall) {
|
|
160
163
|
await installDependencies(projectDir);
|
|
161
164
|
} else {
|
|
@@ -636,8 +639,14 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
636
639
|
'',
|
|
637
640
|
].join('\n');
|
|
638
641
|
|
|
639
|
-
await fs.
|
|
642
|
+
await fs.writeFile(npmrcPath, npmrcContent);
|
|
640
643
|
clack.note('Premium modules configured in .npmrc!');
|
|
644
|
+
|
|
645
|
+
clack.note('Installing @nextblock-cms/ecom...');
|
|
646
|
+
await runCommand('npm', ['install', '@nextblock-cms/ecom'], {
|
|
647
|
+
cwd: projectPath,
|
|
648
|
+
});
|
|
649
|
+
clack.note('Premium module installed!');
|
|
641
650
|
}
|
|
642
651
|
|
|
643
652
|
await appendEnvBlock('SMTP', [
|
|
@@ -1445,6 +1454,15 @@ async function sanitizeNextConfig(projectDir, editorUtilNames = []) {
|
|
|
1445
1454
|
await fs.writeFile(nextConfigPath, content);
|
|
1446
1455
|
}
|
|
1447
1456
|
|
|
1457
|
+
async function ensurePublicNpmrc(projectDir) {
|
|
1458
|
+
const npmrcPath = resolve(projectDir, '.npmrc');
|
|
1459
|
+
// Force the public registry for the @nextblock-cms scope for the initial install
|
|
1460
|
+
// This ensures that even if the user has a global .npmrc pointing to GitHub,
|
|
1461
|
+
// we use the public ghost modules (or full modules) from npmjs.org first.
|
|
1462
|
+
const content = '@nextblock-cms:registry=https://registry.npmjs.org\n';
|
|
1463
|
+
await fs.writeFile(npmrcPath, content);
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1448
1466
|
async function transformPackageJson(projectDir) {
|
|
1449
1467
|
const packageJsonPath = resolve(projectDir, 'package.json');
|
|
1450
1468
|
if (!(await fs.pathExists(packageJsonPath))) {
|
package/package.json
CHANGED
|
@@ -41,8 +41,8 @@ If you are contributing to the core repo or prefer manual setup:
|
|
|
41
41
|
1. **Clone the repo:**
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
git clone https://github.com/
|
|
45
|
-
cd nextblock
|
|
44
|
+
git clone https://github.com/nextblock-cms/nextblock.git
|
|
45
|
+
cd nextblock
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
2. **Install dependencies:**
|