GoogleWebComponents / google-chart

Google Charts API web components
https://www.webcomponents.org/element/@google-web-components/google-chart/elements/google-chart
Apache License 2.0
357 stars 130 forks source link

Ts files and test folder should not be published #301

Closed RoXuS closed 3 years ago

RoXuS commented 3 years ago

Ts files and test folder should not be published to the registry.

rslawik commented 3 years ago

Hi @RoXuS, does it cause any problems if sources are published to npm?

I believe TS files are required for source maps to work. I didn't exclude them because I saw that lit-element keeps them as well, see their package.json.

Maybe, we should exclude test/* only? What do you think?

RoXuS commented 3 years ago

Hum in general we keep only d.ts, d.ts.map, js.map, js which are usefull to detect types when it uses as an external dependencies. As you can see in the following screenshot, lit-element seems to not publish ts files only d.ts:

image

It's that why I keep d.ts with !*.d.ts

RoXuS commented 3 years ago

To answer you, we have an issue because our TS try to convert your loader.ts, we don't know why, even if node_modules it excluded from tsconfig...

rslawik commented 3 years ago

Right, LitElement does not have any ts files at the top-level, but under src/, for example node_modules/lit-element/src/lit-element.ts. Could this be the problem? Can you confirm whether that solves the issue you have?

I checked the contents of js.map and d.ts.map files, they reference the ts file at the top-level, so I am afraid we need to include the sources in the package somewhere.

Perhaps the best course of action here is to follow LitElement setup:

Let me also verify if the changed directory structure will work in our internal setup.

RoXuS commented 3 years ago

Yeah, src folder solves our issues.

Let me know if you have any questions. Thx!

rslawik commented 3 years ago

@RoXuS I pushed #302 to npm as 4.0.1. Let me know if I didn't solve the issue.