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

Should work as an npm package being run locally #11

Open
domharrington opened this issue May 5, 2023 · 1 comment
Open

Should work as an npm package being run locally #11

domharrington opened this issue May 5, 2023 · 1 comment

Comments

@domharrington
Copy link
Member

You should be able to do this and have it push the spec files:

BASE_URL=http://localhost:3000 npx @readme/[email protected] './*{yaml,yml,json}' --key=xxx

Right now the server returns with an error:

data: {
  name: 'TypeError',
  message: "Cannot read property 'repository' of undefined"
}

Which is to be expected, because getContext() doesnt return with anything when in a non-CI environment:

default:
return {};

We could probably build a context from local? Grab the repo name from git origins?

@cvan
Copy link
Contributor

cvan commented Jun 13, 2023

  • create a mock context (similar to the Bitbucket one) for local usage (when ci.isCI === false).
  • use the same mock context - for the list of CI vendors that Micro does not yet support (when ci.name/ci.constant is unmatched).

suggestions

  • use npm's official normalize-package-data package, which among other things, will normalize the package.json, filling in the repository, if it's able to.
  • recommend using nektos/act to simulate GitHub Actions locally
  • look at how serverless projects (that support GH Actions, et al.) handle non-CI environments

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

2 participants