README.md in sewing_kit-0.122.1 vs README.md in sewing_kit-0.123.0

- old
+ new

@@ -17,10 +17,16 @@ yarn dev up ``` +### Run generator + +`rails generate sewing_kit:install` + +will generate a package.json file with common sewing-kit script tasks, default lint, format configuration; a sewing-kit configuration file, and other project default configurations. + ### Add JavaScript sewing_kit looks for JavaScript in `app/ui/index.js`. The code in `index.js` (and any imported JS/CSS) will be built into a `main` bundle. ### Link to JS/CSS with `erb` Helpers @@ -144,11 +150,11 @@ ### How can I fix production builds that are failing due to missing devDependencies? By moving everything into `package.json#dependencies`. This is necessary because Rails 5.2 prunes `devDependencies` during asset compilation. -### How can I test a production verison of my changes? +### How can I test a production version of my changes? Ideally, by deploying to a `staging` environment. If that is not possible, a production-like local development experience is available via: ```sh NODE_ENV=production SK_SIMULATE_PRODUCTION=1 bundle exec rake assets:precompile @@ -174,5 +180,17 @@ ```ruby SewingKit.configure do |config| config.log_level = :warn # may be `:inherit`, `:debug`, `:info`, `:warn`, or `:error` end ``` + +### How do I run sewing-kit in debug mode? + +You can launch sewing-kit in debug mode by setting the `SK_DEBUG` environment flag. + +```bash +$ SK_DEBUG=1 dev run +``` + +This runs your rails app with the sewing-kit development server in debug mode. This is useful for when you want to debug sewing-kit from a rails app. + +Tip: Install the [Node.js V8 --inspector Manager (NiM)](https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj?hl=en) Chrome extension. This will launch a chrome debugger automatically for you.