diff --git a/package.json b/package.json index ce2b2ca..f588ed3 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ }, "dependencies": { "@commercelayer/cli-core": "beta", + "@commercelayer/cli-ux": "^1.0.1", "@commercelayer/sdk": "^6.13.0", "@oclif/core": "4.0.17", "cli-progress": "^3.12.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e774a7..1d98e0a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@commercelayer/cli-core': specifier: beta version: 5.2.3-beta.1(encoding@0.1.13) + '@commercelayer/cli-ux': + specifier: ^1.0.1 + version: 1.0.1 '@commercelayer/sdk': specifier: ^6.13.0 version: 6.13.0 @@ -354,6 +357,10 @@ packages: engines: {node: '>=20'} hasBin: true + '@commercelayer/cli-ux@1.0.1': + resolution: {integrity: sha512-CbtNjt1O5pKh0UYrYFFAlSOu/7pPI9WEUQjF9rKtMu1Zx+ZqOi5JJQ8WiAUoZvRDb9iCmC8mjC4AGvPcNPMP+w==} + engines: {node: '>=20'} + '@commercelayer/eslint-config-ts@1.4.5': resolution: {integrity: sha512-5YqhT5f7V1vs+HTcNwMLXOzo8P1NrRJaJmMF3E/bk1eJDNLIQFVnDX5Z/B4BFcC9GrCOBjuYERYpC6QVnVWEnQ==} peerDependencies: @@ -1140,6 +1147,10 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + ansi-regex@6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1148,6 +1159,10 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + ansicolors@0.3.2: resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} @@ -1642,6 +1657,9 @@ packages: electron-to-chromium@1.5.12: resolution: {integrity: sha512-tIhPkdlEoCL1Y+PToq3zRNehUaKp3wBX/sr7aclAWdIWjvqAe/Im/H0SiCM4c1Q8BLPHCdoJTol+ZblflydehA==} + emoji-regex@10.3.0: + resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2022,6 +2040,10 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -2369,6 +2391,10 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2792,6 +2818,10 @@ packages: natural-orderby@2.0.3: resolution: {integrity: sha512-p7KTHxU0CUrcOXe62Zfrb5Z13nLvPhSWR/so3kFulUQU0sgUll2Z0LwpsLN351eOOD+hRGu/F1g+6xDfPeD++Q==} + natural-orderby@3.0.2: + resolution: {integrity: sha512-x7ZdOwBxZCEm9MM7+eQCjkrNLrW3rkBKNHVr78zbtqnMGVNlnDi6C/eUEYgxHNrcbu0ymvjzcwIL/6H1iHri9g==} + engines: {node: '>=18'} + neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} @@ -2943,6 +2973,10 @@ packages: resolution: {integrity: sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==} engines: {node: '>= 10'} + object-treeify@4.0.1: + resolution: {integrity: sha512-Y6tg5rHfsefSkfKujv2SwHulInROy/rCL5F4w0QOWxut8AnxYxf0YmNhTh95Zfyxpsudo66uqkux0ACFnyMSgQ==} + engines: {node: '>= 16'} + object.assign@4.1.5: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} @@ -3409,6 +3443,10 @@ packages: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} + slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -3455,6 +3493,10 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.trim@1.2.9: resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} @@ -3476,6 +3518,10 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -3531,6 +3577,10 @@ packages: resolution: {integrity: sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==} engines: {node: '>=14.18'} + supports-hyperlinks@3.1.0: + resolution: {integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==} + engines: {node: '>=14.18'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -4543,6 +4593,27 @@ snapshots: normalize-package-data: 5.0.0 tslib: 2.6.3 + '@commercelayer/cli-ux@1.0.1': + dependencies: + '@oclif/core': 4.0.17 + ansi-escapes: 7.0.0 + ansi-styles: 6.2.1 + cardinal: 2.1.1 + chalk: 4.1.2 + cli-progress: 3.12.0 + color: 4.2.3 + hyperlinker: 1.0.0 + js-yaml: 3.14.1 + natural-orderby: 3.0.2 + object-treeify: 4.0.1 + password-prompt: 1.1.3 + slice-ansi: 7.1.0 + string-width: 7.2.0 + strip-ansi: 7.1.0 + supports-color: 8.1.1 + supports-hyperlinks: 3.1.0 + wordwrap: 1.0.0 + '@commercelayer/eslint-config-ts@1.4.5(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) @@ -5551,6 +5622,8 @@ snapshots: ansi-regex@5.0.1: {} + ansi-regex@6.0.1: {} + ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 @@ -5559,6 +5632,8 @@ snapshots: dependencies: color-convert: 2.0.1 + ansi-styles@6.2.1: {} + ansicolors@0.3.2: {} ansis@3.3.2: {} @@ -6099,6 +6174,8 @@ snapshots: electron-to-chromium@1.5.12: {} + emoji-regex@10.3.0: {} + emoji-regex@8.0.0: {} emojilib@2.4.0: {} @@ -6612,6 +6689,8 @@ snapshots: get-caller-file@2.0.5: {} + get-east-asian-width@1.2.0: {} + get-func-name@2.0.2: {} get-intrinsic@1.2.4: @@ -6980,6 +7059,10 @@ snapshots: is-fullwidth-code-point@3.0.0: {} + is-fullwidth-code-point@5.0.0: + dependencies: + get-east-asian-width: 1.2.0 + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -7392,6 +7475,8 @@ snapshots: natural-orderby@2.0.3: {} + natural-orderby@3.0.2: {} + neo-async@2.6.2: {} nerf-dart@1.0.0: {} @@ -7496,6 +7581,8 @@ snapshots: object-treeify@1.1.33: {} + object-treeify@4.0.1: {} + object.assign@4.1.5: dependencies: call-bind: 1.0.7 @@ -8019,6 +8106,11 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 + slice-ansi@7.1.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + snake-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -8081,6 +8173,12 @@ snapshots: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + string-width@7.2.0: + dependencies: + emoji-regex: 10.3.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + string.prototype.trim@1.2.9: dependencies: call-bind: 1.0.7 @@ -8112,6 +8210,10 @@ snapshots: dependencies: ansi-regex: 5.0.1 + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.0.1 + strip-bom@3.0.0: {} strip-bom@4.0.0: {} @@ -8155,6 +8257,11 @@ snapshots: has-flag: 4.0.0 supports-color: 7.2.0 + supports-hyperlinks@3.1.0: + dependencies: + has-flag: 4.0.0 + supports-color: 7.2.0 + supports-preserve-symlinks-flag@1.0.0: {} synckit@0.9.1: diff --git a/src/commands/resources/all.ts b/src/commands/resources/all.ts index 5150f06..95c66c4 100644 --- a/src/commands/resources/all.ts +++ b/src/commands/resources/all.ts @@ -1,10 +1,11 @@ -import Command, { Flags, cliux } from '../../base' +import Command, { Flags } from '../../base' import { clApi, clToken, clColor, clUtil, clCommand, clConfig } from '@commercelayer/cli-core' import type { CommerceLayerClient, QueryParamsList, ListResponse, Resource, QueryPageSize } from '@commercelayer/sdk' import type { ArgOutput, FlagOutput, Input } from '@oclif/core/lib/interfaces/parser' import notifier from 'node-notifier' import cliProgress from 'cli-progress' +import cliux from '@commercelayer/cli-ux' // const maxPagesWarning = 1000 diff --git a/src/commands/resources/args.ts b/src/commands/resources/args.ts index 8ab04b8..6ed1af5 100644 --- a/src/commands/resources/args.ts +++ b/src/commands/resources/args.ts @@ -1,9 +1,10 @@ -import { Command, Flags, ux as cliux } from '@oclif/core' +import { Command, Flags } from '@oclif/core' import { findResource, type ApiResource } from '../../util/resources' import { deleteArgsFile, loadCommandData, readCommandArgs, type ResourceOperation } from '../../commands' import { formatOutput } from '../../output' import type { QueryParamsList } from '@commercelayer/sdk' import { clOutput, clUtil, clColor } from '@commercelayer/cli-core' +import cliux from '@commercelayer/cli-ux' export default class ResourcesArgs extends Command { diff --git a/src/commands/resources/filters.ts b/src/commands/resources/filters.ts index c758782..4f6cab7 100644 --- a/src/commands/resources/filters.ts +++ b/src/commands/resources/filters.ts @@ -1,5 +1,6 @@ -import { Command, ux as cliux } from '@oclif/core' +import { Command } from '@oclif/core' import { clUtil, clColor, clFilter } from '@commercelayer/cli-core' +import cliux from '@commercelayer/cli-ux' diff --git a/src/commands/resources/index.ts b/src/commands/resources/index.ts index 2e8e9c6..53472c1 100644 --- a/src/commands/resources/index.ts +++ b/src/commands/resources/index.ts @@ -1,7 +1,8 @@ -import { Command, Flags, ux as cliux } from '@oclif/core' +import { Command, Flags } from '@oclif/core' import { resourceList } from '../../util/resources' import { clUtil, clColor, clConfig } from '@commercelayer/cli-core' import type { CommandError } from '@oclif/core/lib/interfaces' +import cliux from '@commercelayer/cli-ux' export default class ResourcesIndex extends Command {