highmark-cli 0.0.1
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/.swcrc +11 -0
- package/README.md +46 -0
- package/bin/abbreviations.js +13 -0
- package/bin/action/help.js +26 -0
- package/bin/action/version.js +13 -0
- package/bin/actions.js +36 -0
- package/bin/commands.js +9 -0
- package/bin/constants.js +7 -0
- package/bin/main.js +9 -0
- package/bin/options.js +9 -0
- package/bin/utilities/packageJSON.js +26 -0
- package/highmark.js +20 -0
- package/index.html +46 -0
- package/lib/browser.js +3 -0
- package/lib/main.js +3 -0
- package/license.txt +48 -0
- package/package.json +44 -0
- package/src/browser.js +2 -0
- package/src/main.js +2 -0
package/.swcrc
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Highmark Open-CLI
|
|
2
|
+
|
|
3
|
+
Extensible, styleable Markdown.
|
|
4
|
+
|
|
5
|
+
### Contents
|
|
6
|
+
|
|
7
|
+
- [Introduction](#introduction)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Usage](#usage)
|
|
10
|
+
- [Contact](#contact)
|
|
11
|
+
|
|
12
|
+
## Introduction
|
|
13
|
+
|
|
14
|
+
To come...
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
If you would like to contribute or would simply like to have a look at the code, you can clone the repository with [Git](https://git-scm.com/)...
|
|
19
|
+
|
|
20
|
+
git clone https://github.com/djalbat/highmark-cli.git
|
|
21
|
+
|
|
22
|
+
...and then install the dependencies with [npm](https://www.npmjs.com/) from within the project's root directory:
|
|
23
|
+
|
|
24
|
+
npm install
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
These are the commands and options:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
highmark [<command>] [<argument>]
|
|
32
|
+
|
|
33
|
+
Commands:
|
|
34
|
+
|
|
35
|
+
[help] Show this help
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
|
|
39
|
+
--version|-v Show the version
|
|
40
|
+
|
|
41
|
+
--help|-h Show this help
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Contact
|
|
45
|
+
|
|
46
|
+
* james.smith@openmathematics.org
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function help() {
|
|
4
|
+
console.log(`Usage:
|
|
5
|
+
|
|
6
|
+
highmark [<command>] [<argument>]
|
|
7
|
+
|
|
8
|
+
Commands:
|
|
9
|
+
|
|
10
|
+
[help] Show this help
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
|
|
14
|
+
--version|-v Show the version
|
|
15
|
+
|
|
16
|
+
--help|-h Show this help
|
|
17
|
+
|
|
18
|
+
Further information:
|
|
19
|
+
|
|
20
|
+
Please see the readme file on GitHub:
|
|
21
|
+
|
|
22
|
+
https://github.com/djalbat/highmark-cli
|
|
23
|
+
`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = help;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { OPEN_CLI } = require("../constants"),
|
|
4
|
+
{ getPackageVersion } = require("../utilities/packageJSON");
|
|
5
|
+
|
|
6
|
+
function version() {
|
|
7
|
+
const packageVersion = getPackageVersion(),
|
|
8
|
+
version = packageVersion; ///
|
|
9
|
+
|
|
10
|
+
console.log(`${OPEN_CLI} version ${version}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = version;
|
package/bin/actions.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const help = require("./action/help"),
|
|
4
|
+
version = require("./action/version");
|
|
5
|
+
|
|
6
|
+
const { HELP_OPTION, VERSION_OPTION } = require("./options"),
|
|
7
|
+
{ HELP_COMMAND,
|
|
8
|
+
VERSION_COMMAND } = require("./commands");
|
|
9
|
+
|
|
10
|
+
function actions(command, argument, options) {
|
|
11
|
+
const commandMissing = (command === null),
|
|
12
|
+
helpOptionPresent = options.hasOwnProperty(HELP_OPTION),
|
|
13
|
+
versionOptionPresent = options.hasOwnProperty(VERSION_OPTION);
|
|
14
|
+
|
|
15
|
+
if (false) {
|
|
16
|
+
///
|
|
17
|
+
} else if (versionOptionPresent) {
|
|
18
|
+
command = VERSION_COMMAND;
|
|
19
|
+
} else if (commandMissing || helpOptionPresent) {
|
|
20
|
+
command = HELP_COMMAND;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
switch (command) {
|
|
24
|
+
case HELP_COMMAND : help(); break;
|
|
25
|
+
case VERSION_COMMAND : version(); break;
|
|
26
|
+
|
|
27
|
+
default :
|
|
28
|
+
argument = command; ///
|
|
29
|
+
|
|
30
|
+
install(argument);
|
|
31
|
+
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = actions;
|
package/bin/commands.js
ADDED
package/bin/constants.js
ADDED
package/bin/main.js
ADDED
package/bin/options.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { arrayUtilities, fileSystemUtilities } = require("necessary");
|
|
4
|
+
|
|
5
|
+
const { PACKAGE_JSON } = require("../constants");
|
|
6
|
+
|
|
7
|
+
const { second } = arrayUtilities,
|
|
8
|
+
{ readFile } = fileSystemUtilities;
|
|
9
|
+
|
|
10
|
+
const utilitiesDirectoryName = __dirname, ///
|
|
11
|
+
matches = utilitiesDirectoryName.match(/^(.+)\/bin\/utilities$/),
|
|
12
|
+
secondMatch = second(matches),
|
|
13
|
+
applicationDirectoryName = secondMatch, ///
|
|
14
|
+
packageJSONFilePath = `${applicationDirectoryName}/${PACKAGE_JSON}`,
|
|
15
|
+
packageJSONFile = readFile(packageJSONFilePath),
|
|
16
|
+
packageJSON = JSON.parse(packageJSONFile),
|
|
17
|
+
{ version } = packageJSON,
|
|
18
|
+
packageVersion = version; ///
|
|
19
|
+
|
|
20
|
+
function getPackageVersion() {
|
|
21
|
+
return packageVersion;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
getPackageVersion
|
|
26
|
+
};
|
package/highmark.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const necessary = require("necessary");
|
|
4
|
+
|
|
5
|
+
const { parseArgv } = require("argumentative");
|
|
6
|
+
|
|
7
|
+
const main = require("./bin/main"),
|
|
8
|
+
abbreviations = require("./bin/abbreviations");
|
|
9
|
+
|
|
10
|
+
const { argv } = process,
|
|
11
|
+
{ arrayUtilities } = necessary,
|
|
12
|
+
{ first, second } = arrayUtilities;
|
|
13
|
+
|
|
14
|
+
const { commands, options } = parseArgv(argv, abbreviations),
|
|
15
|
+
firstCommand = first(commands),
|
|
16
|
+
secondCommand = second(commands),
|
|
17
|
+
command = firstCommand || null, ///
|
|
18
|
+
argument = secondCommand || null; ///
|
|
19
|
+
|
|
20
|
+
main(command, argument, options);
|
package/index.html
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Highmark CLI</title>
|
|
5
|
+
<style>
|
|
6
|
+
|
|
7
|
+
*,
|
|
8
|
+
*::after,
|
|
9
|
+
*::before {
|
|
10
|
+
border: 0;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html {
|
|
18
|
+
font-size: 10px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
|
|
25
|
+
<script src="example.js"> </script>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
|
|
29
|
+
var xmlHttpRequest = new XMLHttpRequest();
|
|
30
|
+
|
|
31
|
+
xmlHttpRequest.onreadystatechange = function() {
|
|
32
|
+
if (xmlHttpRequest.readyState == 4) {
|
|
33
|
+
if (xmlHttpRequest.status == 200) {
|
|
34
|
+
location.reload();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
xmlHttpRequest.open("GET", "/live-reload");
|
|
40
|
+
|
|
41
|
+
xmlHttpRequest.send();
|
|
42
|
+
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
package/lib/browser.js
ADDED
package/lib/main.js
ADDED
package/license.txt
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
MIT And Anti-996 Licenses
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 James Smith
|
|
4
|
+
|
|
5
|
+
These licenses shall be included in all copies or substantial portions of
|
|
6
|
+
this software and associated documentation files (the "Software").
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this Software, to deal in the Software without restriction, including
|
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
12
|
+
persons to whom the Software is furnished to do so, subject to the following
|
|
13
|
+
conditions:
|
|
14
|
+
|
|
15
|
+
1. The individual or the legal entity must conspicuously display,
|
|
16
|
+
without modification, this License and the notice on each redistributed
|
|
17
|
+
or derivative copy of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
2. The individual or the legal entity must strictly comply with all
|
|
20
|
+
applicable laws, regulations, rules and standards of the jurisdiction
|
|
21
|
+
relating to labor and employment where the individual is physically
|
|
22
|
+
located or where the individual was born or naturalized; or where the
|
|
23
|
+
legal entity is registered or is operating (whichever is stricter). In
|
|
24
|
+
case that the jurisdiction has no such laws, regulations, rules and
|
|
25
|
+
standards or its laws, regulations, rules and standards are
|
|
26
|
+
unenforceable, the individual or the legal entity are required to
|
|
27
|
+
comply with Core International Labor Standards.
|
|
28
|
+
|
|
29
|
+
3. The individual or the legal entity shall not induce, suggest or force
|
|
30
|
+
its employee(s), whether full-time or part-time, or its independent
|
|
31
|
+
contractor(s), in any methods, to agree in oral or written form, to
|
|
32
|
+
directly or indirectly restrict, weaken or relinquish his or her
|
|
33
|
+
rights or remedies under such laws, regulations, rules and standards
|
|
34
|
+
relating to labor and employment as mentioned above, no matter whether
|
|
35
|
+
such written or oral agreements are enforceable under the laws of the
|
|
36
|
+
said jurisdiction, nor shall such individual or the legal entity
|
|
37
|
+
limit, in any methods, the rights of its employee(s) or independent
|
|
38
|
+
contractor(s) from reporting or complaining to the copyright holder or
|
|
39
|
+
relevant authorities monitoring the compliance of the license about
|
|
40
|
+
its violation(s) of the said license.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "highmark-cli",
|
|
3
|
+
"author": "James Smith",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "MIT, Anti-996",
|
|
6
|
+
"homepage": "https://github.com/djalbat/highmark-cli",
|
|
7
|
+
"description": "Extensible, styleable Markdown.",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/djalbat/highmark-cli"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"argumentative": "^2.0.15",
|
|
14
|
+
"mkdirp": "^0.5.1",
|
|
15
|
+
"necessary": "^11.1.4",
|
|
16
|
+
"occam-dom": "^3.0.212",
|
|
17
|
+
"occam-lexers": "^16.0.61",
|
|
18
|
+
"occam-parsers": "^16.0.110"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@swc/core": "^1.2.50",
|
|
22
|
+
"esbuild": "^0.9.2",
|
|
23
|
+
"express": "^4.17.1",
|
|
24
|
+
"lively-cli": "^2.0.34",
|
|
25
|
+
"watchful-cli": "^1.7.19"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"clean": "rm -rf ./lib",
|
|
29
|
+
"watchful": "watchful -m --transpiler=swc --source-directory=./src --lib-directory=./lib --pause=100",
|
|
30
|
+
"batch": "npm run watchful batch --",
|
|
31
|
+
"batch-debug": "npm run watchful batch -- --debug",
|
|
32
|
+
"incremental": "npm run watchful incremental --",
|
|
33
|
+
"incremental-debug": "npm run watchful incremental -- --debug",
|
|
34
|
+
"build": "npm run clean && npm run batch",
|
|
35
|
+
"build-debug": "npm run clean && npm run batch-debug",
|
|
36
|
+
"watch": "npm run clean && npm run batch && npm run incremental",
|
|
37
|
+
"watch-debug": "npm run clean && npm run batch-debug && npm run incremental-debug"
|
|
38
|
+
},
|
|
39
|
+
"browser": "./lib/browser",
|
|
40
|
+
"main": "./lib/main",
|
|
41
|
+
"bin": {
|
|
42
|
+
"highmark": "./highmark.js"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/browser.js
ADDED
package/src/main.js
ADDED