add-script
npm run add:scriptInteractive, or with args (positional or named; --args optional):
npm run add:script -- --args <workspacePath> <scriptName> <scriptFileName>npm run add:script -- features/@app-core my:script myScript.ts
npm run add:script -- --workspacePath features/@app-core --scriptName my:script --scriptFileName myScript.ts- 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