@haxtheweb/create 9.0.24 → 10.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.
@@ -909,6 +909,7 @@ async function siteCommandDetected(commandRun) {
909
909
  let recContents = await fs.readFileSync(commandRun.options.recipe, 'utf8');
910
910
  // split into commands
911
911
  let commandList = recContents.replaceAll('cli: ', '').split("\n");
912
+ let rootDir = '';
912
913
  // confirm each command or allow --y so that it auto applies
913
914
  for (var i in commandList) {
914
915
  // verify every command starts this way for safety
@@ -924,7 +925,23 @@ async function siteCommandDetected(commandRun) {
924
925
  }
925
926
  // confirmed; let's run!
926
927
  if (confirmation) {
927
- await exec(`${commandList[i]} --y --no-i --auto --quiet`);
928
+ let commandMatch = siteActions().filter(action => action.value === commandList[i].split(' ')[2]);
929
+ // if we found a command that means it is a valid command to run against the site
930
+ if (commandMatch.length > 0) {
931
+ await exec(`${commandList[i]} --y --no-i --auto --quiet${rootDir}`);
932
+ }
933
+ // 1st command won't match as the argument creates a new site
934
+ // but ensure we don't have a site context prior to running this
935
+ // or we'll get a site in a site with the same name which is not
936
+ // the desired result
937
+ else if (!(await hax.systemStructureContext())) {
938
+ await exec(`${commandList[i]} --y --no-i --auto --quiet --no-extras`);
939
+ // site will have been created, obtain the site name and set root so
940
+ // the other commands get piped into it correctly
941
+ rootDir = ` --root ${commandList[i].split(' ')[2]}`;
942
+ } else {
943
+ (0, _logging.log)('Did not run because we already have a site', 'warn');
944
+ }
928
945
  }
929
946
  }
930
947
  }
@@ -138,7 +138,8 @@ class HAXWiring {
138
138
  async function webcomponentProcess(commandRun, project, port = "8000") {
139
139
  // auto select operations to perform if requested
140
140
  if (!project.extras) {
141
- if (!commandRun.options.extras) {
141
+ console.log(commandRun.options.extras);
142
+ if (commandRun.options.extras === false) {
142
143
  project.extras = [];
143
144
  } else {
144
145
  let extras = ['launch', 'install', 'git'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haxtheweb/create",
3
- "version": "9.0.24",
3
+ "version": "10.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,8 +45,8 @@
45
45
  "dependencies": {
46
46
  "@clack/core": "0.3.4",
47
47
  "@clack/prompts": "0.7.0",
48
- "@haxtheweb/haxcms-nodejs": "^9.0.20",
49
- "@haxtheweb/open-apis": "^9.0.12",
48
+ "@haxtheweb/haxcms-nodejs": "^10.0.0",
49
+ "@haxtheweb/open-apis": "^10.0.1",
50
50
  "commander": "12.1.0",
51
51
  "node-html-parser": "6.1.13",
52
52
  "ejs": "3.1.10",