From c57a2dbe07e467cc8d604def860c7970475492f5 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 27 Mar 2023 12:45:27 +0000 Subject: [PATCH] Update 2 files - /home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl --- ...e_after_26-system-vscode-node-modules.tmpl | 49 +++++++++++++++++++ ...n_onchange_after_26-vscode-extensions.tmpl | 29 ++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl index 04f17871..8090d703 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl @@ -1,5 +1,54 @@ {{- if (ne .host.distro.family "windows") -}} #!/usr/bin/env bash +# @file run_onchange_after_26-system-vscode-node-modules.tmpl +# @brief Installs NPM packages to the system `/` directory as a catch-all for tools that recursively search upwards for shared NPM configurations. +# @description +# This script makes fallback linter and code auto-fixer configurations globally available. Normally, configurations, like +# the ones used for ESLint, are installed at the project level by specifying the NPM package configuration +# in the `package.json` file (or via an `.eslintrc` file). However, whenever no configuration is present, IDEs like +# Visual Studio Code will recursively search upwards in the directory tree, trying to find an ESLint configuration. +# +# This script addresses this issue by installing a set of shared NPM packages that enhance the functionality of tools like ESLint +# by placing a `package.json` with all the necessary settings into the highest directory possible and then installing the package's +# modules. This normally results in a `package.json` file and `node_modules/` folder at the root of the system. +# +# ## NPM Packages Included +# +# To reduce clutter, all the configurations are mapped out in the `package.json` file. Our default `package.json` file includes +# the following configuration: +# +# ```json +# +# { +# ... +# // Notable dependencies listed below +# "dependencies": { +# "eslint-config-strictlint": "latest", +# "jest-preset-ts": "latest", +# "prettier-config-strictlint": "latest", +# "remark-preset-strictlint": "latest", +# "stylelint-config-strictlint": "latest" +# }, +# ... +# } +# +# ``` +# +# ## Strict Lint +# +# More details on the shared configurations can be found at [StrictLint.com](https://strictlint.com). +# Strict Lint is another brand maintained by Megabyte Labs that is home to many of the well-crafted +# shared configurations that are included in our default NPM configuration fallback settings. +# +# ## Notes +# +# * If the system root directory is not writable (even with `sudo`), then the shared modules are installed to the provisioning user's `$HOME` directory +# +# ## Links +# +# * [`run_onchange_after_26-system-vscode-node-modules.tmpl`](https://github.com/megabyte-labs/install.doctor/blob/master/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.tmpl) +# * [`package.json` configuration file](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/Code/User/package.json) +# * [StrictLint.com documentation](https://strictlint.com/docs) {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }} diff --git a/home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl index 013cb441..411b64da 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl @@ -1,5 +1,32 @@ -{{- if (eq .host.distro.family "linux") -}} +{{- if (ne .host.distro.family "windows") -}} #!/usr/bin/env bash +# @file run_onchange_after_26-vscode-extensions.tmpl +# @brief Installs all of the Visual Studio Code extensions specified in the [`home/dot_config/Code/User/extensions.json`](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/Code/User/extensions.json) file. +# @description +# This script loops through all the extensions listed in the [`home/dot_config/Code/User/extensions.json`](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/Code/User/extensions.json) +# file. It installs the extensions when either Visual Studio Code or VSCodium is installed. If both are installed, then both will +# have the plugins automatically installed. +# +# The `extensions.json` file is used to house the plugin list so that if you decide to remove this auto-installer script then +# VSCode will retain some functionality from the file. It will show a popover card that recommends installing any plugins in the +# list that are not already installed. +# +# ## Plugin Settings +# +# Most of the plugin settings have been configured and optimized to work properly with the other default settings +# included by Install Doctor. These settings can be found in the [`home/dot_config/Code/User/settings.json` file](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/Code/User/settings.json). +# If you manage to come up with an improvement, please open a pull request so other users can benefit from your work. +# +# ## Default Extensions +# +# The default plugins in the `extensions.json` list are catered mostly towards full-stack web development. The technologies +# that are catered to by the default extensions relate to TypeScript, JavaScript, Go, Python, Rust, and many more technologies. +# Most of the plugins are not language-specific. +# +# ## Links +# +# * [`run_onchange_after_26-vscode-extensions.tmpl`](https://github.com/megabyte-labs/install.doctor/blob/master/home/.chezmoiscripts/universal/run_onchange_after_26-vscode-extensions.tmpl) +# * [Visual Studio Code settings folder](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/Code/User) {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }}