occam-verify-cli 1.0.367 → 1.0.369

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 (44) hide show
  1. package/lib/abbreviations.js +22 -0
  2. package/lib/action/help.js +15 -0
  3. package/lib/action/verify.js +59 -0
  4. package/lib/action/version.js +19 -0
  5. package/lib/commands.js +26 -0
  6. package/lib/configure.js +25 -0
  7. package/lib/constants.js +5 -1
  8. package/lib/context/partial/metavariable.js +1 -1
  9. package/lib/context/partial/statement.js +1 -1
  10. package/lib/context/partial/substitution/frame.js +1 -1
  11. package/lib/context/partial/substitution/reference.js +1 -1
  12. package/lib/context/partial/substitution/statement.js +1 -1
  13. package/lib/context/partial/substitution/term.js +1 -1
  14. package/lib/context/partial/term.js +1 -1
  15. package/lib/context/partial/variable.js +1 -1
  16. package/lib/defaults.js +36 -0
  17. package/lib/dom/lemma.js +1 -1
  18. package/lib/main.js +64 -0
  19. package/lib/messages.js +13 -0
  20. package/lib/options.js +34 -0
  21. package/lib/utilities/releaseContext.js +80 -10
  22. package/lib/utilities/string.js +8 -1
  23. package/package.json +3 -3
  24. package/{bin → src}/abbreviations.js +4 -2
  25. package/{bin → src}/action/help.js +1 -3
  26. package/{bin → src}/action/verify.js +5 -7
  27. package/src/action/version.js +13 -0
  28. package/src/commands.js +5 -0
  29. package/{bin → src}/configure.js +3 -5
  30. package/src/constants.js +1 -0
  31. package/src/defaults.js +11 -0
  32. package/{bin → src}/main.js +8 -10
  33. package/src/messages.js +3 -0
  34. package/src/options.js +7 -0
  35. package/src/utilities/releaseContext.js +100 -8
  36. package/src/utilities/string.js +6 -0
  37. package/bin/action/version.js +0 -15
  38. package/bin/commands.js +0 -11
  39. package/bin/constants.js +0 -9
  40. package/bin/defaults.js +0 -19
  41. package/bin/messages.js +0 -7
  42. package/bin/options.js +0 -15
  43. package/bin/utilities/releaseContext.js +0 -103
  44. package/bin/utilities/string.js +0 -13
package/bin/constants.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- const EMPTY_STRING = "",
4
- OCCAM_VERIFY_CLI = "Occam Verify-CLI";
5
-
6
- module.exports = {
7
- EMPTY_STRING,
8
- OCCAM_VERIFY_CLI
9
- };
package/bin/defaults.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- const { levels } = require("necessary");
4
-
5
- const { INFO_LEVEL } = levels;
6
-
7
- const DEFAULT_HELP = false,
8
- DEFAULT_TAIL = 10,
9
- DEFAULT_FOLLOW = false,
10
- DEFAULT_VERSION = false,
11
- DEFAULT_LOG_LEVEL = INFO_LEVEL;
12
-
13
- module.exports = {
14
- DEFAULT_HELP,
15
- DEFAULT_TAIL,
16
- DEFAULT_FOLLOW,
17
- DEFAULT_VERSION,
18
- DEFAULT_LOG_LEVEL
19
- };
package/bin/messages.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- const NO_COMMAND_GIVEN_MESSAGE = "No command has been given.";
4
-
5
- module.exports = {
6
- NO_COMMAND_GIVEN_MESSAGE
7
- };
package/bin/options.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- const HELP_OPTION = "help",
4
- TAIL_OPTION = "tail",
5
- FOLLOW_OPTION = "follow",
6
- VERSION_OPTION = "version",
7
- LOG_LEVEL_OPTION = "log-level";
8
-
9
- module.exports = {
10
- HELP_OPTION,
11
- TAIL_OPTION,
12
- FOLLOW_OPTION,
13
- VERSION_OPTION,
14
- LOG_LEVEL_OPTION
15
- };
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- const { ReleaseContext } = require("../../lib/index"), ///
4
- { Entries, metaJSONUtilities } = require("occam-entities"),
5
- { fileSystemUtilities : occamFileSystemUtilities } = require("occam-file-system"),
6
- { pathUtilities, fileSystemUtilities : necessaryFileSystemUtilities } = require("necessary");
7
-
8
- const { loadProject } = occamFileSystemUtilities,
9
- { concatenatePaths } = pathUtilities,
10
- { isMetaJSONFileValid } = metaJSONUtilities,
11
- { readFile, isEntryFile, checkEntryExists } = necessaryFileSystemUtilities;
12
-
13
- function releaseContextFromDependency(dependency, context, callback) {
14
- const projectsDirectoryPath = process.cwd(), ///
15
- dependencyName = dependency.getName(),
16
- entryPath = concatenatePaths(projectsDirectoryPath, dependencyName),
17
- entryExists = checkEntryExists(entryPath);
18
-
19
- if (!entryExists) {
20
- const error = null,
21
- releaseContext = null;
22
-
23
- callback(error, releaseContext);
24
-
25
- return;
26
- }
27
-
28
- let releaseContext = null;
29
-
30
- try {
31
- const entryFile = isEntryFile(entryPath);
32
-
33
- if (entryFile) {
34
- const filePath = entryPath, ///
35
- content = readFile(filePath),
36
- jsonString = content, ///
37
- json = JSON.parse(jsonString);
38
-
39
- releaseContext = releaseContextFromJSON(json, context);
40
- } else {
41
- const projectName = dependencyName, ///
42
- project = loadProject(projectName, projectsDirectoryPath);
43
-
44
- if (project !== null) {
45
- releaseContext = releaseContextFromProject(project, context);
46
- }
47
- }
48
- } catch (error) {
49
- callback(error, releaseContext);
50
-
51
- return;
52
- }
53
-
54
- const error = null;
55
-
56
- callback(error, releaseContext);
57
- }
58
-
59
- module.exports = {
60
- releaseContextFromDependency
61
- };
62
-
63
- function releaseContextFromJSON(json, context) {
64
- const { log } = context,
65
- { name } = json;
66
-
67
- ({context} = json); ///
68
-
69
- let { entries } = json;
70
-
71
- json = entries; ///
72
-
73
- entries = Entries.fromJSON(json);
74
-
75
- const contextJSON = context; ///
76
-
77
- json = contextJSON; ///
78
-
79
- const releaseContext = ReleaseContext.fromLogNameJSONAndEntries(log, name, json, entries);
80
-
81
- return releaseContext;
82
- }
83
-
84
- function releaseContextFromProject(project, context) {
85
- let releaseContext = null;
86
-
87
- const metaJSONFile = project.getMetaJSONFile();
88
-
89
- if (metaJSONFile !== null) {
90
- const metaJSONFileValid = isMetaJSONFileValid(metaJSONFile);
91
-
92
- if (metaJSONFileValid) {
93
- const { log } = context,
94
- name = project.getName(),
95
- json = null,
96
- entries = project.getEntries();
97
-
98
- releaseContext = ReleaseContext.fromLogNameJSONAndEntries(log, name, json, entries);
99
- }
100
- }
101
-
102
- return releaseContext;
103
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- const { EMPTY_STRING } = require("../constants");
4
-
5
- function trimTrailingSlash(string) {
6
- string = string.replace(/\/$/, EMPTY_STRING); ///
7
-
8
- return string;
9
- }
10
-
11
- module.exports = {
12
- trimTrailingSlash
13
- };