-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scripts): Args type for script arguments (#11946)
- Loading branch information
Showing
6 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- feat(scripts): Args type for script arguments (#11946) by @Tobbe | ||
|
||
Generated scripts will now come with an `Args` interface that you can add your | ||
arguments to for better TS support. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
packages/cli/src/commands/generate/script/templates/script.js.template
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/cli/src/commands/generate/script/templates/script.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Append api/* to import from api and web/* to import from web | ||
|
||
// To access your database uncomment the line below | ||
// import { db } from 'api/src/lib/db' | ||
|
||
interface Args { | ||
_: string[] | ||
[key: string]: unknown | ||
} | ||
|
||
export default async ({ args }: Args) => { | ||
// Your script here... | ||
console.log(':: Executing script with args ::') | ||
console.log(args) | ||
} |