webalys-hq / streamlinehq-npm

The deprecated Streamline NPM package, which will be deleted on 1st November 2022.
https://medium.com/streamline-icons/how-streamline-narrows-down-its-focus-eac6fdb5c6f2
24 stars 5 forks source link

Allow specifying the dynamic name of the `.env` file to read based on NODE_ENV env var #32

Closed Thomascogez closed 3 years ago

Thomascogez commented 3 years ago

Since 3.0.2 the install script is broken when using streamlinehq.json.

Error get during install TypeError: Cannot read property 'replace' of undefined

I think it come from this change:

    const familiesFromEnv = process.env.STREAMLINE_FAMILIES.replace(/\\/g, '')
cbrwizard commented 3 years ago

You're right, thanks for reporting this! Will fix now

cbrwizard commented 3 years ago

3.0.3 has been released with the fix https://github.com/webalys-hq/streamlinehq-npm/pull/33, please fetch it and try again.

Btw in the next major release we'll deprecate streamlinehq.json https://github.com/webalys-hq/streamlinehq-npm/releases/tag/4.0.0

Thomascogez commented 3 years ago

@cbrwizard Thx for the quick update 👍 , did the .env config support multiple env (.env.local, .env.dev, .env.prod, ...) ?

cbrwizard commented 3 years ago

Unfortunately, it reads only .env file https://github.com/webalys-hq/streamlinehq-npm/blob/master/src/install.ts#L12 since we have to specify the folder where the config file is located and that can be done only be specifying the file name as well.

We could have implemented the dynamic name as well as it's described here https://stackoverflow.com/a/55426597/2707526 but I'm not sure if it's worth it.

NathanBnm commented 3 years ago

@cbrwizard such a feature would be useful 👍

vvo commented 3 years ago

Hey there, a quick message to let you know that systems like Next.js recommend checking .env into source control while keeping .env.local in gitignore. While this is debatable, given the Next.js popularity, it might be a good idea to allow setting the location of the NPM variable dynamically.

Reference: https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables

lveillard commented 3 years ago

Hello! i have this issue. Using nextjs and .env.local and i'm unable to install it

cbrwizard commented 3 years ago

Hello, considering the number of issues with npm package I'd strongly suggest avoiding using it and relying on getting the images from the website directly. Without npm package Streamlime team will be able to spend more time on features which are really needed for customers and you will have always working images. I understand that this is not the answer you've been hoping for and I'm sorry for that. We'll write a more detailed update on this in the foreseeable future.

lveillard commented 3 years ago

To be honest, in my particular case I'm already doing that! Just picking the svg files and importing them manually

cbrwizard commented 3 years ago

Today we announce that we're deprecating the Streamline NPM package. Instead, we’ll focus on the web app and Figma plugin, which are used by a noticeable share of our customers.

Please from now on instead of using our brittle package download the images directly from our website and insert them into your project as SVG files. Meanwhile, Streamline team is focused on ensuring that our web application provides the best user experience for developers' use cases. Please take 2 minutes to share feedback so that we can improve.

We'll keep this package with minimal life support until 1st November 2022, after which it's going to be deleted.

Please read the full story in this article.