occam-open-cli 5.0.103 → 5.0.104

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.
@@ -3,9 +3,9 @@
3
3
  const publishOperation = require("../operation/publish"),
4
4
  zipReleaseOperation = require("../operation/zipRelease"),
5
5
  loadReleaseOperation = require("../operation/loadRelease"),
6
- updateVersionOperation = require("../operation/updateVersion"),
7
6
  getIdentityTokenOperation = require("../operation/getIdentityToken"),
8
- releaseNamePromptOperation = require("../operation/prompt/releaseName");
7
+ releaseNamePromptOperation = require("../operation/prompt/releaseName"),
8
+ updateMetaJSONFileVersionOperation = require("../operation/updateMetaJSONFileVersion");
9
9
 
10
10
  const { DOUBLE_DASH } = require("../constants"),
11
11
  { executeOperations } = require("../utilities/operation"),
@@ -19,7 +19,7 @@ function publishAction(argument, dryRun, logLevel) {
19
19
  loadReleaseOperation,
20
20
  zipReleaseOperation,
21
21
  publishOperation,
22
- updateVersionOperation
22
+ updateMetaJSONFileVersionOperation
23
23
  ],
24
24
  context = {
25
25
  dryRun,
package/bin/constants.js CHANGED
@@ -7,7 +7,6 @@ const END = "end",
7
7
  OPEN_CLI = "Open-CLI",
8
8
  DOUBLE_DOTS = "..",
9
9
  DOUBLE_DASH = "--",
10
- DOUBLE_SPACE = " ",
11
10
  EMPTY_STRING = "",
12
11
  RELEASE_JSON = "release.json",
13
12
  PACKAGE_JSON = "package.json";
@@ -20,7 +19,6 @@ module.exports = {
20
19
  OPEN_CLI,
21
20
  DOUBLE_DOTS,
22
21
  DOUBLE_DASH,
23
- DOUBLE_SPACE,
24
22
  EMPTY_STRING,
25
23
  RELEASE_JSON,
26
24
  PACKAGE_JSON
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ const { Version } = require("occam-file-system");
4
+
3
5
  const post = require("../post");
4
6
 
5
7
  const { PUBLISH_API_URI } = require("../uris");
@@ -15,7 +17,12 @@ function publishOperation(proceed, abort, context) {
15
17
  };
16
18
 
17
19
  post(uri, json, (json) => {
18
- const { success, version, messages } = json;
20
+ let { version } = json;
21
+
22
+ const { success, messages } = json,
23
+ string = version; ///
24
+
25
+ version = Version.fromString(string);
19
26
 
20
27
  Object.assign(context, {
21
28
  success,
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ const { fileNames, metaJSONUtilities } = require("occam-file-system");
4
+
5
+ const { updateMetaJSONFileVersion } = metaJSONUtilities;
6
+
7
+ const { loadFile, saveFile } = fileSystemUtilities,
8
+ { META_JSON_FILE_NAME } = fileNames;
9
+
10
+ function updateMetaJSONFileVersionOperation(proceed, abort, context) {
11
+ const { success } = context;
12
+
13
+ if (success) {
14
+ const { release, version } = context,
15
+ releaseName = release.getName(),
16
+ metaJSONFilePath = `${releaseName}/${META_JSON_FILE_NAME}`,
17
+ projectsDirectoryPath = process.cwd(), ///
18
+ metaJSONFile = loadFile(metaJSONFilePath, projectsDirectoryPath);
19
+
20
+ updateMetaJSONFileVersion(metaJSONFile, version);
21
+
22
+ saveFile(metaJSONFile, projectsDirectoryPath);
23
+ }
24
+
25
+ proceed();
26
+ }
27
+
28
+ module.exports = updateMetaJSONFileVersionOperation;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-open-cli",
3
3
  "author": "James Smith",
4
- "version": "5.0.103",
4
+ "version": "5.0.104",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-open-cli",
7
7
  "description": "Occam's command line package management tool.",
@@ -13,7 +13,7 @@
13
13
  "argumentative": "^2.0.21",
14
14
  "jszip": "^3.10.1",
15
15
  "necessary": "^11.1.4",
16
- "occam-file-system": "^5.0.74"
16
+ "occam-file-system": "^5.0.75"
17
17
  },
18
18
  "scripts": {},
19
19
  "bin": {
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- const { DOUBLE_SPACE } = require("../constants"),
4
- { fileNames, metaJSONUtilities, fileSystemUtilities } = require("occam-file-system");
5
-
6
- const { loadFile, saveFile } = fileSystemUtilities,
7
- { META_JSON_FILE_NAME } = fileNames,
8
- { repositoryFromNode, dependenciesFromNode, metaJSONNodeFromMetaJSONFile } = metaJSONUtilities;
9
-
10
- function updateVersionOperation(proceed, abort, context) {
11
- const { success, release } = context;
12
-
13
- if (success) {
14
- const releaseName = release.getName(),
15
- metaJSONFilePath = `${releaseName}/${META_JSON_FILE_NAME}`,
16
- projectsDirectoryPath = process.cwd(), ///
17
- metaJSONFile = loadFile(metaJSONFilePath, projectsDirectoryPath),
18
- metaJSONNode = metaJSONNodeFromMetaJSONFile(metaJSONFile),
19
- node = metaJSONNode, ///
20
- repository = repositoryFromNode(node);
21
-
22
- let dependencies = dependenciesFromNode(node);
23
-
24
- const dependenciesJSON = dependencies.toJSON();
25
-
26
- dependencies = dependenciesJSON; ///
27
-
28
- const { version } = context,
29
- metaJSON = {
30
- version,
31
- repository,
32
- dependencies
33
- },
34
- metaJSONString = JSON.stringify(metaJSON, null, DOUBLE_SPACE),
35
- content = metaJSONString, ///
36
- file = metaJSONFile; ///
37
-
38
- file.setContent(content);
39
-
40
- saveFile(file, projectsDirectoryPath);
41
- }
42
-
43
- proceed();
44
- }
45
-
46
- module.exports = updateVersionOperation;