
add-script
npm run add:script -- --args <workspacePath> <scriptName> <scriptFileName>
npx turbo gen script --args <workspacePath> <scriptName> <scriptFileName>
- add-script.ts
Prompt Arguments
Argument | Type | Question / Description |
---|---|---|
workspacePath | autocomplete | Where would you like to add this script? => e.g. features/@app-core |
scriptName | text | What is the script name? => string |
scriptFileName | text | What should we name the script file? => string |
Resulting File Changes
/{workspacePath}/ # <- e.g. 'features/@app-core/' or 'packages/some-package/'
└── scripts/
└── {scriptFileName}.ts ❇️
└── package.json ➕ # <- adds the script to the package.json scripts section
package.json ➕ # <- adds a root package.json script as well
turbo.json ➕ # <- adds a turbo.json monorepo script config entry