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

Publish to npm #150

Open
TheJaredWilcurt opened this issue Sep 10, 2024 · 1 comment
Open

Publish to npm #150

TheJaredWilcurt opened this issue Sep 10, 2024 · 1 comment

Comments

@TheJaredWilcurt
Copy link

TheJaredWilcurt commented Sep 10, 2024

Hey, this project would be much more helpful if it could be npm install'd and exported some sort of function that could be called.

Then usage would be:

  1. Run: npm install --save-dev export-figma-svg
  2. Create a node script like this:
import path from 'node:path';
import exportFigmaSvg from 'export-figma-svg';
const __dirname = import.meta.dirname;

exportFigmaSvg({
  figmaBaseUrl: 'https://api.figma.com/v1/',
  figmaProjectId: 'ABCdEfg0HIJkLmN12OpqrS',
  figmaProjectNodeId: '123:456',
  devAccessToken: process.env.FIGMA_API_TOKEN,
  filterPrivateComponents: false,
  output: path.resolve(__dirname, 'icons')
});

That would mean that this repo no longer needs to deal with environment variables at all, pushing that on to the end-users to determine how they want to store API keys.

You'd just need to set up a TS-to-JS build to make a dist folder, then point to it in your package.json and run npm publish after each release.

Copy link

Message that will be displayed on users' first issue

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