Skip to content

Replace cross-env with env-cmd - #83

Open
adam4813 with Copilot wants to merge 2 commits into
mainfrom
copilot/replace-cross-env-with-env-cmd
Open

Replace cross-env with env-cmd#83
adam4813 with Copilot wants to merge 2 commits into
mainfrom
copilot/replace-cross-env-with-env-cmd

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

cross-env is archived and lacks profile support. Replace with env-cmd to enable named environment profiles for dev and e2e, with --no-override ensuring e2e-injected vars take precedence over dev defaults.

Changes

  • .env-cmdrc — new config with two profiles:

    • dev: ports NOTES_PORT=8788, WEB_PORT=5174
    • e2e: ports NOTES_PORT=8789, WEB_PORT=5175, NOTES_TOME=e2e-tome
  • package.jsondev:server, dev:web, dev:desktop now use env-cmd -e dev --no-override; cross-env removed from devDependencies

  • playwright.config.ts — webServer commands changed from direct workspace scripts to root npm run dev:* scripts; Playwright's env block (e2e ports) wins over dev-profile defaults due to --no-override

// package.json (before)
"dev:server": "cross-env NOTES_PORT=8788 npm --workspace @notes/server run dev"

// package.json (after)
"dev:server": "env-cmd -e dev --no-override npm --workspace @notes/server run dev"

During e2e runs, Playwright injects NOTES_PORT=8789 before the child process starts; --no-override ensures env-cmd's dev profile does not clobber it.

Copilot AI linked an issue Aug 31, 2026 that may be closed by this pull request
- Install env-cmd, remove cross-env
- Create .env-cmdrc with dev (ports 8788/5174) and e2e (ports 8789/5175) profiles
- Update root dev:server, dev:web, dev:desktop scripts to use env-cmd -e dev --no-override
- Update playwright.config.ts webServer commands to use root npm scripts
  so e2e env vars injected by Playwright take precedence (--no-override)

Co-authored-by: adam4813 <3011917+adam4813@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace cross-env with env-cmd in project setup Replace cross-env with env-cmd Aug 31, 2026
Copilot AI requested a review from adam4813 August 31, 2026 18:28
@adam4813
adam4813 marked this pull request as ready for review August 31, 2026 19:20
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.

Replace cross-env with env-cmd

2 participants