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 .env style output from resolve and add associated docs #159

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

philmillman
Copy link
Contributor

@philmillman philmillman commented Nov 12, 2024

Adds the env format option for the --format flag in dmno resolve
Adds the -np or --no-prompt flag to bypass the service selection for dmno resolve
Automatically detects if you're in a non-interactive shell (like a subshell) and also moves into non-interactive mode

For example:

pnpm exec dmno resolve --service api --format env >> .env.production

adds docs to:

  • dmno resolve page
  • .env Files guide page

fixes #160

Copy link

changeset-bot bot commented Nov 12, 2024

🦋 Changeset detected

Latest commit: 55874ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dmno Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the maintainer Created by an official project maintainer label Nov 12, 2024
Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for signup-api canceled.

Name Link
🔨 Latest commit 55874ce
🔍 Latest deploy log https://app.netlify.com/sites/signup-api/deploys/67352e19f59a3d0008a61c34

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for dmno ready!

Name Link
🔨 Latest commit 55874ce
🔍 Latest deploy log https://app.netlify.com/sites/dmno/deploys/67352e194b08910008e714c2
😎 Deploy Preview https://deploy-preview-159--dmno.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 12, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/dmno@159
pnpm add https://pkg.pr.new/@dmno/vite-integration@159

commit: 55874ce

Copy link
Member

@theoephraim theoephraim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome - just needs a changeset!

@philmillman philmillman added documentation Improvements or additions to documentation enhancement New feature or request docs-site labels Nov 12, 2024
@@ -0,0 +1 @@
export const isSubshell = () => (process.env.BASH_SUBSHELL && process.env.BASH_SUBSHELL !== '0') || false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple enough! Any other notes about other things you tried / learned worth adding as comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the better way is probably to verify via that the pid differs from the parent pid, but this is different across shells (zsh for example)

import { expect, test, describe } from 'vitest';
import { isSubshell } from './shell-helpers';

describe('isSubshell', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hooray tests! 🥳

@philmillman philmillman merged commit 8549dbe into main Nov 13, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-site documentation Improvements or additions to documentation enhancement New feature or request maintainer Created by an official project maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] better service selection in subshell
2 participants