This repository was archived by the owner on Nov 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +27
-27
lines changed
Expand file tree Collapse file tree 9 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 22 "name" : " cross-env" ,
33 "version" : " 0.0.0-semantically-released" ,
44 "description" : " Run scripts that set and use environment variables across platforms" ,
5- "main" : " dist /index.js" ,
5+ "main" : " src /index.js" ,
66 "bin" : {
7- "cross-env" : " dist /bin/cross-env.js" ,
8- "cross-env-shell" : " dist /bin/cross-env-shell.js"
7+ "cross-env" : " src /bin/cross-env.js" ,
8+ "cross-env-shell" : " src /bin/cross-env-shell.js"
99 },
1010 "engines" : {
1111 "node" : " >=8.0"
1212 },
1313 "scripts" : {
14- "build" : " kcd-scripts build" ,
1514 "lint" : " kcd-scripts lint" ,
1615 "test" : " kcd-scripts test" ,
1716 "validate" : " kcd-scripts validate"
2221 }
2322 },
2423 "files" : [
25- " dist"
24+ " src" ,
25+ " !__tests__"
2626 ],
2727 "keywords" : [
2828 " cross-environment" ,
3232 "author" : " Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)" ,
3333 "license" : " MIT" ,
3434 "dependencies" : {
35- "@babel/runtime" : " ^7.6.2" ,
3635 "cross-spawn" : " ^7.0.0"
3736 },
3837 "devDependencies" : {
4140 "eslintConfig" : {
4241 "extends" : " ./node_modules/kcd-scripts/eslint.js"
4342 },
44- "eslintIgnore" : [
45- " node_modules" ,
46- " coverage" ,
47- " dist"
48- ],
43+ "// babel 1" : " this disables all built-in plugins from kcd-scripts for tests" ,
44+ "// babel 2" : " that way we ensure that the tests run without compilation" ,
45+ "// babel 3" : " because this module is published as-is. It is not compiled." ,
46+ "babel" : {},
4947 "repository" : {
5048 "type" : " git" ,
5149 "url" : " https://github.com/kentcdodds/cross-env.git"
Original file line number Diff line number Diff line change 1- import isWindowsMock from '../is-windows'
2- import commandConvert from '../command'
1+ const isWindowsMock = require ( '../is-windows' )
2+ const commandConvert = require ( '../command' )
33
44jest . mock ( '../is-windows' )
55
Original file line number Diff line number Diff line change 1- import crossSpawnMock from 'cross-spawn'
2- import isWindowsMock from '../is-windows'
1+ const crossSpawnMock = require ( 'cross-spawn' )
2+ const isWindowsMock = require ( '../is-windows' )
33
44jest . mock ( '../is-windows' )
55jest . mock ( 'cross-spawn' )
Original file line number Diff line number Diff line change 1- import isWindows from '../is-windows'
1+ const isWindows = require ( '../is-windows' )
22
33const {
44 platform,
Original file line number Diff line number Diff line change 1- import isWindowsMock from '../is-windows'
2- import varValueConvert from '../variable'
1+ const isWindowsMock = require ( '../is-windows' )
2+ const varValueConvert = require ( '../variable' )
33
44jest . mock ( '../is-windows' )
55
Original file line number Diff line number Diff line change 1- import path from 'path'
2- import isWindows from './is-windows'
1+ const path = require ( 'path' )
2+ const isWindows = require ( './is-windows' )
33
4- export default commandConvert
4+ module . exports = commandConvert
55
66/**
77 * Converts an environment variable usage to be appropriate for the current OS
Original file line number Diff line number Diff line change 1- import { spawn } from 'cross-spawn'
2- import commandConvert from './command'
3- import varValueConvert from './variable'
1+ const { spawn} = require ( 'cross-spawn' )
2+ const commandConvert = require ( './command' )
3+ const varValueConvert = require ( './variable' )
44
55module . exports = crossEnv
66
Original file line number Diff line number Diff line change 1- export default ( ) =>
1+ module . exports = ( ) =>
22 process . platform === 'win32' || / ^ ( m s y s | c y g w i n ) $ / . test ( process . env . OSTYPE )
Original file line number Diff line number Diff line change 1- import isWindows from './is-windows'
1+ const isWindows = require ( './is-windows' )
22
33const pathLikeEnvVarWhitelist = new Set ( [ 'PATH' , 'NODE_PATH' ] )
44
5+ module . exports = varValueConvert
6+
57/**
68 * This will transform UNIX-style list values to Windows-style.
79 * For example, the value of the $PATH variable "/usr/bin:/usr/local/bin:."
@@ -62,6 +64,6 @@ function resolveEnvVars(varValue) {
6264 * @param {String } originalName Original name of the env variable
6365 * @returns {String } Converted value
6466 */
65- export default function varValueConvert ( originalValue , originalName ) {
67+ function varValueConvert ( originalValue , originalName ) {
6668 return resolveEnvVars ( replaceListDelimiters ( originalValue , originalName ) )
6769}
You can’t perform that action at this time.
0 commit comments