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

Allow specifying an entry point in programmatic usage #105

Open
metonym opened this issue Jan 23, 2023 · 0 comments
Open

Allow specifying an entry point in programmatic usage #105

metonym opened this issue Jan 23, 2023 · 0 comments
Assignees

Comments

@metonym
Copy link
Collaborator

metonym commented Jan 23, 2023

Ref: carbon-design-system/carbon-components-svelte#1636 (comment)

Currently, the getSvelteEntry relies purely on package.json for the Svelte entry point. It will throw an error if the "svelte" field is absent in the root package.json.

The plugin that allows programmatic usage should allow the entry point to be specified.

E.g.,

sveld({
  entry: "src/index.js",
  glob: true,
  markdown: true,
  markdownOptions: {
    onAppend: (type, document, components) => {
      if (type === "h1")
        document.append(
          "quote",
          `${components.size} components exported from ${pkg.name}@${pkg.version}.`
        );
    },
  },
  json: true,
  jsonOptions: {
    outFile: "docs/src/COMPONENT_API.json",
  },
});
@metonym metonym self-assigned this Jan 23, 2023
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

1 participant