feat(cli): add tsconfig file detection based on the framework
#397
Annotations
10 errors
|
src/registry/api.test.ts > getRegistriesConfig > should parse valid components.json with registries:
packages/cli/src/utils/get-config.ts#L154
Error: Invalid configuration found in /tmp/shadcn-test-DY5UR3/components.json. [
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"aliases"
],
"message": "Required"
}
]
❯ getRawConfig src/utils/get-config.ts:154:11
❯ Module.getRegistriesConfig src/registry/api.ts:132:24
❯ src/registry/api.test.ts:1259:22
|
|
src/registry/api.test.ts > getRegistry > should handle 403 error from registry endpoint:
packages/cli/src/registry/api.test.ts#L919
AssertionError: expected error to be instance of RegistryForbiddenError
- Expected:
[Function RegistryForbiddenError]
+ Received:
FetchError {
"message": "[GET] \"https://forbidden.com/registry.json\": 403 Forbidden",
"name": "FetchError",
}
❯ src/registry/api.test.ts:919:5
|
|
src/registry/api.test.ts > getRegistry > should handle 401 error from registry endpoint:
packages/cli/src/registry/api.test.ts#L897
AssertionError: expected error to be instance of RegistryUnauthorizedError
- Expected:
[Function RegistryUnauthorizedError]
+ Received:
FetchError {
"message": "[GET] \"https://unauthorized.com/registry.json\": 401 Unauthorized",
"name": "FetchError",
}
❯ src/registry/api.test.ts:897:5
|
|
src/registry/api.test.ts > getRegistry > should handle 404 error from registry endpoint:
packages/cli/src/registry/api.test.ts#L875
AssertionError: expected error to be instance of RegistryNotFoundError
- Expected:
[Function RegistryNotFoundError]
+ Received:
FetchError {
"message": "[GET] \"https://notfound.com/registry.json\": 404 Not Found",
"name": "FetchError",
}
❯ src/registry/api.test.ts:875:5
|
|
src/registry/api.test.ts > getRegistry > should throw RegistryFetchError on network error:
packages/cli/src/registry/api.test.ts#L814
AssertionError: expected error to be instance of RegistryFetchError
- Expected:
[Function RegistryFetchError]
+ Received:
FetchError {
"message": "[GET] \"https://error.com/registry.json\": 500 Internal Server Error",
"name": "FetchError",
}
❯ src/registry/api.test.ts:814:5
|
|
src/registry/api.test.ts > getRegistryItem > should include response body in RegistryFetchError:
packages/cli/src/registry/api.test.ts#L636
AssertionError: expected FetchError: [GET] "https://shadcn-vue.com… { …(8) } to be an instance of RegistryFetchError
❯ src/registry/api.test.ts:636:21
|
|
src/registry/api.test.ts > getRegistryItem > should include error code in RegistryFetchError for 500 errors:
packages/cli/src/registry/api.test.ts#L478
AssertionError: expected FetchError: [GET] "https://shadcn-vue.com… { …(8) } to be an instance of RegistryFetchError
❯ src/registry/api.test.ts:478:21
|
|
src/registry/api.test.ts > getRegistryItem > should include error code in RegistryForbiddenError:
packages/cli/src/registry/api.test.ts#L452
AssertionError: expected FetchError: [GET] "https://shadcn-vue.com… { …(8) } to be an instance of RegistryForbiddenError
❯ src/registry/api.test.ts:452:21
|
|
src/registry/api.test.ts > getRegistryItem > should include error code in RegistryUnauthorizedError:
packages/cli/src/registry/api.test.ts#L429
AssertionError: expected FetchError: [GET] "https://shadcn-vue.com… { …(8) } to be an instance of RegistryUnauthorizedError
❯ src/registry/api.test.ts:429:21
|
|
src/registry/api.test.ts > getRegistryItem > should include error code in RegistryNotFoundError:
packages/cli/src/registry/api.test.ts#L408
AssertionError: expected FetchError: [GET] "https://shadcn-vue.com… { …(8) } to be an instance of RegistryNotFoundError
❯ src/registry/api.test.ts:408:21
|