Détail du package

@ngx-rocket/scripts

ngx-rocket28.4kMIT5.2.3

Support scripts for ngX-Rocket projects

ngx, rocket, angular, cli

readme

:rocket: ngx-rocket/scripts

NPM version Build Status Node version XO code style License

Support scripts for ngX-Rocket projects.

In order to simplify the workflow of applications generated with ngX-Rocket generator, we made this repo to gather all additional scripts and build tools.

Since this module is an independant package, you can even use for projects not built from ngX-Rocket if you find it useful.

Installation

npm install --save @ngx-rocket/scripts

Usage

This modules provides CLI commands to be used in NPM scripts, along with some Cordova hooks (see hooks folder).

Export environment variables to a JSON or JavaScript file

ngx-scripts env <env_var> [<env_var2> ...] [--out <file>] [--format json|js] [--parse-json]

Default output file is src/environments/.env.ts with JavaScript format.

Execute Cordova commands

ngx-scripts cordova <command> [options] [-- <cordova_options>]

Unless the --fast option is provided, the Angular app is rebuilt before executing the command, using npm run build. Any accepted Cordova option can be passed through after --.

Options

  • --app: The name of the Angular app to build. Only useful if you have a workspace with multiples apps.
  • --fast: Skip Angular app rebuild
  • --base-href <ref>: Change application base URL (default is ./)
  • --copy <path>: Copy built apps to the specified path (only works with cordova build)
  • --dev: Build Angular app in dev mode (default is prod)
  • -c, --configuration <name>: Target Angular CLI configuration for npm run build
  • --device: Deploy Cordova build to a device
  • --emulate: Deploy Cordova build to an emulator
  • --debug: Create a Cordova debug build
  • --release: Create a Cordova release build
  • --verbose: Show Cordova debug output
  • --yarn: Use Yarn instead of NPM to run the build script
  • --parse-json: During env, if an environment variable's value is parsable JSON, it will be a proper object in .env.ts

Note: Yarn is automatically used instead of NPM if the environment variable NGX_PACKAGE_MANAGER is set to yarn or if the current project was generated with ngX-Rocket using Yarn option (option is saved in .yo-rc.json).

Examples

ngx-scripts cordova prepare
ngx-scripts cordova run ios --dev --debug --emulate
ngx-scripts cordova build ios --configuration production --device --release -- --developmentTeam="ABCD" --provisioningProfile="UUID"
`

Clean Cordova (platforms, plugins) and dist folders

clean [--cordova] [--dist] [--path <path>]

Options

  • --cordova: Remove only Cordova folders
  • --dist: Remove only dist folder
  • --path <path>: Remove only specified path

License

MIT

changelog

5.2.3 (2022-11-28)

chore

  • update min node version (16b06f5)

BREAKING CHANGES

  • Minimum supported Node.js version is now >=14

5.2.2 (2022-08-24)

5.2.1 (2021-12-10)

Bug Fixes

  • incorrect android build path (0d4374e)

5.2.0 (2021-12-10)

Features

  • add support for cordova-android 10 (edb0454)

5.1.2 (2021-11-30)

5.1.1 (2021-07-20)

chore

BREAKING CHANGES

  • Requires Node >= 12

5.1.0 (2021-03-12)

Features

  • add option to parse JSON in environment variables (#24) (7f2c532)

5.0.0 (2021-01-08)

  • chore!: fix incorrect version number (67031d4)

BREAKING CHANGES

  • Just to force correct release version

4.0.0 (2021-01-08)

  • chore!: fix incorrect version number (67031d4)

BREAKING CHANGES

  • Just to force correct release version

3.1.0 (2021-01-08)

Bug Fixes

  • changed env's default export to named export (691f10c)
  • make env handle null with noImplicitAny (fc4a71d)

chore

Features

BREAKING CHANGES

  • requires Node.js version >= 10.0.0

4.0.0

  • BREAKING CHANGE: requires Node.js version >= 8.0.0
  • BREAKING CHANGE: env command now generates an explicit export instead of a default export
  • BREAKING CHANGE: remove unpin-ionic-dependencies command, as it's no longer needed for Ionic@4

3.0.4

  • Bump dependencies and fix vulnerabilities

3.0.3

  • Allow env to add undefined env vars (fixes #8)

3.0.2

  • Replaced eslint by XO and updated dependencies

3.0.1

  • Fixed clean command for angular/cli@6

3.0.0

  • BREAKING CHANGE: changed --env to --configuration, to match angular-cli@6 changes
  • Fixed --dev option
  • Updated dependencies

2.2.0

  • Added compatibility with cordova-android@7

2.1.0

2.0.0

  • BREAKING CHANGE: renamed env2json script to env and changed its default behavior to export to a .ts file

1.1.0

1.0.5

1.0.3

  • Properly fixed extra resources copy

1.0.2

  • Fixed extra resources copy on Windows

1.0.1

1.0.0

  • Initial release