wp-lemon-create 1.9.1 → 2.0.0

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.
Files changed (2) hide show
  1. package/lib/index.js +19 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -24,6 +24,7 @@ let plugins_wpml = false;
24
24
  let is_spinup = false;
25
25
  let skipGit = false;
26
26
  let branch = false;
27
+ let version_constraints = '*';
27
28
 
28
29
  program
29
30
  .name(commandName)
@@ -109,6 +110,7 @@ program
109
110
  plugins_searchwp = prompt('Add plugin: SearchWP? yes/no (defaults to no)', 'no');
110
111
  plugins_wpml = prompt('Add plugin: WPML? yes/no (defaults to no)', 'no');
111
112
  is_spinup = prompt('Does the project run on Spinup-wp? (defaults to no)', 'no');
113
+ is_beta = prompt('Is this a beta project? (defaults to no)', 'no');
112
114
 
113
115
  if (project_repository == 'none') {
114
116
  skipGit = true;
@@ -128,6 +130,11 @@ program
128
130
  shell.echo(`🎉 Setting up ${project_type} wp-lemon project with url ${project_url} \n`);
129
131
 
130
132
  if (project_type == 'new') {
133
+
134
+ if (is_beta) {
135
+ version_constraints = '^4@beta';
136
+ }
137
+
131
138
  shell.echo('⏳ Downloading Bedrock. This may take a minute or so.\n');
132
139
 
133
140
  /**
@@ -157,7 +164,7 @@ program
157
164
  shell.exec('composer require composer/installers ~1.0', { silent: true });
158
165
  shell.exec('"roots/wordpress', { silent: true });
159
166
  // Add libraries and parent theme
160
- shell.exec('composer require highground/bulldozer giggsey/libphonenumber-for-php timber/timber satispress/wp-lemon --with-all-dependencies', { silent: true });
167
+ shell.exec(`composer require highground/bulldozer giggsey/libphonenumber-for-php timber/timber satispress/wp-lemon:${version_constraints} --with-all-dependencies`, { silent: true });
161
168
 
162
169
  shell.exec(
163
170
  'composer require satispress/advanced-custom-fields-pro satispress/fluentformpro satispress/quartermaster satispress/wp-migrate-db-pro wpackagist-plugin/limit-login-attempts-reloaded log1x/acf-editor-palette wpackagist-plugin/fluentform wpackagist-plugin/seo-by-rank-math wpackagist-plugin/simple-custom-post-order wpackagist-plugin/worker wpackagist-plugin/fluent-smtp --with-all-dependencies',
@@ -180,7 +187,7 @@ program
180
187
  shell.exec('composer require satispress/sitepress-multilingual-cms satispress/acfml satispress/wpml-string-translation', { silent: true });
181
188
  }
182
189
 
183
- shell.echo('✔️ Installing plugins, master theme and packages done \n');
190
+ shell.echo('✔️ Installing plugins, master theme and packages done \n');
184
191
 
185
192
  /**
186
193
  * Git init & add repository
@@ -205,7 +212,9 @@ program
205
212
  shell.echo('⏳ Downloading child theme.\n');
206
213
  shell.cd('web/app/themes/');
207
214
 
208
- shell.exec(`composer create-project --repository https://packagist.studiolemon.nl/satispress/ satispress/wp-lemon-child ${child_theme_folder} --no-dev`, { silent: true });
215
+ shell.exec(`composer create-project --repository https://packagist.studiolemon.nl/satispress/ satispress/wp-lemon-child:${version_constraints} ${child_theme_folder} --no-dev`, { silent: true });
216
+
217
+
209
218
 
210
219
  shell.cd(child_theme_folder);
211
220
  shell.rm('-rf', '.github');
@@ -358,7 +367,7 @@ function createDB() {
358
367
  function setupWordPress() {
359
368
  if (
360
369
  shell.exec(
361
- `wp core install --skip-email --url="http://${project_url}" --title="${project_name}" --admin_user="${username}" --admin_password="${password}" --admin_email="${email}"`,
370
+ `wp core install --skip-email --url='http://${project_url}' --title='${project_name}' --admin_user='${username}' --admin_password='${password}' --admin_email='${email}'`,
362
371
  { silent: true },
363
372
  ).code !== 0
364
373
  ) {
@@ -380,11 +389,17 @@ function setupWordPress() {
380
389
  shell.exec(`wp post delete 1 --force`, { silent: true });
381
390
  shell.exec(`wp comment delete 1 --force`, { silent: true });
382
391
  shell.echo('✔️ Create homepage and set as front-page.');
392
+
383
393
  // Set language
384
394
  shell.exec(`wp language core install nl_NL`, { silent: true });
385
395
  shell.exec(`wp language plugin install nl_NL --all`, { silent: true });
386
396
  shell.exec(`wp language core activate nl_NL`, { silent: true });
387
397
  shell.echo('✔️ Installed Dutch language.');
398
+
399
+ // activate plugins
400
+ shell.exec(`wp plugin activate wp plugin activate fluentform`, { silent: true });
401
+ shell.exec(`wp plugin activate wp plugin activate fluentformpro`, { silent: true });
402
+
388
403
  // set menu
389
404
  shell.exec(`wp menu create "Hoofdmenu"`, { silent: true });
390
405
  shell.exec(`wp menu item add-post Hoofdmenu 2`, { silent: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wp-lemon-create",
3
- "version": "1.9.1",
3
+ "version": "2.0.0",
4
4
  "description": "Bootstrap your wp-lemon project",
5
5
  "main": "index.js",
6
6
  "author": "Erik van der bas",