sfdx-ngx-plugin
v0.2.0-beta.6
Published
SFDX plugin for Angular apps deployment on Salesforce
Downloads
50
Maintainers
Readme
sfdx-ngx-plugin
SFDX plugin for Angular apps deployment on Salesforce
Prerequesites
Installation
Install as plugin
sfdx plugins:install sfdx-ngx-plugin
Install from source
- Clone repository
[email protected]:rzhigalov/sfdx-ngx-plugin.git
- Open cloned folder
cd path/to/cloned/repo
- Install npm modules
npm install
oryarn install
- Link the plugin
sfdx plugins:link .
Usage
General flow
Setup SFDX project e.g.
sfdx force:project:create -n ProjectName --template standard
)Create scratch org or configure persistent instance
Initialize Angular project
e.g.ng new my-shiny-metal-project
/** * ⚠️ If you use routing in Angular app, than configure it to use URL fragment strategy * This is required as you can't override Salesforce routing resolution */ RouterModule.forRoot(ROUTES, { useHash: true, ... });
Run
sfdx ngx:init
and follow the prompts(optional) Configure
vf.template.page
with controller and Visualforce page appearanceRun
sfdx ngx:build
Deploy code to Salesforce (
sfdx force:source:deploy
orsfdx force:source:push
)
Commands
sfdx ngx:init`
Initializes files and settings for plugin
USAGE
$ sfdx ngx:init [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation
EXAMPLE
$ sfdx ngx:init
Starts plugin configuration wizard
sfdx ngx:build
Builds Angular project and packs for SFDC deployment
USAGE
$ sfdx ngx:build [-b <string>] [-m npm|yarn|pnpm] [-p <directory>] [--ngproject <directory>] [-t <directory>] [--sfdcpage <string>] [--sfdcresource <string>] [--apiversion <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
-b, --buildcmd=buildcmd Angular build command
-m, --packagemanager=(npm|yarn|pnpm) Used package manager (npm, yarn, pnpm)
-p, --ngpath=ngpath Relative path to Angular project (folder with angular.json)
-t, --sfdcpath=sfdcpath Relative path to SFDC target dir
--apiversion=apiversion SFDC API version
--ngproject=ngproject Angular Project name
--sfdcpage=sfdcpage SFDC Static Visualforce page name
--sfdcresource=sfdcresource SFDC Static Resource name
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation
EXAMPLES
# Uses initialized plugin settings
$ sfdx ngx:build
=== Building Angular project for SFDC
...
Creating Angular SFDC application... Done
Angular project built and packed for SFDC deployment!
# Flag overrides take precedence over plugin settings
# After plugin will finish execution you will be offered to update plugin settings
$ sfdx ngx:build
-b build:sfdc (--buildcmd=build:commandname)
-m yarn (--packagemanager=(npm|yarn|pnpm))
-p client (--ngpath=relative/path/to/angular-app)
-t forceApp/main/ngApp (--sfdcpath=relative/path/to/sfdc-folder)
--apiversion 42.0
--ngproject ng-app-name
--sfdcpage PageName
--sfdcresource StaticResourceName