Class: Rolemodel::Yarn

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/rolemodel/yarn.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rolemodel/yarn.rb', line 12

def setup
  # Configure the node-modules linker so webpack, Playwright, and the Rails
  # asset pipeline keep working (Yarn 4 defaults to Plug'n'Play otherwise).
  # skip if exists? to avoid overwriting any other existing config
  create_file '.yarnrc.yml', "nodeLinker: node-modules\n", skip: true

  yes! 'yarn set version stable'
  yes! 'corepack enable'
  yes! 'yarn init'

  ignore_yarn_install_state
end