diff --git a/CHANGELOG.md b/CHANGELOG.md index c94a9807..424f1484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.2 (March 13, 2024) + +* Updated docs to cover the latest commands of `enact pack`. + ## 6.1.1 (March 5, 2024) * Updated dependencies. diff --git a/commands/pack.js b/commands/pack.js index ecd68f3b..398eb4f6 100755 --- a/commands/pack.js +++ b/commands/pack.js @@ -38,7 +38,7 @@ function displayHelp() { console.log(' -i, --isomorphic Use isomorphic code layout'); console.log(' (includes prerendering)'); console.log(' -l, --locales Locales for isomorphic mode; one of:'); - console.log(' Locale list'); + console.log(' Locale list'); console.log(' - Read locales from JSON file'); console.log(' "none" - Disable locale-specific handling'); console.log(' "used" - Detect locales used within ./resources/'); diff --git a/docs/building-apps.md b/docs/building-apps.md index ed3a9b27..53d6fd00 100644 --- a/docs/building-apps.md +++ b/docs/building-apps.md @@ -8,14 +8,15 @@ order: 4 enact pack [options] Options + -o, --output Specify an output directory --content-hash Add a unique hash to output file names based on the content of an asset + -w, --watch Rebuild on file changes -p, --production Build in production mode -i, --isomorphic Use isomorphic code layout (includes prerendering) - -w, --watch Rebuild on file changes -l, --locales Locales for isomorphic mode; one of: - Locale list - - Read locales from JSON file + [comma-separated-values] Locale list + [JSON-filepath] - Read locales from JSON file "none" - Disable locale-specific handling "used" - Detect locales used within ./resources/ "tv" - Locales supported on webOS TV @@ -23,14 +24,18 @@ order: 4 "all" - All locales that iLib supports -s, --snapshot Generate V8 snapshot blob (requires V8_MKSNAPSHOT set) + -m, --meta JSON to override package.json enact metadata -c, --custom-skin Build with a custom skin --stats Output bundle analysis file + --verbose Verbose log build details + -v, --version Display version information + -h, --help Display help information ``` Run within an Enact project's source code, the `enact pack` command (aliased as `npm run pack` or `npm run pack-p` for production) will process and bundle the js, css, and asset files into the `./dist` directory. An **index.html** file will be dynamically generated. ## Production Mode -By default, projects will build in development mode. When you're code is ready for deployment you can build in production mode. Production mode will minify the source code and remove dead code, along with numerous other minor code optimization strategies. +By default, projects will build in development mode. When your code is ready for deployment you can build in production mode. Production mode will minify the source code and remove dead code, along with numerous other minor code optimization strategies. ## Browser Support & Polyfills The Enact CLI is designed to be compatible with a wide array of browsers and devices. [Browserslist standard](https://github.com/browserslist/browserslist) is used to handle targeting, with Enact's defaults being: @@ -249,3 +254,25 @@ Similar to the [`enact serve`](./serving-apps.md) command, the watcher will buil ## Stats Analysis The Bundle analysis file option uses the popular [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) to create a visual representation of the project build to **stats.html**, showing the full module hierarchy arranged by output size. This can be very useful in determining where bloat is coming from or finding dependencies that may have been included by mistake. + +## Override Metadata +The @enact/cli tool inspects the `enact` object in the project's package.json for [customization options](./starting-a-new-app.md#enact-project-settings). +You can use the `--meta` flag to input a JSON string that overrides the `enact` metadata in package.json. + +Here's an example of how to use the `--meta` flag: + +```bash +enact pack --meta='{"title":"myapp"}' +``` + +This command has the same effect as adding the following to your package.json: + +```json +{ + ... + "enact": { + "title": "myapp" + } + ... +} +``` \ No newline at end of file diff --git a/docs/serving-apps.md b/docs/serving-apps.md index 82b5c4a3..f64821d5 100644 --- a/docs/serving-apps.md +++ b/docs/serving-apps.md @@ -21,7 +21,7 @@ Enact CLI uses [http-proxy-middleware](https://github.com/chimurai/http-proxy-mi This feature can be configured in the project's **package.json** within the `enact` object's `proxy` property. For example: -```js +```json { ... "enact": { diff --git a/docs/starting-a-new-app.md b/docs/starting-a-new-app.md index 10f7e581..46ecfab3 100644 --- a/docs/starting-a-new-app.md +++ b/docs/starting-a-new-app.md @@ -38,7 +38,7 @@ The @enact/cli tool will check the project's **package.json** looking for an opt * `proxy` _[string]_ - Proxy target during project `serve` to be used within the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware). For example: -```js +```json { ... "enact": { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index aa8c7b9d..a088838d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "@enact/cli", - "version": "6.1.1", + "version": "6.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@enact/cli", - "version": "6.1.1", + "version": "6.1.2", "license": "Apache-2.0", "dependencies": { "@babel/plugin-transform-modules-commonjs": "^7.23.3", diff --git a/package.json b/package.json index 443fc65a..4061b24c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@enact/cli", - "version": "6.1.1", + "version": "6.1.2", "description": "Full-featured build environment tool for Enact applications.", "main": "index.js", "author": "Jason Robitaille ",