{"id":25023695,"url":"https://github.com/xh/hoist-dev-utils","last_synced_at":"2025-04-13T09:10:35.181Z","repository":{"id":32637069,"uuid":"125289779","full_name":"xh/hoist-dev-utils","owner":"xh","description":"🏗️🔨 Build tooling for Hoist React","archived":false,"fork":false,"pushed_at":"2025-04-04T15:53:26.000Z","size":3497,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-04-11T21:57:04.673Z","etag":null,"topics":["devops","javascript","react","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-15T00:14:08.000Z","updated_at":"2025-01-08T14:56:30.000Z","dependencies_parsed_at":"2024-03-15T03:03:11.391Z","dependency_job_id":"e2d84e78-c1ec-4647-b4c1-12957e5f08b3","html_url":"https://github.com/xh/hoist-dev-utils","commit_stats":null,"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xh%2Fhoist-dev-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xh%2Fhoist-dev-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xh%2Fhoist-dev-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xh%2Fhoist-dev-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xh","download_url":"https://codeload.github.com/xh/hoist-dev-utils/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688565,"owners_count":21145766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","javascript","react","webpack"],"created_at":"2025-02-05T15:18:45.087Z","updated_at":"2025-04-13T09:10:35.161Z","avatar_url":"https://github.com/xh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛠️ Hoist Dev Utils\n\nTooling for building and deploying web applications built on the Hoist React platform. This\nrepository is made available as the `@xh/hoist-dev-utils`\n[package on npm](https://www.npmjs.com/package/@xh/hoist-dev-utils) for import and use by\napplications.\n\n### Shared development dependencies\n\nThe package.json file in this repository specifies a set of development dependencies required for\nbuilding Hoist React applications. Those applications can specify `@xh/hoist-dev-utils` as a dev\ndependency and transitively bring in libs for Webpack and all associated plugins used in app builds,\nincluding Webpack Dev Server, Babel, and other essential loaders.\n\nIn most cases this package could be the _only_ dev dependency required by Hoist React apps, although\napps might wish to configure additional tooling such as stylelint (for linting SASS files) or\nlint-staged and husky (for running linters as a pre-commit git hook). See the\n[Toolbox package.json](https://github.com/xh/toolbox/blob/develop/client-app/package.json) for\nexamples of these libraries in action.\n\n### Webpack configuration\n\nThe configureWebpack.js module exports a single `configureWebpack()` method that can be used to\noutput a complete Webpack configuration. This includes support for transpiling and bundling multiple\nclient application entry points with preconfigured loaders for JS code (Babel), styles\n(CSS/SASS/PostCSS) and HTML index file generation. See the docs within that file for supported\narguments and additional details.\n\nThe generated Webpack configuration also sets the value of several XH globals within the built JS\ncode, via the Webpack DefinePlugin. These include `XH.appCode` and `XH.appName` (both required),\n`XH.appVersion` (typically set as part of the build) and similar.\n\nThe intention is to reduce application webpack config files to a minimal and manageable subset of\noptions. An example of such a file would be:\n\n```javascript\nconst configureWebpack = require('@xh/hoist-dev-utils/configureWebpack');\n\nmodule.exports = (env = {}) =\u003e {\n    return configureWebpack({\n        appCode: 'myApp',\n        appName: 'My Application',\n        appVersion: env.appVersion || '1.0-SNAPSHOT',\n        favicon: './public/favicon.svg',\n        devServerOpenPage: 'app/',\n        ...env\n    });\n};\n```\n\nNote that additional env variables can be provided at build time, so the application file can\nspecify initial defaults (such as appVersion above, checked in as a SNAPSHOT) that are then\noverridden for particular builds (e.g. via `webpack --env prodBuild --env appVersion=1.2.3` to cut a\nversioned 1.2.3 release).\n\nSee the [Hoist React docs](https://github.com/xh/hoist-react/blob/develop/docs/build-and-deploy.md)\nfor step-by-step details on the build process.\n\n### Favicons\n\nTo include a favicon with your app, provide the `favicon` option to `configureWebpack()`. This can be either\na `png` or an `svg` file:\n\n```javascript\nreturn configureWebpack({\n    ...,\n    favicon: './public/favicon.svg',\n    ...\n});\n```\n\nIf your app is intended to be used on mobile devices, you may want to also include a wider variety of favicons.\nThe following files will be automatically bundled in your app's manifest.json if they are found in your project's\n`/client-app/public` folder:\n\n+ `favicon-192.png` (192px x 192px)\n+ `favicon-512.png` (512px x 512px)\n+ `apple-touch-icon.png` (180px x 180px)\n\nYou can use the `svg-favicon.sh` script to automatically create these favicons from a square SVG. Note that this script\nrequires inkscape to be installed. Download the latest version from [https://inkscape.org/](https://inkscape.org/) or\ninstall on Mac via Homebrew with `brew install inkscape`.\n\nInkscape includes a command-line interface which is leveraged by the script. In order for the script to be able to use\nit, you must first symlink Inkscape to `/usr/local/bin`. (Note this step is _not_ required if you have installed via\nHomebrew.)\n\n```shell\nln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \\\n/usr/local/bin/inkscape\n```\n\nThen run the script, passing a path to the SVG file as the argument. The command below assumes that you have \n`hoist-dev-utils` checked out as a sibling of your top-level project directory, and that you are running the command \nfrom within `$projectDir/client-app/public`: \n\n```shell\n../../../hoist-dev-utils/svg-favicon.sh favicon.svg\n```\n\n### ESLint Configuration\n\n✨ This package includes a development dependency on the `@xh/eslint-config` package.\n[That package](https://github.com/xh/eslint-config) exports an eslint configuration object with\nExHI's coding conventions and best practices for Hoist React based development.\n\nApplications that already have `@xh/hoist-dev-utils` as a dependency can use these rules for their\nown ESLint config by specifying their `.eslintrc` file as simply:\n\n```\n{\n  \"extends\": [\"@xh/eslint-config\"]\n}\n```\n\nIf required, rules and other settings extended from this base configuration can be overridden at the\napp level.\n\n### Hoist Dev Utils Development\n\nTo develop improvements to this library, clone its repo into your workspace alongside a project \nthat uses Hoist-React, like [Toolbox](https://github.com/xh/toolbox).  Then follow the instructions for \n[yarn link](https://classic.yarnpkg.com/lang/en/docs/cli/link/) to symlink to this repo.\n\n------------------------------------------\n\n☎️ info@xh.io | \u003chttps://xh.io\u003e\n\nCopyright © 2024 Extremely Heavy Industries Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxh%2Fhoist-dev-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxh%2Fhoist-dev-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxh%2Fhoist-dev-utils/lists"}