tektronix / tsp-toolkit

VSCode extension for Keithley Instruments' Test Script Processor
Apache License 2.0
5 stars 1 forks source link

[Bug]: `tsp-toolkit` depends on private repos, building impossible. #16

Open 956MB opened 5 months ago

956MB commented 5 months ago

Pre-check

This project's dependencies currently contains three private repos, @tektronix/keithley_instrument_libraries, @tektronix/kic-cli, and @tektronix/web-help-documents, making work on the extension impossible.

TSP Toolkit Version

0.15.0

TSP Toolkit Develop Version

0.15.0

Steps to Reproduce

  1. Fork tsp-toolkit
  2. Clone (git clone https://github.com/956MB/tsp-toolkit.git)
  3. Run pnpm install:
     ERR_PNPM_FETCH_401  GET https://npm.pkg.github.com/@tektronix%2Fkeithley_instrument_libraries: Unauthorized - 401
  4. Delete "@tektronix/web-help-documents": "0.15.0", from package.json
  5. Run pnpm install again:
     ERR_PNPM_FETCH_401  GET https://npm.pkg.github.com/@tektronix%2Fweb-help-documents: Unauthorized - 401
  6. Delete "@tektronix/kic-cli": "0.15.1", from package.json
  7. Run pnpm install again:
     ERR_PNPM_FETCH_401  GET https://npm.pkg.github.com/@tektronix%2Fweb-help-documents: Unauthorized - 401
  8. Delete last line "@tektronix/keithley_instrument_libraries": "0.15.0", from package.json
  9. Running pnpm install this last time installs fine with no errors, but then obviously we don't have the packages needed for COMMAND_SETS and EXECUTABLE in src/extension.ts, and elsewhere:
    
    import { COMMAND_SETS } from "@tektronix/keithley_instrument_libraries"
    import { EXECUTABLE } from "@tektronix/kic-cli"

// ├╴E Cannot find module '@tektronix/keithley_instrument_libraries' or its corresponding type declarations. typescript (2307) [5, 29] // ├╴E Cannot find module '@tektronix/kic-cli' or its corresponding type declarations. typescript (2307) [6, 27]

esarver commented 5 months ago

@956MB Thank you so much for the issue! We appreciate the contribution!

I just checked and all those repos and packages are set to public visibility. I am not familiar with pnpm, but we do define the @tektronix scope in the .npmrc file in the project root. I'm not sure if pnpm respects that file.

esarver commented 5 months ago

Just tried npm ci on my personal laptop and got the same issue. I think you need to set up authentication to use the GitHub npm registry (see https://stackoverflow.com/a/61666885 for more info). You'll just need to create a GitHub PAT to use for that authToken. We do plan to add a better Contributing document in the future.

esarver commented 5 months ago

In my work .npmrc file, I have something like

//npm.pkg.github.com/:_authToken=GITHUB_PAT

Where GITHUB_PAT is the literal PAT generated by GitHub.

956MB commented 5 months ago

Yeah I reached the same conclusion and was finally able to get through. I was just about to comment the same thing 👍 👍 A note about having the right env variable with the PAT set would probably be best. Edit: unless it was on me not having an up to date token with permissions... :|

esarver commented 5 months ago

unless it was on me not having an up to date token with permissions...

I think it is on us for not having better developer docs. It's in the works, but I'm glad that you submitted this issue so we would know to state it explicitly!

esarver commented 4 months ago

Internal reference: TSP-663