sdfx

1.0.36 • Public • Published

sdfx

Extra SDF commands for your project.

npm version license

Introduction

sdfx is a utility package providing additional commands for SuiteScript Development Framework (SDF) projects. It aims to streamline and enhance your SDF workflow.

Features

  • Additional commands for managing SDF objects and files
  • Simplified import and update processes
  • Branch protection and validation before commits or deployments

Installation

To install sdfx, you need to have Node.js and npm installed on your machine.

  1. Install Husky (if not already installed):

    npm install husky --save-dev
  2. Initialize Husky:

    npx husky init
  3. Install sdfx:

    npm install sdfx

Usage

After installation, you can use the additional SDF commands provided by sdfx. Once sdfx is installed, you should be able to see the new commands in your package.json file. Additionally, branches named "main" or "master" will be automatically protected. This means that every commit to these branches will require a successful validation.

Commands

npm run validate

Executes

suitecloud project:deploy --dryrun

Description

This command runs a dry run deployment to validate your project against the current account. It helps ensure that all configurations and customizations in your SuiteScript Development Framework (SDF) project are correct and compatible with the target account. By performing a dry run, you can identify and address any potential issues before performing an actual deployment, reducing the risk of errors during the deployment process.

npm run deploy

Executes

suitecloud project:deploy --dryrun && suitecloud project:deploy && npm run sdf:create:checkpoint

Description

This command runs a validation, deploys the project, and then creates a "checkpoint." The checkpoint is a commit that includes the name of the account and a timestamp in the following format:

Account: <account_name> | Checkpoint: <timestamp>

This ensures that the project is validated and deployed successfully, and a historical record of the deployment is maintained for reference and rollback purposes.

npm run sdf:files:update

Executes

The import-files script.

Description

This command allows you to update all files in a project at once by executing the import-files script. This ensures that all the latest changes are imported and synchronized with the project files, streamlining the update process.

npm run sdf:objects:update

Executes

The update-objects script.

Description

This command updates all objects in a project at once by executing the update-objects script. It ensures that all the latest changes to objects are imported and synchronized with the project, streamlining the update process.

npm run sdf:update:all

Executes

The update-objects script and then the import-files script.

Description

This command combines the update-objects script and the import-files script to update both objects and files in the project. It ensures that all changes to objects and files are imported and synchronized with the project, streamlining the update process by handling everything together.

npm run sdf:create:checkpoint

Executes

npm run sdf:update:all

and then executes the commit-changes script.

Description

This command first runs npm run sdf:update:all, which updates both objects and files in the project. It then executes the commit-changes script, which creates a commit message containing the name of the account and a timestamp. Additionally, if the current branch is protected (main/master by default), it will run the pre-commit validation to ensure all changes meet the required standards before committing.

npm run sdf:create:branch

Executes

The create-branch script.

Description

This command executes the create-branch script, which automates the process of creating a new branch in the project. The script performs the following steps:

  1. Runs npm run sdf:create:checkpoint to create an initial checkpoint.
  2. Prompts the user to specify the purpose of the branch (either "feature" or "fix").
  3. Prompts the user to provide the name for the new branch.
  4. Creates the new branch using the specified purpose and name.
  5. Prompts the user to select the account from which the new branch will be updated by running suitecloud account:setup -i.
  6. Runs npm run sdf:create:checkpoint again to create a checkpoint for the new branch.

The commit-changes script creates a commit message with the account name and a timestamp. If the current branch is protected (main/master by default), it will run the pre-commit validation.

Readme

Keywords

none

Package Sidebar

Install

npm i sdfx

Weekly Downloads

24

Version

1.0.36

License

ISC

Unpacked Size

179 kB

Total Files

16

Last publish

Collaborators

  • luissimosa199