Skip to content

Adding "src" to the "files" in package.json is throwing TypeScript errors in our consuming app #138

@BoussonKarel

Description

@BoussonKarel
[lint:types] node_modules/.pnpm/@getflights+ember-data-utils@0.0.1_@babel+core@7.29.0_@warp-drive+core@5.8.0_@babel+cor_fe390bbe2475c54779f4ec3e838150d6/node_modules/@getflights/ember-data-utils/src/query/query.ts(10,29): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.

Our consuming app's tsconfig:

{
  "extends": "@tsconfig/ember",
  "compilerOptions": {
    "allowJs": true,
    "skipLibCheck": true,

    // The combination of `baseUrl` with `paths` allows Ember's classic package
    // layout, which is not resolvable with the Node resolution algorithm, to
    // work with TypeScript.
    "baseUrl": ".",
    "paths": {
      "atlas/tests/*": ["tests/*"],
      "atlas/*": ["app/*"],
      "*": ["types/*"]
    },
    "types": [
      "ember-source/types",
      "@glint/ember-tsc/types",
      "@getflights/ember-attribute-validations"
    ]
  },
  "include": ["app", "tests", "types"]
}

Exports etc of the addon:

  "imports": {
    "#src/*": "./src/*"
  },
  "exports": {
    ".": {
      "types": "./declarations/index.d.ts",
      "default": "./dist/index.js"
    },
    "./addon-main.js": "./addon-main.cjs",
    "./*.css": "./dist/*.css",
    "./query/*": {
      "types": "./declarations/query/*.d.ts",
      "default": "./dist/query/*.js"
    },
    "./utils/*": {
      "types": "./declarations/utils/*.d.ts",
      "default": "./dist/utils/*.js"
    },
    "./*": {
      "types": "./declarations/*.d.ts",
      "default": "./dist/*.js"
    }
  },
  "files": [
    "addon-main.cjs",
    "declarations",
    "dist",
    "src"
  ],

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