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

Extend package argument to handle directory, file, or archive #81

Closed
razor-x opened this issue Apr 14, 2023 · 0 comments · Fixed by #84
Closed

Extend package argument to handle directory, file, or archive #81

razor-x opened this issue Apr 14, 2023 · 0 comments · Fixed by #84
Labels
enhancement New feature or request

Comments

@razor-x
Copy link
Collaborator

razor-x commented Apr 14, 2023

          I've been working my way through the code in the main branch, and I'm starting to have a few thoughts about the existing `package` and proposed `package-spec` inputs:
  • I'm not sure overriding the working directory is important or useful, compared to exposing the package-spec arg (or a workspace option, in the future), so we can probably drop the idea of working-directory for now
  • If the package-spec is a pre-packed tarball, then we still need something to point us to package.json so we can read the package name / current version.
    • Or maybe we extract package.json from the archive?
  • If package-spec is a directory, we should use the package.json in the directory, I think

What do you think of these points? To brainstorm something:

  • Keep the package arg
  • If package unspecified, default to regular npm behavior: use the cwd as the current package
  • If package is a package.json file, use the directory of that file as the package_spec argument to npm
  • If package is a directory, look for a package.json in that directory and use the directory as the package_spec arg to npm
  • If package is an archive, I'm not sure
    • Extract package.json from the archive?
    • Require a separate package-manifest input?

Originally posted by @mcous in #69 (comment)

What do you think of these points? To brainstorm something:...

That looks like the right logic to me. And yes, we should extract the package.json file from the tar file, not require another argument. I don't think we need to extract it to the file system though, we should just be able to read it into memory.

@mcous mcous added the enhancement New feature or request label Apr 14, 2023
@mcous mcous closed this as completed in #84 Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants