question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate .env when run shipjs setup

See original GitHub issue

Is your feature request related to a problem? Please describe. When we run shipjs prepare at local, .env is needed. But Shipjs’s log when run command shipjs setup does not explain that thing.

Describe the solution you’d like I want to propose two ways.

  • Generate .env when run npx shipjs setup
#======= Attention: Please don't commit this file =======

# Used when using the `shipjs prepare` command
GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>

  • Include this text in log when finished shipjs setup: create .env file on project's root. The file used when run shipjs prepare

Describe alternatives you’ve considered

Additional context If already exists .env, insert text to the file.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Haroenvcommented, Jul 5, 2021

I’m actually increasingly convinced that having a .env in the root of a package that you will publish is too risky, we have also published tokens by accident (by doing the publish on a local machine when CI failed), and that’s a design we want to avoid! Either shipjs creates it, but also creates all files to be sure it’s ignored, or we recommend passing the token as an environment variable only.

Did anyone do research on how other publish scripts solve this?

0reactions
eunjae-leecommented, Jul 8, 2021

Umm. If you don’t think about generating the .env file, how do you think adding some messages when running shipjs setup, and shipjs prepare?

We have this step in shipjs prepare: https://github.com/algolia/shipjs/blob/12c21cefa20f0f35153c81e9a6fdd2ffdc369bac/packages/shipjs/src/step/checkGitHubToken.js#L6:L6

If I understand your intention correctly, you think it’s a bit too late and you’d like to get the information at the time of shipjs setup. Right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started | Ship.js - Algolia Community
This interactive CLI will help you install Ship.js into your package and create ... GITHUB_TOKEN=xxx shipjs prepare; Create a file named ".env" and...
Read more >
Next.js environment variables - Refine Dev
We will take a closer look at environment variables in Next.js.
Read more >
How to set environment variables from within package.json?
For a test you can see the env variables by running npm run env-linux or npm run env-windows , and test that they...
Read more >
Advanced Usage of Pipenv - Read the Docs
pipenv install --deploy. This will fail a build if the Pipfile.lock is out–of–date, instead of generating a new one. Or you can install...
Read more >
Angular Basics: Environmental Variables—Build Configurations
Angular Basics: Using Environmental Variables To Organize Build ... Package Manager version 6.7 (it usually ships with Node installation) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found