Class: KBuilder::PackageJson::Configuration
- Inherits:
-
BaseConfiguration
- Object
- BaseConfiguration
- KBuilder::PackageJson::Configuration
- Defined in:
- lib/k_builder/package_json/configuration.rb
Overview
Configuration class
Instance Attribute Summary collapse
-
#package_groups ⇒ Object
Returns the value of attribute package_groups.
Instance Method Summary collapse
- #default_package_groups ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_package_group(key, description, package_names) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 |
# File 'lib/k_builder/package_json/configuration.rb', line 14 def initialize super() @package_groups = {} end |
Instance Attribute Details
#package_groups ⇒ Object
Returns the value of attribute package_groups.
12 13 14 |
# File 'lib/k_builder/package_json/configuration.rb', line 12 def package_groups @package_groups end |
Instance Method Details
#default_package_groups ⇒ Object
23 24 25 26 27 28 |
# File 'lib/k_builder/package_json/configuration.rb', line 23 def default_package_groups set_package_group('webpack', 'Webpack V5', %w[webpack webpack-cli webpack-dev-server]) set_package_group('swc', 'SWC Transpiler', %w[@swc/cli @swc/core swc-loader]) set_package_group('babel', 'Babel Transpiler', %w[@babel/core @babel/cli @babel/preset-env babel-loader]) set_package_group('typescript', 'Typescript', %w[typescript ts-loader]) end |
#set_package_group(key, description, package_names) ⇒ Object
19 20 21 |
# File 'lib/k_builder/package_json/configuration.rb', line 19 def set_package_group(key, description, package_names) package_groups[key] = PackageGroup.new(key, description, package_names) end |