Skip to content

Commit

Permalink
fix(cli): compatible with napi artifacts -d option
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 28, 2023
1 parent 5825dcc commit d44d6db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/codegen/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const ARTIFACTS_OPTIONS: CommandSchema = {
type: 'string',
description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
short: ['o'],
short: ['o', 'd'],
default: "'./artifacts'",
},
{
Expand Down
2 changes: 1 addition & 1 deletion cli/docs/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ new NapiCli().artifacts({
| cwd | --cwd | string | false | process.cwd() | The working directory of where napi command will be executed in, all other paths options are relative to this path |
| configPath | --config-path,-c | string | false | | Path to `napi` config json file |
| packageJsonPath | --package-json-path | string | false | 'package.json' | Path to `package.json` |
| outputDir | --output-dir,-o | string | false | './artifacts' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command |
| outputDir | --output-dir,-o,-d | string | false | './artifacts' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command |
| npmDir | --npm-dir | string | false | 'npm' | Path to the folder where the npm packages put |
4 changes: 2 additions & 2 deletions cli/src/commands/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export class ArtifactsCommand extends BaseArtifactsCommand {
description: 'Copy artifacts from Github Actions into specified dir',
examples: [
[
'$0 artifacts --dir . --dist ./npm',
'$0 artifacts --output-dir ./artifacts --dist ./npm',
`Copy [binaryName].[platform].node under current dir(.) into packages under npm dir.
e.g: index.linux-x64-gnu.node --> ./npm/linux-x64-gnu/index.node`,
e.g: index.linux-x64-gnu.node --> ./npm/linux-x64-gnu/index.linux-x64-gnu.node`,
],
],
})
Expand Down
2 changes: 1 addition & 1 deletion cli/src/def/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export abstract class BaseArtifactsCommand extends Command {
description: 'Path to `package.json`',
})

outputDir = Option.String('--output-dir,-o', './artifacts', {
outputDir = Option.String('--output-dir,-o,-d', './artifacts', {
description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
})
Expand Down

1 comment on commit d44d6db

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: d44d6db Previous: 5825dcc Ratio
noop#napi-rs 86831375 ops/sec (±0.24%) 84740183 ops/sec (±1.99%) 0.98
noop#JavaScript 822361333 ops/sec (±0.25%) 822842777 ops/sec (±0.09%) 1.00
Plus number#napi-rs 24626215 ops/sec (±0.82%) 24539987 ops/sec (±0.14%) 1.00
Plus number#JavaScript 822459401 ops/sec (±0.09%) 822487987 ops/sec (±0.08%) 1.00
Create buffer#napi-rs 670473 ops/sec (±12.79%) 657037 ops/sec (±13%) 0.98
Create buffer#JavaScript 3185858 ops/sec (±6.19%) 3280710 ops/sec (±1.93%) 1.03
createArray#createArrayJson 55314 ops/sec (±0.55%) 55187 ops/sec (±0.44%) 1.00
createArray#create array for loop 9757 ops/sec (±0.54%) 9764 ops/sec (±0.37%) 1.00
createArray#create array with serde trait 9868 ops/sec (±0.57%) 9902 ops/sec (±0.12%) 1.00
getArrayFromJs#get array from json string 24075 ops/sec (±0.55%) 24076 ops/sec (±0.57%) 1.00
getArrayFromJs#get array from serde 13026 ops/sec (±0.33%) 13116 ops/sec (±0.33%) 1.01
getArrayFromJs#get array with for loop 16943 ops/sec (±0.52%) 16652 ops/sec (±0.23%) 0.98
Get Set property#Get Set from native#u32 560816 ops/sec (±12.84%) 567428 ops/sec (±12.66%) 1.01
Get Set property#Get Set from JavaScript#u32 535586 ops/sec (±2.36%) 535754 ops/sec (±2.59%) 1.00
Get Set property#Get Set from native#string 574505 ops/sec (±11.75%) 580099 ops/sec (±10.64%) 1.01
Get Set property#Get Set from JavaScript#string 520632 ops/sec (±1.87%) 523697 ops/sec (±2.1%) 1.01
Async task#spawn task 27329 ops/sec (±0.31%) 26967 ops/sec (±0.86%) 0.99
Async task#ThreadSafeFunction 9318 ops/sec (±1.44%) 9275 ops/sec (±0.87%) 1.00
Async task#Tokio future to Promise 32528 ops/sec (±1.17%) 32416 ops/sec (±0.74%) 1.00
Query#query * 100 3936 ops/sec (±0.37%) 3873 ops/sec (±1.23%) 0.98
Query#query * 1 27831 ops/sec (±1.63%) 27652 ops/sec (±1.13%) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.