mythix 2.8.18 → 2.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.8.18",
3
+ "version": "2.9.0",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index",
6
6
  "scripts": {
@@ -35,7 +35,7 @@
35
35
  "form-data": "^4.0.0",
36
36
  "luxon": "^3.1.0",
37
37
  "micromatch": "^4.0.5",
38
- "mythix-orm": "^1.8.3",
38
+ "mythix-orm": "^1.10.2",
39
39
  "nife": "^1.12.1",
40
40
  "prompts": "^2.4.2"
41
41
  }
@@ -26,10 +26,14 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
26
26
  '@title': 'Deploy your application to the specified target',
27
27
  '--dry-run': 'Show what would be deployed without actually deploying',
28
28
  '--no-cleanup': 'File prep in the temporary file location will not be cleaned up after processing',
29
+ '--direct': 'Skip source control, and deploy the project as-is',
30
+ '--branch': 'Specify branch to deploy (overrides configuration for specified environment)',
29
31
  },
30
32
  runner: ({ $, Types }) => {
31
33
  $('--dry-run', Types.BOOLEAN());
32
34
  $('--no-cleanup', Types.BOOLEAN());
35
+ $('--direct', Types.BOOLEAN());
36
+ $('--branch', Types.STRING());
33
37
 
34
38
  return $(
35
39
  /[\w-]+/,
@@ -229,6 +233,7 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
229
233
  async cloneProject(deployConfig) {
230
234
  let {
231
235
  git,
236
+ directDeploy,
232
237
  tempLocation,
233
238
  rootPath,
234
239
  } = deployConfig;
@@ -242,7 +247,7 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
242
247
 
243
248
  let targetPath = Path.join(tempLocation, 'project');
244
249
 
245
- if (!repository) {
250
+ if (directDeploy || !repository) {
246
251
  let copyCommand;
247
252
 
248
253
  if (process.platform === 'win32') {
@@ -833,6 +838,8 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
833
838
  throw new Error(`Bad "uri" specified for "targets[${index}]": "${rawURI}". No "pathname" found.`);
834
839
  });
835
840
 
841
+ deployConfig.directDeploy = args.direct;
842
+ deployConfig.branchOverride = (Nife.isNotEmpty(args.branch)) ? args.branch : undefined;
836
843
  deployConfig.dryRun = args.dryRun;
837
844
  deployConfig.version = this.getRevisionNumber();
838
845
 
@@ -845,7 +852,7 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
845
852
  if (appOptions.configPath)
846
853
  deployConfig.relativeConfigPath = appOptions.configPath.substring(deployConfig.rootPath.length).replace(/^[/\\.]+/, '').replace(/[/\\]+$/, '');
847
854
 
848
- let git = deployConfig.git || {};
855
+ let { git } = deployConfig;
849
856
  if (git.useGitIgnore) {
850
857
  let gitIgnorePath = Path.resolve(deployConfig.rootPath, '.gitignore');
851
858
  try {
@@ -898,7 +905,7 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
898
905
  try {
899
906
  deployConfig = await this.loadDeployConfig(args);
900
907
  } catch (error) {
901
- console.error(error.message);
908
+ console.error(error);
902
909
  return 1;
903
910
  }
904
911
 
@@ -940,9 +947,21 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
940
947
  console.log(` -> ${target.uri}`);
941
948
  }
942
949
 
943
- if (Nife.isEmpty(branch)) {
950
+ if (!deployConfig.directDeploy && Nife.isEmpty(branch)) {
944
951
  console.log('');
945
952
  console.log(' !!!WARNING!!! "branch" is not set in your deploy configuration. The current file structure will be deployed "as-is". It is highly recommended that you set a "branch" in your deploy configuration.');
953
+ } else if (deployConfig.directDeploy) {
954
+ console.log('');
955
+ console.log(' !!!NOTICE!!! "--direct" argument was specified. Deploying project as-is, bypassing source-control.');
956
+ }
957
+
958
+ if (!deployConfig.directDeploy && !Nife.isEmpty(branch) && deployConfig.branchOverride) {
959
+ console.log('');
960
+ console.log(` !!!NOTICE!!! "--branch" argument was specified. Overriding config branch "${branch}" and using branch "${deployConfig.branchOverride}" instead.`);
961
+
962
+ branch = deployConfig.branchOverride;
963
+ if (git)
964
+ git.branch = deployConfig.branchOverride;
946
965
  }
947
966
 
948
967
  console.log('');
@@ -953,7 +972,7 @@ module.exports = defineCommand('deploy', ({ Parent }) => {
953
972
  this.mkdirSync(false, tempLocation);
954
973
  this.mkdirSync(false, Path.join(tempLocation, deployConfig.version));
955
974
 
956
- if (Nife.isNotEmpty(branch) && Nife.isEmpty(repository)) {
975
+ if (!deployConfig.directDeploy && (Nife.isNotEmpty(branch) && Nife.isEmpty(repository))) {
957
976
  repository = await this.getRepositoryURL(remoteName);
958
977
  if (git)
959
978
  git.repository = repository;