Class: KDirector::Dsls::Children::PackageJsonConfiguration
- Inherits:
-
Object
- Object
- KDirector::Dsls::Children::PackageJsonConfiguration
- Includes:
- KLog::Logging
- Defined in:
- lib/k_director/dsls/children/package_json_configuration.rb
Overview
PackageJson Configuration
Defined Under Namespace
Classes: PackageGroup
Instance Attribute Summary collapse
-
#package_groups ⇒ Object
Returns the value of attribute package_groups.
Instance Method Summary collapse
-
#debug ⇒ Object
rubocop:enable Metrics/MethodLength.
-
#initialize ⇒ PackageJsonConfiguration
constructor
A new instance of PackageJsonConfiguration.
-
#set_default_package_groups ⇒ Object
Setup the default package groups rubocop:disable Metrics/MethodLength.
- #set_package_group(key, description, package_names) ⇒ Object
Constructor Details
#initialize ⇒ PackageJsonConfiguration
Returns a new instance of PackageJsonConfiguration.
30 31 32 |
# File 'lib/k_director/dsls/children/package_json_configuration.rb', line 30 def initialize @package_groups = {} end |
Instance Attribute Details
#package_groups ⇒ Object
Returns the value of attribute package_groups.
28 29 30 |
# File 'lib/k_director/dsls/children/package_json_configuration.rb', line 28 def package_groups @package_groups end |
Instance Method Details
#debug ⇒ Object
rubocop:enable Metrics/MethodLength
111 112 113 |
# File 'lib/k_director/dsls/children/package_json_configuration.rb', line 111 def debug log.structure(package_groups, convert_data_to: :open_struct) end |
#set_default_package_groups ⇒ Object
Setup the default package groups rubocop:disable Metrics/MethodLength
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/k_director/dsls/children/package_json_configuration.rb', line 40 def set_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]) set_package_group('semver-ruby' , 'Semantic Release for Ruby' , %w[ semantic-release @semantic-release/changelog @semantic-release/git @klueless-js/semantic-release-rubygem@github:klueless-js/semantic-release-rubygem ]) set_package_group('semver-nuxt' , 'Semantic Release for Nuxt' , %w[ semantic-release @semantic-release/changelog @semantic-release/git ]) set_package_group('tailwind-nuxt' , 'TailwindCSS for Nuxt' , %w[ tailwindcss@latest postcss@latest autoprefixer@latest ]) set_package_group('svelte', 'Svelte' , %w[ @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup rollup-plugin-css-only rollup-plugin-livereload rollup-plugin-svelte rollup-plugin-terser svelte ]) # { # "name": "svelte-app", # "version": "1.0.0", # "scripts": { # "build": "rollup -c", # "dev": "rollup -c -w", # "start": "sirv public" # }, # "devDependencies": { # "@rollup/plugin-commonjs": "^16.0.0", # "@rollup/plugin-node-resolve": "^10.0.0", # "rollup": "^2.3.4", # "rollup-plugin-css-only": "^3.0.0", # "rollup-plugin-livereload": "^2.0.0", # "rollup-plugin-svelte": "^7.0.0", # "rollup-plugin-terser": "^7.0.0", # "svelte": "^3.0.0" # }, # "dependencies": { # "sirv-cli": "^1.0.0" # } # } set_package_group('storybook-nuxt' , 'Storybook for (Vite/Nuxt)' , %w[ @storybook/[email protected] @storybook/[email protected] @storybook/[email protected] storybook-builder-vite ]) # Currently these two need to be forced # @storybook/[email protected] # @storybook/[email protected] end |
#set_package_group(key, description, package_names) ⇒ Object
34 35 36 |
# File 'lib/k_director/dsls/children/package_json_configuration.rb', line 34 def set_package_group(key, description, package_names) package_groups[key] = PackageGroup.new(key, description, package_names) end |