Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm pack not packaging the dist directory #23

Closed
jonathansant opened this issue Mar 29, 2018 · 2 comments
Closed

npm pack not packaging the dist directory #23

jonathansant opened this issue Mar 29, 2018 · 2 comments

Comments

@jonathansant
Copy link

I just installed the package and encountered a build error because the modules were not found in index.ts. At face value seems that the problem is that index.ts should be index.d.ts but delving a bit deeper into the problem, it seems that the npm package does not contain the contents of the dist directory generated by an npm build (of the kubernetes-client project).

@cjlarose
Copy link
Contributor

I'm seeing a similar issue, though it does look like the dist directory is part of the package distributed on npm.

I have installed

"@kubernetes/client-node": "^0.2.1",

If I try to import the package with

import k8s = require('@kubernetes/client-node');

from a TypeScript file, I get these compiler errors

$ tsc
node_modules/@kubernetes/client-node/index.ts(1,15): error TS2307: Cannot find module './src/config'.
node_modules/@kubernetes/client-node/index.ts(2,15): error TS2307: Cannot find module './src/api'.
node_modules/@kubernetes/client-node/index.ts(3,15): error TS2307: Cannot find module './src/attach'.
node_modules/@kubernetes/client-node/index.ts(4,15): error TS2307: Cannot find module './src/watch'.
node_modules/@kubernetes/client-node/index.ts(5,15): error TS2307: Cannot find module './src/exec'.

Examining the package tree, we see

$ tree node_modules/@kubernetes/client-node/
node_modules/@kubernetes/client-node/
├── dist
│   ├── index.js
│   └── src
│       ├── api.d.ts
│       ├── api.js
│       ├── attach.d.ts
│       ├── attach.js
│       ├── auth-wrapper.d.ts
│       ├── auth-wrapper.js
│       ├── config.d.ts
│       ├── config.js
│       ├── config_test.d.ts
│       ├── config_test.js
│       ├── config_types.d.ts
│       ├── config_types.js
│       ├── exec.d.ts
│       ├── exec.js
│       ├── index.d.ts
│       ├── index.js
│       ├── watch.d.ts
│       ├── watch.js
│       ├── web-socket-handler.d.ts
│       └── web-socket-handler.js
├── index.ts
├── node_modules
└── package.json

3 directories, 23 files

It looks like the compiler fails when reading the index.ts file at the root of the package which has broken references to a bunch of modules:

$ less node_modules/@kubernetes/client-node/index.ts
export * from './src/config';
export * from './src/api';
export * from './src/attach';
export * from './src/watch';
export * from './src/exec';

@abedra
Copy link

abedra commented Apr 3, 2018

👍 I am having this issue as well. When do you expect this to be merged and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants