2.0.5 • Published 3 months ago

@brokenrubik/ss-build-tools v2.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

SuiteScript Build Tools

Usage on existing projects:

  1. Install dependency in your project (started from ss-template)
npm i -D @brokenrubik/ss-build-tools@latest

Example package.json:

{
  "scripts": {
    "deploy": "ss-deploy",
    "build": "ss-build",
    "watch": "ss-watch"
  }
}

Building

The default TypeScript source path is set to "src/TypeScript". If you want to specify a different path you can either:

  • Use the TS_SOURCE_PATH environment variable
  • Use the --source-path command line argument

For example:

{
  "scripts": {
    "build": "ss-build --source-path src/ts-files"
  }
}

The output of the build command will be be placed in the outDir specified in your tsconfig.json file.

We recomend setting the outDir to "src/FileCabinet/SuiteScripts/<Project Name>".

ss-build -js flag

You can pass the -js flag to the build command to copy files from the src/SuiteScripts directory to the src/FileCAbinet/SuiteScripts directory.

Deploying

Running the deploy command will automatically build, and pass the arguments. You can specify the source path in the same way as the build command.

The files in "src/FileCabinet/SuiteScripts" will be deployed using suitecloud commands.

Watch Mode (Experimental)

Running the watch command will automatically build and deploy on file changes.

This is useful for development, but it is not recommended to use this in production.

The watch mode will incrementally build the TypeScript output, and deploy files that have changed.

You can specify the source path in the same way as the build command. The default is "src/TypeScript".

{
  "scripts": {
    "watch": "ss-watch --source-path src/TypeScript"
  }
}

Prefixing the project's File Cabinet directory

You can use the FILE_PATH environment variable to prefix the project's dir.

For example, if you create a .env file with:

FILE_PATH=my-custom-scripts

Then, only files under src/FileCabinet/SuiteScripts/my-custom-scripts will be deployed.

2.0.5

3 months ago

2.0.4

4 months ago

2.0.3

4 months ago

2.0.2

4 months ago

2.0.1

4 months ago

2.0.0-beta.0

5 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.8-beta.0

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago