foobara-typescript-remote-command-generator 0.0.12 → 0.0.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1104e4a22fbc43acc6eb9224e9e4a2e66c50a9de682ec7433869852d16fa5066
4
- data.tar.gz: a3ac71e2f721f84fc3b939ab1bee3022c2db37aa69c6a315557e75470e5e0bcc
3
+ metadata.gz: 5045b4f54238822deb4764d5ea2f259b482c3350c20e348472b20d30fd1feb83
4
+ data.tar.gz: 24187f3f79dc8fcd275ff4a8b98010dbac41128b4a6dd92faaf073544746eb7c
5
5
  SHA512:
6
- metadata.gz: bfc502a91885feb02d56384ee7add5b7740dd22159b33eb2dd844283be6f8e77ed989a494218d72f2ce98d540a335a5fafef126e7770e0b33c9e2eed32a43511
7
- data.tar.gz: 2f6a3fe9fa23fcd90014030b037f0e0eafb90b1011a795ac9755c0b9cbde88ea7bcfb56500254eb5b087bab1ec074b189887efaa94aaffbf25d17cd5158b24aa
6
+ metadata.gz: ae7f0d944f64a64faf54c8cc78f9d0afc53f9c4e857c75efff8993c3132ecefcaa96aec799909444f80dd38b3023db947ab3381a116f298e365b2fb0455432e3
7
+ data.tar.gz: 8b8b124b10f82ce701b48216f338561b7104d44b45f0793148df2d0545d41947cde9d5b12dd2dea4796c9a5c79005d4f9489ebc6f52cbf68d39cf1698b863b26
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.13] - 2025-03-17
2
+
3
+ - Fix bug incorrectly generating model typescript for detached entities
4
+ - Fix bug preventing Loaded/Unloaded entity import from being destructured properly
5
+ - Handle errors with prefixes
6
+ - Include custom types and models in error generator dependencies
7
+ - Fix bug preventing allow_nil from having an effect
8
+
1
9
  ## [0.0.12] - 2025-03-02
2
10
 
3
11
  - Add ability to ask RemoteCommand for its state and outcome
@@ -9,17 +9,17 @@ module Foobara
9
9
  def target_path
10
10
  p = parent
11
11
 
12
- basename = "#{error_name}.ts"
12
+ basename = "#{error_name}.ts".split("::")
13
13
 
14
14
  case parent
15
15
  when OrganizationGenerator, DomainGenerator, CommandGenerator
16
- [*p.target_dir, "errors", basename]
16
+ [*p.target_dir, "errors", *basename]
17
17
  when nil
18
18
  # :nocov:
19
19
  raise "Expected #{error_name} to have a parent but it did not"
20
20
  # :nocov:
21
21
  else
22
- [*p.target_dir, basename]
22
+ [*p.target_dir, *basename]
23
23
  end
24
24
  end
25
25
 
@@ -50,8 +50,7 @@ module Foobara
50
50
  end
51
51
 
52
52
  def dependencies
53
- # Why don't we need models and custom types?
54
- types_depended_on.select(&:detached_entity?)
53
+ types_depended_on.select { |type| type.detached_entity? || type.custom? || type.model? }
55
54
  end
56
55
 
57
56
  def ts_type_full_path
@@ -21,6 +21,10 @@ module Foobara
21
21
  *prefix, name = super
22
22
  [*prefix, "Loaded#{name}"]
23
23
  end
24
+
25
+ def import_destructure
26
+ "{ Loaded#{scoped_short_name} }"
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -76,7 +76,7 @@ module Foobara
76
76
  # :nocov:
77
77
  end
78
78
 
79
- if declaration_data["allows_nil"]
79
+ if declaration_data["allow_nil"]
80
80
  # TODO: add a custom type to the fixture manifest that includes allows_nil
81
81
  # :nocov:
82
82
  guts += " | undefined"
@@ -48,7 +48,7 @@ module Foobara
48
48
  Services::OrganizationConfigGenerator,
49
49
  Services::OrganizationManifestGenerator
50
50
  ]
51
- when Manifest::Entity
51
+ when Manifest::Entity, Manifest::DetachedEntity
52
52
  [
53
53
  Services::EntityGenerator,
54
54
  Services::EntityVariantsGenerator,
@@ -14,6 +14,10 @@ module Foobara
14
14
  *prefix, name = super
15
15
  [*prefix, "Unloaded#{name}"]
16
16
  end
17
+
18
+ def import_destructure
19
+ "{ Unloaded#{scoped_short_name} }"
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -4,5 +4,5 @@ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= de
4
4
 
5
5
  import { <%= error_base_class %> } from "<%= path_to_root %>base/Error"
6
6
 
7
- export class <%= error_name %> extends <%= error_base_class %><<%= context_ts_type %>> {
7
+ export class <%= short_error_name %> extends <%= error_base_class %><<%= context_ts_type %>> {
8
8
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-typescript-remote-command-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-02 00:00:00.000000000 Z
10
+ date: 2025-03-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.6.3
137
+ rubygems_version: 3.6.5
138
138
  specification_version: 4
139
139
  summary: Generates remote commands for Typescript from a foobara manifest
140
140
  test_files: []