Skip to content

Commit 52c16ad

Browse files
committed
feat(interfaces): PackageScope
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent feda82b commit 52c16ad

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

docs/.vitepress/theme/comments/link-replacements.json

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"{@linkcode ExportStatement}": "/api/interfaces#exportstatement",
1010
"{@linkcode Ext}": "https://github.com/flex-development/pathe/blob/main/src/types/ext.ts",
1111
"{@linkcode ImportStatement}": "/api/interfaces#importstatement",
12+
"{@linkcode PackageJson}": "https://github.com/flex-development/pkg-types/blob/2.0.0/src/interfaces/package-json.ts",
13+
"{@linkcode PackageScope}": "/api/interfaces/#packagescope",
1214
"{@linkcode MIMEType}": "/api/types#mimetype",
1315
"{@linkcode ModuleSpecifierType}": "/api/types#modulespecifiertype",
1416
"{@linkcode RESOLVE_EXTENSIONS}": "/api/constants#resolve-extensions",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @file Type Tests - PackageScope
3+
* @module mlly/interfaces/tests/unit-d/PackageScope
4+
*/
5+
6+
import type { PackageJson } from '@flex-development/pkg-types'
7+
import type TestSubject from '../package-scope'
8+
9+
describe('unit-d:interfaces/PackageScope', () => {
10+
it('should match [dir: string]', () => {
11+
expectTypeOf<TestSubject>().toHaveProperty('dir').toBeString()
12+
})
13+
14+
it('should match [pkg: PackageJson]', () => {
15+
expectTypeOf<TestSubject>()
16+
.toHaveProperty('pkg')
17+
.toEqualTypeOf<PackageJson>()
18+
})
19+
})

src/interfaces/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type { default as DynamicImport } from './import-dynamic'
77
export type { default as StaticImport } from './import-static'
88
export type { default as ResolveOptions } from './options-resolve'
99
export type { default as ResolveAliasOptions } from './options-resolve-alias'
10+
export type { default as PackageScope } from './package-scope'
1011
export type { default as Statement } from './statement'
1112
export type { default as ExportStatement } from './statement-export'
1213
export type { default as ImportStatement } from './statement-import'

src/interfaces/package-scope.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @file Interfaces - PackageScope
3+
* @module mlly/interfaces/PackageScope
4+
*/
5+
6+
import type { PackageJson } from '@flex-development/pkg-types'
7+
8+
/**
9+
* Object containing a `package.json` object and an absolute path to a directory
10+
* containing a `package.json` file.
11+
*
12+
* @see {@linkcode PackageJson}
13+
*/
14+
interface PackageScope {
15+
/**
16+
* Absolute path to directory containing `package.json` file.
17+
*/
18+
dir: string
19+
20+
/**
21+
* `package.json` object.
22+
*/
23+
pkg: PackageJson
24+
}
25+
26+
export type { PackageScope as default }

0 commit comments

Comments
 (0)