Skip to content

Spot doesn't work in a monorepo #2059

@ipekt

Description

@ipekt

Describe the bug
Spot outputs TS errors when spot generate command is run in an monorepo. But the same code works fine when it is outside a monorepo. This may be an issue with TS looking at parent node_modules folder

To Reproduce

  1. Create a package.json with serverless in root folder:
{
  "dependencies": {
    "serverless": "^3.15.0"
  }
}
  1. Create another package.json in a nested folder: (root/spot)
{
   "dependencies": {
    "@airtasker/spot": "^1.9.0"
  }
}
  1. Add api.ts file
  2. Run spot generate --contract api.ts --language yaml --generator openapi3 --out output/
  3. Exists with errors shared below

Expected behavior
spot generate works in a monorepo setup

Screenshots
Example command line output:

...

 ';' expected.
    Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.
    ';' expected.
    Cannot find name 'infer'.
    ';' expected.
    Cannot find name 'T'.
    Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.
    ';' expected.
    Cannot find name 'infer'.
    ';' expected.
    Cannot find name 'U'.
    ';' expected.
    Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.
    ';' expected.
    Cannot find name 'T'.
    Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.
    ';' expected.
    'PascalCase' only refers to a type, but is being used as a value here.
    Cannot find name 'U'.
    '(' expected.
    ';' expected.
    'PropertyKey' only refers to a type, but is being used as a value here.
    ';' expected.
    ';' expected.
    ';' expected.
    This expression is not callable.
    Unterminated template literal.

Desktop (please complete the following information):

  • NPM version: 6.14.16
  • Node version: v14.19.1
  • Spot version: 1.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions