{"_id":"@cucwd-prod/frontend-build","name":"@cucwd-prod/frontend-build","dist-tags":{"latest":"9.0.5-maple.3"},"versions":{"9.0.5-maple.3":{"name":"@cucwd-prod/frontend-build","description":"Build tools, setup and config for frontend apps","publishConfig":{"access":"public"},"main":"index.js","bin":{"fedx-scripts":"bin/fedx-scripts.js"},"scripts":{"lint":"eslint . --no-eslintrc -c .eslintrc.js","test":"bash ./smoke-test.sh"},"repository":{"type":"git","url":"git+https://github.com/CUCWD/frontend-build.git"},"keywords":[],"author":{"name":"edX, CUCWD"},"license":"AGPL-3.0","bugs":{"url":"https://github.com/CUCWD/frontend-build/issues"},"homepage":"https://github.com/CUCWD/frontend-build#readme","dependencies":{"@babel/cli":"7.16.0","@babel/core":"7.16.0","@babel/plugin-proposal-class-properties":"7.16.0","@babel/plugin-proposal-object-rest-spread":"7.16.0","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/preset-env":"7.16.4","@babel/preset-react":"7.16.0","@edx/eslint-config":"1.2.0","@edx/new-relic-source-map-webpack-plugin":"1.0.1","@pmmmwh/react-refresh-webpack-plugin":"0.5.3","@svgr/webpack":"5.5.0","autoprefixer":"10.2.6","babel-eslint":"10.1.0","babel-jest":"26.6.3","babel-loader":"8.2.3","babel-plugin-react-intl":"7.9.4","babel-plugin-transform-imports":"2.0.0","babel-polyfill":"6.26.0","clean-webpack-plugin":"3.0.0","css-loader":"5.2.7","cssnano":"5.0.12","dotenv":"8.2.0","dotenv-webpack":"7.0.3","eslint":"6.8.0","eslint-config-airbnb":"18.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-react":"7.19.0","eslint-plugin-react-hooks":"1.7.0","file-loader":"6.2.0","html-webpack-plugin":"5.3.2","identity-obj-proxy":"3.0.0","image-webpack-loader":"8.0.1","jest":"26.6.3","mini-css-extract-plugin":"1.6.2","postcss":"8.4.5","postcss-loader":"6.1.1","postcss-rtlcss":"3.5.1","react-dev-utils":"12.0.0","react-refresh":"0.10.0","resolve-url-loader":"5.0.0-beta.1","sass":"1.26.11","sass-loader":"10.0.5","source-map-loader":"0.2.4","style-loader":"2.0.0","url-loader":"4.1.1","webpack":"5.50.0","webpack-bundle-analyzer":"3.9.0","webpack-cli":"4.10.0","webpack-dev-server":"4.6.0","webpack-merge":"5.2.0"},"peerDependencies":{"react":"^16.14.0 || ^17.0.0"},"version":"9.0.5-maple.3","gitHead":"cbbed7e2ddbbc607811e83e86fdb33d58a5107a9","_id":"@cucwd-prod/frontend-build@9.0.5-maple.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-7gQjAm+4KxwyJtJ2aW6zEweDVhwIYTIzz44r1ffF7UrgQbpr3hX8vN3OPhn2rKQmB0MjGI07uJum7KiFxIhkdw==","shasum":"5f283f245cd0c56ee1e8b647be00a93bd4003cab","tarball":"https://registry.npmjs.org/@cucwd-prod/frontend-build/-/frontend-build-9.0.5-maple.3.tgz","fileCount":222,"unpackedSize":12082730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8qshB1r07iW/Tf49df4bcfEj+FEkK6DunsH9SrDRaPAiAEP3bokIaCxtpUxtNOHcfWDl52b2mxb/bRfwmYjJgoIA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW/TTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMpBAAgiTd9K+dRNi77UHfJOle9BuHuVKWYPl8SfWrZL8k693G0JED\r\n/8gyuOgtE7NuSuITWnvpT4scwGnVJa3xAKzw8glwYfNE2oVTsDZr633+LUUz\r\ntd5/sfo22OI7bFslvvAVRS5P+ak2F5ZtoGif488gIyVcIboHHDCQu6Nx5TNp\r\n7LaJwf4tLmAJlkcFhk82JmdT3ZNjNqyvJax+GE/OSFCqbrZnRI6q9mu0dstZ\r\nkAO3jBLT42klkwCmDiTQm9TW/AsxJY6Pv3Nbn4jJ2pX8V8DwxxGTHKWDU4pM\r\ngWbm4ArL1nrD+v6TR6yEdBKA1Cg+4WHj3ylcd0ZjLrJyC59xJKXS4ZVXy5p/\r\nd306L+RWkJkKpM50HYR4fFaNQsrDXjcQP4KgGKA4bF7uWLpFsDWH/N5PKXxs\r\nG04psWIvqgcPjDeJlS+/u/VybWSXJ1y/DXzy9bdbx+GMX21SwN1LHZFJCyTt\r\nCPwwwadsJbOIq95sf3Bn7UXcrYAj5IAw3JLyGp39nt3QnSJMojsnVB9IKS5I\r\nWhaIyPiw4j7pi2kvzAiw0hkG7/rzl3sTjrkfbSd4JiOiHZP4pdQ15w2oKsyT\r\nl7mb9UoYsvjUGcls44A6CMgjdZexoWacchexg37bZ7ZlcuK5S6nsa1sRNyNH\r\n8mSe5wZRWhyn7FOUdbYWXktBP0BvET2l7OY=\r\n=+9on\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"sc.workforce.development","email":"sc.workforce.development@gmail.com"},"directories":{},"maintainers":[{"name":"sc.workforce.development","email":"sc.workforce.development@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/frontend-build_9.0.5-maple.3_1666970834683_0.45567791887530196"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-28T15:27:14.627Z","9.0.5-maple.3":"2022-10-28T15:27:15.003Z","modified":"2022-10-28T15:27:15.143Z"},"maintainers":[{"name":"sc.workforce.development","email":"sc.workforce.development@gmail.com"}],"description":"Build tools, setup and config for frontend apps","homepage":"https://github.com/CUCWD/frontend-build#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/CUCWD/frontend-build.git"},"author":{"name":"edX, CUCWD"},"bugs":{"url":"https://github.com/CUCWD/frontend-build/issues"},"license":"AGPL-3.0","readme":"frontend-build\n==============\n\n|Build Status| |npm_version| |Codecov| |license|\n\nThe purpose of this package is to provide a common sense foundation and\nsetup for frontend projects including:\n\n- linting (eslint)\n- testing (jest)\n- development server (webpack-dev-server)\n- build (webpack)\n\nThis package can serve as a single dev dependency replacing a large number of\ndev and build dependencies. It aims to provide common sense defaults that\nshould be good for most edX projects out of the box, but can extended or\noverridden where needed.\n\nUsage\n-----\n\nCLI commands are structured: ``fedx-scripts <targetScript> <options>``. Options\nare passed on to the target script, so refer to each target script's cli\ndocumentation to learn what options are available. Example package.json::\n\n  {\n     \"scripts\": {\n        \"build\": \"fedx-scripts webpack\",\n        \"i18n_extract\": \"BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null\",\n        \"lint\": \"fedx-scripts eslint --ext .jsx,.js .\",\n        \"precommit\": \"npm run lint\",\n        \"snapshot\": \"fedx-scripts jest --updateSnapshot\",\n        \"start\": \"fedx-scripts webpack-dev-server --progress\",\n        \"test\": \"fedx-scripts jest --coverage --passWithNoTests\"\n     },\n     \"dependencies\": {\n        ...\n     },\n     \"devDependencies\": {\n        \"@edx/frontend-build\": \"1.0.0\"\n     }\n  }\n\nExtending or Overriding Config Presets\n--------------------------------------\n\nThis package contains a set of configuration presets:\n\n- webpack-prod (or webpack)\n- webpack-dev (or webpack-dev-server)\n- webpack-dev-stage (for running development apps against stage apis)\n- babel\n- babel-preserve-modules\n- jest\n- eslint\n\nIf you need to extend or modify a configuration you can add your\nown configuration files, either by extending frontend-build's\nconfiguration files or supplying your own wholesale.\n\nMethod 1: Extend base config (babel.config.js)::\n\n   const { createConfig } = require('@edx/frontend-build');\n   module.exports = createConfig('babel', {\n      /* option overrides or extensions */\n   });\n\nMethod 2: Custom manipulations (babel.config.js)::\n\n   const { getBaseConfig } = require('@edx/frontend-build');\n   const config = getBaseConfig('babel');\n\n   /* Custom config manipulations */\n\n   module.exports = config;\n\nFrontend build will look in the following locations for configuration\nfiles in your project.\n\n- eslint: ``<project_root>/.eslintrc.js``\n- jest: ``<project_root>/jest.config.js``\n- babel: ``<project_root>/babel.config.js``\n- webpack-prod: ``<project_root>/webpack.prod.config.js``\n- webpack-dev-server: ``<project_root>/webpack.dev.config.js``\n\nYou may specify custom config file locations via the command\nline if you prefer a different location. Example package.json::\n\n  {\n     \"scripts\": {\n        \"build\": \"fedx-scripts webpack --config ./config/webpack.config.js\",\n        \"start:stage\": \"fedx-scripts webpack-dev-server --config webpack.dev-stage.config.js\",\n        ...\n     }\n  }\n\nNote, specifying a custom config location for babel may cause issues with other\ntools in frontend-build. eslint, jest, webpack, and webpack-dev-server configuration\npresets rely upon the babel config and resolve the location of the config file\naccording to the default locations described above. If you need to move the babel\nconfig file to a custom location, you may also need to customize references to its\nlocation in other configuration files. Please reach out to the FedX team if you\nneed to do this and are running into problems.\n\nLocal module configuration for Webpack\n--------------------------------------\n\nThe development webpack configuration allows engineers to create a \"module.config.js\" file containing local module overrides.  This means that if you're developing a new feature in a shared library (@edx/frontend-platform, @edx/paragon, etc.), you can add the local location of that repository to your module.config.js file and the webpack build for your application will automatically pick it up and use it, rather than its node_modules version of the file.\n\n**NOTE: This module.config.js file should be added to your** `.gitignore`.\n\nAn example module.config.js file looks like the following.  You can copy this into your application to use local versions of paragon and frontend-platform::\n\n   module.exports = {\n     /*\n     Modules you want to use from local source code.  Adding a module here means that when this app\n     runs its build, it'll resolve the source from peer directories of this app.\n\n     moduleName: the name you use to import code from the module.\n     dir: The relative path to the module's source code.\n     dist: The sub-directory of the source code where it puts its build artifact.  Often \"dist\".\n     */\n     localModules: [\n       { moduleName: '@edx/brand', dir: '../src/brand-openedx' }, // replace with your brand checkout\n       { moduleName: '@edx/paragon/scss/core', dir: '../src/paragon', dist: 'scss/core' },\n       { moduleName: '@edx/paragon/icons', dir: '../src/paragon', dist: 'icons' },\n       { moduleName: '@edx/paragon', dir: '../src/paragon', dist: 'dist' },\n       { moduleName: '@edx/frontend-platform', dir: '../src/frontend-platform', dist: 'dist' },\n     ],\n   };\n\nSteps\n~~~~~\n\n#. Copy the ``module.config.js`` into your frontend app repository, modifying it as necessary.\n#. Run ``npm install && npm run build`` within any shared NPM package you want to use locally.\n#. Restart your app.\n\nNotes\n~~~~~\n\n* The \"dir\" and \"dist\" keys give you granular control over the shape of your repository's distribution.  Paragon, for instance, needs two separate entries to pick up both JS and SCSS imports.\n* The directory location ``../src`` (relative to the root of your frontend app repository) is recommended for shared NPM package repositories, since it will work whether or not you are running your frontend via devstack. If you are *not* running your frontend via devstack, then you can place your shared libraries anywhere in your file system, updating the \"dir\" key accordingly. To learn more, see `this devstack ADR on local packages`_.\n* This mechanism uses Webpack resolve aliases, as documented here: https://webpack.js.org/configuration/resolve/#resolvealias\n\n.. _this devstack ADR on local packages: https://github.com/edx/devstack/tree/master/docs/decisions/0005-frontend-package-mounts.rst\n\nOverride default .env.development environment variables with .env.private\n-------------------------------------------------------------------------\n\nIn some situations, you may want to override development environment variables defined in .env.development\nwith private environment variables that should never be checked into a repository. For example, a\n.env.development file may contain secrets for a third-party service (e.g., Algolia) that you'd like to use\nduring development but want to ensure these secrets are not checked into Git.\n\nYou may create a `.env.private` with any overrides of the environment settings configured in `.env.development`.\n\n**Note: .env.private should be added to your project's .gitignore so it does not get checked in.**\n\nDevelopment\n-----------\n\nThis project leverages the command line interface for webpack, jest, eslint, and babel.\nBecause of this, local development can be tricky. The easiest way to do local\ndevelopment on this project is to either run scripts inside the project in example\nor to test with an existing project you can do the following:\n\n1. Delete the node_modules directories in the host project:\n   ``rm -rf node_modules/``\n\n2. Move frontend-build inside the host project and delete its node modules folder\n   ``mv ../frontend-build ./ && rm -rf frontend-build/node_modules``\n\n3. Install the development version of frontend-build\n   ``npm i --save-dev @edx/frontend-build@file:./frontend-build``.\n\n.. |Build Status| image:: https://api.travis-ci.com/edx/frontend-build.svg?branch=master\n   :target: https://travis-ci.com/edx/frontend-build\n.. |Codecov| image:: https://img.shields.io/codecov/c/github/edx/frontend-build\n   :target: https://codecov.io/gh/edx/frontend-build\n.. |license| image:: https://img.shields.io/npm/l/@edx/frontend-build.svg\n   :target: https://github.com/edx/frontend-base/blob/master/LICENSE\n.. |npm_version| image:: https://img.shields.io/npm/v/@edx/frontend-build.svg\n","readmeFilename":"README.rst"}