cobra_commander-yarn 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e12dbf63e528ae67ac2b1e3fb13992c5f77a13f44b04f058bd66c260e54292ad
4
+ data.tar.gz: 8f4f2eaa1229154f33b0b812e7519dd223223f5e7badf0ef8e2fb3380e822d1b
5
+ SHA512:
6
+ metadata.gz: febe0e0a5d03cf5656e71e77c838e4c3ffb5e32c9fdd4423db0530643cc3d3db5767605795b1bbc1d0761b6104a22ff4c67076b332d0899d6f1ec458ab533355
7
+ data.tar.gz: 81a1c3a2987453fd7f5ccfe4660ba0e71d32189852f803a0cc44bef9d92d0a3c16006995c91f03b2e0e2b7be34a11ac7ec41069d879826c7f8033bd18ca6e269
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ require:
2
+ - rubocop-powerhome
3
+
4
+ Rails:
5
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ gem "cobra_commander", path: "../"
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+ require "rspec/core/rake_task"
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new(:rubocop)
9
+
10
+ task default: %i[spec rubocop]
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/cobra_commander/yarn/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "cobra_commander-yarn"
7
+ spec.version = CobraCommander::Yarn::VERSION
8
+ spec.authors = [
9
+ "Ben Langfeld",
10
+ "Garett Arrowood",
11
+ "Carlos Palhares",
12
+ ]
13
+ spec.email = [
14
+ "blangfeld@powerhrg.com",
15
+ "garett.arrowood@powerhrg.com",
16
+ "carlos.palhares@powerhrg.com",
17
+ ]
18
+ spec.summary = "Tools for working with Component Based Rails Apps"
19
+ spec.description = <<~DESCRIPTION
20
+ Tools for working with Component Based Rails Apps (see https://cbra.info).
21
+ Includes tools for graphing the components of an app and their relationships, as well as selectively
22
+ testing components based on changes made.
23
+ DESCRIPTION
24
+ spec.homepage = "http://tech.powerhrg.com/cobra_commander/"
25
+ spec.license = "MIT"
26
+ spec.required_ruby_version = ">= 2.7.0"
27
+
28
+ spec.metadata["rubygems_mfa_required"] = "true"
29
+ spec.metadata["homepage_uri"] = spec.homepage
30
+ spec.metadata["source_code_uri"] = "https://github.com/powerhome/cobra_commander"
31
+ spec.metadata["changelog_uri"] = "https://github.com/powerhome/cobra_commander/blob/main/cobra_commander-yarn/docs/CHANGELOG.md"
32
+
33
+ # Specify which files should be added to the gem when it is released.
34
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
35
+ spec.files = Dir.chdir(__dir__) do
36
+ `git ls-files -z`.split("\x0").reject do |f|
37
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
38
+ end
39
+ end
40
+ spec.require_paths = ["lib"]
41
+
42
+ spec.add_development_dependency "license_finder", ">= 7.0"
43
+ spec.add_development_dependency "pry"
44
+ spec.add_development_dependency "rake", ">= 12.3.3"
45
+ spec.add_development_dependency "rspec", "~> 3.5"
46
+ spec.add_development_dependency "rubocop", "1.30.1"
47
+ spec.add_development_dependency "rubocop-powerhome", ">= 0.5.0"
48
+ end
@@ -0,0 +1,9 @@
1
+ ---
2
+ - - :inherit_from
3
+ - https://raw.githubusercontent.com/powerhome/oss-guide/master/license_rules.yml
4
+ - - :approve
5
+ - bundler
6
+ - :who: Carlos Palhares <carlos.palhares@powerhrg.com>
7
+ :why: 'Bundler <https://rubygems.org/gems/bundler/versions/1.17.3> is licensed under MIT, but license_finder sometimes fails to resolve that with 1.17.3.'
8
+ :versions: [1.17.3]
9
+ :when: 2022-11-02 20:36:55.617698000 Z
data/docs/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ ## Unreleased
4
+
5
+ ## Version 1.0.0 - 2022-10-15
6
+
7
+ Initial extraction of the Yarn/JS plugin from `cobra_commander`.
data/docs/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # CobraCommander::Yarn
2
+
3
+ CobraCommander::Yarn is the ruby plugin for CobraCommander. It supports loading complex local dependency graphs from Yarn workspaces.
4
+
5
+ ## Installation
6
+
7
+ Add `cobra_commander-yarn` to the `:cobra` group of your Gemfile:
8
+
9
+ ```ruby
10
+ group :cobra do
11
+ gem 'cobra_commander-yarn'
12
+ end
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CobraCommander
4
+ module Yarn
5
+ VERSION = "1.0.0"
6
+ end
7
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require "open3"
5
+ require "pathname"
6
+
7
+ module CobraCommander
8
+ module Yarn
9
+ # Yarn workspace components source for an umbrella
10
+ class Workspace < CobraCommander::Source[:js]
11
+ def packages
12
+ workspace_data.map do |name, spec|
13
+ ::CobraCommander::Package.new(
14
+ self,
15
+ path: path.join(spec["location"]),
16
+ dependencies: spec["workspaceDependencies"].map { |d| untag(d) },
17
+ name: untag(name)
18
+ )
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def workspace_data
25
+ output, error, status = Open3.capture3("yarn workspaces --json info", chdir: path.to_s)
26
+ raise ::CobraCommander::Source::Error, json_data(error) unless status.success?
27
+
28
+ JSON.parse(json_data(output))
29
+ end
30
+
31
+ def json_data(json)
32
+ JSON.parse(json)["data"]
33
+ end
34
+
35
+ def untag(name)
36
+ name&.gsub(%r{^@[\w-]+/}, "")
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cobra_commander/source"
4
+
5
+ require_relative "yarn/version"
6
+ require_relative "yarn/workspace"
7
+
8
+ module CobraCommander
9
+ # CobraCommander Yarn plugin
10
+ module Yarn
11
+ end
12
+ end
data/mkdocs.yml ADDED
@@ -0,0 +1,8 @@
1
+ site_name: Cobra Commander - Yarn
2
+ site_description: Cobra Commander Yarn Documentation
3
+ repo_url: https://github.com/powerhome/cobra_commander
4
+ nav:
5
+ - "Home": "README.md"
6
+ - "Changelog": "CHANGELOG.md"
7
+ plugins:
8
+ - techdocs-core
metadata ADDED
@@ -0,0 +1,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cobra_commander-yarn
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Langfeld
8
+ - Garett Arrowood
9
+ - Carlos Palhares
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2022-12-30 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: license_finder
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '7.0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '7.0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: pry
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rake
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 12.3.3
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 12.3.3
57
+ - !ruby/object:Gem::Dependency
58
+ name: rspec
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '3.5'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.5'
71
+ - !ruby/object:Gem::Dependency
72
+ name: rubocop
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.30.1
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '='
83
+ - !ruby/object:Gem::Version
84
+ version: 1.30.1
85
+ - !ruby/object:Gem::Dependency
86
+ name: rubocop-powerhome
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 0.5.0
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 0.5.0
99
+ description: |
100
+ Tools for working with Component Based Rails Apps (see https://cbra.info).
101
+ Includes tools for graphing the components of an app and their relationships, as well as selectively
102
+ testing components based on changes made.
103
+ email:
104
+ - blangfeld@powerhrg.com
105
+ - garett.arrowood@powerhrg.com
106
+ - carlos.palhares@powerhrg.com
107
+ executables: []
108
+ extensions: []
109
+ extra_rdoc_files: []
110
+ files:
111
+ - ".rspec"
112
+ - ".rubocop.yml"
113
+ - Gemfile
114
+ - Rakefile
115
+ - cobra_commander-yarn.gemspec
116
+ - doc/dependency_decisions.yml
117
+ - docs/CHANGELOG.md
118
+ - docs/README.md
119
+ - lib/cobra_commander/yarn.rb
120
+ - lib/cobra_commander/yarn/version.rb
121
+ - lib/cobra_commander/yarn/workspace.rb
122
+ - mkdocs.yml
123
+ homepage: http://tech.powerhrg.com/cobra_commander/
124
+ licenses:
125
+ - MIT
126
+ metadata:
127
+ rubygems_mfa_required: 'true'
128
+ homepage_uri: http://tech.powerhrg.com/cobra_commander/
129
+ source_code_uri: https://github.com/powerhome/cobra_commander
130
+ changelog_uri: https://github.com/powerhome/cobra_commander/blob/main/cobra_commander-yarn/docs/CHANGELOG.md
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: 2.7.0
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubygems_version: 3.4.1
147
+ signing_key:
148
+ specification_version: 4
149
+ summary: Tools for working with Component Based Rails Apps
150
+ test_files: []