Skip to content

Commit ec32053

Browse files
committed
fix(models): patch build errors
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 8ef9a81 commit ec32053

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"typecheck:watch": "vitest typecheck"
6969
},
7070
"dependencies": {
71-
"@flex-development/pkg-types": "1.0.0",
7271
"@flex-development/tutils": "6.0.0-alpha.7",
7372
"node-inspect-extracted": "2.0.0"
7473
},
@@ -78,6 +77,7 @@
7877
"@commitlint/types": "17.0.0",
7978
"@faker-js/faker": "7.6.0",
8079
"@flex-development/mkbuild": "1.0.0-alpha.9",
80+
"@flex-development/pkg-types": "1.0.0",
8181
"@graphql-eslint/eslint-plugin": "3.13.0",
8282
"@types/chai": "4.3.4",
8383
"@types/chai-string": "1.4.2",

src/models/__tests__/err-invalid-package-target.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
*/
55

66
import { ErrorCode } from '#src/enums'
7-
import type pkg from '@flex-development/pkg-types'
87
import TestSubject from '../err-invalid-package-target'
98

109
describe('unit:models/ERR_INVALID_PACKAGE_TARGET', () => {
1110
let base: string
1211
let dir: string
1312
let key: string
14-
let target: pkg.Exports
13+
let target: unknown
1514

1615
beforeEach(() => {
1716
base = import.meta.url

src/models/err-invalid-package-target.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { ErrorCode } from '#src/enums'
88
import type { MessageFn, NodeError, NodeErrorConstructor } from '#src/types'
99
import { createNodeError } from '#src/utils'
10-
import type pkg from '@flex-development/pkg-types'
1110

1211
/**
1312
* `ERR_INVALID_PACKAGE_TARGET` model.
@@ -24,14 +23,14 @@ import type pkg from '@flex-development/pkg-types'
2423
*
2524
* @param {string} dir - Directory containing `package.json` file
2625
* @param {string} key - `exports` or `imports` key
27-
* @param {pkg.Exports} target - Invalid package target
26+
* @param {unknown} target - Invalid package target
2827
* @param {boolean?} [internal=false] - `target` is package [`imports`][2]?
2928
* @param {string?} [base=''] - Id of module package was imported from
3029
* @return {NodeError} `Error` instance
3130
*/
3231
const ERR_INVALID_PACKAGE_TARGET: NodeErrorConstructor<
3332
ErrorConstructor,
34-
MessageFn<[string, string, pkg.Exports, boolean?, string?]>
33+
MessageFn<[string, string, unknown, boolean?, string?]>
3534
> = createNodeError(
3635
ErrorCode.ERR_INVALID_PACKAGE_TARGET,
3736
Error,
@@ -43,15 +42,15 @@ const ERR_INVALID_PACKAGE_TARGET: NodeErrorConstructor<
4342
*
4443
* @param {string} dir - Directory containing `package.json` file
4544
* @param {string} key - `exports` or `imports` key
46-
* @param {pkg.Exports} target - Invalid package target
45+
* @param {unknown} target - Invalid package target
4746
* @param {boolean?} [internal=false] - `target` is package [`imports`][2]?
4847
* @param {string?} [base=''] - Id of module package was imported from
4948
* @return {string} Error message
5049
*/
5150
(
5251
dir: string,
5352
key: string,
54-
target: pkg.Exports,
53+
target: unknown,
5554
internal: boolean = false,
5655
base: string = ''
5756
): string => {

src/models/err-unsupported-dir-import.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ const ERR_UNSUPPORTED_DIR_IMPORT: NodeErrorConstructor<
2727
> = createNodeError(
2828
ErrorCode.ERR_UNSUPPORTED_DIR_IMPORT,
2929
Error,
30-
"Directory import '%s' is not supported resolving ES modules imported from %s"
30+
// needs mkbuild update => import '%s' is being picked up as import statement
31+
[
32+
'Directory',
33+
'import',
34+
"'%s' is not supported resolving ES modules imported from %s"
35+
].join(' ')
3136
)
3237

3338
export default ERR_UNSUPPORTED_DIR_IMPORT

0 commit comments

Comments
 (0)