@flock/wirespec 0.14.6 → 0.14.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flock/wirespec",
3
- "version": "0.14.6",
3
+ "version": "0.14.8",
4
4
  "main": "wirespec-src-plugin-npm.mjs",
5
5
  "types": "wirespec-src-plugin-npm.d.ts",
6
6
  "devDependencies": {
@@ -21,11 +21,12 @@ import {
21
21
  mapOf1xd03cq9cnmy8 as mapOf,
22
22
  removePrefix279df90bhrqqg as removePrefix,
23
23
  removeSuffix3d61x5lsuvuho as removeSuffix,
24
+ startsWith26w8qjqapeeq6 as startsWith,
24
25
  isCharSequence1ju9jr1w86plq as isCharSequence,
25
26
  trim11nh7r46at6sx as trim,
26
27
  isBlank1dvkhjjvox3p0 as isBlank,
27
28
  _Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
28
- startsWith1bgirhbedtv2y as startsWith,
29
+ startsWith1bgirhbedtv2y as startsWith_0,
29
30
  endsWith278181ii8uuo as endsWith,
30
31
  until1jbpn0z3f8lbg as until,
31
32
  substring2pnd9wgs9hwtx as substring,
@@ -57,7 +58,6 @@ import {
57
58
  dropLastlqc2oyv04br0 as dropLast,
58
59
  replace3le3ie7l9k8aq as replace,
59
60
  first58ocm7j58k3q as first_0,
60
- last1vo29oleiqj36 as last,
61
61
  emptyList1g2z5xcrvp2zy as emptyList,
62
62
  plus310ted5e4i90h as plus,
63
63
  flatten2dh4kibw1u0qq as flatten,
@@ -68,6 +68,7 @@ import {
68
68
  hashCodeq5arwsb9dgti as hashCode,
69
69
  compareValues1n2ayl87ihzfk as compareValues,
70
70
  sortedWith2csnbbb21k0lg as sortedWith,
71
+ last1vo29oleiqj36 as last,
71
72
  trimIndent1qytc1wvt8suh as trimIndent,
72
73
  prependIndentkl9wuvcodvmu as prependIndent,
73
74
  toSet2orjxp16sotqu as toSet,
@@ -430,7 +431,7 @@ function WirespecSpec() {
430
431
  WirespecSpec_instance = this;
431
432
  this.o23_1 = WirespecType_getInstance();
432
433
  this.p23_1 = WirespecField_getInstance();
433
- this.q23_1 = listOf([to(Regex_init_$Create$('^\\btype\\b'), TypeDefinition_instance), to(Regex_init_$Create$('^\\benum\\b'), EnumTypeDefinition_instance), to(Regex_init_$Create$('^\\bendpoint\\b'), EndpointDefinition_instance), to(Regex_init_$Create$('^\\bchannel\\b'), ChannelDefinition_instance), to(Regex_init_$Create$('^[^\\S\\r\\n]+'), WhiteSpaceExceptNewLine_instance), to(Regex_init_$Create$('^[\\r\\n]'), NewLine_instance), to(Regex_init_$Create$('^\\{'), LeftCurly_instance), to(Regex_init_$Create$('^\\}'), RightCurly_instance), to(Regex_init_$Create$('^->'), Arrow_instance), to(Regex_init_$Create$('^='), Equals_instance), to(Regex_init_$Create$('^\\|'), Pipe_instance), to(Regex_init_$Create$('^:'), Colon_instance), to(Regex_init_$Create$('^,'), Comma_instance), to(Regex_init_$Create$('^\\?'), QuestionMark_instance), to(Regex_init_$Create$('^#'), Hash_instance), to(Regex_init_$Create$('^\\[\\]'), Brackets_instance), to(Regex_init_$Create$('^\\b(GET|POST|PUT|DELETE|OPTIONS|HEAD|PATCH|TRACE)\\b'), Method_instance), to(Regex_init_$Create$('^[1-5][0-9][0-9]'), StatusCode_instance), to(Regex_init_$Create$('^[a-z`][a-zA-Z0-9_\\-`]*'), this.p23_1), to(Regex_init_$Create$('^\\b[A-Z][a-zA-Z0-9_]*\\b'), this.o23_1), to(Regex_init_$Create$('^/[a-zA-Z0-9-_]+'), Path_instance), to(Regex_init_$Create$('^\\/\\*(\\*(?!\\/)|[^*])*\\*\\/'), Comment_instance), to(Regex_init_$Create$('^/'), ForwardSlash_instance), to(Regex_init_$Create$('^.'), Character_instance)]);
434
+ this.q23_1 = listOf([to(Regex_init_$Create$('^\\btype\\b'), TypeDefinition_instance), to(Regex_init_$Create$('^\\benum\\b'), EnumTypeDefinition_instance), to(Regex_init_$Create$('^\\bendpoint\\b'), EndpointDefinition_instance), to(Regex_init_$Create$('^\\bchannel\\b'), ChannelDefinition_instance), to(Regex_init_$Create$('^[^\\S\\r\\n]+'), WhiteSpaceExceptNewLine_instance), to(Regex_init_$Create$('^[\\r\\n]'), NewLine_instance), to(Regex_init_$Create$('^\\{'), LeftCurly_instance), to(Regex_init_$Create$('^\\}'), RightCurly_instance), to(Regex_init_$Create$('^->'), Arrow_instance), to(Regex_init_$Create$('^='), Equals_instance), to(Regex_init_$Create$('^\\|'), Pipe_instance), to(Regex_init_$Create$('^:'), Colon_instance), to(Regex_init_$Create$('^,'), Comma_instance), to(Regex_init_$Create$('^\\?'), QuestionMark_instance), to(Regex_init_$Create$('^#'), Hash_instance), to(Regex_init_$Create$('^\\[\\]'), Brackets_instance), to(Regex_init_$Create$('^\\b(GET|POST|PUT|DELETE|OPTIONS|HEAD|PATCH|TRACE)\\b'), Method_instance), to(Regex_init_$Create$('^[1-5][0-9][0-9]'), StatusCode_instance), to(Regex_init_$Create$('^[a-z`][a-zA-Z0-9_\\-`]*'), this.p23_1), to(Regex_init_$Create$('^\\b[A-Z][a-zA-Z0-9_]*\\b'), this.o23_1), to(Regex_init_$Create$('^/[a-zA-Z0-9-_]+'), Path_instance), to(Regex_init_$Create$('^//.*'), Comment_instance), to(Regex_init_$Create$('^\\/\\*(\\*(?!\\/)|[^*])*\\*\\/'), Comment_instance), to(Regex_init_$Create$('^/'), ForwardSlash_instance), to(Regex_init_$Create$('^.'), Character_instance)]);
434
435
  }
435
436
  protoOf(WirespecSpec).r23 = function () {
436
437
  return this.o23_1;
@@ -504,8 +505,14 @@ function WirespecField_getInstance() {
504
505
  return WirespecField_instance;
505
506
  }
506
507
  function removeCommentMarkers(_this__u8e3s4) {
508
+ var tmp;
509
+ if (startsWith(_this__u8e3s4, '//')) {
510
+ tmp = removePrefix(_this__u8e3s4, '//');
511
+ } else {
512
+ tmp = removeSuffix(removePrefix(_this__u8e3s4, '/*'), '*/');
513
+ }
507
514
  // Inline function 'kotlin.text.trim' call
508
- var this_0 = removeSuffix(removePrefix(_this__u8e3s4, '/*'), '*/');
515
+ var this_0 = tmp;
509
516
  return toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
510
517
  }
511
518
  function removeBackticks(_this__u8e3s4) {
@@ -532,7 +539,7 @@ function addBackticks(_this__u8e3s4) {
532
539
  return '`' + _this__u8e3s4 + '`';
533
540
  }
534
541
  function hasBackticks(_this__u8e3s4) {
535
- return _this__u8e3s4.length > 1 && startsWith(_this__u8e3s4, _Char___init__impl__6a9atx(96)) && endsWith(_this__u8e3s4, _Char___init__impl__6a9atx(96));
542
+ return _this__u8e3s4.length > 1 && startsWith_0(_this__u8e3s4, _Char___init__impl__6a9atx(96)) && endsWith(_this__u8e3s4, _Char___init__impl__6a9atx(96));
536
543
  }
537
544
  function removeFirstAndLastChar(_this__u8e3s4) {
538
545
  return substring(_this__u8e3s4, until(1, _this__u8e3s4.length - 1 | 0));
@@ -1122,9 +1129,9 @@ protoOf(JavaEmitter).a27 = function (module_0, logger) {
1122
1129
  var this_0 = protoOf(Emitter).a27.call(this, module_0, logger);
1123
1130
  // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
1124
1131
  var destruct = this_0.uk_1;
1125
- var typeName = destruct.yd();
1132
+ var file = destruct.yd();
1126
1133
  var result = destruct.zd();
1127
- var tmp = this.d24_1.f27() + sanitizeSymbol(typeName, this);
1134
+ var tmp = this.d24_1.f27() + sanitizeSymbol(file, this);
1128
1135
  // Inline function 'kotlin.text.trimStart' call
1129
1136
  var this_1 = trimMargin('\n |package ' + this.d24_1.toString() + ';\n |' + (Companion_getInstance_4().g27(module_0) ? this.f24_1 : '') + '\n |' + result + '\n ');
1130
1137
  var tmp$ret$0 = toString(trimStart(isCharSequence(this_1) ? this_1 : THROW_CCE()));
@@ -1137,9 +1144,9 @@ protoOf(JavaEmitter).a27 = function (module_0, logger) {
1137
1144
  while (_iterator__ex2g4s.h()) {
1138
1145
  var item = _iterator__ex2g4s.i();
1139
1146
  // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
1140
- var typeName_0 = item.yd();
1147
+ var file_0 = item.yd();
1141
1148
  var result_0 = item.zd();
1142
- var tmp_1 = this.d24_1.f27() + sanitizeSymbol(typeName_0, this);
1149
+ var tmp_1 = this.d24_1.f27() + sanitizeSymbol(file_0, this);
1143
1150
  // Inline function 'kotlin.text.trimStart' call
1144
1151
  var this_3 = trimMargin('\n |package ' + this.d24_1.toString() + ';\n |' + (Companion_getInstance_4().g27(module_0) ? this.f24_1 : '') + '\n |' + result_0 + '\n ');
1145
1152
  var tmp$ret$2 = toString(trimStart(isCharSequence(this_3) ? this_3 : THROW_CCE()));
@@ -1840,29 +1847,35 @@ protoOf(KotlinEmitter).z26 = function () {
1840
1847
  return this.h28_1;
1841
1848
  };
1842
1849
  protoOf(KotlinEmitter).a27 = function (module_0, logger) {
1843
- var tmp = this.c28_1.f27() + Companion_getInstance_4().o25(last(split(module_0.m27_1, ['/'])));
1844
- var tmp_0 = this.c28_1.toString();
1845
- var tmp_1 = Companion_getInstance_4().g27(module_0) ? this.e28_1 : '';
1846
1850
  // Inline function 'arrow.core.NonEmptyList.map' call
1847
1851
  var this_0 = protoOf(Emitter).a27.call(this, module_0, logger);
1848
- // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.stub_for_inlining' call
1849
- var tmp_2 = this_0.uk_1.c27_1;
1852
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>' call
1853
+ var destruct = this_0.uk_1;
1854
+ var file = destruct.yd();
1855
+ var result = destruct.zd();
1856
+ var tmp = this.c28_1.f27() + sanitizeSymbol_0(file, this);
1857
+ // Inline function 'kotlin.text.trimStart' call
1858
+ var this_1 = trimMargin('\n |package ' + this.c28_1.toString() + '\n |' + (Companion_getInstance_4().g27(module_0) ? this.e28_1 : '') + '\n |' + result + '\n ');
1859
+ var tmp$ret$0 = toString(trimStart(isCharSequence(this_1) ? this_1 : THROW_CCE()));
1860
+ var tmp_0 = new Emitted(tmp, tmp$ret$0);
1850
1861
  // Inline function 'kotlin.collections.map' call
1851
- var this_1 = this_0.vk_1;
1862
+ var this_2 = this_0.vk_1;
1852
1863
  // Inline function 'kotlin.collections.mapTo' call
1853
- var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
1854
- var _iterator__ex2g4s = this_1.g();
1864
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
1865
+ var _iterator__ex2g4s = this_2.g();
1855
1866
  while (_iterator__ex2g4s.h()) {
1856
1867
  var item = _iterator__ex2g4s.i();
1857
- // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.stub_for_inlining' call
1858
- var tmp$ret$1 = item.c27_1;
1859
- destination.e(tmp$ret$1);
1868
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>' call
1869
+ var file_0 = item.yd();
1870
+ var result_0 = item.zd();
1871
+ var tmp_1 = this.c28_1.f27() + sanitizeSymbol_0(file_0, this);
1872
+ // Inline function 'kotlin.text.trimStart' call
1873
+ var this_3 = trimMargin('\n |package ' + this.c28_1.toString() + '\n |' + (Companion_getInstance_4().g27(module_0) ? this.e28_1 : '') + '\n |' + result_0 + '\n ');
1874
+ var tmp$ret$2 = toString(trimStart(isCharSequence(this_3) ? this_3 : THROW_CCE()));
1875
+ var tmp$ret$3 = new Emitted(tmp_1, tmp$ret$2);
1876
+ destination.e(tmp$ret$3);
1860
1877
  }
1861
- var tmp$ret$4 = new NonEmptyList(tmp_2, destination);
1862
- // Inline function 'kotlin.text.trimStart' call
1863
- var this_2 = trimMargin('\n |package ' + tmp_0 + '\n |' + tmp_1 + '\n |' + joinToString(tmp$ret$4, '\n') + '\n ');
1864
- var tmp$ret$5 = toString(trimStart(isCharSequence(this_2) ? this_2 : THROW_CCE()));
1865
- var emitted = nonEmptyListOf(new Emitted(tmp, tmp$ret$5), []);
1878
+ var emitted = new NonEmptyList(tmp_0, destination);
1866
1879
  return this.d28_1 ? emitted.al(new Emitted(Companion_instance_6.f26('community.flock.wirespec.generated').f27() + 'Wirespec', this.h26().k28_1)) : emitted;
1867
1880
  };
1868
1881
  protoOf(KotlinEmitter).j27 = function (type, module_0) {
@@ -4261,8 +4274,8 @@ var Spacer_instance;
4261
4274
  function Spacer_getInstance() {
4262
4275
  return Spacer_instance;
4263
4276
  }
4264
- function Emitted(typeName, result) {
4265
- this.b27_1 = typeName;
4277
+ function Emitted(file, result) {
4278
+ this.b27_1 = file;
4266
4279
  this.c27_1 = result;
4267
4280
  }
4268
4281
  protoOf(Emitted).yd = function () {
@@ -4272,7 +4285,7 @@ protoOf(Emitted).zd = function () {
4272
4285
  return this.c27_1;
4273
4286
  };
4274
4287
  protoOf(Emitted).toString = function () {
4275
- return 'Emitted(typeName=' + this.b27_1 + ', result=' + this.c27_1 + ')';
4288
+ return 'Emitted(file=' + this.b27_1 + ', result=' + this.c27_1 + ')';
4276
4289
  };
4277
4290
  protoOf(Emitted).hashCode = function () {
4278
4291
  var result = getStringHashCode(this.b27_1);
@@ -9595,7 +9608,6 @@ export {
9595
9608
  Emitted as Emitted3cm6ez40hij29,
9596
9609
  Emitter as Emitter1jsaltl7ktuoe,
9597
9610
  get_entries as get_entries4pic4pnz9ji1,
9598
- PackageName as PackageName35p0zgv8tekor,
9599
9611
  JavaEmitter as JavaEmitter1iajkiqm8e1w2,
9600
9612
  KotlinEmitter as KotlinEmitter3u2bd89c6zjpn,
9601
9613
  PythonEmitter as PythonEmitter2ympv43525ly9,