@contrail/cli 3.6.0-alpha-8-alpha.14399c5 → 3.6.0-alpha-8-alpha.e4ae6bd

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/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
17
17
  $ contrail COMMAND
18
18
  running command...
19
19
  $ contrail (--version)
20
- @contrail/cli/3.6.0-alpha-8-alpha.14399c5 linux-x64 node-v24.21.0
20
+ @contrail/cli/3.6.0-alpha-8-alpha.e4ae6bd linux-x64 node-v24.21.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -527,7 +527,7 @@ describe('castValueToPropertyType array coercion', () => {
527
527
  ]);
528
528
  });
529
529
  it('should keep a comma value literal on a multi-value property and warn with the repeated-key form', () => {
530
- const consoleError = jest.spyOn(console, 'error').mockImplementation(() => undefined);
530
+ const consoleError = jest.spyOn(console, 'error').mockImplementation(() => { });
531
531
  expect((0, create_1.castValueToPropertyType)('option,family', types_1.PropertyType.MultiSelect)).toEqual([
532
532
  'option,family',
533
533
  ]);
@@ -535,7 +535,7 @@ describe('castValueToPropertyType array coercion', () => {
535
535
  consoleError.mockRestore();
536
536
  });
537
537
  it('should keep commas literal on string properties without warning', () => {
538
- const consoleError = jest.spyOn(console, 'error').mockImplementation(() => undefined);
538
+ const consoleError = jest.spyOn(console, 'error').mockImplementation(() => { });
539
539
  expect((0, create_1.castValueToPropertyType)('my,name', types_1.PropertyType.String)).toBe('my,name');
540
540
  expect(consoleError).not.toHaveBeenCalled();
541
541
  consoleError.mockRestore();
@@ -26,7 +26,7 @@ class DeleteEntity extends basecommand_1.BaseCommand {
26
26
  }),
27
27
  inputFile: core_1.Flags.string({
28
28
  char: 'i',
29
- description: "A file with a JSON array of objects; only each object's id is used. Deletes every entity in the file.",
29
+ description: 'A file with a JSON array of objects; only each object\'s id is used. Deletes every entity in the file.',
30
30
  required: false,
31
31
  multiple: false,
32
32
  }),
@@ -35,34 +35,34 @@ describe('entities command grammar: entities <verb> <typePath> [ID...]', () => {
35
35
  });
36
36
  });
37
37
  describe('positional id arguments', () => {
38
- it('should accept variadic positional ids on get', () => {
38
+ it('get accepts variadic positional ids', () => {
39
39
  expect(get_1.default.strict).toBe(false);
40
40
  expect(get_1.default.args.ids).toBeDefined();
41
41
  });
42
- it('should accept variadic positional ids on update with no single id arg', () => {
42
+ it('update accepts variadic positional ids and has no single id arg', () => {
43
43
  expect(update_1.default.strict).toBe(false);
44
44
  expect(update_1.default.args.ids).toBeDefined();
45
45
  expect(update_1.default.args.id).toBeUndefined();
46
46
  });
47
- it('should accept variadic positional ids on delete with no --id flag', () => {
47
+ it('delete accepts variadic positional ids and has no --id flag', () => {
48
48
  expect(delete_1.default.strict).toBe(false);
49
49
  expect(delete_1.default.args.ids).toBeDefined();
50
50
  expect(delete_1.default.flags.id).toBeUndefined();
51
51
  });
52
52
  });
53
53
  describe('flag alignment across verbs', () => {
54
- it('should name the input file -i, --inputFile on every verb that accepts one', () => {
54
+ it('the input file is -i, --inputFile on every verb that accepts one', () => {
55
55
  expect(create_1.default.flags.inputFile.char).toBe('i');
56
56
  expect(update_1.default.flags.inputFile.char).toBe('i');
57
57
  expect(delete_1.default.flags.inputFile.char).toBe('i');
58
58
  expect(delete_1.default.flags.input).toBeUndefined();
59
59
  });
60
- it('should map skipHydrateRelationships to -S on every verb', () => {
60
+ it('skipHydrateRelationships is -S on every verb', () => {
61
61
  expect(create_1.default.flags.skipHydrateRelationships.char).toBe('S');
62
62
  expect(get_1.default.flags.skipHydrateRelationships.char).toBe('S');
63
63
  expect(update_1.default.flags.skipHydrateRelationships.char).toBe('S');
64
64
  });
65
- it('should keep -s for --skip on get', () => {
65
+ it('get keeps -s for --skip', () => {
66
66
  expect(get_1.default.flags.skip.char).toBe('s');
67
67
  });
68
68
  });
@@ -31,7 +31,8 @@ export declare function parsePropertySpecification(spec: PropertySpecificationSt
31
31
  export declare function parsePropertySpecificationsIntoMap(propertySpecifications: PropertySpecificationString[]): PropertySpecificationBySlug;
32
32
  /**
33
33
  * Splits command argv tokens (after the typePath) into positional ids and
34
- * property specifications.
34
+ * property specifications. A token containing '=' is a property specification
35
+ * candidate; every other token is an id.
35
36
  */
36
37
  export declare function partitionIdsAndSpecs(tokens: string[]): {
37
38
  ids: string[];
@@ -71,6 +71,8 @@ function parsePropertySpecificationsIntoMap(propertySpecifications) {
71
71
  propertySpecBySlug.set(slug, idsArray);
72
72
  continue;
73
73
  }
74
+ // Repeating a key accumulates values into an array; commas in every other
75
+ // value are literal.
74
76
  const existing = propertySpecBySlug.get(slug);
75
77
  if (propertySpecBySlug.has(slug) && existing !== undefined && value !== undefined) {
76
78
  propertySpecBySlug.set(slug, Array.isArray(existing) ? [...existing, value] : [existing, value]);
@@ -83,7 +85,8 @@ function parsePropertySpecificationsIntoMap(propertySpecifications) {
83
85
  exports.parsePropertySpecificationsIntoMap = parsePropertySpecificationsIntoMap;
84
86
  /**
85
87
  * Splits command argv tokens (after the typePath) into positional ids and
86
- * property specifications.
88
+ * property specifications. A token containing '=' is a property specification
89
+ * candidate; every other token is an id.
87
90
  */
88
91
  function partitionIdsAndSpecs(tokens) {
89
92
  return {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const logger_1 = tslib_1.__importDefault(require("./logger"));
5
5
  describe('logger', () => {
6
- it('should write every log level to stderr so stdout carries only command output', () => {
6
+ it('writes every level to stderr so stdout carries only command output', () => {
7
7
  const consoleTransport = logger_1.default.transports[0];
8
8
  for (const level of ['error', 'warn', 'info', 'debug']) {
9
9
  expect(consoleTransport.stderrLevels[level]).toBe(true);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.6.0-alpha-8-alpha.14399c5",
2
+ "version": "3.6.0-alpha-8-alpha.e4ae6bd",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.6.0-alpha-8-alpha.14399c5",
3
+ "version": "3.6.0-alpha-8-alpha.e4ae6bd",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",