Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

fix(ts): do not require storage/pubsub types, add install test#430

Merged
JustinBeckwith merged 2 commits intomasterfrom
fix-types
Mar 19, 2019
Merged

fix(ts): do not require storage/pubsub types, add install test#430
JustinBeckwith merged 2 commits intomasterfrom
fix-types

Conversation

@JustinBeckwith
Copy link
Copy Markdown
Contributor

@JustinBeckwith JustinBeckwith commented Mar 19, 2019

Fixes #429. This PR includes two changes:

  1. An install test that verifies we can install the module and use it's types and
  2. A change to use any in places where the types were previously used

I don't feel great about this fix. This another case where I'm starting to wonder if packaging types with the package is actually a good idea. Thoughts/ideas on the approach welcomed

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 19, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2019

Codecov Report

Merging #430 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #430   +/-   ##
======================================
  Coverage    90.6%   90.6%           
======================================
  Files          14      14           
  Lines         628     628           
  Branches       32      32           
======================================
  Hits          569     569           
  Misses         41      41           
  Partials       18      18
Impacted Files Coverage Δ
src/index.ts 99.44% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00fa912...4f6b4da. Read the comment docs.

@JustinBeckwith JustinBeckwith changed the title [WIP] fix(ts): add install test fix(ts): do not require storage/pubsub types, add install test Mar 19, 2019
Copy link
Copy Markdown

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

Comment thread src/index.ts
destination: Bucket|Dataset|Topic|string;
// destination: Bucket|Dataset|Topic|string;
// tslint:disable-next-line no-any
destination: any;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha, this is the same thing I did in my local testing; glad that I'm figuring these things out.

Comment thread system-test/install.ts
* application.
*/
it('should be able to use the d.ts', async () => {
await execa('npm', ['pack', '--unsafe-perm']);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach to integration testing the TypeScript module, I wonder if this could be be abstracted into a module.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinBeckwith I see that you chose not to use post-install-check. I am guessing that there are things in that module that you don't like. Can you work with @DominicKramer and provide feedback to make sure we are serving your needs and making that module better for everyone ❤️.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wasn't trying to be a :trollface:, I didn't realize this was essentially what post-install-check does.

It would be nice to eventually consolidate on a module like post-install-check ... I honestly don't love the name post-install-check if what it does is check that TypeScript has the appropriate dependencies. I read post-install-check and assumed it was something more abstract (a generic way of checking your packages post-install scripts?). I'd advocate a name like check-installed-types?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it is not the best name. We can rename it. How about something like ts-pack-n-play?

/cc @googleapis/node-team FYI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW - I love that name. @ofrobots wanna open an issue over there to consider the rename?

@JustinBeckwith JustinBeckwith merged commit 8b30674 into master Mar 19, 2019
@ofrobots ofrobots deleted the fix-types branch March 19, 2019 16:57
Comment thread src/index.ts
export interface CreateSinkRequest {
destination: Bucket|Dataset|Topic|string;
// destination: Bucket|Dataset|Topic|string;
// tslint:disable-next-line no-any
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinBeckwith can you add a comment here indicating why any is being used, and what would be an ideal type definition if it were not for the npm/typescript limitations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsatisfied types dependencies in 4.5.0

4 participants