@eik/cli 3.0.0-next.2 → 3.1.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/CHANGELOG.md +152 -9
- package/classes/alias.js +49 -22
- package/classes/index.js +47 -23
- package/classes/integrity.js +27 -16
- package/classes/login.js +21 -7
- package/classes/meta.js +20 -12
- package/classes/ping.js +20 -9
- package/classes/publish/map.js +33 -10
- package/classes/publish/package/index.js +54 -17
- package/classes/publish/package/tasks/check-bundle-sizes.js +7 -11
- package/classes/publish/package/tasks/check-if-already-published.js +8 -11
- package/classes/publish/package/tasks/cleanup.js +7 -9
- package/classes/publish/package/tasks/create-temp-directory.js +5 -9
- package/classes/publish/package/tasks/create-zip-file.js +6 -11
- package/classes/publish/package/tasks/dry-run.js +4 -8
- package/classes/publish/package/tasks/save-metafile.js +5 -7
- package/classes/publish/package/tasks/task.js +3 -5
- package/classes/publish/package/tasks/upload-files.js +16 -17
- package/classes/publish/package/tasks/validate-input.js +4 -8
- package/classes/version.js +38 -21
- package/commands/alias.js +51 -71
- package/commands/index.js +27 -0
- package/commands/init.js +69 -52
- package/commands/integrity.js +15 -32
- package/commands/login.js +23 -35
- package/commands/map-alias.js +95 -0
- package/commands/map.js +90 -0
- package/commands/meta.js +12 -29
- package/commands/npm-alias.js +90 -0
- package/commands/package-alias.js +102 -0
- package/commands/ping.js +11 -21
- package/commands/publish.js +82 -138
- package/commands/version.js +16 -33
- package/formatters/alias.js +8 -14
- package/formatters/artifact.js +8 -8
- package/formatters/file.js +3 -10
- package/formatters/index.js +5 -5
- package/formatters/version.js +5 -12
- package/index.js +53 -12
- package/package.json +49 -52
- package/readme.md +16 -4
- package/types/classes/alias.d.ts +60 -0
- package/types/classes/index.d.ts +37 -0
- package/types/classes/integrity.d.ts +35 -0
- package/types/classes/login.d.ts +25 -0
- package/types/classes/meta.d.ts +28 -0
- package/types/classes/ping.d.ts +23 -0
- package/types/classes/publish/map.d.ts +51 -0
- package/types/classes/publish/package/index.d.ts +94 -0
- package/types/classes/publish/package/tasks/check-bundle-sizes.d.ts +4 -0
- package/types/classes/publish/package/tasks/check-if-already-published.d.ts +4 -0
- package/types/classes/publish/package/tasks/cleanup.d.ts +4 -0
- package/types/classes/publish/package/tasks/create-temp-directory.d.ts +4 -0
- package/types/classes/publish/package/tasks/create-zip-file.d.ts +4 -0
- package/types/classes/publish/package/tasks/dry-run.d.ts +7 -0
- package/types/classes/publish/package/tasks/save-metafile.d.ts +4 -0
- package/types/classes/publish/package/tasks/task.d.ts +8 -0
- package/types/classes/publish/package/tasks/upload-files.d.ts +4 -0
- package/types/classes/publish/package/tasks/validate-input.d.ts +4 -0
- package/types/classes/version.d.ts +43 -0
- package/types/utils/hash/compare.d.ts +2 -0
- package/types/utils/hash/file.d.ts +2 -0
- package/types/utils/hash/files.d.ts +2 -0
- package/types/utils/hash/index.d.ts +9 -0
- package/types/utils/http/index.d.ts +12 -0
- package/types/utils/http/integrity.d.ts +2 -0
- package/types/utils/http/latest-version.d.ts +2 -0
- package/types/utils/http/request.d.ts +33 -0
- package/types/utils/http/versions.d.ts +5 -0
- package/types/utils/index.d.ts +6 -0
- package/types/utils/json/index.d.ts +9 -0
- package/types/utils/json/read.d.ts +5 -0
- package/types/utils/json/write-eik.d.ts +5 -0
- package/types/utils/json/write.d.ts +5 -0
- package/types/utils/logger.d.ts +33 -0
- package/types/utils/type-title.d.ts +2 -0
- package/utils/hash/compare.js +1 -3
- package/utils/hash/file.js +3 -5
- package/utils/hash/files.js +4 -6
- package/utils/hash/index.js +4 -4
- package/utils/http/index.js +6 -5
- package/utils/http/integrity.js +2 -5
- package/utils/http/latest-version.js +2 -5
- package/utils/http/request.js +25 -19
- package/utils/http/versions.js +2 -5
- package/utils/index.js +5 -4
- package/utils/json/index.js +4 -4
- package/utils/json/read.js +5 -7
- package/utils/json/write-eik.js +4 -6
- package/utils/json/write.js +4 -6
- package/utils/logger.js +2 -5
- package/utils/type-title.js +1 -1
- package/utils/get-cwd.js +0 -14
- package/utils/type-slug.js +0 -4
package/commands/version.js
CHANGED
@@ -1,23 +1,15 @@
|
|
1
|
-
|
1
|
+
import { execSync } from 'child_process';
|
2
|
+
import { join } from 'path';
|
3
|
+
import ora from 'ora';
|
4
|
+
import VersionPackage from '../classes/version.js';
|
5
|
+
import { logger, getDefaults } from '../utils/index.js';
|
6
|
+
import json from '../utils/json/index.js';
|
2
7
|
|
3
|
-
const
|
4
|
-
const { join } = require('path');
|
5
|
-
const ora = require('ora');
|
6
|
-
const { configStore, getDefaults } = require('@eik/common-config-loader');
|
7
|
-
const VersionPackage = require('../classes/version');
|
8
|
-
const { logger, getCWD } = require('../utils');
|
9
|
-
const json = require('../utils/json');
|
8
|
+
export const command = 'version [level]';
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
exports.aliases = ['v'];
|
14
|
-
|
15
|
-
exports.describe = `Compares local files with files on server and increments "version" field in eik.json if necessary.`;
|
16
|
-
|
17
|
-
exports.builder = (yargs) => {
|
18
|
-
const cwd = getCWD();
|
19
|
-
const defaults = getDefaults(cwd);
|
10
|
+
export const describe = `Compares local files with files on server and increments "version" field in eik.json if necessary.`;
|
20
11
|
|
12
|
+
export const builder = (yargs) => {
|
21
13
|
yargs.positional('level', {
|
22
14
|
describe: 'Semver level to increment version by',
|
23
15
|
default: 'patch',
|
@@ -26,12 +18,6 @@ exports.builder = (yargs) => {
|
|
26
18
|
});
|
27
19
|
|
28
20
|
yargs.options({
|
29
|
-
cwd: {
|
30
|
-
alias: 'c',
|
31
|
-
describe: 'Alter the current working directory.',
|
32
|
-
default: defaults.cwd,
|
33
|
-
type: 'string',
|
34
|
-
},
|
35
21
|
dryRun: {
|
36
22
|
alias: 'd',
|
37
23
|
describe:
|
@@ -39,23 +25,19 @@ exports.builder = (yargs) => {
|
|
39
25
|
default: false,
|
40
26
|
type: 'boolean',
|
41
27
|
},
|
42
|
-
debug: {
|
43
|
-
describe: 'Logs additional messages',
|
44
|
-
default: false,
|
45
|
-
type: 'boolean',
|
46
|
-
},
|
47
28
|
});
|
48
29
|
|
49
30
|
yargs.example(`eik version`);
|
50
31
|
yargs.example(`eik version minor`);
|
51
|
-
yargs.example(`eik v`);
|
52
32
|
};
|
53
33
|
|
54
|
-
|
34
|
+
export const handler = async (argv) => {
|
55
35
|
const spinner = ora({ stream: process.stdout }).start('working...');
|
56
|
-
const { level, debug, dryRun, cwd } = argv;
|
57
|
-
|
58
|
-
const { name, version, server, map, out, files } =
|
36
|
+
const { level, debug, dryRun, cwd, config } = argv;
|
37
|
+
// @ts-expect-error
|
38
|
+
const { name, version, server, map, out, files } = getDefaults(
|
39
|
+
config || cwd,
|
40
|
+
);
|
59
41
|
|
60
42
|
try {
|
61
43
|
const log = logger(spinner, debug);
|
@@ -80,6 +62,7 @@ exports.handler = async (argv) => {
|
|
80
62
|
);
|
81
63
|
} else {
|
82
64
|
log.debug(`Writing new version ${newVersion} to eik.json`);
|
65
|
+
// @ts-expect-error
|
83
66
|
await json.writeEik({ version: newVersion }, { cwd });
|
84
67
|
|
85
68
|
log.debug(`Committing eik.json to local git repository`);
|
package/formatters/alias.js
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
const { join } = require('path');
|
6
|
-
const chalk = require('chalk');
|
7
|
-
const File = require('./file');
|
1
|
+
import { join } from 'path';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
import File from './file.js';
|
8
4
|
|
9
5
|
function colorType(type) {
|
10
6
|
if (type === 'npm') {
|
@@ -15,6 +11,10 @@ function colorType(type) {
|
|
15
11
|
return chalk.white.bgYellow.bold(' PACKAGE ');
|
16
12
|
}
|
17
13
|
|
14
|
+
if (type === 'img') {
|
15
|
+
return chalk.white.bgYellow.bold(' IMAGE ');
|
16
|
+
}
|
17
|
+
|
18
18
|
return chalk.white.bgBlue.bold(' IMPORT MAP ');
|
19
19
|
}
|
20
20
|
|
@@ -55,12 +55,6 @@ class Alias {
|
|
55
55
|
|
56
56
|
if (this.update) {
|
57
57
|
write(`${chalk.bgMagenta.white(' UPDATED \n\n')}`);
|
58
|
-
|
59
|
-
write(
|
60
|
-
`${chalk.yellow.bold(
|
61
|
-
'! It may take up to 40 minutes before this alias updates due to caching.',
|
62
|
-
)}\n\n`,
|
63
|
-
);
|
64
58
|
} else {
|
65
59
|
write(`${chalk.bgGreen.white(' NEW ')}\n\n`);
|
66
60
|
}
|
@@ -85,4 +79,4 @@ class Alias {
|
|
85
79
|
}
|
86
80
|
}
|
87
81
|
|
88
|
-
|
82
|
+
export default Alias;
|
package/formatters/artifact.js
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
const { join } = require('path');
|
6
|
-
const chalk = require('chalk');
|
7
|
-
const Version = require('./version');
|
1
|
+
import { join } from 'path';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
import Version from './version.js';
|
8
4
|
|
9
5
|
const _name = Symbol('name');
|
10
6
|
const _type = Symbol('type');
|
@@ -20,6 +16,10 @@ function colorType(type) {
|
|
20
16
|
return chalk.white.bgYellow.bold(' PACKAGE ');
|
21
17
|
}
|
22
18
|
|
19
|
+
if (type === 'img') {
|
20
|
+
return chalk.white.bgYellow.bold(' IMAGE ');
|
21
|
+
}
|
22
|
+
|
23
23
|
return chalk.white.bgBlue.bold(' IMPORT MAP ');
|
24
24
|
}
|
25
25
|
|
@@ -86,4 +86,4 @@ class Artifact {
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
|
89
|
-
|
89
|
+
export default Artifact;
|
package/formatters/file.js
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
/* eslint-disable one-var */
|
4
|
-
/* eslint-disable no-underscore-dangle */
|
5
|
-
|
6
|
-
'use strict';
|
7
|
-
|
8
|
-
const { join } = require('path');
|
9
|
-
const chalk = require('chalk');
|
1
|
+
import { join } from 'path';
|
2
|
+
import chalk from 'chalk';
|
10
3
|
|
11
4
|
function readableBytes(bytes) {
|
12
5
|
const i = Math.floor(Math.log(bytes) / Math.log(1024)),
|
@@ -39,4 +32,4 @@ class File {
|
|
39
32
|
}
|
40
33
|
}
|
41
34
|
|
42
|
-
|
35
|
+
export default File;
|
package/formatters/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import Artifact from './artifact.js';
|
2
|
+
import Alias from './alias.js';
|
3
|
+
import File from './file.js';
|
4
|
+
import Version from './version.js';
|
5
5
|
|
6
|
-
|
6
|
+
export { Artifact, Alias, Version, File };
|
package/formatters/version.js
CHANGED
@@ -1,14 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
'use strict';
|
7
|
-
|
8
|
-
const { join } = require('path');
|
9
|
-
const chalk = require('chalk');
|
10
|
-
const formatDistance = require('date-fns/formatDistance');
|
11
|
-
const File = require('./file');
|
1
|
+
import { join } from 'path';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
import { formatDistance } from 'date-fns/formatDistance';
|
4
|
+
import File from './file.js';
|
12
5
|
|
13
6
|
class Version {
|
14
7
|
constructor({
|
@@ -65,4 +58,4 @@ class Version {
|
|
65
58
|
}
|
66
59
|
}
|
67
60
|
|
68
|
-
|
61
|
+
export default Version;
|
package/index.js
CHANGED
@@ -1,14 +1,31 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
+
import chalk from 'chalk';
|
3
|
+
import yargs from 'yargs';
|
4
|
+
import { hideBin } from 'yargs/helpers';
|
5
|
+
import boxen from 'boxen';
|
6
|
+
import { join } from 'path';
|
7
|
+
import { readFileSync } from 'fs';
|
8
|
+
import { fileURLToPath } from 'url';
|
9
|
+
import { dirname } from 'path';
|
10
|
+
import { commands } from './commands/index.js';
|
2
11
|
|
3
|
-
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
13
|
+
const __dirname = dirname(__filename);
|
4
14
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
15
|
+
const { version } = JSON.parse(
|
16
|
+
readFileSync(join(__dirname, './package.json'), { encoding: 'utf-8' }),
|
17
|
+
);
|
18
|
+
|
19
|
+
// short circuit and provide a -v and --version flag
|
20
|
+
if (
|
21
|
+
process.argv.includes('-v') ||
|
22
|
+
// last position only to avoid conflict with publish command
|
23
|
+
process.argv[process.argv.length - 1].includes('--version')
|
24
|
+
) {
|
25
|
+
console.log(version);
|
26
|
+
process.exit(0);
|
27
|
+
}
|
10
28
|
|
11
|
-
const { version } = JSON.parse(readFileSync(join(__dirname, './package.json')));
|
12
29
|
const greeting = chalk.white.bold(`Eik CLI (v${version})`);
|
13
30
|
|
14
31
|
const boxenOptions = {
|
@@ -18,26 +35,50 @@ const boxenOptions = {
|
|
18
35
|
borderColor: 'green',
|
19
36
|
backgroundColor: '#555555',
|
20
37
|
};
|
38
|
+
// @ts-expect-error
|
21
39
|
const msgBox = boxen(greeting, boxenOptions);
|
22
40
|
|
23
|
-
// eslint-disable-next-line no-console
|
24
41
|
console.log(msgBox);
|
25
42
|
|
26
|
-
|
27
|
-
|
43
|
+
yargs(hideBin(process.argv))
|
44
|
+
.options({
|
45
|
+
config: {
|
46
|
+
alias: 'c',
|
47
|
+
describe:
|
48
|
+
'Provide an exact path to an eik.json or package.json file to use as config. Default is eik.json in the current working directory.',
|
49
|
+
},
|
50
|
+
cwd: {
|
51
|
+
describe: 'Alter the current working directory.',
|
52
|
+
default: process.cwd(),
|
53
|
+
},
|
54
|
+
debug: {
|
55
|
+
describe: 'Logs additional messages',
|
56
|
+
default: false,
|
57
|
+
type: 'boolean',
|
58
|
+
},
|
59
|
+
})
|
60
|
+
// @ts-expect-error
|
28
61
|
.example('eik init')
|
62
|
+
// @ts-expect-error
|
29
63
|
.example('eik login --server https://assets.myserver.com --key ######')
|
64
|
+
// @ts-expect-error
|
30
65
|
.example('eik publish')
|
66
|
+
// @ts-expect-error
|
31
67
|
.example('eik meta my-app --server https://assets.myserver.com')
|
32
68
|
.example(
|
69
|
+
// @ts-expect-error
|
33
70
|
'eik npm-alias lit-html 1.0.0 1 --server https://assets.myserver.com --token ######',
|
34
71
|
)
|
35
72
|
.example(
|
73
|
+
// @ts-expect-error
|
36
74
|
'eik map my-map 1.0.0 ./import-map.json --server https://assets.myserver.com --token ######',
|
37
75
|
)
|
76
|
+
// @ts-expect-error
|
38
77
|
.example('eik map-alias my-map 1.0.0 1')
|
39
|
-
|
78
|
+
// @ts-expect-error
|
79
|
+
.command(commands)
|
40
80
|
.demandCommand()
|
41
81
|
.wrap(150)
|
42
82
|
.version(false)
|
43
|
-
.help()
|
83
|
+
.help()
|
84
|
+
.parse();
|
package/package.json
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eik/cli",
|
3
|
-
"version": "3.
|
4
|
-
"description": "
|
3
|
+
"version": "3.1.0",
|
4
|
+
"description": "CLI tool for publishing assets to an Eik server",
|
5
5
|
"main": "./classes/index.js",
|
6
|
+
"types": "./types/classes/index.d.ts",
|
7
|
+
"type": "module",
|
6
8
|
"bin": {
|
7
9
|
"eik": "index.js"
|
8
10
|
},
|
@@ -14,69 +16,64 @@
|
|
14
16
|
"commands",
|
15
17
|
"classes",
|
16
18
|
"utils",
|
17
|
-
"formatters"
|
19
|
+
"formatters",
|
20
|
+
"types"
|
18
21
|
],
|
19
22
|
"scripts": {
|
20
|
-
"
|
21
|
-
"test
|
22
|
-
"test:
|
23
|
-
"test:
|
24
|
-
"test:
|
25
|
-
"
|
23
|
+
"clean": "rimraf .tap node_modules types",
|
24
|
+
"test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/**/*.test.mjs",
|
25
|
+
"test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/integration/**/*.test.mjs",
|
26
|
+
"test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/*.test.mjs",
|
27
|
+
"test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 0 --disable-coverage test/tasks/*.test.mjs",
|
28
|
+
"test:ci:integration": "npm run test:integration -- --jobs=1",
|
29
|
+
"test:ci:unit": "npm run test:unit -- --jobs=1",
|
30
|
+
"test:ci:tasks": "npm run test:tasks -- --jobs=1",
|
31
|
+
"test:ci": "run-s test:ci:*",
|
32
|
+
"lint": "eslint .",
|
26
33
|
"lint:fix": "eslint --fix .",
|
27
34
|
"format:check": "prettier -c .",
|
28
35
|
"format:fix": "prettier -w .",
|
29
|
-
"fix": "
|
36
|
+
"fix": "run-s lint:fix format:fix",
|
37
|
+
"types": "run-s types:module types:test",
|
38
|
+
"types:module": "tsc",
|
39
|
+
"types:test": "tsc --project tsconfig.test.json"
|
30
40
|
},
|
31
41
|
"keywords": [],
|
32
42
|
"author": "",
|
33
43
|
"license": "MIT",
|
34
44
|
"dependencies": {
|
35
|
-
"@eik/common
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"@eik/common-validators": "^4.0.0-next.8",
|
39
|
-
"abslog": "2.4.0",
|
40
|
-
"boxen": "5.1.2",
|
45
|
+
"@eik/common": "4.1.0",
|
46
|
+
"abslog": "2.4.4",
|
47
|
+
"boxen": "8.0.0",
|
41
48
|
"bytes": "3.1.2",
|
42
|
-
"chalk": "
|
43
|
-
"
|
44
|
-
"date-fns": "2.28.0",
|
49
|
+
"chalk": "5.3.0",
|
50
|
+
"date-fns": "3.6.0",
|
45
51
|
"form-data": "4.0.0",
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"ssri": "8.0.1",
|
56
|
-
"tar": "6.1.11",
|
57
|
-
"temp-dir": "2.0.0",
|
58
|
-
"yargs": "17.3.1",
|
59
|
-
"yargs-parser": "21.0.0"
|
52
|
+
"gzip-size": "7.0.0",
|
53
|
+
"make-dir": "5.0.0",
|
54
|
+
"ora": "8.0.1",
|
55
|
+
"rimraf": "6.0.1",
|
56
|
+
"semver": "7.6.3",
|
57
|
+
"ssri": "10.0.6",
|
58
|
+
"tar": "7.4.3",
|
59
|
+
"yargs": "17.7.2",
|
60
|
+
"yargs-parser": "21.1.1"
|
60
61
|
},
|
61
62
|
"devDependencies": {
|
62
|
-
"@eik/
|
63
|
-
"@eik/
|
64
|
-
"@
|
65
|
-
"@
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"eslint
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"react-dom": "17.0.2",
|
78
|
-
"semantic-release": "19.0.2",
|
79
|
-
"semantic-release-slack-bot": "3.5.2",
|
80
|
-
"tap": "15.1.6"
|
63
|
+
"@eik/eslint-config": "1.0.2",
|
64
|
+
"@eik/semantic-release-config": "1.0.0",
|
65
|
+
"@eik/service": "2.3.0",
|
66
|
+
"@eik/sink-memory": "1.1.1",
|
67
|
+
"@eik/typescript-config": "1.0.0",
|
68
|
+
"cross-env": "7.0.3",
|
69
|
+
"eslint": "9.8.0",
|
70
|
+
"fastify": "4.28.1",
|
71
|
+
"fs-extra": "11.2.0",
|
72
|
+
"npm-run-all": "4.1.5",
|
73
|
+
"prettier": "3.3.3",
|
74
|
+
"semantic-release": "24.0.0",
|
75
|
+
"semantic-release-slack-bot": "4.0.2",
|
76
|
+
"tap": "21.0.0",
|
77
|
+
"typescript": "5.5.4"
|
81
78
|
}
|
82
79
|
}
|
package/readme.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# @eik/cli
|
2
2
|
|
3
|
-
|
3
|
+
The Eik CLI helps you publish to an [Eik server](https://eik.dev/docs/introduction/) and manage import maps and aliases.
|
4
|
+
|
5
|
+
## Installing
|
6
|
+
|
7
|
+
Run this command to install the Eik CLI globally.
|
4
8
|
|
5
9
|
```sh
|
6
|
-
npm install
|
10
|
+
npm install --global @eik/cli
|
7
11
|
```
|
8
12
|
|
9
|
-
|
13
|
+
This makes the `eik` command available in your shell.
|
14
|
+
|
15
|
+
```sh
|
16
|
+
eik --version
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
See [the CLI reference documentation](https://eik.dev/docs/reference/at-eik-cli) to learn about the available commands.
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/**
|
2
|
+
* @typedef {object} AliasOptions
|
3
|
+
* @property {import('abslog').AbstractLoggerOptions} [logger]
|
4
|
+
* @property {string} server
|
5
|
+
* @property {"package" | "npm" | "map"} [type="package"]
|
6
|
+
* @property {string} name
|
7
|
+
* @property {string} version
|
8
|
+
* @property {string} alias
|
9
|
+
* @property {string} token
|
10
|
+
*/
|
11
|
+
/**
|
12
|
+
* @typedef {object} AliasResult
|
13
|
+
* @property {string} server
|
14
|
+
* @property {string} type
|
15
|
+
* @property {string} name
|
16
|
+
* @property {string} alias
|
17
|
+
* @property {string} version
|
18
|
+
* @property {boolean} update
|
19
|
+
* @property {string[]} files
|
20
|
+
* @property {string} org
|
21
|
+
* @property {string} integrity
|
22
|
+
*/
|
23
|
+
export default class Alias {
|
24
|
+
/**
|
25
|
+
* @param {AliasOptions} options
|
26
|
+
*/
|
27
|
+
constructor({ logger, server, token, type, name, version, alias }: AliasOptions);
|
28
|
+
log: abslog.ValidLogger;
|
29
|
+
server: string;
|
30
|
+
token: string;
|
31
|
+
type: string;
|
32
|
+
name: string;
|
33
|
+
alias: string;
|
34
|
+
version: string;
|
35
|
+
/**
|
36
|
+
* @returns {Promise<AliasResult>}
|
37
|
+
*/
|
38
|
+
run(): Promise<AliasResult>;
|
39
|
+
}
|
40
|
+
export type AliasOptions = {
|
41
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
42
|
+
server: string;
|
43
|
+
type?: "package" | "npm" | "map";
|
44
|
+
name: string;
|
45
|
+
version: string;
|
46
|
+
alias: string;
|
47
|
+
token: string;
|
48
|
+
};
|
49
|
+
export type AliasResult = {
|
50
|
+
server: string;
|
51
|
+
type: string;
|
52
|
+
name: string;
|
53
|
+
alias: string;
|
54
|
+
version: string;
|
55
|
+
update: boolean;
|
56
|
+
files: string[];
|
57
|
+
org: string;
|
58
|
+
integrity: string;
|
59
|
+
};
|
60
|
+
import abslog from 'abslog';
|
@@ -0,0 +1,37 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
/**
|
3
|
+
* @param {import('./alias.js').AliasOptions} opts
|
4
|
+
*/
|
5
|
+
function alias(opts: import("./alias.js").AliasOptions): Promise<import("./alias.js").AliasResult>;
|
6
|
+
/**
|
7
|
+
* @param {import('./integrity.js').IntegrityOptions} opts
|
8
|
+
*/
|
9
|
+
function integrity(opts: import("./integrity.js").IntegrityOptions): Promise<any>;
|
10
|
+
/**
|
11
|
+
* Log in using a key to get a Bearer token for use with other commands.
|
12
|
+
*
|
13
|
+
* @param {import('./login.js').LoginOptions} opts
|
14
|
+
*/
|
15
|
+
function login(opts: import("./login.js").LoginOptions): Promise<string | false>;
|
16
|
+
/**
|
17
|
+
* @param {import('./publish/map.js').PublishMapOptions} opts
|
18
|
+
*/
|
19
|
+
function map(opts: import("./publish/map.js").PublishMapOptions): Promise<import("./publish/map.js").PublishMapResult>;
|
20
|
+
/**
|
21
|
+
* @param {import('./meta.js').MetaOptions} opts
|
22
|
+
*/
|
23
|
+
function meta(opts: import("./meta.js").MetaOptions): Promise<unknown>;
|
24
|
+
/**
|
25
|
+
* @param {import('./ping.js').PingOptions} opts
|
26
|
+
*/
|
27
|
+
function ping(opts: import("./ping.js").PingOptions): Promise<boolean>;
|
28
|
+
/**
|
29
|
+
* @param {import('./publish/package/index.js').PublishOptions} opts
|
30
|
+
*/
|
31
|
+
function publish(opts: import("./publish/package/index.js").PublishOptions): Promise<import("./publish/package/index.js").PublishResult>;
|
32
|
+
/**
|
33
|
+
* @param {import('./version.js').VersionOptions} opts
|
34
|
+
*/
|
35
|
+
function version(opts: import("./version.js").VersionOptions): Promise<string>;
|
36
|
+
}
|
37
|
+
export default _default;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* @typedef {object} IntegrityOptions
|
3
|
+
* @property {import('abslog').AbstractLoggerOptions} [logger]
|
4
|
+
* @property {string} server
|
5
|
+
* @property {"package" | "npm" | "map"} [type="package"]
|
6
|
+
* @property {string} name
|
7
|
+
* @property {string} version
|
8
|
+
* @property {string} [cwd]
|
9
|
+
* @property {boolean} [debug]
|
10
|
+
*/
|
11
|
+
export default class Integrity {
|
12
|
+
/**
|
13
|
+
*
|
14
|
+
* @param {IntegrityOptions} options
|
15
|
+
*/
|
16
|
+
constructor({ logger, name, version, server, type, debug, cwd, }: IntegrityOptions);
|
17
|
+
log: abslog.ValidLogger;
|
18
|
+
server: string;
|
19
|
+
name: string;
|
20
|
+
version: string;
|
21
|
+
debug: boolean;
|
22
|
+
cwd: string;
|
23
|
+
type: "map" | "package" | "npm";
|
24
|
+
run(): Promise<any>;
|
25
|
+
}
|
26
|
+
export type IntegrityOptions = {
|
27
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
28
|
+
server: string;
|
29
|
+
type?: "package" | "npm" | "map";
|
30
|
+
name: string;
|
31
|
+
version: string;
|
32
|
+
cwd?: string;
|
33
|
+
debug?: boolean;
|
34
|
+
};
|
35
|
+
import abslog from 'abslog';
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* @typedef {object} LoginOptions
|
3
|
+
* @property {import('abslog').AbstractLoggerOptions} [logger]
|
4
|
+
* @property {string} server
|
5
|
+
* @property {string} key
|
6
|
+
*/
|
7
|
+
export default class Login {
|
8
|
+
/**
|
9
|
+
* @param {LoginOptions} options
|
10
|
+
*/
|
11
|
+
constructor({ logger, server, key }: LoginOptions);
|
12
|
+
log: abslog.ValidLogger;
|
13
|
+
server: string;
|
14
|
+
key: string;
|
15
|
+
/**
|
16
|
+
* @returns {Promise<string | false>} Bearer token, or false if login fails
|
17
|
+
*/
|
18
|
+
run(): Promise<string | false>;
|
19
|
+
}
|
20
|
+
export type LoginOptions = {
|
21
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
22
|
+
server: string;
|
23
|
+
key: string;
|
24
|
+
};
|
25
|
+
import abslog from 'abslog';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/**
|
2
|
+
* @typedef {object} MetaOptions
|
3
|
+
* @property {import('abslog').AbstractLoggerOptions} [logger]
|
4
|
+
* @property {string} server
|
5
|
+
* @property {string} name
|
6
|
+
* @property {string} version
|
7
|
+
*/
|
8
|
+
export default class Meta {
|
9
|
+
/**
|
10
|
+
* @param {MetaOptions} options
|
11
|
+
*/
|
12
|
+
constructor({ logger, server, name, version }: MetaOptions);
|
13
|
+
log: abslog.ValidLogger;
|
14
|
+
server: string;
|
15
|
+
name: string;
|
16
|
+
version: string;
|
17
|
+
/**
|
18
|
+
* @returns {Promise<unknown | false>}
|
19
|
+
*/
|
20
|
+
run(): Promise<unknown | false>;
|
21
|
+
}
|
22
|
+
export type MetaOptions = {
|
23
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
24
|
+
server: string;
|
25
|
+
name: string;
|
26
|
+
version: string;
|
27
|
+
};
|
28
|
+
import abslog from 'abslog';
|