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.
- package/lib/abbreviations.js +22 -0
- package/lib/action/help.js +15 -0
- package/lib/action/verify.js +59 -0
- package/lib/action/version.js +19 -0
- package/lib/commands.js +26 -0
- package/lib/configure.js +25 -0
- package/lib/constants.js +5 -1
- package/lib/context/partial/metavariable.js +1 -1
- package/lib/context/partial/statement.js +1 -1
- package/lib/context/partial/substitution/frame.js +1 -1
- package/lib/context/partial/substitution/reference.js +1 -1
- package/lib/context/partial/substitution/statement.js +1 -1
- package/lib/context/partial/substitution/term.js +1 -1
- package/lib/context/partial/term.js +1 -1
- package/lib/context/partial/variable.js +1 -1
- package/lib/defaults.js +36 -0
- package/lib/dom/lemma.js +1 -1
- package/lib/main.js +64 -0
- package/lib/messages.js +13 -0
- package/lib/options.js +34 -0
- package/lib/utilities/releaseContext.js +80 -10
- package/lib/utilities/string.js +8 -1
- package/package.json +3 -3
- package/{bin → src}/abbreviations.js +4 -2
- package/{bin → src}/action/help.js +1 -3
- package/{bin → src}/action/verify.js +5 -7
- package/src/action/version.js +13 -0
- package/src/commands.js +5 -0
- package/{bin → src}/configure.js +3 -5
- package/src/constants.js +1 -0
- package/src/defaults.js +11 -0
- package/{bin → src}/main.js +8 -10
- package/src/messages.js +3 -0
- package/src/options.js +7 -0
- package/src/utilities/releaseContext.js +100 -8
- package/src/utilities/string.js +6 -0
- package/bin/action/version.js +0 -15
- package/bin/commands.js +0 -11
- package/bin/constants.js +0 -9
- package/bin/defaults.js +0 -19
- package/bin/messages.js +0 -7
- package/bin/options.js +0 -15
- package/bin/utilities/releaseContext.js +0 -103
- package/bin/utilities/string.js +0 -13
package/bin/constants.js
DELETED
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
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
|
-
}
|
package/bin/utilities/string.js
DELETED