63 Commits
Author SHA1 Message Date
Kent C. Dodds 12bdd8805c fix: link to license 2025-07-25 15:33:10 -06:00
Kent C. Dodds 3bd3a08c3d fix: handle edge case and update README for clarity 2025-07-25 15:32:30 -06:00
0112288e01 feat: modernize cross-env with TypeScript, Vitest, and ESM-only build (#261)
NOTE: For the vast majority of users running supported versions of Node.js, this should not require any changes and you can update without issue.

BREAKING CHANGE: This is a major rewrite that changes the module format from CommonJS to ESM-only. The package now requires Node.js >=20 and only exports ESM modules (not relevant in most cases).

BREAKING CHANGE: The package.json exports have been updated to remove CommonJS support. Only ESM imports are now supported.

BREAKING CHANGE: All source files have been converted from JavaScript to TypeScript, requiring TypeScript-aware tooling for development.

- Replace Jest with Vitest for testing
- Convert all source files from .js to .ts with proper TypeScript types
- Use zshy for ESM-only builds (removes CJS support)
- Adopt @epic-web/config for TypeScript, ESLint, and Prettier
- Update to Node.js >=20 requirement
- Remove kcd-scripts dependency
- Add comprehensive e2e tests with GitHub Actions matrix testing
- Update GitHub workflow with caching and cross-platform testing
- Modernize documentation and remove outdated sections
- Update all dependencies to latest versions
- Add proper TypeScript declarations and exports

The tool maintains its original functionality while being completely modernized with the latest tooling and best practices

Co-authored-by: GitHub Action <[email protected]>
2025-07-25 15:19:14 -06:00
Kent C. Dodds 79a99c6d32 fix(readme): update readme badges 2025-07-25 12:28:47 -06:00
Kent C. DoddsandGitHub e280ec9373 Update README.md 2021-01-05 09:16:29 -07:00
allcontributors[bot]GitHuballcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
e2d5ed2755 docs: add dsbert as a contributor (#260)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-12-01 12:10:21 -07:00
DanielandGitHub 647ca8b651 docs: Update README.md (#259)
Clarify feature requests section.
2020-12-01 12:09:48 -07:00
Kent C. DoddsandGitHub 093d1b5c1b fix: add maintenance mode notice
Using `fix` so this gets shipped to npm.
2020-12-01 10:37:34 -07:00
Michaël De BoeyandGitHub ae88dd407f chore: Switch to GitHub Actions (#251) 2020-11-05 11:42:22 -07:00
allcontributors[bot]andGitHub abeee6f53b docs: add devuxer as a contributor (#241) 2020-05-20 16:39:14 -06:00
devuxerandGitHub 71a0210447 docs: add multi vars example to README (#240) 2020-05-20 16:38:41 -06:00
Kent C. DoddsandGitHub 02566a1fc3 docs: remove codefund 2020-03-03 11:31:14 -07:00
allcontributors[bot]andGitHub 0c76dbf539 docs: add lauriii as a contributor (#226)
* docs: update README.md

* docs: update .all-contributorsrc
2020-01-28 15:22:35 -07:00
Lauri EskolaandGitHub 905f5dd767 docs: update warning about Node versions (#225) 2020-01-28 15:22:10 -07:00
allcontributors[bot]andKent C. Dodds c95444c82d docs: add MichaelDeBoey as a contributor (#224)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]
2020-01-25 11:46:28 -07:00
Kent C. Dodds 63778b11a4 fix: table of contents in README 2019-10-01 10:54:01 -06:00
Kent C. Dodds 83db27a819 fix: update all packages, tests, and README 2019-10-01 10:50:59 -06:00
allcontributors[bot]Kent C. Doddsnull <46447321+allcontributors[bot]@users.noreply.github.com>
dcc63c53bc docs: add coderberry as a contributor (#213)
* docs: update README.md

* docs: update .all-contributorsrc


Co-authored-by: null <46447321+allcontributors[bot]@users.noreply.github.com>
2019-09-26 15:58:46 -06:00
Eric BerryandKent C. Dodds 4dcced8a99 chore: Add CodeFund sponsorship message to README (#212)
[CodeFund](https://codefund.io) provides ethical sponsorships to open source maintainers. This PR will place the "Sponsored by" image at the top of the README. The sponsoring companies are not paying per click nor impression. They are paying the maintainer(s) on a per-month basis to be the primary sponsor of this project.
2019-09-26 15:57:58 -06:00
bibo5088andKent C. Dodds c8f9b7dcf5 fix: bumped cross-spawn to version 7.0.0 (#211)
* bumped cross-spawn to version 7.0.0 and added a warning about node.js 7 and lower

* package.json, engines node : ">=8.0"

BREAKING CHANGE: Drop support for Node.js < 7.
2019-09-17 11:16:28 -06:00
bibo5088andKent C. Dodds a7932c7db2 fix: remove is-windows dependency (#207) 2019-08-31 12:27:34 -06:00
Kent C. DoddsandGitHub 80dfef45a9 docs: add note for windows issues
Closes #192
2019-08-02 13:17:28 -06:00
allcontributors[bot]andKent C. Dodds 2b36bb3c30 docs: add Jason-Cooke as a contributor (#201)
* docs: update README.md

* docs: update .all-contributorsrc
2019-03-27 06:59:36 -06:00
Jason CookeandKent C. Dodds 41ab3b0797 docs: Fix typo (#200) 2019-03-27 06:58:40 -06:00
Armin SebastianandKent C. Dodds 553705c302 docs(README): list @naholyr/cross-env in Other Solutions section (#189) 2018-09-02 09:14:33 -06:00
Ashik NesinandKent C. Dodds 5d0f19f276 docs: remove codesponsor (#186) 2018-06-26 07:18:51 -06:00
Jordan NielsonandKent C. Dodds b88977c17d fix: check for sigint before setting exit code to 1 (#181) 2018-05-22 15:56:37 -06:00
Benny NeugebauerandKent C. Dodds eb3798448e docs: inform about signal events on Windows (#179) 2018-05-15 17:19:11 -06:00
Johan HernandezandKent C. Dodds d5170bfc55 fix: exit code should be set to 1 when os kills child process (#177)
* fixes #150 exit code when os kills child process

* Update .all-contributorsrc
2018-05-09 11:55:23 -06:00
Benny NeugebauerandKent C. Dodds 5204dd65f7 docs: Fix typo (#166) 2018-01-11 09:40:26 -07:00
Alex PotsidesandKent C. Dodds 3c064d8010 docs: Closes #153 with documentation update (#165)
After discussion on #155 this seems like the better solution.
2017-12-27 08:53:48 -07:00
D. Nicolás Lopez ZelayaandKent C. Dodds 3cf4170d6d fix: regex flag fix (#161)
* Adding myself as a contributor

* Using regex literal instead of constructor function

closes #159
closes #160
2017-12-21 15:59:44 -07:00
SvenandKent C. Dodds 36b009e25a feat: introduce dollar sign escaping (#147)
* Introduce dollar sign escaping

* Fix typo in README.md
2017-10-16 10:50:17 -06:00
Kent C. DoddsandGitHub 7719fb27b6 docs(README): reformat things 2017-10-12 19:28:44 -06:00
Anish KarandikarandKent C. Dodds 72e29f08b7 docs: Update README.md (#144) 2017-09-29 13:57:09 -06:00
Eric BerryandKent C. Dodds da1e82105c docs: update Code Sponsor link position (#141)
* Update Code Sponsor link position

@kentcdodds When the link is found at the bottom of the README, it is more effective in helping funding this project.

* Update README.md
2017-09-07 21:57:30 -06:00
Kent C. DoddsandGitHub 44b37dd1ae fix(docs): add malware warning to README
Also add codesponsor to README
2017-08-08 13:45:12 -06:00
Suhas KaranthandKent C. Dodds 487241db78 fix: Handle relative path in cmd on windows (#130)
* fix: Normalize command to handle relative path on windows

* test: Normalize command for embedded env variable conversion test

* docs(contributors): Add @sudo-suhas

Closes #127
2017-08-01 09:53:53 -06:00
Turner HayesandKent C. Dodds b10de51286 fix: Change splitter regex to use .* instead of .+ (#117)
The regex was using .+, which meant that it wasn't possible to unset variables.

Closes #114, Closes #116
2017-06-07 20:24:49 -06:00
Luís FernandesandKent C. Dodds c9908f364f test(JSON): add JSON value tests that work on both Windows and UNIX (#112)
add working tests that use the same JSON value on both Windows and UNIX

Closes #30
2017-05-21 20:51:53 -06:00
Hugo WoodandKent C. Dodds d7b48d5ce1 feat(bin): two bins (shell, non-shell) (#104)
Revert the default bin (cross-env) to its v3 behavior (not using the shell option). Add a new
(cross-env-shell)  which uses the shell option.

BREAKING CHANGE: Scripts using quotes or escape sequences will see a difference in behavior.
Switching to the second bin should resolve any issue.

Closes #99.
2017-05-11 11:10:16 -06:00
Paul BettsandKent C. Dodds 38814238a5 feat: don't change colons on non-PATH/NODE_PATH on win32 (#107)
* Add a whitelist for variables to : => ; ify

* Plumb the name through

* Write some tests

* Dox, linter fascism

* Much better!

* Contributors

BREAKING CHANGES: We no longer swap `:` for `;` on windows for any variables other than `PATH` and `NODE_PATH`.
2017-05-11 11:10:16 -06:00
Amila WelihindaandKent C. Dodds 6994a24dfa docs(contributors): add amilajack to contributors (#98)
* Added amilajack to contributors

* Added 'infra' to 'contributions'
2017-03-31 11:35:50 -06:00
Hugo WoodandKent C. Dodds 9e0ea056e3 docs(engine): revert support to node 4 (#96)
See https://github.com/kentcdodds/cross-env/pull/89#issuecomment-287932203
2017-03-30 20:06:49 -06:00
Daniel Rey LópezandKent C. Dodds ea0ac4bd04 feat: Convert list delimiters for PATH-style env variables (#93)
* feat: Convert list delimiters for PATH-style env variables

In Windows, env variables that represent a list (such as PATH or NODE_PATH) separate their elements
using a semicolon(;), but in UNIX they're separated using a colon (:).

This commit adds a conversion layer, so regardless of how the delimiter is written when calling
cross-env, it will be converted to the correct platform delimiter at runtime. To interpret a colon/semicolon
literally instead, preced it with a backslash, like this: "cross-env VAR=semi\\;colon\\:"

BREAKING CHANGE: If an env variable has : or ; in its value, it will be converted to : on UNIX
systems or ; on Windows systems. To keep the old functionality, you will need to escape those
characters with a backslash.

#80

* chore: Add myself (DanReyLop) to the contributors list

* Simplified logic. Now only : (UNIX-style) are converted to ; (Windows-style), not the other way around

BREAKING CHANGE: You now must escape `:` to use it in a value of you don't want it to be swapped with `;` on Windows
2017-03-30 20:06:49 -06:00
Hugo WoodandKent C. Dodds ea80021304 feat(spawn): add support for quoted scripts
* feat(spawn): add support for quoted scripts

Use the shell option of spawn introduced in Node.js 4.8 (see
https://github.com/nodejs/node/pull/4598) to pass the command to the OS shell.
Supersedes #77.


* docs(readme): add gotchas

Add Gotchas paragraph about passing variables to multiple scripts.

* docs(readme): add required node version badge

Replace the Prerequisite paragraph by a badge showing the require version of Node.js required to run
cross-env.

* test(spawn): add test for quoted scripts

See https://github.com/kentcdodds/cross-env/pull/89#pullrequestreview-27055572.


BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
2017-03-30 20:06:49 -06:00
Thiebaud ThomasandKent C. Dodds 22d1c801fa fix(module): Add export for commonjs (#88)
* fix(module): Add export for commonjs

Add commonjs export, so it is possible to require crossEnv using `require('cross-env')` (needed to
use in js script without babel)

84

* fix(module): Only export crossEnv using commonjs
2017-03-30 20:06:49 -06:00
Hugo WoodandKent C. Dodds c1a9ed0764 fix(args): make args conversion stateless (#85)
* fix(args): make args conversion stateless

* docs(args): replace short url by full url

* docs(contributors): add @hgwood
2017-03-14 10:22:22 -06:00
Jonas KeinholzandKent C. Dodds 920451ddb6 docs(contributors): add @inyono (#83) 2017-03-09 06:38:11 -07:00
Daniel Rodríguez RiveroandKent C. Dodds b59473a627 docs(contributors): add @danielo515 (#81)
* Update README.md

Added how to use cross-env to run npm sub-scripts

* chore(Added danielo515 as contributor): Just added danielo515 as contributor following repo guidelin

Added danielo515 to the all-contributors file
2017-03-06 07:33:43 -08:00