-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
63abb4a
commit b9db53b
Showing
3 changed files
with
73 additions
and
0 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,21 @@ | ||
/** | ||
* @file Unit Tests - Scripts | ||
* @module pkg-types/interfaces/tests/Scripts | ||
*/ | ||
|
||
import type { JsonObject } from '@flex-development/tutils' | ||
import type TestSubject from '../scripts' | ||
|
||
describe('unit:interfaces/Scripts', () => { | ||
it('should allow empty object', () => { | ||
assertType<TestSubject>({}) | ||
}) | ||
|
||
it('should be json object', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<JsonObject>() | ||
}) | ||
|
||
it('should only have string values', () => { | ||
expectTypeOf<TestSubject[string]>().toBeString() | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @file Interfaces - Scripts | ||
* @module pkg-types/interfaces/Scripts | ||
*/ | ||
|
||
import type { JsonObject } from '@flex-development/tutils' | ||
|
||
/** | ||
* Package lifecycle scripts. | ||
* | ||
* @see https://docs.npmjs.com/cli/using-npm/scripts | ||
* @see https://yarnpkg.com/advanced/lifecycle-scripts | ||
* @see https://classic.yarnpkg.com/en/docs/package-json#toc-scripts | ||
* | ||
* @extends {JsonObject} | ||
*/ | ||
interface Scripts extends JsonObject { | ||
[script: string]: string | ||
|
||
install?: string | ||
postinstall?: string | ||
postpack?: string | ||
postpublish?: string | ||
postrestart?: string | ||
poststart?: string | ||
poststop?: string | ||
posttest?: string | ||
postuninstall?: string | ||
postversion?: string | ||
preinstall?: string | ||
prepack?: string | ||
prepare?: string | ||
prepublish?: string | ||
prepublishOnly?: string | ||
prerestart?: string | ||
prestart?: string | ||
prestop?: string | ||
pretest?: string | ||
preuninstall?: string | ||
preversion?: string | ||
publish?: string | ||
restart?: string | ||
start?: string | ||
stop?: string | ||
test?: string | ||
typecheck?: string | ||
uninstall?: string | ||
version?: string | ||
} | ||
|
||
export type { Scripts as default } |