Skip to content

Commit

Permalink
build: latest dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Oct 24, 2024
1 parent edbefcb commit 0b2adfb
Show file tree
Hide file tree
Showing 27 changed files with 82 additions and 89 deletions.
2 changes: 1 addition & 1 deletion extra/incus-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "MIT",
"dependencies": {
"@nikitajs/core": "^1.0.0-alpha.9",
"shell": "^0.9.6"
"shell": "^0.11.0"
},
"devDependencies": {
"coffeescript": "^2.7.0"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"private": true,
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.9.1",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@eslint/js": "^9.13.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^9.9.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-prettier": "^5.2.1",
"glob": "^11.0.0",
"husky": "^9.1.1",
"lerna": "^8.1.6",
"husky": "^9.1.6",
"lerna": "^8.1.8",
"prettier": "^3.3.3"
},
"scripts": {
Expand All @@ -27,7 +27,7 @@
"goodies:incus:macos": "./packages/incus/assets/multipass.sh",
"update-version": "lerna publish --skip-git --skip-npm --force-publish '*'",
"check-packages": "yarn clean && yarn compile && yarn test && yarn lint",
"postinstall": "husky install"
"prepare": "husky install"
},
"workspaces": [
"docs/*",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/lib/actions/execute/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export default {
if (config.dry) {
return resolve(result);
}
const child = exec(config, {
const child = exec({
...config,
ssh: ssh,
env: config.env,
});
Expand Down
11 changes: 6 additions & 5 deletions packages/core/lib/actions/fs/createWriteStream/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export default {
// In append mode, we write to a copy of the target file located in a temporary location
if (config.flags[0] === "a") {
const whoami = utils.os.whoami({ ssh });
await exec(
ssh,
[
await exec({
ssh: ssh,
command: [
sudo(`[ ! -f '${config.target}' ] && exit`),
sudo(`cp '${config.target}' '${config.target_tmp}'`),
sudo(`chown ${whoami} '${config.target_tmp}'`),
].join("\n"),
);
});
log(
"INFO",
"Append prepared by placing a copy of the original file in a temporary path",
Expand Down Expand Up @@ -85,7 +85,8 @@ export default {
await promise;
// Replace the target file in append or sudo mode
if (config.target_tmp) {
await exec(ssh, {
await exec({
ssh: ssh,
command: [
sudo(`mv '${config.target_tmp}' '${config.target}'`),
config.sudo ? sudo(`chown root:root '${config.target}'`) : undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/actions/ssh/close/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dependencies
import connect from "ssh2-connect";
import * as connect from "ssh2-connect";
import utils from "@nikitajs/core/utils";
// Schema
// import definitions from "./schema.json" with { type: "json" };
Expand Down
20 changes: 6 additions & 14 deletions packages/core/lib/actions/ssh/open/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
`Read Private Key: ${JSON.stringify(config.private_key_path)}`,
);
const conn = await connect(config);
log("INFO", "Connection is established");
log("Connection is established");
return {
ssh: conn,
};
Expand All @@ -50,7 +50,7 @@ export default {
}
// Enable root access
if (config.root.username) {
log("INFO", "Bootstrap Root Access");
log("Bootstrap Root Access");
await this.ssh.root(config.root);
}
log("DEBUG", "Establish Connection: attempt after enabling root access");
Expand All @@ -67,26 +67,18 @@ export default {
},
hooks: {
on_action: function ({ config }) {
if (config.private_key == null) {
config.private_key = config.privateKey;
}
config.private_key ??= config.privateKey;
// Define host from ip
if (config.ip && !config.host) {
config.host = config.ip;
}
// Default root properties
if (config.root == null) {
config.root = {};
}
config.root ??= {};
if (config.root.ip && !config.root.host) {
config.root.host = config.root.ip;
}
if (config.root.host == null) {
config.root.host = config.host;
}
if (config.root.port == null) {
config.root.port = config.port;
}
config.root.host ??= config.host;
config.root.port ??= config.port;
},
},
metadata: {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
"each": "^2.7.0",
"minimatch": "^10.0.1",
"mixme": "^1.1.0",
"pad": "^3.2.0",
"pad": "^3.3.0",
"plug-and-play": "^2.5.8",
"regexp-quote": "^0.0.0",
"self-templated": "^0.2.3",
"semver": "^7.6.3",
"ssh2-connect": "^3.5.0",
"ssh2-exec": "^0.7.7",
"ssh2-fs": "^1.1.3",
"ssh2-connect": "^4.1.1",
"ssh2-exec": "^0.8.4",
"ssh2-fs": "^1.2.2",
"stack-trace": "^0.0.10",
"tilde-expansion": "^0.0.0",
"uuid": "^10.0.0"
Expand All @@ -67,7 +67,7 @@
"@nikitajs/incus-runner": "^1.0.0-alpha.6",
"coffeescript": "^2.7.0",
"mocha": "^10.7.3",
"mocha-they": "^0.1.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
14 changes: 7 additions & 7 deletions packages/core/test/actions/execute/wait.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe 'actions.execute.wait', ->
{$status} = await @execute.wait
command: "test -d #{tmpdir}"
$status.should.be.false()

they 'single command, status true', ({ssh}) ->
nikita
$ssh: ssh
Expand Down Expand Up @@ -100,9 +100,9 @@ describe 'actions.execute.wait', ->
$log: ({log}) ->
logs++ if log.type in ['stdin', 'stdout', 'stderr']
logs.should.eql 0

describe 'config `code`', ->

they 'error with code.false, first attempt', ({ssh}) ->
nikita
$ssh: ssh
Expand All @@ -115,7 +115,7 @@ describe 'actions.execute.wait', ->
.should.be.rejectedWith
code: 'NIKITA_EXECUTE_EXIT_CODE_INVALID'
exit_code: 99

they 'error with code.false, retried attempt', ({ssh}) ->
nikita
$ssh: ssh
Expand All @@ -138,7 +138,7 @@ describe 'actions.execute.wait', ->
attempts.should.be.above 1

describe 'config `quorum`', ->

it 'boolean `true` is converted to quorum', ->
# Odd number
quorum = await nikita.execute.wait
Expand Down Expand Up @@ -233,9 +233,9 @@ describe 'actions.execute.wait', ->
await @fs.assert
target: "#{tmpdir}/result"
content: '1\n2\n'

describe 'option `retry`', ->

they 'when `0`, not execution', ({ssh}) ->
nikita
$ssh: ssh
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/actions/fs/createWriteStream.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ they = mochaThey(test.config)

describe 'actions.fs.createWriteStream', ->
return unless test.tags.posix

describe 'validation', ->

it 'schema stream is required', ->
Expand Down Expand Up @@ -46,7 +46,7 @@ describe 'actions.fs.createWriteStream', ->
code: 'NIKITA_FS_CWS_TARGET_ENOENT'
syscall: 'open'
path: "#{tmpdir}/a_dir/a_file"

describe 'usage', ->

they 'write a file', ({ssh}) ->
Expand Down Expand Up @@ -89,7 +89,7 @@ describe 'actions.fs.createWriteStream', ->
mode: 0o0611
{stats} = await @fs.stat "#{tmpdir}/a_file"
utils.mode.compare(stats.mode, 0o0611).should.be.true()

they 'config `flags` equal "a"', ({ssh}) ->
nikita
$ssh: ssh
Expand Down
4 changes: 2 additions & 2 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
],
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"devDependencies": {
"@nikitajs/network": "^1.0.0-alpha.9",
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
"dependencies": {
"cson": "^8.4.0",
"dedent": "^1.5.3",
"diff": "^5.2.0",
"diff": "^7.0.0",
"handlebars": "^4.7.8",
"ini": "^4.1.3",
"ini": "^5.0.0",
"mixme": "^1.1.0",
"xmlbuilder": "^15.1.1",
"xmldom": "^0.6.0"
},
"devDependencies": {
"@nikitajs/log": "^2.0.0-alpha.6",
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/file/test/index.diff.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe 'file config diff', ->
diff: (text, diff) ->
diffcalled = true
diff.should.eql [
{ value: 'Testing diff\n', count: 1 }
{ value: 'original text', count: 1, added: undefined, removed: true }
{ value: 'new text', count: 1, added: true, removed: undefined }
{ added: false, count: 1, removed: false, value: 'Testing diff\n' }
{ added: false, count: 1, removed: true, value: 'original text' }
{ added: true, count: 1, removed: false, value: 'new text' }
]
.should.be.finally.containEql $status: true

Expand Down Expand Up @@ -93,7 +93,7 @@ describe 'file config diff', ->
content: 'some content'
diff: (text, raw) -> diff = text
diff.should.eql '1 + some content\n'

they 'honored by `log.md` action', ({ssh}) ->
nikita
$ssh: ssh
Expand Down
6 changes: 3 additions & 3 deletions packages/incus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"dedent": "^1.5.3",
"js-yaml": "^4.1.0",
"object-diff": "^0.0.4",
"shell": "^0.9.6"
"shell": "^0.11.0"
},
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ipa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@nikitajs/incus-runner": "^1.0.0-alpha.6",
"coffeescript": "^2.7.0",
"mixme": "^1.1.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/java/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
3 changes: 1 addition & 2 deletions packages/krb5/lib/ktadd/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

# `nikita.krb5.ktadd`

Create and manage a keytab. This function is usually not used directly but instead
called by the `krb5.addprinc` function.
Create and manage a keytab. This function is usually not used directly but instead called by the `krb5.addprinc` action.

## Example

Expand Down
4 changes: 2 additions & 2 deletions packages/krb5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
},
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ldap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
],
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/log/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"dependencies": {
"colors": "^1.4.0",
"mixme": "^1.1.0",
"pad": "^3.2.0"
"pad": "^3.3.0"
},
"devDependencies": {
"coffeescript": "^2.7.0",
"mocha": "^10.7.0",
"mocha-they": "^0.1.3",
"mocha": "^10.7.3",
"mocha-they": "^0.1.10",
"should": "^13.2.3"
},
"engines": {
Expand Down
Loading

0 comments on commit 0b2adfb

Please sign in to comment.