-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass module id of package directory or manifest
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
c4517bb
commit a710037
Showing
11 changed files
with
307 additions
and
100 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
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,22 @@ | ||
/** | ||
* @file Mocks - @flex-development/mlly | ||
* @module mocks/flex-development/mlly | ||
* @see https://github.com/flex-development/mlly | ||
*/ | ||
|
||
/** | ||
* [`@flex-development/mlly`][1] module type. | ||
* | ||
* [1]: https://github.com/flex-development/mlly | ||
*/ | ||
type Actual = typeof import('@flex-development/mlly') | ||
|
||
/** | ||
* `@flex-development/mlly` module. | ||
* | ||
* @const {Actual} actual | ||
*/ | ||
const actual: Actual = await vi.importActual<Actual>('@flex-development/mlly') | ||
|
||
export const readPackageJson = vi.fn(actual.readPackageJson) | ||
export const toURL = vi.fn(actual.toURL) |
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 |
---|---|---|
@@ -1,37 +1,24 @@ | ||
/** | ||
* @file Mocks - fs | ||
* @module mocks/fs | ||
* @see https://nodejs.org/docs/latest-v16.x/api/fs.html | ||
* @see https://nodejs.org/api/fs.html | ||
*/ | ||
|
||
import volume from '#fixtures/volume' | ||
import type { TDataOut } from 'memfs/lib/encoding' | ||
import type { IWriteFileOptions, TData, TFileId } from 'memfs/lib/volume' | ||
|
||
/** | ||
* Synchronously returns the contents of `path`. | ||
* | ||
* @see https://nodejs.org/docs/latest-v16.x/api/fs.html#fsreadfilesyncpath-options | ||
* | ||
* @param {TFileId} path - Filename or file descriptor | ||
* @param {IWriteFileOptions | string} [options] - Read file options | ||
* @return {TDataOut} File content | ||
*/ | ||
export const readFileSync = vi.fn(volume.readFileSync.bind(volume)) | ||
import type fs from 'node:fs' | ||
|
||
/** | ||
* Synchronously writes `data` to `file`, replacing `file` if it already exists. | ||
* | ||
* @see https://nodejs.org/docs/latest-v16.x/api/fs.html#fswritefilesyncfile-data-options | ||
* @see https://nodejs.org/api/fs.html#fswritefilesyncfile-data-options | ||
* | ||
* @param {TFileId} file - Filename or file descriptor | ||
* @param {TData} data - File content | ||
* @param {IWriteFileOptions} [options] - Write file options | ||
* @param {fs.PathOrFileDescriptor} file - Filename or file descriptor | ||
* @param {ArrayBufferView | string} data - File content | ||
* @param {fs.WriteFileOptions} [options] - Write options | ||
* @return {Promise<void>} Nothing when complete | ||
*/ | ||
export const writeFileSync = vi.fn(volume.writeFileSync.bind(volume)) | ||
export const writeFileSync = vi | ||
.fn(volume.writeFileSync.bind(volume)) | ||
.mockName('writeFileSync') | ||
|
||
export default { | ||
readFileSync, | ||
writeFileSync | ||
} | ||
export default { writeFileSync } |
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 |
---|---|---|
|
@@ -71,14 +71,16 @@ | |
"typecheck": "vitest typecheck --run", | ||
"typecheck:watch": "vitest typecheck" | ||
}, | ||
"dependencies": { | ||
"@flex-development/mlly": "1.0.0-alpha.11", | ||
"@flex-development/pathe": "1.0.3", | ||
"@flex-development/tutils": "6.0.0-alpha.10" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "17.3.0", | ||
"@commitlint/config-conventional": "17.3.0", | ||
"@flex-development/mkbuild": "1.0.0-alpha.13", | ||
"@flex-development/mlly": "1.0.0-alpha.11", | ||
"@flex-development/pathe": "1.0.3", | ||
"@flex-development/pkg-types": "1.0.0", | ||
"@flex-development/tutils": "6.0.0-alpha.10", | ||
"@flex-development/pkg-types": "2.0.0", | ||
"@graphql-eslint/eslint-plugin": "3.16.0", | ||
"@types/chai": "4.3.4", | ||
"@types/conventional-changelog": "3.1.1", | ||
|
@@ -91,6 +93,7 @@ | |
"@types/git-raw-commits": "2.0.1", | ||
"@types/is-ci": "3.0.0", | ||
"@types/node": "18.14.0", | ||
"@types/node-fetch": "2.6.2", | ||
"@types/node-notifier": "8.0.2", | ||
"@types/prettier": "2.7.2", | ||
"@types/semver": "7.3.13", | ||
|
@@ -148,7 +151,7 @@ | |
"@flex-development/tutils": "6.0.0-alpha.10" | ||
}, | ||
"engines": { | ||
"node": ">=14.16", | ||
"node": ">=14.17.0", | ||
"yarn": "4.0.0-rc.39" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
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
Oops, something went wrong.