Skip to content

fix(dev,preview,typecheck): use explicit --dotenv filename - #381

Merged
danielroe merged 11 commits into
mainfrom
fix/dotenv-arg-for-dev
Apr 3, 2025
Merged

danielroe merged 11 commits into
mainfrom
fix/dotenv-arg-for-dev

Conversation

@DamianGlowala

Copy link
Copy Markdown
Member

resolves #360

This corrects types for the --dotenv flag and sets the default value at source.

@danielroe danielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will running npx nuxi preview --dotenv continue to work as expected (ie. a non-breaking change)?

@DamianGlowala DamianGlowala changed the title fix(dev): correctly apply --dotenv arg fix(dev,preview): correctly apply --dotenv arg May 10, 2024
@DamianGlowala
DamianGlowala marked this pull request as draft May 10, 2024 10:09
@pkg-pr-new

pkg-pr-new Bot commented Jan 11, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-nuxt@381
npm i https://pkg.pr.new/nuxi@381
npm i https://pkg.pr.new/@nuxt/cli@381

commit: 0d9c517

@github-actions

github-actions Bot commented Jan 11, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
28 75.42 kB → 75.96 kB (+558 B) +0.72%
Changeset
File Δ Size
src/commands/dev-child.ts 📈 +169 B (+9.39%) 1.76 kB → 1.92 kB
src/commands/preview.ts 📈 +159 B (+5.47%) 2.84 kB → 3 kB
src/utils/dev.ts 📈 +139 B (+1.91%) 7.12 kB → 7.25 kB
src/commands/dev.ts 📈 +91 B (+1.27%) 7 kB → 7.09 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev-child.mjs 1.76 kB → 1.92 kB (+169 B) +9.39%
chunks/preview.mjs 2.84 kB → 3 kB (+159 B) +5.47%
chunks/dev2.mjs 7.12 kB → 7.25 kB (+139 B) +1.91%
chunks/dev.mjs 7 kB → 7.09 kB (+91 B) +1.27%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 201 B 0%
chunks/add.mjs 6.83 kB 0%
chunks/analyze.mjs 3.18 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 388 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/init.mjs 5.05 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 1.74 kB 0%
chunks/upgrade.mjs 5.69 kB 0%
chunks/add2.mjs 10.04 kB 0%
chunks/search.mjs 2.94 kB 0%
shared/nuxi.KWbgM7Cu.mjs 5.47 kB 0%
shared/nuxi.CconR24j.mjs 804 B 0%
shared/nuxi.p9Qemyqb.mjs 294 B 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.DlcAx0De.mjs 1.04 kB 0%
shared/nuxi.GA8i2PDO.mjs 1.24 kB 0%
shared/nuxi.Cxkkjbvc.mjs 1.11 kB 0%
shared/nuxi.C935N1ss.mjs 687 B 0%

@DamianGlowala DamianGlowala changed the title fix(dev,preview): correctly apply --dotenv arg fix(dev,preview): correctly infer .env filename from --dotenv arg Jan 12, 2025
@DamianGlowala
DamianGlowala marked this pull request as ready for review January 12, 2025 12:53
@DamianGlowala
DamianGlowala requested review from danielroe and removed request for pi0 January 12, 2025 12:54
Comment thread src/commands/preview.ts Outdated
Comment on lines +105 to +106
logger.error(`Cannot find \`${envFileName}\`.`)
process.exit(1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we just warn in this case?

@danielroe danielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

checking, this doesn't seem to resolved the linked issue - .env is used as a the 'fallback' instead of .env.local.

@github-actions

github-actions Bot commented Apr 3, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats — create-nuxt size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
49 5.92 MB → 5.92 MB (+320 B) +0.01%
Changeset
File Δ Size
home/runner/work/cli/cli/packages/nuxi/src/commands/typecheck.ts 📈 +69 B (+3.86%) 1.74 kB → 1.81 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/preview.ts 📈 +61 B (+1.85%) 3.22 kB → 3.28 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/dev-child.ts 📈 +36 B (+1.54%) 2.29 kB → 2.33 kB
home/runner/work/cli/cli/packages/nuxi/src/utils/dev.ts 📈 +112 B (+1.33%) 8.25 kB → 8.36 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/dev.ts 📈 +42 B (+0.44%) 9.23 kB → 9.27 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev2.mjs 251.69 kB → 251.8 kB (+112 B) +0.04%
chunks/typecheck.mjs 1.74 kB → 1.81 kB (+69 B) +3.86%
chunks/preview.mjs 3.22 kB → 3.28 kB (+61 B) +1.85%
chunks/dev.mjs 9.23 kB → 9.27 kB (+42 B) +0.44%
chunks/dev-child.mjs 2.29 kB → 2.33 kB (+36 B) +1.54%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 1.07 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
chunks/add.mjs 6.89 kB 0%
chunks/analyze.mjs 3.27 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/devtools.mjs 764 B 0%
chunks/generate.mjs 472 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/test.mjs 1.16 kB 0%
chunks/upgrade.mjs 6.28 kB 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/kit.mjs 1.34 kB 0%
chunks/index2.mjs 1.17 MB 0%
chunks/index3.mjs 17.14 kB 0%
chunks/index4.mjs 71.98 kB 0%
chunks/add2.mjs 12.4 kB 0%
chunks/search.mjs 45.85 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 140.67 kB 0%
chunks/index5.mjs 1.23 kB 0%
chunks/index6.mjs 6.25 kB 0%
chunks/index7.mjs 50.51 kB 0%
chunks/index8.mjs 5.85 kB 0%
chunks/index9.mjs 886.24 kB 0%
shared/create-nuxt.Cnc0B9Ka.mjs 961.2 kB 0%
shared/create-nuxt.vIGdhyxa.mjs 18.95 kB 0%
shared/create-nuxt.D052eicA.mjs 804 B 0%
shared/create-nuxt.BYvA_PAc.mjs 294 B 0%
shared/create-nuxt.BV3fL9w-.mjs 3.9 kB 0%
shared/create-nuxt.FuHYoJN8.mjs 4.07 kB 0%
shared/create-nuxt.BSm0_9Hr.mjs 107 B 0%
shared/create-nuxt.DZbvovWX.mjs 836 B 0%
shared/create-nuxt.BpLYnZfL.mjs 108.13 kB 0%
shared/create-nuxt.jjur9XJH.mjs 43.55 kB 0%
shared/create-nuxt.XLUPIWkb.mjs 2.02 MB 0%
shared/create-nuxt.BjhZEm2-.mjs 1.75 kB 0%
shared/create-nuxt.DnK9Crop.mjs 26.94 kB 0%
shared/create-nuxt.7wzCLB1q.mjs 15.2 kB 0%
shared/create-nuxt.BBdEY2iV.mjs 715 B 0%

@github-actions

github-actions Bot commented Apr 3, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats — nuxt-cli size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
30 85.28 kB → 85.59 kB (+320 B) +0.37%
Changeset
File Δ Size
home/runner/work/cli/cli/packages/nuxi/src/commands/typecheck.ts 📈 +69 B (+3.86%) 1.74 kB → 1.81 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/preview.ts 📈 +61 B (+1.85%) 3.22 kB → 3.28 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/dev-child.ts 📈 +36 B (+1.53%) 2.29 kB → 2.33 kB
home/runner/work/cli/cli/packages/nuxi/src/utils/dev.ts 📈 +112 B (+1.33%) 8.24 kB → 8.35 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/dev.ts 📈 +42 B (+0.45%) 9.18 kB → 9.22 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev2.mjs 8.54 kB → 8.65 kB (+112 B) +1.28%
chunks/typecheck.mjs 1.74 kB → 1.81 kB (+69 B) +3.86%
chunks/preview.mjs 3.22 kB → 3.28 kB (+61 B) +1.85%
chunks/dev.mjs 9.18 kB → 9.22 kB (+42 B) +0.45%
chunks/dev-child.mjs 2.29 kB → 2.33 kB (+36 B) +1.53%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 224 B 0%
chunks/add.mjs 6.89 kB 0%
chunks/analyze.mjs 3.27 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 472 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/init.mjs 7.54 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/test.mjs 1.16 kB 0%
chunks/upgrade.mjs 6.28 kB 0%
chunks/add2.mjs 10.48 kB 0%
chunks/search.mjs 2.96 kB 0%
shared/cli.Bs_tfqQV.mjs 5.5 kB 0%
shared/cli.Dr1-AgrT.mjs 804 B 0%
shared/cli.BnGOlRzw.mjs 294 B 0%
shared/cli.CvXMTUIz.mjs 1.23 kB 0%
shared/cli.BSm0_9Hr.mjs 107 B 0%
shared/cli.DFKm8SnQ.mjs 836 B 0%
shared/cli.DlcAx0De.mjs 1.04 kB 0%
shared/cli.CHOX_2my.mjs 1.72 kB 0%
shared/cli.BRvtDybo.mjs 78 B 0%
shared/cli.C935N1ss.mjs 687 B 0%

@github-actions

github-actions Bot commented Apr 3, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats — nuxi size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
55 5.49 MB → 5.49 MB (+320 B) +0.01%
Changeset
File Δ Size
src/commands/typecheck.ts 📈 +69 B (+3.86%) 1.74 kB → 1.81 kB
src/commands/preview.ts 📈 +61 B (+1.85%) 3.22 kB → 3.28 kB
src/commands/dev-child.ts 📈 +36 B (+1.54%) 2.29 kB → 2.33 kB
src/utils/dev.ts 📈 +112 B (+1.33%) 8.25 kB → 8.36 kB
src/commands/dev.ts 📈 +42 B (+0.44%) 9.23 kB → 9.27 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev2.mjs 251.69 kB → 251.8 kB (+112 B) +0.04%
chunks/typecheck.mjs 1.74 kB → 1.81 kB (+69 B) +3.86%
chunks/preview.mjs 3.22 kB → 3.28 kB (+61 B) +1.85%
chunks/dev.mjs 9.23 kB → 9.27 kB (+42 B) +0.44%
chunks/dev-child.mjs 2.29 kB → 2.33 kB (+36 B) +1.54%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 210 B 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/add.mjs 6.89 kB 0%
chunks/analyze.mjs 3.27 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/devtools.mjs 764 B 0%
chunks/generate.mjs 472 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/init.mjs 663.66 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/test.mjs 1.16 kB 0%
chunks/upgrade.mjs 6.28 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/main.mjs 15.3 kB 0%
chunks/index2.mjs 915.2 kB 0%
chunks/index3.mjs 17.14 kB 0%
chunks/index4.mjs 71.98 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/add2.mjs 12.4 kB 0%
chunks/search.mjs 45.85 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 140.67 kB 0%
chunks/index5.mjs 1.23 kB 0%
chunks/index6.mjs 5.85 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
chunks/index7.mjs 886.24 kB 0%
shared/nuxi.CSptgxBl.mjs 76.33 kB 0%
shared/nuxi.DqkIr2yV.mjs 18.95 kB 0%
shared/nuxi.CDMTOway.mjs 804 B 0%
shared/nuxi.D379Yd9N.mjs 294 B 0%
shared/nuxi.CynwrLpQ.mjs 2.57 kB 0%
shared/nuxi.D2_bzAv0.mjs 1.54 kB 0%
shared/nuxi.h63hatje.mjs 4.07 kB 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.98PeB88r.mjs 836 B 0%
shared/nuxi.BxIDvNqq.mjs 1.34 kB 0%
shared/nuxi.Dza8Ny5q.mjs 15.2 kB 0%
shared/nuxi.DigSKSZu.mjs 25.34 kB 0%
shared/nuxi.C4l48OVX.mjs 2.02 MB 0%
shared/nuxi.D5KtpA0t.mjs 984 B 0%
shared/nuxi.BjhZEm2-.mjs 1.75 kB 0%
shared/nuxi.DwEL8L-T.mjs 715 B 0%
shared/nuxi.Kph9bHCN.mjs 26.94 kB 0%
shared/nuxi.BPxiWRC2.mjs 123.73 kB 0%
shared/nuxi.D4vggcPe.mjs 5.7 kB 0%
shared/nuxi.wIrae1ai.mjs 54.97 kB 0%
shared/nuxi.Do0aYBCO.mjs 5.46 kB 0%
shared/nuxi.jjur9XJH.mjs 43.55 kB 0%

@danielroe danielroe changed the title fix(dev,preview): correctly infer .env filename from --dotenv arg fix(dev,preview,typecheck): use explicit --dotenv filename Apr 3, 2025
@danielroe
danielroe merged commit 590ec22 into main Apr 3, 2025
@danielroe
danielroe deleted the fix/dotenv-arg-for-dev branch April 3, 2025 14:22
@github-actions github-actions Bot mentioned this pull request Apr 3, 2025
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

Successfully merging this pull request may close these issues.

Nuxt reads a different env file if value is not found in the configured env file

2 participants